agent-tower 0.7.2-beta.8 → 0.7.3
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/dist/executors/__tests__/providers.test.js +53 -0
- package/dist/executors/__tests__/providers.test.js.map +1 -1
- package/dist/executors/providers.d.ts +2 -0
- package/dist/executors/providers.d.ts.map +1 -1
- package/dist/executors/providers.js +3 -2
- package/dist/executors/providers.js.map +1 -1
- package/dist/git/base-branch.d.ts +3 -0
- package/dist/git/base-branch.d.ts.map +1 -0
- package/dist/git/base-branch.js +17 -0
- package/dist/git/base-branch.js.map +1 -0
- package/dist/mcp/http-client.d.ts +2 -6
- package/dist/mcp/http-client.d.ts.map +1 -1
- package/dist/mcp/http-client.js.map +1 -1
- package/dist/mcp/tools/__tests__/providers.test.d.ts +2 -0
- package/dist/mcp/tools/__tests__/providers.test.d.ts.map +1 -0
- package/dist/mcp/tools/__tests__/providers.test.js +22 -0
- package/dist/mcp/tools/__tests__/providers.test.js.map +1 -0
- package/dist/mcp/tools/__tests__/tasks.test.d.ts +2 -0
- package/dist/mcp/tools/__tests__/tasks.test.d.ts.map +1 -0
- package/dist/mcp/tools/__tests__/tasks.test.js +17 -0
- package/dist/mcp/tools/__tests__/tasks.test.js.map +1 -0
- package/dist/mcp/tools/providers.d.ts.map +1 -1
- package/dist/mcp/tools/providers.js +3 -2
- package/dist/mcp/tools/providers.js.map +1 -1
- package/dist/mcp/tools/tasks.d.ts.map +1 -1
- package/dist/mcp/tools/tasks.js +1 -0
- package/dist/mcp/tools/tasks.js.map +1 -1
- package/dist/mcp/types.d.ts +3 -0
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/mcp/types.js +2 -0
- package/dist/mcp/types.js.map +1 -1
- package/dist/output/__tests__/text-block-lifecycle.test.js +37 -0
- package/dist/output/__tests__/text-block-lifecycle.test.js.map +1 -1
- package/dist/output/text-block-tracker.d.ts.map +1 -1
- package/dist/output/text-block-tracker.js +24 -1
- package/dist/output/text-block-tracker.js.map +1 -1
- package/dist/routes/__tests__/providers.test.js +67 -0
- package/dist/routes/__tests__/providers.test.js.map +1 -1
- package/dist/routes/__tests__/tasks.test.js +23 -0
- package/dist/routes/__tests__/tasks.test.js.map +1 -1
- package/dist/routes/providers.d.ts.map +1 -1
- package/dist/routes/providers.js +8 -0
- package/dist/routes/providers.js.map +1 -1
- package/dist/routes/tasks.d.ts.map +1 -1
- package/dist/routes/tasks.js +1 -0
- package/dist/routes/tasks.js.map +1 -1
- package/dist/runtime/acp/history-reconciler.js +1 -1
- package/dist/runtime/acp/history-reconciler.js.map +1 -1
- package/dist/services/__tests__/task.service.test.js +43 -0
- package/dist/services/__tests__/task.service.test.js.map +1 -1
- package/dist/services/__tests__/translation-protection.test.js +48 -18
- package/dist/services/__tests__/translation-protection.test.js.map +1 -1
- package/dist/services/__tests__/translation-session-blocks.test.js +66 -2
- package/dist/services/__tests__/translation-session-blocks.test.js.map +1 -1
- package/dist/services/__tests__/workspace.service.test.js +34 -0
- package/dist/services/__tests__/workspace.service.test.js.map +1 -1
- package/dist/services/message-delivery.service.d.ts +2 -1
- package/dist/services/message-delivery.service.d.ts.map +1 -1
- package/dist/services/project.service.d.ts +1 -0
- package/dist/services/project.service.d.ts.map +1 -1
- package/dist/services/provider-config.service.d.ts.map +1 -1
- package/dist/services/provider-config.service.js +1 -0
- package/dist/services/provider-config.service.js.map +1 -1
- package/dist/services/session-manager.d.ts +7 -4
- package/dist/services/session-manager.d.ts.map +1 -1
- package/dist/services/session-manager.js +1 -1
- package/dist/services/session-manager.js.map +1 -1
- package/dist/services/task.service.d.ts +10 -8
- package/dist/services/task.service.d.ts.map +1 -1
- package/dist/services/task.service.js +14 -1
- package/dist/services/task.service.js.map +1 -1
- package/dist/services/team-run.service.d.ts +1 -0
- package/dist/services/team-run.service.d.ts.map +1 -1
- package/dist/services/team-task-input.service.d.ts +1 -0
- package/dist/services/team-task-input.service.d.ts.map +1 -1
- package/dist/services/translation-protection.d.ts +3 -1
- package/dist/services/translation-protection.d.ts.map +1 -1
- package/dist/services/translation-protection.js +21 -67
- package/dist/services/translation-protection.js.map +1 -1
- package/dist/services/translation-settings.service.d.ts +4 -4
- package/dist/services/translation.service.d.ts.map +1 -1
- package/dist/services/translation.service.js +44 -20
- package/dist/services/translation.service.js.map +1 -1
- package/dist/services/workspace.service.d.ts +11 -6
- package/dist/services/workspace.service.d.ts.map +1 -1
- package/dist/services/workspace.service.js +6 -4
- package/dist/services/workspace.service.js.map +1 -1
- package/dist/utils/database-runtime.test.js +82 -5
- package/dist/utils/database-runtime.test.js.map +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +29 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/web/assets/{AgentDemoPage-CtCYXopw.js → AgentDemoPage-Dwux6TyV.js} +1 -1
- package/dist/web/assets/{AgentEnvironmentSettingsPage-DSWN546Y.js → AgentEnvironmentSettingsPage-CvvkMKT1.js} +1 -1
- package/dist/web/assets/AttachmentPreview-CFJ6MZ1f.js +2 -0
- package/dist/web/assets/BranchSelect-Cv92vEjG.js +1 -0
- package/dist/web/assets/BrandLogo-H4nCbVzs.js +1 -0
- package/dist/web/assets/ConversationPage-CZzGME21.js +1 -0
- package/dist/web/assets/CreateTaskInput-BM2tx4hJ.js +1 -0
- package/dist/web/assets/{DemoPage-Dyn-U9JO.js → DemoPage-CpYNBQhA.js} +1 -1
- package/dist/web/assets/DesignSystemPage-DLeH6DnV.js +12 -0
- package/dist/web/assets/EditableTaskTitle-BEsiULnD.js +70 -0
- package/dist/web/assets/{ExecutionPermissionSelector-CQ_GNxR0.js → ExecutionPermissionSelector-IoWR9YLb.js} +1 -1
- package/dist/web/assets/GeneralSettingsPage-BAYgxCqx.js +1 -0
- package/dist/web/assets/{LoadingPreviewPage-BlW2PJhI.js → LoadingPreviewPage-CumrzyxW.js} +1 -1
- package/dist/web/assets/McpSettingsPage-CFNwxT9Y.js +1 -0
- package/dist/web/assets/{MemberAvatar-B2pAdWUi.js → MemberAvatar-BVXD0jTy.js} +1 -1
- package/dist/web/assets/{MobileTaskDetail-CvmNW0BQ.js → MobileTaskDetail-IOQ1WnS8.js} +3 -3
- package/dist/web/assets/NotificationSettingsPage-B0s5YbG3.js +1 -0
- package/dist/web/assets/{ProfileSettingsPage-DMxpHmF1.js → ProfileSettingsPage-BuhoF-mL.js} +1 -1
- package/dist/web/assets/{ProjectKanbanPage-CHW79td4.js → ProjectKanbanPage-DMtv15rq.js} +7 -7
- package/dist/web/assets/ProjectSettingsPage-DDMg6axy.js +2 -0
- package/dist/web/assets/ProviderSettingsPage-DRt9m4mF.js +67 -0
- package/dist/web/assets/{SettingsMasterDetail-DnF0lsV1.js → SettingsMasterDetail-D7vStQjR.js} +1 -1
- package/dist/web/assets/TaskDetail-DzKbs5Jt.js +1 -0
- package/dist/web/assets/TeamSettingsPage-fjlaqaLo.js +1 -0
- package/dist/web/assets/{TranslationSettingsPage-D3mazqEW.js → TranslationSettingsPage-D2oks6OM.js} +1 -1
- package/dist/web/assets/{arc-hUh7ykl8.js → arc-vYWCZsE_.js} +1 -1
- package/dist/web/assets/{architectureDiagram-3BPJPVTR-CcV9CLkm.js → architectureDiagram-3BPJPVTR-Cu1VIpcJ.js} +1 -1
- package/dist/web/assets/{at-sign-B-nhoGyH.js → at-sign-BhSPafOS.js} +1 -1
- package/dist/web/assets/{blockDiagram-GPEHLZMM-5q3Y9y0e.js → blockDiagram-GPEHLZMM-C4x_nj5S.js} +1 -1
- package/dist/web/assets/{c4Diagram-AAUBKEIU-CorBXi06.js → c4Diagram-AAUBKEIU-jHOo5lal.js} +1 -1
- package/dist/web/assets/channel-D1cEj22-.js +1 -0
- package/dist/web/assets/check-D_VFGpIy.js +1 -0
- package/dist/web/assets/{chevron-down-CPnvItQw.js → chevron-down-BoS08pMa.js} +1 -1
- package/dist/web/assets/{chevron-up-B8PE5N0G.js → chevron-up-BWtKfdKT.js} +1 -1
- package/dist/web/assets/chip-Ck4dqxR3.js +1 -0
- package/dist/web/assets/{chunk-2J33WTMH-BUf5B4z4.js → chunk-2J33WTMH-BZcpjmfm.js} +1 -1
- package/dist/web/assets/{chunk-4BX2VUAB-CdnOHkro.js → chunk-4BX2VUAB-DZGB3q-I.js} +1 -1
- package/dist/web/assets/{chunk-55IACEB6-U7edZDpP.js → chunk-55IACEB6-CcNrOmyy.js} +1 -1
- package/dist/web/assets/{chunk-727SXJPM-B64Tuhla.js → chunk-727SXJPM-dWrxio8O.js} +1 -1
- package/dist/web/assets/{chunk-AQP2D5EJ-dXfe56jB.js → chunk-AQP2D5EJ-K4gkVzqE.js} +1 -1
- package/dist/web/assets/{chunk-FMBD7UC4-DDYbxc1Q.js → chunk-FMBD7UC4-CnHyY4qD.js} +1 -1
- package/dist/web/assets/{chunk-ND2GUHAM-BQDGMv0R.js → chunk-ND2GUHAM-CHUmcyDv.js} +1 -1
- package/dist/web/assets/{chunk-QZHKN3VN-DB8q4xAj.js → chunk-QZHKN3VN-Bzzjd-Qt.js} +1 -1
- package/dist/web/assets/classDiagram-4FO5ZUOK-DIrDMefa.js +1 -0
- package/dist/web/assets/classDiagram-v2-Q7XG4LA2-DIrDMefa.js +1 -0
- package/dist/web/assets/{code-block-OCS4YCEC-BSdICyOa.js → code-block-OCS4YCEC-B2hHBO_G.js} +1 -1
- package/dist/web/assets/{confirm-dialog-DxEBZEbV.js → confirm-dialog-CL_1pF4K.js} +1 -1
- package/dist/web/assets/content-D0qmHfHK.js +2 -0
- package/dist/web/assets/{copy-DyxlXxiU.js → copy-C4WnOY6Y.js} +1 -1
- package/dist/web/assets/{cose-bilkent-S5V4N54A-Dx6eMnll.js → cose-bilkent-S5V4N54A-Dcn8tOhb.js} +1 -1
- package/dist/web/assets/cssMode-CXBMyfYY.js +1 -0
- package/dist/web/assets/{dagre-BM42HDAG-Cxe8pLgD.js → dagre-BM42HDAG-DWBV4UfP.js} +1 -1
- package/dist/web/assets/{diagram-2AECGRRQ-RMsswEBe.js → diagram-2AECGRRQ-CnNTJQ3q.js} +1 -1
- package/dist/web/assets/{diagram-5GNKFQAL-Bi4E0hzx.js → diagram-5GNKFQAL-DlXJFzDF.js} +1 -1
- package/dist/web/assets/{diagram-KO2AKTUF-Mv6CDCyn.js → diagram-KO2AKTUF-DZ22YV4n.js} +1 -1
- package/dist/web/assets/{diagram-LMA3HP47-CJ3qKNzK.js → diagram-LMA3HP47-B4pQJjG9.js} +1 -1
- package/dist/web/assets/{diagram-OG6HWLK6-D8SBY4ft.js → diagram-OG6HWLK6-DJBLjtgL.js} +1 -1
- package/dist/web/assets/dialog-1o8KQWoQ.js +5 -0
- package/dist/web/assets/{erDiagram-TEJ5UH35-DwVSCU6X.js → erDiagram-TEJ5UH35-CDsfoJUT.js} +1 -1
- package/dist/web/assets/file-6qwbIga1.js +1 -0
- package/dist/web/assets/{flowDiagram-I6XJVG4X-CyipYAWd.js → flowDiagram-I6XJVG4X-CuGOAYmY.js} +1 -1
- package/dist/web/assets/folder-picker-Cj1VZOZU.js +1 -0
- package/dist/web/assets/{freemarker2-DbH_yMCO.js → freemarker2-BG8VyI2V.js} +1 -1
- package/dist/web/assets/{ganttDiagram-6RSMTGT7-CsC6Wjt4.js → ganttDiagram-6RSMTGT7-BjrSOqAM.js} +1 -1
- package/dist/web/assets/{gitGraphDiagram-PVQCEYII-E5jNbqlq.js → gitGraphDiagram-PVQCEYII-4VVr4F8_.js} +1 -1
- package/dist/web/assets/{globe-B2rgTPH3.js → globe-CxeM27yy.js} +1 -1
- package/dist/web/assets/handlebars-Ci38FPsA.js +1 -0
- package/dist/web/assets/html-5hdYEgVF.js +1 -0
- package/dist/web/assets/htmlMode-BzU9qsw0.js +1 -0
- package/dist/web/assets/{icon-button-BEMJj_6T.js → icon-button-BmrJtYFC.js} +1 -1
- package/dist/web/assets/index-BR3Wg2fS.js +122 -0
- package/dist/web/assets/{index-IMdA08Ok.js → index-C1lMEjmZ.js} +1 -1
- package/dist/web/assets/{index-C-M0QDqc.js → index-CrKx8Yaz.js} +4 -4
- package/dist/web/assets/{index-BYPOXP6w.js → index-DSy5JLC1.js} +1 -1
- package/dist/web/assets/{index-CAjqC8pT.js → index-DVdiOmqt.js} +2 -2
- package/dist/web/assets/index-DZLg4-xM.css +1 -0
- package/dist/web/assets/{index-kr6U6_pi.js → index-Da2mWAtm.js} +1 -1
- package/dist/web/assets/{index-CPGzLjEC.js → index-Db28hRe8.js} +1 -1
- package/dist/web/assets/{index-DppwrK2G.js → index-cu8sedJH.js} +1 -1
- package/dist/web/assets/{index-DNdMmXBr.js → index-hHrknzh7.js} +1 -1
- package/dist/web/assets/{infoDiagram-5YYISTIA-5_0wrRXl.js → infoDiagram-5YYISTIA-Cy9ntb6t.js} +1 -1
- package/dist/web/assets/{ishikawaDiagram-YF4QCWOH-aQujIFZw.js → ishikawaDiagram-YF4QCWOH-D6UiVzRz.js} +1 -1
- package/dist/web/assets/javascript-Ib060GQ8.js +1 -0
- package/dist/web/assets/{journeyDiagram-JHISSGLW-ClMzHdqI.js → journeyDiagram-JHISSGLW-owdKzZoh.js} +1 -1
- package/dist/web/assets/{jsonMode-nHmLVf-n.js → jsonMode-CLmu6gzc.js} +1 -1
- package/dist/web/assets/{kanban-definition-UN3LZRKU-BFVlt0tz.js → kanban-definition-UN3LZRKU-v5TBnyp0.js} +1 -1
- package/dist/web/assets/{kbd-Bfq5K6Ux.js → kbd-Cl4AzzJp.js} +1 -1
- package/dist/web/assets/{key-round-BqsaQdce.js → key-round-CnYjSrCz.js} +1 -1
- package/dist/web/assets/{layers-DI4vFJ4F.js → layers-XImbMX-P.js} +1 -1
- package/dist/web/assets/{linear-DZ-6PAPS.js → linear-DNlKYt8R.js} +1 -1
- package/dist/web/assets/{link-BU4PN723.js → link-DQk-Vapq.js} +1 -1
- package/dist/web/assets/liquid-Bc7OSAPR.js +1 -0
- package/dist/web/assets/{lspLanguageFeatures-DH4Z8jiM.js → lspLanguageFeatures-DD_y1bZa.js} +1 -1
- package/dist/web/assets/mdx-CxJNHHTn.js +1 -0
- package/dist/web/assets/{menu-C3uB3M7p.js → menu-DXF6iUsq.js} +1 -1
- package/dist/web/assets/{mermaid-NOHMQCX5-BqeX1osS.js → mermaid-NOHMQCX5-CG_LpwAI.js} +59 -59
- package/dist/web/assets/{message-square-E5K8E3A-.js → message-square-BviHdb67.js} +1 -1
- package/dist/web/assets/{mindmap-definition-RKZ34NQL-C7dea0db.js → mindmap-definition-RKZ34NQL-Bn_rnnGT.js} +1 -1
- package/dist/web/assets/{modal-Cz1iIVeD.js → modal-D496f1fE.js} +1 -1
- package/dist/web/assets/{monaco-DM3DuGN5.js → monaco-yuGji-2E.js} +3 -3
- package/dist/web/assets/{paperclip-COXNce_v.js → paperclip-D9ka2IAB.js} +1 -1
- package/dist/web/assets/{pencil-BFc4n44f.js → pencil-isP1rXC-.js} +1 -1
- package/dist/web/assets/{people-BaCetIqh.js → people-CbmH8m4i.js} +1 -1
- package/dist/web/assets/{pieDiagram-4H26LBE5-2q5medug.js → pieDiagram-4H26LBE5-DIE_f9W_.js} +1 -1
- package/dist/web/assets/popover-D8VtO5qF.js +1 -0
- package/dist/web/assets/provider-selection-DSu7SCI7.js +1 -0
- package/dist/web/assets/python-C0E43gUo.js +1 -0
- package/dist/web/assets/{quadrantDiagram-W4KKPZXB-DHPEM56s.js → quadrantDiagram-W4KKPZXB-CavFxJCk.js} +1 -1
- package/dist/web/assets/razor-xarhYR9V.js +1 -0
- package/dist/web/assets/{requirementDiagram-4Y6WPE33-B_KyH7PP.js → requirementDiagram-4Y6WPE33-Dm1FwUUh.js} +1 -1
- package/dist/web/assets/{sankeyDiagram-5OEKKPKP-CrqkZAYW.js → sankeyDiagram-5OEKKPKP-qeqcO27M.js} +1 -1
- package/dist/web/assets/{search-CkiBPir_.js → search-DOMr5jPS.js} +1 -1
- package/dist/web/assets/{select-DJsEG0jq.js → select-Cw5BaOLQ.js} +1 -1
- package/dist/web/assets/{select-Br0TAs7A.js → select-CzZNbe1Z.js} +1 -1
- package/dist/web/assets/{sequenceDiagram-3UESZ5HK-BRTm1WQA.js → sequenceDiagram-3UESZ5HK-Dqtb3BYG.js} +1 -1
- package/dist/web/assets/{server-DYeSE1wn.js → server-u-PC-CcX.js} +1 -1
- package/dist/web/assets/{stateDiagram-AJRCARHV-qN49iyR2.js → stateDiagram-AJRCARHV-C_MqF9Fy.js} +1 -1
- package/dist/web/assets/stateDiagram-v2-BHNVJYJU-BxmbGAhh.js +1 -0
- package/dist/web/assets/{textarea-B7vtoRE3.js → textarea-xt2hLb-d.js} +1 -1
- package/dist/web/assets/{timeline-definition-PNZ67QCA-BzarcDi3.js → timeline-definition-PNZ67QCA-Bzov6t31.js} +1 -1
- package/dist/web/assets/{toggles-jo27o0AH.js → toggles-B6E1UBYN.js} +1 -1
- package/dist/web/assets/{tooltip-DbVtCXcO.js → tooltip-C8--8CNX.js} +1 -1
- package/dist/web/assets/{track-C0vxnITw.js → track-BeqaPopG.js} +1 -1
- package/dist/web/assets/{trash-2-CUM-XX8B.js → trash-2-5jI3_KHh.js} +1 -1
- package/dist/web/assets/{tsMode-7D3gqep6.js → tsMode-uT3sMVHt.js} +1 -1
- package/dist/web/assets/typescript-Dkdj2ks0.js +1 -0
- package/dist/web/assets/{upload-CJ6jVmte.js → upload-DUteazR7.js} +1 -1
- package/dist/web/assets/{use-profiles-B0xXAf7Z.js → use-profiles-T3saKiBg.js} +1 -1
- package/dist/web/assets/{use-providers-FMSfyTD1.js → use-providers-CQwBj9hp.js} +1 -1
- package/dist/web/assets/use-translation-settings-DBzFqP-d.js +1 -0
- package/dist/web/assets/useNormalizedLogs-DsdwmfS7.js +1 -0
- package/dist/web/assets/useTokenUsage-Drh3v3kx.js +1 -0
- package/dist/web/assets/{vennDiagram-CIIHVFJN-B6oZetvf.js → vennDiagram-CIIHVFJN-BqxICvT_.js} +1 -1
- package/dist/web/assets/{wardley-L42UT6IY-Bzuhm76f.js → wardley-L42UT6IY-BTdLPFcA.js} +1 -1
- package/dist/web/assets/{wardleyDiagram-YWT4CUSO-DaC-FUf5.js → wardleyDiagram-YWT4CUSO-icnFsFn4.js} +1 -1
- package/dist/web/assets/xml-BO8gYu0L.js +1 -0
- package/dist/web/assets/{xychartDiagram-2RQKCTM6-CCvRIJRL.js → xychartDiagram-2RQKCTM6-BN2_ducK.js} +1 -1
- package/dist/web/assets/yaml-DlovbQzw.js +1 -0
- package/dist/web/index.html +2 -2
- package/node_modules/@agent-tower/shared/dist/translation.d.ts +12 -0
- package/node_modules/@agent-tower/shared/dist/translation.d.ts.map +1 -1
- package/node_modules/@agent-tower/shared/dist/translation.js +19 -0
- package/node_modules/@agent-tower/shared/dist/translation.js.map +1 -1
- package/node_modules/@agent-tower/shared/dist/types.d.ts +13 -1
- package/node_modules/@agent-tower/shared/dist/types.d.ts.map +1 -1
- package/node_modules/@agent-tower/shared/dist/types.js.map +1 -1
- package/package.json +1 -1
- package/prisma/migrations/20261023000000_add_task_base_branch/migration.sql +2 -0
- package/prisma/schema.prisma +1 -0
- package/dist/web/assets/AttachmentPreview-DRG5_cfN.js +0 -2
- package/dist/web/assets/BranchSelect-Dxs7HnMM.js +0 -1
- package/dist/web/assets/BrandLogo-Ilm880Xs.js +0 -1
- package/dist/web/assets/ConversationPage-B55Bj_ft.js +0 -1
- package/dist/web/assets/CreateTaskInput-CxWPeToI.js +0 -1
- package/dist/web/assets/DesignSystemPage-BxypsRUZ.js +0 -12
- package/dist/web/assets/EditableTaskTitle-Dh-SmvFW.js +0 -70
- package/dist/web/assets/GeneralSettingsPage-CzoejPZP.js +0 -1
- package/dist/web/assets/McpSettingsPage-DD7EqD4L.js +0 -1
- package/dist/web/assets/NotificationSettingsPage-BIqldIRf.js +0 -1
- package/dist/web/assets/ProjectSettingsPage-DKiEUkoa.js +0 -2
- package/dist/web/assets/ProviderSettingsPage-DZT7wyE2.js +0 -67
- package/dist/web/assets/TaskDetail-D_970BDY.js +0 -1
- package/dist/web/assets/TeamSettingsPage-BJIEZ7xL.js +0 -1
- package/dist/web/assets/channel-By24WpLg.js +0 -1
- package/dist/web/assets/check-DqPSoX0r.js +0 -1
- package/dist/web/assets/classDiagram-4FO5ZUOK-DxHoimtR.js +0 -1
- package/dist/web/assets/classDiagram-v2-Q7XG4LA2-DxHoimtR.js +0 -1
- package/dist/web/assets/content-CMUL3HGx.js +0 -2
- package/dist/web/assets/cssMode-ZnNWfjZ6.js +0 -1
- package/dist/web/assets/dialog-BYdeYC2Y.js +0 -5
- package/dist/web/assets/handlebars-C5VY_S-z.js +0 -1
- package/dist/web/assets/hooks-Ct0srfV-.js +0 -1
- package/dist/web/assets/html-e5uLnAgN.js +0 -1
- package/dist/web/assets/htmlMode-BeNiGozX.js +0 -1
- package/dist/web/assets/index-0XPZayUU.css +0 -1
- package/dist/web/assets/index-Cm6snkmR.js +0 -122
- package/dist/web/assets/javascript-D7QVj9jR.js +0 -1
- package/dist/web/assets/liquid-BPIyogoj.js +0 -1
- package/dist/web/assets/mdx-CI8yO2pV.js +0 -1
- package/dist/web/assets/popover-CJCQLoGu.js +0 -1
- package/dist/web/assets/python-CSxVPG9p.js +0 -1
- package/dist/web/assets/razor-CVoIieeS.js +0 -1
- package/dist/web/assets/search-field-CbM2P2KE.js +0 -1
- package/dist/web/assets/stateDiagram-v2-BHNVJYJU-B1clBPkJ.js +0 -1
- package/dist/web/assets/typescript-CbOVEQNg.js +0 -1
- package/dist/web/assets/use-projects-BlTwWxkY.js +0 -1
- package/dist/web/assets/use-translation-settings-BOlszecX.js +0 -1
- package/dist/web/assets/use-workspaces-DYrEp0Lw.js +0 -1
- package/dist/web/assets/useNormalizedLogs-D0N8MJdH.js +0 -1
- package/dist/web/assets/useTokenUsage-WB3ZQ25v.js +0 -1
- package/dist/web/assets/xml-Cfa9tkdT.js +0 -1
- package/dist/web/assets/yaml-C86f7VLL.js +0 -1
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/code-block-OCS4YCEC-
|
|
2
|
-
import{cB as Kc,cC as Ts,cD as Xc,cE as Zc,cF as Jc,c as ed,cG as se,u as Xe,j as p,q as cr,r as k,o as gu,ac as Wn,ad as Gn,ae as Qn,s as Zr,v as Pt,aI as bu,cH as td,p as nd,cI as rd,X as id,cJ as sd,aC as ad,bb as Eu,cK as ud,cL as od,bu as Ni,a2 as xn,n as dr,b2 as ld,ay as kn,ag as Tu,cM as cd}from"./index-Cm6snkmR.js";import{c as xu,f as dd,a as hd,b as fd,T as md}from"./AttachmentPreview-DRG5_cfN.js";import{t as pd,u as ku}from"./use-translation-settings-BOlszecX.js";import{C as gd}from"./copy-DyxlXxiU.js";import{R as bd,A as Ed,P as Td,C as xd}from"./index-kr6U6_pi.js";import{t as xs}from"./tooltip-DbVtCXcO.js";import{C as yu}from"./chevron-down-CPnvItQw.js";var kd=class extends Kc{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:Ts()})}getOptimisticResult(e){return e.behavior=Ts(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:s,isError:a,isRefetchError:u}=r,o=n.fetchMeta?.fetchMore?.direction,c=a&&o==="forward",d=i&&o==="forward",h=a&&o==="backward",f=i&&o==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Zc(t,n.data),hasPreviousPage:Xc(t,n.data),isFetchNextPageError:c,isFetchingNextPage:d,isFetchPreviousPageError:h,isFetchingPreviousPage:f,isRefetchError:u&&!c&&!h,isRefetching:s&&!d&&!f}}};function yd(e,t){return Jc(e,kd,t)}const Ad=[["path",{d:"M12 16v5",key:"zza2cw"}],["path",{d:"M16 14v7",key:"1g90b9"}],["path",{d:"M20 10v11",key:"1iqoj0"}],["path",{d:"m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15",key:"1fw8x9"}],["path",{d:"M4 18v3",key:"1yp0dc"}],["path",{d:"M8 14v7",key:"n3cwzv"}]],_d=ed("chart-no-axes-combined",Ad),Cd=/^[ \t]{0,3}::agent-download\{file="([^"\r\n]+)"\}[ \t]*$/,Sd=/^[a-zA-Z]:[\\/]/,Nd=1024;function Au(e){if(!e||e.length>Nd||e!==e.trim()||e.includes("\\")||/[\0-\x1f\x7f]/.test(e)||e.startsWith("/")||Sd.test(e))return null;const t=e.split("/");return t.some(n=>!n||n==="."||n==="..")?null:t.join("/")}function Id(e){const t=e.match(Cd);return t?Au(t[1]):null}function wd(e,t){const n=new Set(e.flatMap(i=>i.deliveryId?[i.deliveryId]:[])),r=t.filter(i=>i.state!=="CANCELLED"&&!n.has(i.id)).map(i=>({id:`user:${i.id}`,deliveryId:i.id,timestamp:Date.parse(i.createdAt),type:se.User,content:i.originalText}));return r.length?[...e,...r].sort((i,s)=>(i.timestamp??0)-(s.timestamp??0)):e}function Ld({item:e,onConversationCreated:t}){const{t:n}=Xe(),r="attachmentIds"in e.body&&Array.isArray(e.body.attachmentIds)?e.body.attachmentIds:[],i=xu(r),s=dd(e);return p.jsx("div",{className:"my-4 flex justify-end","data-submission-id":e.id,children:p.jsxs("div",{className:"flex max-w-[85%] min-w-0 flex-col items-end",children:[p.jsxs("div",{className:"max-w-full min-w-0 rounded-2xl rounded-tr-sm bg-foreground/[0.08] px-5 py-3.5 text-sm",children:[p.jsx("p",{className:"whitespace-pre-wrap break-words",children:e.text}),i.data?.map(a=>p.jsx("span",{className:"mt-1 block text-xs text-muted-foreground",children:a.originalName},a.id))]}),e.failed&&p.jsxs("div",{className:"mt-1 max-w-full px-0.5 text-xs text-muted-foreground","data-message-feedback":!0,children:[p.jsx("p",{children:n("Acceptance unknown; check or retry the same submission.")}),p.jsx("button",{type:"button",className:"mt-1 text-xs underline",disabled:s.isPending,onClick:()=>s.mutate(void 0,{onSuccess:a=>{"id"in a&&t?.(a.id)}}),children:n("Retry original submission")})]})]})})}const Jr=new WeakMap;function Rd(e,t,n){let r=Jr.get(e);r||(r=new Map,Jr.set(e,r));let i=r.get(t);if(i)i.owners.add(n),n.permission(i.denied);else{const s=new Set;let a=0;const u=()=>{i.epoch++;for(const d of s)d.refresh()},o=()=>{const d=++a;e.emit(Qn.SUBSCRIBE,{topic:"session",id:t},h=>{if(!(d!==a||r.get(t)!==i)){i.denied=!h.success;for(const f of s)f.permission(!h.success);u()}}),u()},c=d=>{d.sessionId===t&&u()};i={owners:s,epoch:0,denied:!1,dispose:()=>{a++,e.off("connect",o),e.off(Gn.TRANSLATION_INVALIDATED,c),e.emit(Qn.UNSUBSCRIBE,{topic:"session",id:t})}},r.set(t,i),e.on("connect",o),e.on(Gn.TRANSLATION_INVALIDATED,c),s.add(n),e.connected&&o()}return()=>{i.owners.delete(n),i.owners.size||(i.dispose(),r.delete(t))}}function ks(e,t){return Jr.get(e)?.get(t)?.epoch??0}function _u(e){return e.type===se.Assistant&&e.title!=="Thinking"&&!e.content.startsWith("Thinking:")&&e.textBlock?.semanticType==="assistant_message"}function Od(e,t,n){const r=t.textBlock;if(!(!_u(t)||r?.state!=="SEALED"))return n.find(i=>i.sessionId===e&&i.turnId===r.turnId&&i.blockId===r.blockId&&i.sourceRevision===r.sourceRevision&&i.originalText===t.content)}function Dd(e,t){const n=new Map(e?.map(r=>[r.sourceId,r]));return t.map(r=>{const i=n.get(r.sourceId);return i&&i.overlayRevision>r.overlayRevision?i:r})}async function Pd(e,t,n){const r=[];for(let i=0;i<t.length;i+=100){let s=null;const a=new Set;do{if(n.aborted)throw new DOMException("Aborted","AbortError");const u=await Pt.get(`/sessions/${encodeURIComponent(e)}/translations`,{signal:n,params:{blockIds:t.slice(i,i+100).join(","),...s?{cursor:s}:{}}});if(r.push(...u.items),s=u.nextCursor,s&&(a.has(s)||a.size>=1e3))throw new Error("Translation pagination did not finish");s&&a.add(s)}while(s!==null)}return r}function vd(e,t){const n=cr(),[r,i]=k.useState(!1),s=k.useMemo(()=>t.filter(c=>_u(c)&&c.textBlock.state==="SEALED"),[t]),a=k.useMemo(()=>[...new Set(s.map(c=>c.textBlock.blockId))].sort(),[s]),u=k.useMemo(()=>s.map(c=>[c.textBlock.turnId,c.textBlock.blockId,c.textBlock.sourceRevision,c.textBlock.state,c.content]),[s]),o=gu({queryKey:[...Zr.sessionTranslations.blocks(e,a),u],enabled:a.length>0,queryFn:async({signal:c})=>{const d=Wn.getSocket();for(let h=0;h<3;h++){const f=ks(d,e),m=await Pd(e,a,c);if(c.aborted)throw new DOMException("Aborted","AbortError");if(ks(d,e)===f)return m}throw new Error("Translation snapshot changed while reading")},structuralSharing:(c,d)=>Dd(c,d),placeholderData:(c,d)=>d?.queryKey[1]===e&&d.state.status==="success"?c:void 0,refetchOnMount:"always",refetchInterval:5e3,retry:!1,gcTime:6e4});return k.useEffect(()=>{const c=Wn.connect();return Rd(c,e,{refresh:()=>{n.invalidateQueries({queryKey:Zr.sessionTranslations.session(e)})},permission:i})},[n,e]),{...o,overlays:!r&&!o.isError&&(o.isFetchedAfterMount||o.isPlaceholderData)?o.data??[]:[]}}class Md{initialized=!1;sources=new Map;live=new Set;pending=new Set;completed=new Set;eligible=new Set;consumed=new Set;update(t,n,r){for(const i of t){const s=this.sources.get(i.id);(i.streaming||this.initialized&&(s===void 0||s!==i.revision))&&this.live.add(i.id),this.sources.set(i.id,i.revision)}r&&(this.initialized=!0);for(const i of n)i.state!=="SUCCESS"?i.state!=="NOT_REQUIRED"&&this.pending.add(i.version):this.completed.has(i.version)||(this.completed.add(i.version),(this.live.has(i.id)||this.pending.has(i.version))&&this.eligible.add(i.version))}claim=t=>this.consumed.has(t)?!1:(this.consumed.add(t),this.eligible.has(t))}function Bd(e,t,n,r){const i=k.useMemo(()=>new Md,[e]);return i.update(t,n,r),i.claim}const Rn=new Map;function Fd(e){const t=Rn.get(e);if(t)t.count++;else{const n=Wn.connect(),r=()=>n.emit(Qn.SUBSCRIBE,{topic:"task",id:e});n.on("connect",r),n.connected&&r(),Rn.set(e,{count:1,release:()=>{n.off("connect",r),n.emit(Qn.UNSUBSCRIBE,{topic:"task",id:e})}})}return()=>{const n=Rn.get(e);n&&--n.count===0&&(n.release(),Rn.delete(e))}}const jn=e=>["message-deliveries",e];function ys(e,t="pending",n="SESSION"){const r=cr(),i=yd({queryKey:[...jn(e),t],structuralSharing:(s,a)=>td(s,a),initialPageParam:"",queryFn:async({pageParam:s})=>{const a=await Pt.get("/message-deliveries",{params:{scopeType:n,scopeId:n==="TEAM_TASK"?e.replace(/^task:/,""):e,filter:t,...s?{cursor:s}:{}}});if(t!=="pending"||s)return a;const u=r.getQueryData([...jn(e),"pending"]),o=new Set(a.items.map(h=>h.id)),c=u?.pages.flatMap(h=>h.items).filter(h=>!["SENT","CANCELLED"].includes(h.state)&&!o.has(h.id))??[],d=await Promise.all(c.map(h=>Pt.get(`/message-deliveries/${encodeURIComponent(h.id)}`)));for(const h of d)bu(r,h);return{...a,items:[...a.items,...d]}},getNextPageParam:s=>s.nextCursor??void 0,enabled:!!e,refetchInterval:s=>s.state.data?.pages.some(a=>a.items.some(u=>!["SENT","CANCELLED"].includes(u.state)))?1e3:5e3});return k.useEffect(()=>{n==="TEAM_TASK"&&i.dataUpdatedAt&&r.invalidateQueries({queryKey:["team-runs","task",e.replace(/^task:/,"")]})},[r,n,e,i.dataUpdatedAt]),k.useEffect(()=>{if(!e)return;const s=n==="TEAM_TASK"?Fd(e.replace(/^task:/,"")):void 0,a=Wn.connect(),u=()=>{r.invalidateQueries({queryKey:jn(e)})},o=c=>{(c.sessionId===e||c.taskId&&`task:${c.taskId}`===e)&&u()};return a.on(Gn.MESSAGE_DELIVERY_INVALIDATED,o),a.on("connect",u),()=>{s?.(),a.off(Gn.MESSAGE_DELIVERY_INVALIDATED,o),a.off("connect",u)}},[e,n,r]),i}function Hd(e){const t=cr();return nd({mutationFn:({delivery:n,action:r})=>{const i={action:r,expectedRevision:n.revision};return hd(`action:${n.id}`,i,s=>{const{clientSubmissionId:a,...u}=s;return Pt.post(`/message-deliveries/${n.id}/actions`,{...u,actionId:a})})},onSuccess:n=>bu(t,n.delivery),onSettled:()=>t.invalidateQueries({queryKey:jn(e)})})}function Ud({text:e,label:t,getText:n,canCopy:r}){const{t:i}=Xe(),[s,a]=k.useState(null),u=k.useRef(!1),o=k.useRef(!0);k.useEffect(()=>(o.current=!0,()=>{o.current=!1}),[]);const c=async()=>{if(!u.current){u.current=!0;try{const d=n?await n():e;if(!o.current||r&&!r())return;if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(d);else{const h=document.activeElement,f=document.createElement("textarea");f.value=d,f.readOnly=!0,f.style.position="fixed",f.style.opacity="0",document.body.appendChild(f);try{if(f.focus(),f.select(),!document.execCommand("copy"))throw new Error}finally{f.remove(),h?.focus()}}o.current&&a("已复制")}catch{o.current&&a("Copy failed.")}finally{u.current=!1}}};return p.jsxs("span",{className:"inline-flex items-center gap-1",children:[p.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 rounded px-1.5 py-1 text-xs text-muted-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":t,onClick:()=>{c()},children:[p.jsx(gd,{size:12}),t]}),s&&p.jsx("span",{className:"text-xs text-muted-foreground",role:"status",children:i(s)})]})}function Cu({original:e,children:t,onOpen:n,getOriginal:r,canCopy:i,loading:s,error:a,label:u="Original"}){const{t:o}=Xe(),[c,d]=k.useState(!1),h=k.useRef(null),f=k.useRef(null),m=k.useRef(!1),b=k.useRef(!1),A=k.useRef(!1),S=k.useRef(null),_=k.useId(),L=k.useId(),I=()=>{S.current&&clearTimeout(S.current)},B=($=!1)=>{I(),b.current=$,d(!1)},z=()=>{I(),S.current=setTimeout(()=>{!f.current?.contains(document.activeElement)&&document.activeElement!==h.current&&B()},250)};k.useEffect(()=>()=>{S.current&&clearTimeout(S.current)},[]);const R=k.useRef(n);return k.useEffect(()=>{R.current=n},[n]),k.useEffect(()=>{c&&R.current?.()},[c]),p.jsxs(bd,{open:c,onOpenChange:$=>{b.current=!1,d($)},children:[p.jsx(Ed,{asChild:!0,children:p.jsx("button",{type:"button",ref:h,"aria-haspopup":"dialog","aria-expanded":c,"aria-controls":c?L:void 0,"aria-label":o(u),title:o(u),className:"inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",onPointerEnter:$=>{$.pointerType==="mouse"&&(I(),d(!0))},onPointerLeave:z,onFocus:()=>{m.current||(I(),d(!0)),m.current=!1},onBlur:z,onClick:()=>{I(),d(!0)},onKeyDown:$=>{($.key==="ArrowDown"||$.key==="Tab"&&!$.shiftKey&&c)&&($.preventDefault(),A.current=!0,d(!0),f.current?.querySelector("button")?.focus()),$.key==="Escape"&&c&&($.preventDefault(),$.stopPropagation(),B(!0))},children:p.jsx(rd,{size:14,"aria-hidden":"true"})})}),p.jsx(Td,{children:p.jsxs(xd,{ref:f,id:L,align:"start",sideOffset:6,collisionPadding:12,"aria-labelledby":_,className:"z-[80] flex max-h-[var(--radix-popover-content-available-height)] w-[min(36rem,calc(100vw-24px))] flex-col rounded-xl border border-border bg-background p-4 text-foreground shadow-xl outline-none",onOpenAutoFocus:$=>{$.preventDefault(),A.current&&f.current?.querySelector("button")?.focus(),A.current=!1},onFocusOutside:$=>{$.target===h.current&&$.preventDefault()},onCloseAutoFocus:$=>{$.preventDefault(),b.current&&document.activeElement!==h.current&&(m.current=!0,h.current?.focus()),b.current=!1},onEscapeKeyDown:$=>{$.preventDefault(),$.stopPropagation(),B(!0)},onPointerEnter:I,onPointerLeave:z,onFocus:I,onBlur:z,children:[p.jsxs("div",{className:"mb-3 flex shrink-0 items-center justify-between gap-2",children:[p.jsx("h3",{id:_,className:"text-sm font-medium",children:o(u)}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Ud,{text:e,getText:r,canCopy:i,label:o(u==="Original"?"Copy original":"复制")}),p.jsx("button",{type:"button","aria-label":o("关闭"),onClick:()=>B(!0),className:"rounded p-1 hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring",children:p.jsx(id,{size:15})})]})]}),s&&p.jsx("span",{role:"status",className:"text-xs text-muted-foreground",children:o("Loading")}),a&&p.jsxs("div",{role:"alert",className:"text-xs text-destructive",children:[a,p.jsx("button",{type:"button",onClick:n,className:"ml-2 underline",children:o("Retry")})]}),p.jsx("div",{tabIndex:0,"aria-label":o(u),className:"max-h-[min(55vh,28rem)] min-h-0 overflow-y-auto overscroll-contain break-words pr-2 text-sm leading-6 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:t})]})})]})}function jd({version:e,claim:t,children:n}){const r=k.useRef(null),i=k.useRef(e);return k.useLayoutEffect(()=>{const s=i.current!==e;i.current=e;const a=e!==null&&t?.(e);if(!s||!a||!r.current?.animate||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;const u=r.current.animate([{opacity:.55,transform:"translateY(2px)"},{opacity:1,transform:"translateY(0)"}],{duration:180,easing:"ease-out"});return()=>u.cancel()},[e,t]),p.jsx("div",{ref:r,"data-translation-version":e??"original",children:n})}const zd=new Set(["FAILED","CANCELLED","INTERRUPTED","QUEUE_FULL","PAUSED_DISABLED"]),$d={PENDING:"Waiting for translation",RUNNING:"Translating…",RETRY_WAIT:"Waiting to retry translation",FAILED:"Translation failed",CANCELLED:"Translation cancelled",INTERRUPTED:"Translation interrupted",QUEUE_FULL:"Translation queue full",PAUSED_DISABLED:"Translation paused"};function Yd({overlay:e,enabled:t}){const n=cr();return p.jsx(qd,{state:e.state,enabled:t,onRetry:async()=>{try{await Pt.post(`/sessions/${encodeURIComponent(e.sessionId)}/translations/${encodeURIComponent(e.sourceId)}/retry`,{expectedRevision:e.sourceRevision})}finally{n.invalidateQueries({queryKey:Zr.sessionTranslations.session(e.sessionId)})}}})}function qd({state:e,enabled:t,onRetry:n}){const{t:r}=Xe(),[i,s]=k.useState(!1),a=k.useRef(!1),[u,o]=k.useState(null),c=k.useRef(!0);k.useEffect(()=>(c.current=!0,()=>{c.current=!1}),[]);const d=$d[e];return d?p.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[p.jsx("span",{children:r(d)}),t&&zd.has(e)&&p.jsx("button",{type:"button",disabled:i,className:"rounded px-1.5 py-1 underline hover:bg-muted disabled:opacity-50",onClick:async()=>{if(!a.current){a.current=!0,s(!0),o(null);try{await n()}catch(h){c.current&&o(pd(h))}finally{a.current=!1,c.current&&s(!1)}}},children:r(i?"Retrying…":"Retry translation")}),u&&p.jsx("span",{role:"alert",children:r(u)})]}):null}function Vd({delivery:e}){const t=xu(e.attachmentIds);return["SENT","CANCELLED"].includes(e.state)?null:t.data?.map(n=>p.jsx("a",{className:"mt-1 block text-xs underline",href:`/api/attachments/${encodeURIComponent(n.id)}/file`,target:"_blank",rel:"noreferrer",children:n.originalName},n.id))}function Su({delivery:e}){const{t}=Xe(),n=Hd(sd(e)?e.sessionId:`task:${e.destination.taskId}`),r=ku(),i=e.sentMode==="ORIGINAL"&&e.acceptedText!==null;if(i&&!e.lastError&&["READY","DISPATCHING"].includes(e.state)||e.state==="SENT"&&e.sentMode!=="TRANSLATED")return null;if(e.state==="SENT")return p.jsx("div",{className:"flex justify-end",children:p.jsx(Cu,{original:e.actualSentText??"",label:"Actual sent text",children:p.jsx("pre",{className:"whitespace-pre-wrap",children:e.actualSentText})})});if(e.state==="CANCELLED")return p.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:t("Cancelled")});const s=e.state==="DELIVERY_UNKNOWN"?[["confirm_not_sent","Confirmed not sent: retry"],["end_unknown","End operation (may already be received)"]]:e.state==="DISPATCHING"?[]:[...!i&&r.data?.enabled===!0&&["TRANSLATION_FAILED","PAUSED_DISABLED"].includes(e.state)?[["retry_translation","Retry translation"]]:[],...["DELIVERY_FAILED","PAUSED_DISABLED"].includes(e.state)&&e.acceptedText!==null?[["retry_delivery","Retry delivery"]]:[],...!i&&["TRANSLATION_FAILED","PAUSED_DISABLED","WAITING_TRANSLATION","WAITING_TASK_INPUT","READY","WAITING_PREDECESSOR","ACCEPTED"].includes(e.state)?[["send_original","Send original"]]:[],["cancel","Cancel"]];return p.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground","data-delivery-state":e.state,"aria-live":"polite",children:[p.jsx("p",{children:t(e.state==="DELIVERY_UNKNOWN"?"Delivery result unknown. Verify before retrying.":["ACCEPTED","WAITING_PREDECESSOR"].includes(e.state)?"Queued, not sent":e.state==="TRANSLATION_FAILED"?"Translation failed":e.state==="PAUSED_DISABLED"?"Sending paused":e.state==="DELIVERY_FAILED"?"Delivery failed":e.state==="WAITING_TASK_INPUT"?"Waiting for task input":e.state==="WAITING_TRANSLATION"?"Waiting for translation":"Waiting to send")}),e.lastError&&p.jsx("p",{children:e.lastError}),p.jsx("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:s.map(([a,u])=>p.jsx("button",{type:"button",className:"underline",disabled:n.isPending,onClick:()=>n.mutate({delivery:e,action:a}),children:t(u)},a))}),n.error&&p.jsx("p",{role:"alert",className:"text-destructive",children:t("Delivery action failed. Refresh and try again.")})]})}function St(e,t,n){let r=n.initialDeps??[],i,s=!0;function a(){var u,o,c;let d;n.key&&((u=n.debug)!=null&&u.call(n))&&(d=Date.now());const h=e();if(!(h.length!==r.length||h.some((b,A)=>r[A]!==b)))return i;r=h;let m;if(n.key&&((o=n.debug)!=null&&o.call(n))&&(m=Date.now()),i=t(...h),n.key&&((c=n.debug)!=null&&c.call(n))){const b=Math.round((Date.now()-d)*100)/100,A=Math.round((Date.now()-m)*100)/100,S=A/16,_=(L,I)=>{for(L=String(L);L.length<I;)L=" "+L;return L};console.info(`%c⏱ ${_(A,5)} /${_(b,5)} ms`,`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/code-block-OCS4YCEC-B2hHBO_G.js","assets/index-BR3Wg2fS.js","assets/index-DZLg4-xM.css","assets/AttachmentPreview-CFJ6MZ1f.js","assets/tooltip-C8--8CNX.js","assets/kbd-Cl4AzzJp.js","assets/index-DVdiOmqt.js","assets/index-hHrknzh7.js","assets/index-cu8sedJH.js","assets/use-translation-settings-DBzFqP-d.js","assets/copy-C4WnOY6Y.js","assets/index-Da2mWAtm.js","assets/chevron-down-BoS08pMa.js","assets/index-CrKx8Yaz.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{cC as td,cD as xs,cE as nd,cF as rd,cG as id,c as sd,cH as se,u as Xe,j as p,q as fr,r as y,o as xu,ae as Kn,s as ft,af as Xn,ag as Zn,M as ad,cI as ku,ci as ud,v as vt,aI as yu,cJ as od,p as ld,cK as cd,X as dd,cL as hd,aC as fd,bc as Au,cM as md,cN as pd,bu as Ii,n as kn,$ as yn,b5 as gd,a1 as An,ai as _u,cO as bd}from"./index-BR3Wg2fS.js";import{c as Cu,f as Ed,a as Td,b as xd}from"./AttachmentPreview-CFJ6MZ1f.js";import{t as ks,u as Su}from"./use-translation-settings-DBzFqP-d.js";import{C as kd}from"./copy-C4WnOY6Y.js";import{R as yd,A as Ad,P as _d,C as Cd}from"./index-Da2mWAtm.js";import{T as Sd,t as ys}from"./tooltip-C8--8CNX.js";import{C as Nu}from"./chevron-down-BoS08pMa.js";var Nd=class extends td{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:xs()})}getOptimisticResult(e){return e.behavior=xs(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:s,isError:a,isRefetchError:u}=r,o=n.fetchMeta?.fetchMore?.direction,c=a&&o==="forward",d=i&&o==="forward",h=a&&o==="backward",f=i&&o==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:rd(t,n.data),hasPreviousPage:nd(t,n.data),isFetchNextPageError:c,isFetchingNextPage:d,isFetchPreviousPageError:h,isFetchingPreviousPage:f,isRefetchError:u&&!c&&!h,isRefetching:s&&!d&&!f}}};function Id(e,t){return id(e,Nd,t)}const wd=[["path",{d:"M12 16v5",key:"zza2cw"}],["path",{d:"M16 14v7",key:"1g90b9"}],["path",{d:"M20 10v11",key:"1iqoj0"}],["path",{d:"m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15",key:"1fw8x9"}],["path",{d:"M4 18v3",key:"1yp0dc"}],["path",{d:"M8 14v7",key:"n3cwzv"}]],Ld=sd("chart-no-axes-combined",wd),Rd=/^[ \t]{0,3}::agent-download\{file="([^"\r\n]+)"\}[ \t]*$/,Od=/^[a-zA-Z]:[\\/]/,Dd=1024;function Iu(e){if(!e||e.length>Dd||e!==e.trim()||e.includes("\\")||/[\0-\x1f\x7f]/.test(e)||e.startsWith("/")||Od.test(e))return null;const t=e.split("/");return t.some(n=>!n||n==="."||n==="..")?null:t.join("/")}function Pd(e){const t=e.match(Rd);return t?Iu(t[1]):null}function vd(e,t){const n=new Set(e.flatMap(i=>i.deliveryId?[i.deliveryId]:[])),r=t.filter(i=>i.state!=="CANCELLED"&&!n.has(i.id)).map(i=>({id:`user:${i.id}`,deliveryId:i.id,timestamp:Date.parse(i.createdAt),type:se.User,content:i.originalText}));return r.length?[...e,...r].sort((i,s)=>(i.timestamp??0)-(s.timestamp??0)):e}function Md({item:e,onConversationCreated:t}){const{t:n}=Xe(),r="attachmentIds"in e.body&&Array.isArray(e.body.attachmentIds)?e.body.attachmentIds:[],i=Cu(r),s=Ed(e);return p.jsx("div",{className:"my-4 flex justify-end","data-submission-id":e.id,children:p.jsxs("div",{className:"flex max-w-[85%] min-w-0 flex-col items-end",children:[p.jsxs("div",{className:"max-w-full min-w-0 rounded-2xl rounded-tr-sm bg-foreground/[0.08] px-5 py-3.5 text-sm",children:[p.jsx("p",{className:"whitespace-pre-wrap break-words",children:e.text}),i.data?.map(a=>p.jsx("span",{className:"mt-1 block text-xs text-muted-foreground",children:a.originalName},a.id))]}),e.failed&&p.jsxs("div",{className:"mt-1 max-w-full px-0.5 text-xs text-muted-foreground","data-message-feedback":!0,children:[p.jsx("p",{children:n("Acceptance unknown; check or retry the same submission.")}),p.jsx("button",{type:"button",className:"mt-1 text-xs underline",disabled:s.isPending,onClick:()=>s.mutate(void 0,{onSuccess:a=>{"id"in a&&t?.(a.id)}}),children:n("Retry original submission")})]})]})})}const ei=new WeakMap,Dn=[];function Bd(e,t,n){let r=ei.get(e);r||(r=new Map,ei.set(e,r));let i=r.get(t);if(i)i.owners.add(n),n.permission(i.denied);else{const s=new Set;let a=0;const u=()=>{i.epoch++;for(const d of s)d.refresh()},o=(d=!0)=>{const h=++a;e.emit(Zn.SUBSCRIBE,{topic:"session",id:t},f=>{if(h!==a||r.get(t)!==i)return;const m=i.denied;i.denied=!f.success;for(const b of s)b.permission(!f.success);m&&f.success&&u()}),d&&u()},c=d=>{d.sessionId===t&&u()};i={owners:s,epoch:0,denied:!1,dispose:()=>{a++,e.off("connect",o),e.off(Xn.TRANSLATION_INVALIDATED,c),e.emit(Zn.UNSUBSCRIBE,{topic:"session",id:t})}},r.set(t,i),e.on("connect",o),e.on(Xn.TRANSLATION_INVALIDATED,c),s.add(n),e.connected&&o(!1)}return()=>{i.owners.delete(n),i.owners.size||(i.dispose(),r.delete(t))}}function As(e,t){return ei.get(e)?.get(t)?.epoch??0}function _s(e){return e instanceof ad&&[401,403,404].includes(e.status)}function wu(e){return e.type===se.Assistant&&e.title!=="Thinking"&&!e.content.startsWith("Thinking:")&&e.textBlock?.semanticType==="assistant_message"}function Fd(e){return new Map(e.map(t=>[JSON.stringify([t.sessionId,t.turnId,t.blockId]),t]))}function Hd(e,t,n){const r=[];let i=null;if(!wu(t)||!t.textBlock)return{content:t.content,overlays:r,version:i};const s=ku(t.content,t.textBlock),a=s.map(u=>{const o=n.get(JSON.stringify([e,u.turnId,u.blockId]));return u.state!=="SEALED"||!o||o.sourceRevision!==u.sourceRevision||o.originalText!==u.content||(r.push(o),o.state!=="SUCCESS"||o.translatedText===null)?u.content:(i=`${o.sourceId}:${o.sourceRevision}`,o.translatedText)}).join("");return{content:s.length?a:t.content,overlays:r,version:i}}function Ud(e,t){const n=new Map(e?.map(r=>[r.sourceId,r]));return ud(e,t.map(r=>{const i=n.get(r.sourceId);return i&&i.overlayRevision>r.overlayRevision?i:r}))}async function jd(e,t,n){const r=[];for(let i=0;i<1;i+=100){let s=null;const a=new Set;do{if(n.aborted)throw new DOMException("Aborted","AbortError");const u=await vt.get(`/sessions/${encodeURIComponent(e)}/translations`,{signal:n,params:{...s?{cursor:s}:{}}});if(r.push(...u.items),s=u.nextCursor,s&&(a.has(s)||a.size>=1e3))throw new Error("Translation pagination did not finish");s&&a.add(s)}while(s!==null)}return r}function zd(e,t){const n=fr(),[r,i]=y.useState(!1),s=y.useMemo(()=>JSON.stringify(t.filter(wu).map(c=>{const d=c.textBlock;return[d.turnId,d.blockId,d.sourceRevision,d.state,d.paragraphs?.length??0]})),[t]),a=y.useRef({sessionId:e,selection:s}),u=xu({queryKey:ft.sessionTranslations.session(e),enabled:s!=="[]",queryFn:async({signal:c})=>{const d=Kn.getSocket();for(let h=0;h<3;h++){const f=As(d,e);let m;try{m=await jd(e,void 0,c)}catch(b){throw!c.aborted&&_s(b)&&n.setQueryData(ft.sessionTranslations.session(e),Dn),b}if(c.aborted)throw new DOMException("Aborted","AbortError");if(As(d,e)===f)return m}throw new Error("Translation snapshot changed while reading")},structuralSharing:(c,d)=>Ud(c,d),refetchOnMount:"always",refetchInterval:5e3,retry:!1,gcTime:30*6e4});y.useEffect(()=>{const c=Kn.connect();return Bd(c,e,{refresh:()=>{n.invalidateQueries({queryKey:ft.sessionTranslations.session(e)},{cancelRefetch:!1})},permission:h=>{i(h),h&&(n.cancelQueries({queryKey:ft.sessionTranslations.session(e)},{revert:!1}),n.setQueryData(ft.sessionTranslations.session(e),Dn))}})},[n,e]),y.useEffect(()=>{const c=a.current;a.current={sessionId:e,selection:s},c.sessionId===e&&c.selection!==s&&n.invalidateQueries({queryKey:ft.sessionTranslations.session(e)},{cancelRefetch:!1})},[n,e,s]);const o=_s(u.error);return{...u,overlays:!r&&!o?u.data??Dn:Dn}}class $d{initialized=!1;sources=new Map;live=new Set;pending=new Set;completed=new Set;eligible=new Set;consumed=new Set;update(t,n,r){for(const i of t){const s=this.sources.get(i.id);(i.streaming||this.initialized&&(s===void 0||s!==i.revision))&&this.live.add(i.id),this.sources.set(i.id,i.revision)}r&&(this.initialized=!0);for(const i of n)i.state!=="SUCCESS"?i.state!=="NOT_REQUIRED"&&this.pending.add(i.version):this.completed.has(i.version)||(this.completed.add(i.version),(this.live.has(i.id)||this.pending.has(i.version))&&this.eligible.add(i.version))}claim=t=>this.consumed.has(t)?!1:(this.consumed.add(t),this.eligible.has(t))}function Yd(e,t,n,r){const i=y.useMemo(()=>new $d,[e]);return i.update(t,n,r),i.claim}const Pn=new Map;function qd(e){const t=Pn.get(e);if(t)t.count++;else{const n=Kn.connect(),r=()=>n.emit(Zn.SUBSCRIBE,{topic:"task",id:e});n.on("connect",r),n.connected&&r(),Pn.set(e,{count:1,release:()=>{n.off("connect",r),n.emit(Zn.UNSUBSCRIBE,{topic:"task",id:e})}})}return()=>{const n=Pn.get(e);n&&--n.count===0&&(n.release(),Pn.delete(e))}}const Yn=e=>["message-deliveries",e];function Cs(e,t="pending",n="SESSION"){const r=fr(),i=Id({queryKey:[...Yn(e),t],structuralSharing:(s,a)=>od(s,a),initialPageParam:"",queryFn:async({pageParam:s})=>{const a=await vt.get("/message-deliveries",{params:{scopeType:n,scopeId:n==="TEAM_TASK"?e.replace(/^task:/,""):e,filter:t,...s?{cursor:s}:{}}});if(t!=="pending"||s)return a;const u=r.getQueryData([...Yn(e),"pending"]),o=new Set(a.items.map(h=>h.id)),c=u?.pages.flatMap(h=>h.items).filter(h=>!["SENT","CANCELLED"].includes(h.state)&&!o.has(h.id))??[],d=await Promise.all(c.map(h=>vt.get(`/message-deliveries/${encodeURIComponent(h.id)}`)));for(const h of d)yu(r,h);return{...a,items:[...a.items,...d]}},getNextPageParam:s=>s.nextCursor??void 0,enabled:!!e,refetchInterval:s=>s.state.data?.pages.some(a=>a.items.some(u=>!["SENT","CANCELLED"].includes(u.state)))?1e3:5e3});return y.useEffect(()=>{n==="TEAM_TASK"&&i.dataUpdatedAt&&r.invalidateQueries({queryKey:["team-runs","task",e.replace(/^task:/,"")]})},[r,n,e,i.dataUpdatedAt]),y.useEffect(()=>{if(!e)return;const s=n==="TEAM_TASK"?qd(e.replace(/^task:/,"")):void 0,a=Kn.connect(),u=()=>{r.invalidateQueries({queryKey:Yn(e)})},o=c=>{(c.sessionId===e||c.taskId&&`task:${c.taskId}`===e)&&u()};return a.on(Xn.MESSAGE_DELIVERY_INVALIDATED,o),a.on("connect",u),()=>{s?.(),a.off(Xn.MESSAGE_DELIVERY_INVALIDATED,o),a.off("connect",u)}},[e,n,r]),i}function Vd(e){const t=fr();return ld({mutationFn:({delivery:n,action:r})=>{const i={action:r,expectedRevision:n.revision};return Td(`action:${n.id}`,i,s=>{const{clientSubmissionId:a,...u}=s;return vt.post(`/message-deliveries/${n.id}/actions`,{...u,actionId:a})})},onSuccess:n=>yu(t,n.delivery),onSettled:()=>t.invalidateQueries({queryKey:Yn(e)})})}function Wd({text:e,label:t,getText:n,canCopy:r}){const{t:i}=Xe(),[s,a]=y.useState(null),u=y.useRef(!1),o=y.useRef(!0);y.useEffect(()=>(o.current=!0,()=>{o.current=!1}),[]);const c=async()=>{if(!u.current){u.current=!0;try{const d=n?await n():e;if(!o.current||r&&!r())return;if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(d);else{const h=document.activeElement,f=document.createElement("textarea");f.value=d,f.readOnly=!0,f.style.position="fixed",f.style.opacity="0",document.body.appendChild(f);try{if(f.focus(),f.select(),!document.execCommand("copy"))throw new Error}finally{f.remove(),h?.focus()}}o.current&&a("已复制")}catch{o.current&&a("Copy failed.")}finally{u.current=!1}}};return p.jsxs("span",{className:"inline-flex items-center gap-1",children:[p.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 rounded px-1.5 py-1 text-xs text-muted-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":t,onClick:()=>{c()},children:[p.jsx(kd,{size:12}),t]}),s&&p.jsx("span",{className:"text-xs text-muted-foreground",role:"status",children:i(s)})]})}function Lu({original:e,children:t,onOpen:n,getOriginal:r,canCopy:i,loading:s,error:a,label:u="Original"}){const{t:o}=Xe(),[c,d]=y.useState(!1),h=y.useRef(null),f=y.useRef(null),m=y.useRef(!1),b=y.useRef(!1),k=y.useRef(!1),S=y.useRef(null),_=y.useId(),L=y.useId(),I=()=>{S.current&&clearTimeout(S.current)},B=($=!1)=>{I(),b.current=$,d(!1)},z=()=>{I(),S.current=setTimeout(()=>{!f.current?.contains(document.activeElement)&&document.activeElement!==h.current&&B()},250)};y.useEffect(()=>()=>{S.current&&clearTimeout(S.current)},[]);const R=y.useRef(n);return y.useEffect(()=>{R.current=n},[n]),y.useEffect(()=>{c&&R.current?.()},[c]),p.jsxs(yd,{open:c,onOpenChange:$=>{b.current=!1,d($)},children:[p.jsx(Ad,{asChild:!0,children:p.jsx("button",{type:"button",ref:h,"aria-haspopup":"dialog","aria-expanded":c,"aria-controls":c?L:void 0,"aria-label":o(u),title:o(u),className:"inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",onPointerEnter:$=>{$.pointerType==="mouse"&&(I(),d(!0))},onPointerLeave:z,onFocus:()=>{m.current||(I(),d(!0)),m.current=!1},onBlur:z,onClick:()=>{I(),d(!0)},onKeyDown:$=>{($.key==="ArrowDown"||$.key==="Tab"&&!$.shiftKey&&c)&&($.preventDefault(),k.current=!0,d(!0),f.current?.querySelector("button")?.focus()),$.key==="Escape"&&c&&($.preventDefault(),$.stopPropagation(),B(!0))},children:p.jsx(cd,{size:14,"aria-hidden":"true"})})}),p.jsx(_d,{children:p.jsxs(Cd,{ref:f,id:L,align:"start",sideOffset:6,collisionPadding:12,"aria-labelledby":_,className:"z-[80] flex max-h-[var(--radix-popover-content-available-height)] w-[min(36rem,calc(100vw-24px))] flex-col rounded-xl border border-border bg-background p-4 text-foreground shadow-xl outline-none",onOpenAutoFocus:$=>{$.preventDefault(),k.current&&f.current?.querySelector("button")?.focus(),k.current=!1},onFocusOutside:$=>{$.target===h.current&&$.preventDefault()},onCloseAutoFocus:$=>{$.preventDefault(),b.current&&document.activeElement!==h.current&&(m.current=!0,h.current?.focus()),b.current=!1},onEscapeKeyDown:$=>{$.preventDefault(),$.stopPropagation(),B(!0)},onPointerEnter:I,onPointerLeave:z,onFocus:I,onBlur:z,children:[p.jsxs("div",{className:"mb-3 flex shrink-0 items-center justify-between gap-2",children:[p.jsx("h3",{id:_,className:"text-sm font-medium",children:o(u)}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Wd,{text:e,getText:r,canCopy:i,label:o(u==="Original"?"Copy original":"复制")}),p.jsx("button",{type:"button","aria-label":o("关闭"),onClick:()=>B(!0),className:"rounded p-1 hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring",children:p.jsx(dd,{size:15})})]})]}),s&&p.jsx("span",{role:"status",className:"text-xs text-muted-foreground",children:o("Loading")}),a&&p.jsxs("div",{role:"alert",className:"text-xs text-destructive",children:[a,p.jsx("button",{type:"button",onClick:n,className:"ml-2 underline",children:o("Retry")})]}),p.jsx("div",{tabIndex:0,"aria-label":o(u),className:"max-h-[min(55vh,28rem)] min-h-0 overflow-y-auto overscroll-contain break-words pr-2 text-sm leading-6 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:t})]})})]})}function Gd({version:e,claim:t,children:n}){const r=y.useRef(null),i=y.useRef(e);return y.useLayoutEffect(()=>{const s=i.current!==e;i.current=e;const a=e!==null&&t?.(e);if(!s||!a||!r.current?.animate||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;const u=r.current.animate([{opacity:.55,transform:"translateY(2px)"},{opacity:1,transform:"translateY(0)"}],{duration:180,easing:"ease-out"});return()=>u.cancel()},[e,t]),p.jsx("div",{ref:r,"data-translation-version":e??"original",children:n})}const Ss=new Set(["FAILED","CANCELLED","INTERRUPTED","QUEUE_FULL","PAUSED_DISABLED"]),Qd={PENDING:"Waiting for translation",RUNNING:"Translating…",RETRY_WAIT:"Waiting to retry translation",FAILED:"Translation failed",CANCELLED:"Translation cancelled",INTERRUPTED:"Translation interrupted",QUEUE_FULL:"Translation queue full",PAUSED_DISABLED:"Translation paused"};function Kd({overlay:e,enabled:t}){const n=fr();return p.jsx(Xd,{state:e.state,errorCode:e.errorCode,enabled:t,onRetry:async()=>{try{await vt.post(`/sessions/${encodeURIComponent(e.sessionId)}/translations/${encodeURIComponent(e.sourceId)}/retry`,{expectedRevision:e.sourceRevision})}finally{n.invalidateQueries({queryKey:ft.sessionTranslations.session(e.sessionId)})}}})}function Xd({state:e,errorCode:t,enabled:n,onRetry:r}){const{t:i}=Xe(),[s,a]=y.useState(!1),u=y.useRef(!1),[o,c]=y.useState(null),d=y.useRef(!0);y.useEffect(()=>(d.current=!0,()=>{d.current=!1}),[]);const h=Qd[e];if(!h)return null;const f=e==="FAILED"||t&&(Ss.has(e)||e==="RETRY_WAIT");return p.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[p.jsx("span",{children:i(h)}),n&&Ss.has(e)&&p.jsx("button",{type:"button",disabled:s,className:"rounded px-1.5 py-1 underline hover:bg-muted disabled:opacity-50",onClick:async()=>{if(!u.current){u.current=!0,a(!0),c(null);try{await r()}catch(m){d.current&&c(ks(m))}finally{u.current=!1,d.current&&a(!1)}}},children:i(s?"Retrying…":"Retry translation")}),f&&p.jsxs("p",{role:"alert",className:"w-full break-words text-destructive",children:[i(ks(t)),t&&p.jsxs(p.Fragment,{children:[" ",p.jsxs("span",{className:"font-mono",children:["(",t,")"]})]})]}),o&&p.jsx("span",{role:"alert",children:i(o)})]})}function Zd({delivery:e}){const t=Cu(e.attachmentIds);return["SENT","CANCELLED"].includes(e.state)?null:t.data?.map(n=>p.jsx("a",{className:"mt-1 block text-xs underline",href:`/api/attachments/${encodeURIComponent(n.id)}/file`,target:"_blank",rel:"noreferrer",children:n.originalName},n.id))}function Ru({delivery:e}){const{t}=Xe(),n=Vd(hd(e)?e.sessionId:`task:${e.destination.taskId}`),r=Su(),i=e.sentMode==="ORIGINAL"&&e.acceptedText!==null;if(i&&!e.lastError&&["READY","DISPATCHING"].includes(e.state)||e.state==="SENT"&&e.sentMode!=="TRANSLATED")return null;if(e.state==="SENT")return p.jsx("div",{className:"flex justify-end",children:p.jsx(Lu,{original:e.actualSentText??"",label:"Actual sent text",children:p.jsx("pre",{className:"whitespace-pre-wrap",children:e.actualSentText})})});if(e.state==="CANCELLED")return p.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:t("Cancelled")});const s=e.state==="DELIVERY_UNKNOWN"?[["confirm_not_sent","Confirmed not sent: retry"],["end_unknown","End operation (may already be received)"]]:e.state==="DISPATCHING"?[]:[...!i&&r.data?.enabled===!0&&["TRANSLATION_FAILED","PAUSED_DISABLED"].includes(e.state)?[["retry_translation","Retry translation"]]:[],...["DELIVERY_FAILED","PAUSED_DISABLED"].includes(e.state)&&e.acceptedText!==null?[["retry_delivery","Retry delivery"]]:[],...!i&&["TRANSLATION_FAILED","PAUSED_DISABLED","WAITING_TRANSLATION","WAITING_TASK_INPUT","READY","WAITING_PREDECESSOR","ACCEPTED"].includes(e.state)?[["send_original","Send original"]]:[],["cancel","Cancel"]];return p.jsxs("div",{className:"space-y-1 text-xs text-muted-foreground","data-delivery-state":e.state,"aria-live":"polite",children:[p.jsx("p",{children:t(e.state==="DELIVERY_UNKNOWN"?"Delivery result unknown. Verify before retrying.":["ACCEPTED","WAITING_PREDECESSOR"].includes(e.state)?"Queued, not sent":e.state==="TRANSLATION_FAILED"?"Translation failed":e.state==="PAUSED_DISABLED"?"Sending paused":e.state==="DELIVERY_FAILED"?"Delivery failed":e.state==="WAITING_TASK_INPUT"?"Waiting for task input":e.state==="WAITING_TRANSLATION"?"Waiting for translation":"Waiting to send")}),e.lastError&&p.jsx("p",{children:e.lastError}),p.jsx("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:s.map(([a,u])=>p.jsx("button",{type:"button",className:"underline",disabled:n.isPending,onClick:()=>n.mutate({delivery:e,action:a}),children:t(u)},a))}),n.error&&p.jsx("p",{role:"alert",className:"text-destructive",children:t("Delivery action failed. Refresh and try again.")})]})}function Nt(e,t,n){let r=n.initialDeps??[],i,s=!0;function a(){var u,o,c;let d;n.key&&((u=n.debug)!=null&&u.call(n))&&(d=Date.now());const h=e();if(!(h.length!==r.length||h.some((b,k)=>r[k]!==b)))return i;r=h;let m;if(n.key&&((o=n.debug)!=null&&o.call(n))&&(m=Date.now()),i=t(...h),n.key&&((c=n.debug)!=null&&c.call(n))){const b=Math.round((Date.now()-d)*100)/100,k=Math.round((Date.now()-m)*100)/100,S=k/16,_=(L,I)=>{for(L=String(L);L.length<I;)L=" "+L;return L};console.info(`%c⏱ ${_(k,5)} /${_(b,5)} ms`,`
|
|
3
3
|
font-size: .6rem;
|
|
4
4
|
font-weight: bold;
|
|
5
|
-
color: hsl(${Math.max(0,Math.min(120-120*S,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(s&&n.skipInitialOnChange)&&n.onChange(i),s=!1,i}return a.updateDeps=u=>{r=u},a}function As(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Wd=(e,t)=>Math.abs(e-t)<1.01,Gd=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},_s=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Qd=e=>e,Kd=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let i=t;i<=n;i++)r.push(i);return r},Xd=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const i=a=>{const{width:u,height:o}=a;t({width:Math.round(u),height:Math.round(o)})};if(i(_s(n)),!r.ResizeObserver)return()=>{};const s=new r.ResizeObserver(a=>{const u=()=>{const o=a[0];if(o?.borderBoxSize){const c=o.borderBoxSize[0];if(c){i({width:c.inlineSize,height:c.blockSize});return}}i(_s(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(u):u()});return s.observe(n,{box:"border-box"}),()=>{s.unobserve(n)}},Cs={passive:!0},Ss=typeof window>"u"?!0:"onscrollend"in window,Zd=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let i=0;const s=e.options.useScrollendEvent&&Ss?()=>{}:Gd(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),a=d=>()=>{const{horizontal:h,isRtl:f}=e.options;i=h?n.scrollLeft*(f&&-1||1):n.scrollTop,s(),t(i,d)},u=a(!0),o=a(!1);n.addEventListener("scroll",u,Cs);const c=e.options.useScrollendEvent&&Ss;return c&&n.addEventListener("scrollend",o,Cs),()=>{n.removeEventListener("scroll",u),c&&n.removeEventListener("scrollend",o)}},Jd=(e,t,n)=>{if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},eh=(e,{adjustments:t=0,behavior:n},r)=>{var i,s;const a=e+t;(s=(i=r.scrollElement)==null?void 0:i.scrollTo)==null||s.call(i,{[r.options.horizontal?"left":"top"]:a,behavior:n})};class th{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(i=>{i.forEach(s=>{const a=()=>{this._measureElement(s.target,s)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var i;(i=r())==null||i.disconnect(),n=null},observe:i=>{var s;return(s=r())==null?void 0:s.observe(i,{box:"border-box"})},unobserve:i=>{var s;return(s=r())==null?void 0:s.unobserve(i)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,i])=>{typeof i>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Qd,rangeExtractor:Kd,onChange:()=>{},measureElement:Jd,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,n)},this.maybeNotify=St(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,s)=>{this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=s,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const i=new Map,s=new Map;for(let a=r-1;a>=0;a--){const u=n[a];if(i.has(u.lane))continue;const o=s.get(u.lane);if(o==null||u.end>o.end?s.set(u.lane,u):u.end<o.end&&i.set(u.lane,!0),i.size===this.options.lanes)break}return s.size===this.options.lanes?Array.from(s.values()).sort((a,u)=>a.end===u.end?a.index-u.index:a.end-u.end)[0]:void 0},this.getMeasurementOptions=St(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,i,s,a,u)=>(this.prevLanes!==void 0&&this.prevLanes!==u&&(this.lanesChangedFlag=!0),this.prevLanes=u,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:i,getItemKey:s,enabled:a,lanes:u}),{key:!1}),this.getMeasurements=St(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:i,getItemKey:s,enabled:a,lanes:u},o)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const f of this.laneAssignments.keys())f>=n&&this.laneAssignments.delete(f);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(f=>{this.itemSizeCache.set(f.key,f.size)}));const c=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const d=this.measurementsCache.slice(0,c),h=new Array(u).fill(void 0);for(let f=0;f<c;f++){const m=d[f];m&&(h[m.lane]=f)}for(let f=c;f<n;f++){const m=s(f),b=this.laneAssignments.get(f);let A,S;if(b!==void 0&&this.options.lanes>1){A=b;const B=h[A],z=B!==void 0?d[B]:void 0;S=z?z.end+this.options.gap:r+i}else{const B=this.options.lanes===1?d[f-1]:this.getFurthestMeasurement(d,f);S=B?B.end+this.options.gap:r+i,A=B?B.lane:f%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(f,A)}const _=o.get(m),L=typeof _=="number"?_:this.options.estimateSize(f),I=S+L;d[f]={index:f,start:S,size:L,end:I,key:m,lane:A},h[A]=f}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=St(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,i,s)=>this.range=n.length>0&&r>0?nh({measurements:n,outerSize:r,scrollOffset:i,lanes:s}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=St(()=>{let n=null,r=null;const i=this.calculateRange();return i&&(n=i.startIndex,r=i.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,i,s,a)=>s===null||a===null?[]:n({startIndex:s,endIndex:a,overscan:r,count:i}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,i=n.getAttribute(r);return i?parseInt(i,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const i=this.indexFromElement(n),s=this.measurementsCache[i];if(!s)return;const a=s.key,u=this.elementsCache.get(a);u!==n&&(u&&this.observer.unobserve(u),this.observer.observe(n),this.elementsCache.set(a,n)),n.isConnected&&this.resizeItem(i,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const i=this.measurementsCache[n];if(!i)return;const s=this.itemSizeCache.get(i.key)??i.size,a=r-s;a!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(i,a,this):i.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(i.index),this.itemSizeCache=new Map(this.itemSizeCache.set(i.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,i)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(i))});return}this._measureElement(n,void 0)},this.getVirtualItems=St(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const i=[];for(let s=0,a=n.length;s<a;s++){const u=n[s],o=r[u];i.push(o)}return i},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return As(r[Nu(0,r.length-1,i=>As(r[i]).start,n)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(n,r,i=0)=>{if(!this.scrollElement)return 0;const s=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=n>=a+s?"end":"start"),r==="center"?n+=(i-s)/2:r==="end"&&(n-=s);const u=this.getMaxScrollOffset();return Math.max(Math.min(u,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const i=this.measurementsCache[n];if(!i)return;const s=this.getSize(),a=this.getScrollOffset();if(r==="auto")if(i.end>=a+s-this.options.scrollPaddingEnd)r="end";else if(i.start<=a+this.options.scrollPaddingStart)r="start";else return[a,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const u=r==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(u,r,i.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:r="start",behavior:i}={})=>{i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:i})},this.scrollToIndex=(n,{align:r="auto",behavior:i}={})=>{i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1)),this.currentScrollToIndex=n;let s=0;const a=10,u=c=>{if(!this.targetWindow)return;const d=this.getOffsetForIndex(n,c);if(!d){console.warn("Failed to get offset for index:",n);return}const[h,f]=d;this._scrollToOffset(h,{adjustments:void 0,behavior:i}),this.targetWindow.requestAnimationFrame(()=>{const m=()=>{if(this.currentScrollToIndex!==n)return;const b=this.getScrollOffset(),A=this.getOffsetForIndex(n,f);if(!A){console.warn("Failed to get offset for index:",n);return}Wd(A[0],b)||o(f)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(m):m()})},o=c=>{this.targetWindow&&this.currentScrollToIndex===n&&(s++,s<a?this.targetWindow.requestAnimationFrame(()=>u(c)):console.warn(`Failed to scroll to index ${n} after ${a} attempts.`))};u(r)},this.scrollBy=(n,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let i;if(r.length===0)i=this.options.paddingStart;else if(this.options.lanes===1)i=((n=r[r.length-1])==null?void 0:n.end)??0;else{const s=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&s.some(u=>u===null);){const u=r[a];s[u.lane]===null&&(s[u.lane]=u.end),a--}i=Math.max(...s.filter(u=>u!==null))}return Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:i})=>{this.options.scrollToFn(n,{behavior:i,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}}const Nu=(e,t,n,r)=>{for(;e<=t;){const i=(e+t)/2|0,s=n(i);if(s<r)e=i+1;else if(s>r)t=i-1;else return i}return e>0?e-1:0};function nh({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const i=e.length-1,s=o=>e[o].start;if(e.length<=r)return{startIndex:0,endIndex:i};let a=Nu(0,i,s,n),u=a;if(r===1)for(;u<i&&e[u].end<n+t;)u++;else if(r>1){const o=Array(r).fill(0);for(;u<i&&o.some(d=>d<n+t);){const d=e[u];o[d.lane]=d.end,u++}const c=Array(r).fill(n+t);for(;a>=0&&c.some(d=>d>=n);){const d=e[a];c[d.lane]=d.start,a--}a=Math.max(0,a-a%r),u=Math.min(i,u+(r-1-u%r))}return{startIndex:a,endIndex:u}}const Ns=typeof document<"u"?k.useLayoutEffect:k.useEffect;function rh({useFlushSync:e=!0,...t}){const n=k.useReducer(()=>({}),{})[1],r={...t,onChange:(s,a)=>{var u;e&&a?ad.flushSync(n):n(),(u=t.onChange)==null||u.call(t,s,a)}},[i]=k.useState(()=>new th(r));return i.setOptions(r),Ns(()=>i._didMount(),[]),Ns(()=>i._willUpdate()),i}function ih(e){return rh({observeElementRect:Xd,observeElementOffset:Zd,scrollToFn:eh,...e})}function sh(e,t,n){const r=n,i=r.getScrollOffset()+r.scrollAdjustments;return e.end+t<=i}const hr=(function(e){if(e==null)return lh;if(typeof e=="function")return fr(e);if(typeof e=="object")return Array.isArray(e)?ah(e):uh(e);if(typeof e=="string")return oh(e);throw new Error("Expected function, string, or object as test")});function ah(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=hr(e[n]);return fr(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function uh(e){const t=e;return fr(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function oh(e){return fr(t);function t(n){return n&&n.type===e}}function fr(e){return t;function t(n,r,i){return!!(ch(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function lh(){return!0}function ch(e){return e!==null&&typeof e=="object"&&"type"in e}const Iu=[],Jt=!0,ei=!1,Kn="skip";function Ii(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=hr(i),a=r?-1:1;u(e,void 0,[])();function u(o,c,d){const h=o&&typeof o=="object"?o:{};if(typeof h.type=="string"){const m=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(o.type+(m?"<"+m+">":""))+")"})}return f;function f(){let m=Iu,b,A,S;if((!t||s(o,c,d[d.length-1]||void 0))&&(m=dh(n(o,d)),m[0]===ei))return m;if("children"in o&&o.children){const _=o;if(_.children&&m[0]!==Kn)for(A=(r?_.children.length:-1)+a,S=d.concat(_);A>-1&&A<_.children.length;){const L=_.children[A];if(b=u(L,A,S)(),b[0]===ei)return b;A=typeof b[1]=="number"?b[1]:A+a}}return m}}}function dh(e){return Array.isArray(e)?e:typeof e=="number"?[Jt,e]:e==null?Iu:[e]}function st(e,t,n,r){let i,s,a;typeof t=="function"&&typeof n!="function"?(s=void 0,a=t,i=n):(s=t,a=n,i=r),Ii(e,s,u,i);function u(o,c){const d=c[c.length-1],h=d?d.children.indexOf(o):void 0;return a(o,h,d)}}function hh({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],blockedImageClass:s="inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm",blockedLinkClass:a="text-gray-500"}){const u=t.length&&!t.every(c=>c==="*"),o=n.length&&!n.every(c=>c==="*");if(!e&&(u||o))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return c=>{const d=gh(e,t,n,r,i,s,a);st(c,d)}}function Is(e,t){if(typeof e!="string")return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))try{return new URL(e,"http://example.com")}catch{return null}return null}}function fh(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}const mh=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),ph=new Set(["javascript:","data:","file:","vbscript:"]);function ws(e,t,n,r=!1,i=!1,s=[]){if(!e)return null;if(typeof e=="string"&&e.startsWith("#")&&!i)try{if(new URL(e,"http://example.com").hash===e)return e}catch{}if(typeof e=="string"&&e.startsWith("data:"))return i&&r&&e.startsWith("data:image/")?e:null;if(typeof e=="string"&&e.startsWith("blob:")){try{if(new URL(e).protocol==="blob:"&&e.length>5){const d=e.substring(5);if(d&&d.length>0&&d!=="invalid")return e}}catch{return null}return null}const a=Is(e,n);if(!a||ph.has(a.protocol)||!(mh.has(a.protocol)||s.includes(a.protocol)||s.includes("*")))return null;if(a.protocol==="mailto:"||!a.protocol.match(/^https?:$/))return a.href;const o=fh(e);return a&&t.some(c=>{const d=Is(c,n);return!d||d.origin!==a.origin?!1:a.href.startsWith(d.href)})?o?a.pathname+a.search+a.hash:a.href:t.includes("*")?a.protocol!=="https:"&&a.protocol!=="http:"?null:o?a.pathname+a.search+a.hash:a.href:null}const wr=Symbol("node-seen"),gh=(e,t,n,r,i,s,a)=>{const u=(o,c,d)=>{if(o.type!=="element"||o[wr])return Jt;if(o.tagName==="a"){const h=ws(o.properties.href,t,e,!1,!1,i);return h===null?(o[wr]=!0,st(o,u),d&&typeof c=="number"&&(d.children[c]={type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(o.properties.href),class:a},children:[...o.children,{type:"text",value:" [blocked]"}]}),Kn):(o.properties.href=h,o.properties.target="_blank",o.properties.rel="noopener noreferrer",Jt)}if(o.tagName==="img"){const h=ws(o.properties.src,n,e,r,!0,i);return h===null?(o[wr]=!0,st(o,u),d&&typeof c=="number"&&(d.children[c]={type:"element",tagName:"span",properties:{class:s},children:[{type:"text",value:"[Image blocked: "+String(o.properties.alt||"No description")+"]"}]}),Kn):(o.properties.src=h,Jt)}return Jt};return u},wu=-1,mr=0,nn=1,Xn=2,wi=3,Li=4,Ri=5,Oi=6,Lu=7,Ru=8,Ls=typeof self=="object"?self:globalThis,bh=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,a]=t[i];switch(s){case mr:case wu:return n(a,i);case nn:{const u=n([],i);for(const o of a)u.push(r(o));return u}case Xn:{const u=n({},i);for(const[o,c]of a)u[r(o)]=r(c);return u}case wi:return n(new Date(a),i);case Li:{const{source:u,flags:o}=a;return n(new RegExp(u,o),i)}case Ri:{const u=n(new Map,i);for(const[o,c]of a)u.set(r(o),r(c));return u}case Oi:{const u=n(new Set,i);for(const o of a)u.add(r(o));return u}case Lu:{const{name:u,message:o}=a;return n(new Ls[u](o),i)}case Ru:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:u}=new Uint8Array(a);return n(new DataView(u),a)}}return n(new Ls[s](a),i)};return r},Rs=e=>bh(new Map,e)(0),Nt="",{toString:Eh}={},{keys:Th}=Object,qt=e=>{const t=typeof e;if(t!=="object"||!e)return[mr,t];const n=Eh.call(e).slice(8,-1);switch(n){case"Array":return[nn,Nt];case"Object":return[Xn,Nt];case"Date":return[wi,Nt];case"RegExp":return[Li,Nt];case"Map":return[Ri,Nt];case"Set":return[Oi,Nt];case"DataView":return[nn,n]}return n.includes("Array")?[nn,n]:n.includes("Error")?[Lu,n]:[Xn,n]},On=([e,t])=>e===mr&&(t==="function"||t==="symbol"),xh=(e,t,n,r)=>{const i=(a,u)=>{const o=r.push(a)-1;return n.set(u,o),o},s=a=>{if(n.has(a))return n.get(a);let[u,o]=qt(a);switch(u){case mr:{let d=a;switch(o){case"bigint":u=Ru,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+o);d=null;break;case"undefined":return i([wu],a)}return i([u,d],a)}case nn:{if(o){let f=a;return o==="DataView"?f=new Uint8Array(a.buffer):o==="ArrayBuffer"&&(f=new Uint8Array(a)),i([o,[...f]],a)}const d=[],h=i([u,d],a);for(const f of a)d.push(s(f));return h}case Xn:{if(o)switch(o){case"BigInt":return i([o,a.toString()],a);case"Boolean":case"Number":case"String":return i([o,a.valueOf()],a)}if(t&&"toJSON"in a)return s(a.toJSON());const d=[],h=i([u,d],a);for(const f of Th(a))(e||!On(qt(a[f])))&&d.push([s(f),s(a[f])]);return h}case wi:return i([u,a.toISOString()],a);case Li:{const{source:d,flags:h}=a;return i([u,{source:d,flags:h}],a)}case Ri:{const d=[],h=i([u,d],a);for(const[f,m]of a)(e||!(On(qt(f))||On(qt(m))))&&d.push([s(f),s(m)]);return h}case Oi:{const d=[],h=i([u,d],a);for(const f of a)(e||!On(qt(f)))&&d.push(s(f));return h}}const{message:c}=a;return i([u,{name:o,message:c}],a)};return s},Os=(e,{json:t,lossy:n}={})=>{const r=[];return xh(!(t||n),!!t,new Map,r)(e),r},pt=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Rs(Os(e,t)):structuredClone(e):(e,t)=>Rs(Os(e,t));class yn{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}yn.prototype.normal={};yn.prototype.property={};yn.prototype.space=void 0;function Ou(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new yn(n,r,t)}function pn(e){return e.toLowerCase()}class Se{constructor(t,n){this.attribute=n,this.property=t}}Se.prototype.attribute="";Se.prototype.booleanish=!1;Se.prototype.boolean=!1;Se.prototype.commaOrSpaceSeparated=!1;Se.prototype.commaSeparated=!1;Se.prototype.defined=!1;Se.prototype.mustUseProperty=!1;Se.prototype.number=!1;Se.prototype.overloadedBoolean=!1;Se.prototype.property="";Se.prototype.spaceSeparated=!1;Se.prototype.space=void 0;let kh=0;const Z=Tt(),me=Tt(),ti=Tt(),M=Tt(),ce=Tt(),Ot=Tt(),we=Tt();function Tt(){return 2**++kh}const ni=Object.freeze(Object.defineProperty({__proto__:null,boolean:Z,booleanish:me,commaOrSpaceSeparated:we,commaSeparated:Ot,number:M,overloadedBoolean:ti,spaceSeparated:ce},Symbol.toStringTag,{value:"Module"})),Lr=Object.keys(ni);class Di extends Se{constructor(t,n,r,i){let s=-1;if(super(t,n),Ds(this,"space",i),typeof r=="number")for(;++s<Lr.length;){const a=Lr[s];Ds(this,Lr[s],(r&ni[a])===ni[a])}}}Di.prototype.defined=!0;function Ds(e,t,n){n&&(e[t]=n)}function Bt(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new Di(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[pn(r)]=r,n[pn(s.attribute)]=r}return new yn(t,n,e.space)}const Du=Bt({properties:{ariaActiveDescendant:null,ariaAtomic:me,ariaAutoComplete:null,ariaBusy:me,ariaChecked:me,ariaColCount:M,ariaColIndex:M,ariaColSpan:M,ariaControls:ce,ariaCurrent:null,ariaDescribedBy:ce,ariaDetails:null,ariaDisabled:me,ariaDropEffect:ce,ariaErrorMessage:null,ariaExpanded:me,ariaFlowTo:ce,ariaGrabbed:me,ariaHasPopup:null,ariaHidden:me,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ce,ariaLevel:M,ariaLive:null,ariaModal:me,ariaMultiLine:me,ariaMultiSelectable:me,ariaOrientation:null,ariaOwns:ce,ariaPlaceholder:null,ariaPosInSet:M,ariaPressed:me,ariaReadOnly:me,ariaRelevant:null,ariaRequired:me,ariaRoleDescription:ce,ariaRowCount:M,ariaRowIndex:M,ariaRowSpan:M,ariaSelected:me,ariaSetSize:M,ariaSort:null,ariaValueMax:M,ariaValueMin:M,ariaValueNow:M,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Pu(e,t){return t in e?e[t]:t}function vu(e,t){return Pu(e,t.toLowerCase())}const yh=Bt({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ot,acceptCharset:ce,accessKey:ce,action:null,allow:null,allowFullScreen:Z,allowPaymentRequest:Z,allowUserMedia:Z,alt:null,as:null,async:Z,autoCapitalize:null,autoComplete:ce,autoFocus:Z,autoPlay:Z,blocking:ce,capture:null,charSet:null,checked:Z,cite:null,className:ce,cols:M,colSpan:null,content:null,contentEditable:me,controls:Z,controlsList:ce,coords:M|Ot,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Z,defer:Z,dir:null,dirName:null,disabled:Z,download:ti,draggable:me,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Z,formTarget:null,headers:ce,height:M,hidden:ti,high:M,href:null,hrefLang:null,htmlFor:ce,httpEquiv:ce,id:null,imageSizes:null,imageSrcSet:null,inert:Z,inputMode:null,integrity:null,is:null,isMap:Z,itemId:null,itemProp:ce,itemRef:ce,itemScope:Z,itemType:ce,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Z,low:M,manifest:null,max:null,maxLength:M,media:null,method:null,min:null,minLength:M,multiple:Z,muted:Z,name:null,nonce:null,noModule:Z,noValidate:Z,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:Z,optimum:M,pattern:null,ping:ce,placeholder:null,playsInline:Z,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Z,referrerPolicy:null,rel:ce,required:Z,reversed:Z,rows:M,rowSpan:M,sandbox:ce,scope:null,scoped:Z,seamless:Z,selected:Z,shadowRootClonable:Z,shadowRootDelegatesFocus:Z,shadowRootMode:null,shape:null,size:M,sizes:null,slot:null,span:M,spellCheck:me,src:null,srcDoc:null,srcLang:null,srcSet:null,start:M,step:null,style:null,tabIndex:M,target:null,title:null,translate:null,type:null,typeMustMatch:Z,useMap:null,value:me,width:M,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ce,axis:null,background:null,bgColor:null,border:M,borderColor:null,bottomMargin:M,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Z,declare:Z,event:null,face:null,frame:null,frameBorder:null,hSpace:M,leftMargin:M,link:null,longDesc:null,lowSrc:null,marginHeight:M,marginWidth:M,noResize:Z,noHref:Z,noShade:Z,noWrap:Z,object:null,profile:null,prompt:null,rev:null,rightMargin:M,rules:null,scheme:null,scrolling:me,standby:null,summary:null,text:null,topMargin:M,valueType:null,version:null,vAlign:null,vLink:null,vSpace:M,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Z,disableRemotePlayback:Z,prefix:null,property:null,results:M,security:null,unselectable:null},space:"html",transform:vu}),Ah=Bt({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",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:we,accentHeight:M,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:M,amplitude:M,arabicForm:null,ascent:M,attributeName:null,attributeType:null,azimuth:M,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:M,by:null,calcMode:null,capHeight:M,className:ce,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:M,diffuseConstant:M,direction:null,display:null,dur:null,divisor:M,dominantBaseline:null,download:Z,dx:null,dy:null,edgeMode:null,editable:null,elevation:M,enableBackground:null,end:null,event:null,exponent:M,externalResourcesRequired:null,fill:null,fillOpacity:M,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:Ot,g2:Ot,glyphName:Ot,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:M,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:M,horizOriginX:M,horizOriginY:M,id:null,ideographic:M,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:M,k:M,k1:M,k2:M,k3:M,k4:M,kernelMatrix:we,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:M,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:M,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:M,overlineThickness:M,paintOrder:null,panose1:null,path:null,pathLength:M,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ce,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:M,pointsAtY:M,pointsAtZ:M,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:we,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:we,rev:we,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:we,requiredFeatures:we,requiredFonts:we,requiredFormats:we,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:M,specularExponent:M,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:M,strikethroughThickness:M,string:null,stroke:null,strokeDashArray:we,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:M,strokeOpacity:M,strokeWidth:null,style:null,surfaceScale:M,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:we,tabIndex:M,tableValues:null,target:null,targetX:M,targetY:M,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:we,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:M,underlineThickness:M,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:M,values:null,vAlphabetic:M,vMathematical:M,vectorEffect:null,vHanging:M,vIdeographic:M,version:null,vertAdvY:M,vertOriginX:M,vertOriginY:M,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:M,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Pu}),Mu=Bt({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()}}),Bu=Bt({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:vu}),Fu=Bt({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),_h={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"},Ch=/[A-Z]/g,Ps=/-[a-z]/g,Sh=/^data[-\w.:]+$/i;function pr(e,t){const n=pn(t);let r=t,i=Se;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Sh.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(Ps,Ih);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!Ps.test(s)){let a=s.replace(Ch,Nh);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Di}return new i(r,t)}function Nh(e){return"-"+e.toLowerCase()}function Ih(e){return e.charAt(1).toUpperCase()}const An=Ou([Du,yh,Mu,Bu,Fu],"html"),ut=Ou([Du,Ah,Mu,Bu,Fu],"svg");function vs(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,s=!1;for(;!s;){r===-1&&(r=n.length,s=!0);const a=n.slice(i,r).trim();(a||!s)&&t.push(a),i=r+1,r=n.indexOf(",",i)}return t}function Hu(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Ms=/[#.]/g;function wh(e,t){const n=e||"",r={};let i=0,s,a;for(;i<n.length;){Ms.lastIndex=i;const u=Ms.exec(n),o=n.slice(i,u?u.index:n.length);o&&(s?s==="#"?r.id=o:Array.isArray(r.className)?r.className.push(o):r.className=[o]:a=o,i+=o.length),u&&(s=u[0],i++)}return{type:"element",tagName:a||t||"div",properties:r,children:[]}}function Bs(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Uu(e){return e.join(" ").trim()}function ju(e,t,n){const r=n?Dh(n):void 0;function i(s,a,...u){let o;if(s==null){o={type:"root",children:[]};const c=a;u.unshift(c)}else{o=wh(s,t);const c=o.tagName.toLowerCase(),d=r?r.get(c):void 0;if(o.tagName=d||c,Lh(a))u.unshift(a);else for(const[h,f]of Object.entries(a))Rh(e,o.properties,h,f)}for(const c of u)ri(o.children,c);return o.type==="element"&&o.tagName==="template"&&(o.content={type:"root",children:o.children},o.children=[]),o}return i}function Lh(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const i=t[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const s=i;for(const a of s)if(typeof a!="number"&&typeof a!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function Rh(e,t,n,r){const i=pr(e,n);let s;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;s=r}else typeof r=="boolean"?s=r:typeof r=="string"?i.spaceSeparated?s=Bs(r):i.commaSeparated?s=vs(r):i.commaOrSpaceSeparated?s=Bs(vs(r).join(" ")):s=Fs(i,i.property,r):Array.isArray(r)?s=[...r]:s=i.property==="style"?Oh(r):String(r);if(Array.isArray(s)){const a=[];for(const u of s)a.push(Fs(i,i.property,u));s=a}i.property==="className"&&Array.isArray(t.className)&&(s=t.className.concat(s)),t[i.property]=s}}function ri(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)ri(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?ri(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function Fs(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||pn(n)===pn(t)))return!0}return n}function Oh(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function Dh(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const Ph=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],vh=ju(An,"div"),Mh=ju(ut,"g",Ph);function Bh(e){const t=String(e),n=[];return{toOffset:i,toPoint:r};function r(s){if(typeof s=="number"&&s>-1&&s<=t.length){let a=0;for(;;){let u=n[a];if(u===void 0){const o=Hs(t,n[a-1]);u=o===-1?t.length+1:o+1,n[a]=u}if(u>s)return{line:a+1,column:s-(a>0?n[a-1]:0)+1,offset:s};a++}}}function i(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length<s.line;){const u=n[n.length-1],o=Hs(t,u),c=o===-1?t.length+1:o+1;if(u===c)break;n.push(c)}const a=(s.line>1?n[s.line-2]:0)+s.column-1;if(a<n[s.line-1])return a}}}function Hs(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
|
|
6
|
-
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const ft={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},zu={}.hasOwnProperty,Fh=Object.prototype;function Hh(e,t){const n=t||{};return Pi({file:n.file||void 0,location:!1,schema:n.space==="svg"?ut:An,verbose:n.verbose||!1},e)}function Pi(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},zn(e,r,n),n}case"#document":case"#document-fragment":{const r=t,i="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:$u(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){const s=String(e.file),a=Bh(s),u=a.toPoint(0),o=a.toPoint(s.length);n.position={start:u,end:o}}return n}case"#documentType":{const r=t;return n={type:"doctype"},zn(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},zn(e,r,n),n}default:return n=Uh(e,t),n}}function $u(e,t){let n=-1;const r=[];for(;++n<t.length;){const i=Pi(e,t[n]);r.push(i)}return r}function Uh(e,t){const n=e.schema;e.schema=t.namespaceURI===ft.svg?ut:An;let r=-1;const i={};for(;++r<t.attrs.length;){const u=t.attrs[r],o=(u.prefix?u.prefix+":":"")+u.name;zu.call(Fh,o)||(i[o]=u.value)}const a=(e.schema.space==="svg"?Mh:vh)(t.tagName,i,$u(e,t.childNodes));if(zn(e,t,a),a.tagName==="template"){const u=t,o=u.sourceCodeLocation,c=o&&o.startTag&&Lt(o.startTag),d=o&&o.endTag&&Lt(o.endTag),h=Pi(e,u.content);c&&d&&e.file&&(h.position={start:c.end,end:d.start}),a.content=h}return e.schema=n,a}function zn(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=jh(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function jh(e,t,n){const r=Lt(n);if(t.type==="element"){const i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){const s={};let a;if(n.attrs)for(a in n.attrs)zu.call(n.attrs,a)&&(s[pr(e.schema,a).property]=Lt(n.attrs[a]));n.startTag;const u=Lt(n.startTag),o=n.endTag?Lt(n.endTag):void 0,c={opening:u};o&&(c.closing=o),c.properties=s,t.data={position:c}}}return r}function Lt(e){const t=Us({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=Us({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function Us(e){return e.line&&e.column?e:void 0}const js={}.hasOwnProperty;function Yu(e,t){const n=t||{};function r(i,...s){let a=r.invalid;const u=r.handlers;if(i&&js.call(i,e)){const o=String(i[e]);a=js.call(u,o)?u[o]:r.unknown}if(a)return a.call(this,i,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const zh={},$h={}.hasOwnProperty,qu=Yu("type",{handlers:{root:qh,element:Kh,text:Gh,comment:Qh,doctype:Wh}});function Yh(e,t){const r=(t||zh).space;return qu(e,r==="svg"?ut:An)}function qh(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=vi(e.children,n,t),Ft(e,n),n}function Vh(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=vi(e.children,n,t),Ft(e,n),n}function Wh(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Ft(e,t),t}function Gh(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Ft(e,t),t}function Qh(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Ft(e,t),t}function Kh(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=ut);const i=[];let s;if(e.properties){for(s in e.properties)if(s!=="children"&&$h.call(e.properties,s)){const o=Xh(r,s,e.properties[s]);o&&i.push(o)}}const a=r.space,u={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:ft[a],childNodes:[],parentNode:null};return u.childNodes=vi(e.children,u,r),Ft(e,u),e.tagName==="template"&&e.content&&(u.content=Vh(e.content,r)),u}function Xh(e,t,n){const r=pr(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?Hu(n):Uu(n));const i={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const s=i.name.indexOf(":");s<0?i.prefix="":(i.name=i.name.slice(s+1),i.prefix=r.attribute.slice(0,s)),i.namespace=ft[r.space]}return i}function vi(e,t,n){let r=-1;const i=[];if(e)for(;++r<e.length;){const s=qu(e[r],n);s.parentNode=t,i.push(s)}return i}function Ft(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const Zh=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],Jh=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),de="�";var g;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(g||(g={}));const _e={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function Vu(e){return e>=55296&&e<=57343}function ef(e){return e>=56320&&e<=57343}function tf(e,t){return(e-55296)*1024+9216+t}function Wu(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function Gu(e){return e>=64976&&e<=65007||Jh.has(e)}var w;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(w||(w={}));const nf=65536;class rf{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=nf,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:i,offset:s}=this,a=i+n,u=s+n;return{code:t,startLine:r,endLine:r,startCol:a,endCol:a,startOffset:u,endOffset:u}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(ef(n))return this.pos++,this._addGap(),tf(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,g.EOF;return this._err(w.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,g.EOF;const r=this.html.charCodeAt(n);return r===g.CARRIAGE_RETURN?g.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,g.EOF;let t=this.html.charCodeAt(this.pos);return t===g.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,g.LINE_FEED):t===g.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Vu(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===g.LINE_FEED||t===g.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){Wu(t)?this._err(w.controlCharacterInInputStream):Gu(t)&&this._err(w.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var J;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(J||(J={}));function Qu(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const sf=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),af=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function uf(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=af.get(e))!==null&&t!==void 0?t:e}var ge;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(ge||(ge={}));const of=32;var it;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(it||(it={}));function ii(e){return e>=ge.ZERO&&e<=ge.NINE}function lf(e){return e>=ge.UPPER_A&&e<=ge.UPPER_F||e>=ge.LOWER_A&&e<=ge.LOWER_F}function cf(e){return e>=ge.UPPER_A&&e<=ge.UPPER_Z||e>=ge.LOWER_A&&e<=ge.LOWER_Z||ii(e)}function df(e){return e===ge.EQUALS||cf(e)}var pe;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(pe||(pe={}));var Ke;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Ke||(Ke={}));class hf{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=pe.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ke.Strict}startEntity(t){this.decodeMode=t,this.state=pe.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case pe.EntityStart:return t.charCodeAt(n)===ge.NUM?(this.state=pe.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=pe.NamedEntity,this.stateNamedEntity(t,n));case pe.NumericStart:return this.stateNumericStart(t,n);case pe.NumericDecimal:return this.stateNumericDecimal(t,n);case pe.NumericHex:return this.stateNumericHex(t,n);case pe.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|of)===ge.LOWER_X?(this.state=pe.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=pe.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,i){if(n!==r){const s=r-n;this.result=this.result*Math.pow(i,s)+Number.parseInt(t.substr(n,s),i),this.consumed+=s}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(ii(i)||lf(i))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(ii(i))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===ge.SEMI)this.consumed+=1;else if(this.decodeMode===Ke.Strict)return 0;return this.emitCodePoint(uf(this.result),this.consumed),this.errors&&(t!==ge.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let i=r[this.treeIndex],s=(i&it.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const a=t.charCodeAt(n);if(this.treeIndex=ff(r,i,this.treeIndex+Math.max(1,s),a),this.treeIndex<0)return this.result===0||this.decodeMode===Ke.Attribute&&(s===0||df(a))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],s=(i&it.VALUE_LENGTH)>>14,s!==0){if(a===ge.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Ke.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&it.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~it.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case pe.NamedEntity:return this.result!==0&&(this.decodeMode!==Ke.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case pe.NumericDecimal:return this.emitNumericEntity(0,2);case pe.NumericHex:return this.emitNumericEntity(0,3);case pe.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case pe.EntityStart:return 0}}}function ff(e,t,n,r){const i=(t&it.BRANCH_LENGTH)>>7,s=t&it.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const o=r-s;return o<0||o>=i?-1:e[n+o]-1}let a=n,u=a+i-1;for(;a<=u;){const o=a+u>>>1,c=e[o];if(c<r)a=o+1;else if(c>r)u=o-1;else return e[o+i]}return-1}var D;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(D||(D={}));var mt;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(mt||(mt={}));var Re;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Re||(Re={}));var C;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(C||(C={}));var l;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(l||(l={}));const mf=new Map([[C.A,l.A],[C.ADDRESS,l.ADDRESS],[C.ANNOTATION_XML,l.ANNOTATION_XML],[C.APPLET,l.APPLET],[C.AREA,l.AREA],[C.ARTICLE,l.ARTICLE],[C.ASIDE,l.ASIDE],[C.B,l.B],[C.BASE,l.BASE],[C.BASEFONT,l.BASEFONT],[C.BGSOUND,l.BGSOUND],[C.BIG,l.BIG],[C.BLOCKQUOTE,l.BLOCKQUOTE],[C.BODY,l.BODY],[C.BR,l.BR],[C.BUTTON,l.BUTTON],[C.CAPTION,l.CAPTION],[C.CENTER,l.CENTER],[C.CODE,l.CODE],[C.COL,l.COL],[C.COLGROUP,l.COLGROUP],[C.DD,l.DD],[C.DESC,l.DESC],[C.DETAILS,l.DETAILS],[C.DIALOG,l.DIALOG],[C.DIR,l.DIR],[C.DIV,l.DIV],[C.DL,l.DL],[C.DT,l.DT],[C.EM,l.EM],[C.EMBED,l.EMBED],[C.FIELDSET,l.FIELDSET],[C.FIGCAPTION,l.FIGCAPTION],[C.FIGURE,l.FIGURE],[C.FONT,l.FONT],[C.FOOTER,l.FOOTER],[C.FOREIGN_OBJECT,l.FOREIGN_OBJECT],[C.FORM,l.FORM],[C.FRAME,l.FRAME],[C.FRAMESET,l.FRAMESET],[C.H1,l.H1],[C.H2,l.H2],[C.H3,l.H3],[C.H4,l.H4],[C.H5,l.H5],[C.H6,l.H6],[C.HEAD,l.HEAD],[C.HEADER,l.HEADER],[C.HGROUP,l.HGROUP],[C.HR,l.HR],[C.HTML,l.HTML],[C.I,l.I],[C.IMG,l.IMG],[C.IMAGE,l.IMAGE],[C.INPUT,l.INPUT],[C.IFRAME,l.IFRAME],[C.KEYGEN,l.KEYGEN],[C.LABEL,l.LABEL],[C.LI,l.LI],[C.LINK,l.LINK],[C.LISTING,l.LISTING],[C.MAIN,l.MAIN],[C.MALIGNMARK,l.MALIGNMARK],[C.MARQUEE,l.MARQUEE],[C.MATH,l.MATH],[C.MENU,l.MENU],[C.META,l.META],[C.MGLYPH,l.MGLYPH],[C.MI,l.MI],[C.MO,l.MO],[C.MN,l.MN],[C.MS,l.MS],[C.MTEXT,l.MTEXT],[C.NAV,l.NAV],[C.NOBR,l.NOBR],[C.NOFRAMES,l.NOFRAMES],[C.NOEMBED,l.NOEMBED],[C.NOSCRIPT,l.NOSCRIPT],[C.OBJECT,l.OBJECT],[C.OL,l.OL],[C.OPTGROUP,l.OPTGROUP],[C.OPTION,l.OPTION],[C.P,l.P],[C.PARAM,l.PARAM],[C.PLAINTEXT,l.PLAINTEXT],[C.PRE,l.PRE],[C.RB,l.RB],[C.RP,l.RP],[C.RT,l.RT],[C.RTC,l.RTC],[C.RUBY,l.RUBY],[C.S,l.S],[C.SCRIPT,l.SCRIPT],[C.SEARCH,l.SEARCH],[C.SECTION,l.SECTION],[C.SELECT,l.SELECT],[C.SOURCE,l.SOURCE],[C.SMALL,l.SMALL],[C.SPAN,l.SPAN],[C.STRIKE,l.STRIKE],[C.STRONG,l.STRONG],[C.STYLE,l.STYLE],[C.SUB,l.SUB],[C.SUMMARY,l.SUMMARY],[C.SUP,l.SUP],[C.TABLE,l.TABLE],[C.TBODY,l.TBODY],[C.TEMPLATE,l.TEMPLATE],[C.TEXTAREA,l.TEXTAREA],[C.TFOOT,l.TFOOT],[C.TD,l.TD],[C.TH,l.TH],[C.THEAD,l.THEAD],[C.TITLE,l.TITLE],[C.TR,l.TR],[C.TRACK,l.TRACK],[C.TT,l.TT],[C.U,l.U],[C.UL,l.UL],[C.SVG,l.SVG],[C.VAR,l.VAR],[C.WBR,l.WBR],[C.XMP,l.XMP]]);function Ht(e){var t;return(t=mf.get(e))!==null&&t!==void 0?t:l.UNKNOWN}const P=l,pf={[D.HTML]:new Set([P.ADDRESS,P.APPLET,P.AREA,P.ARTICLE,P.ASIDE,P.BASE,P.BASEFONT,P.BGSOUND,P.BLOCKQUOTE,P.BODY,P.BR,P.BUTTON,P.CAPTION,P.CENTER,P.COL,P.COLGROUP,P.DD,P.DETAILS,P.DIR,P.DIV,P.DL,P.DT,P.EMBED,P.FIELDSET,P.FIGCAPTION,P.FIGURE,P.FOOTER,P.FORM,P.FRAME,P.FRAMESET,P.H1,P.H2,P.H3,P.H4,P.H5,P.H6,P.HEAD,P.HEADER,P.HGROUP,P.HR,P.HTML,P.IFRAME,P.IMG,P.INPUT,P.LI,P.LINK,P.LISTING,P.MAIN,P.MARQUEE,P.MENU,P.META,P.NAV,P.NOEMBED,P.NOFRAMES,P.NOSCRIPT,P.OBJECT,P.OL,P.P,P.PARAM,P.PLAINTEXT,P.PRE,P.SCRIPT,P.SECTION,P.SELECT,P.SOURCE,P.STYLE,P.SUMMARY,P.TABLE,P.TBODY,P.TD,P.TEMPLATE,P.TEXTAREA,P.TFOOT,P.TH,P.THEAD,P.TITLE,P.TR,P.TRACK,P.UL,P.WBR,P.XMP]),[D.MATHML]:new Set([P.MI,P.MO,P.MN,P.MS,P.MTEXT,P.ANNOTATION_XML]),[D.SVG]:new Set([P.TITLE,P.FOREIGN_OBJECT,P.DESC]),[D.XLINK]:new Set,[D.XML]:new Set,[D.XMLNS]:new Set},si=new Set([P.H1,P.H2,P.H3,P.H4,P.H5,P.H6]);C.STYLE,C.SCRIPT,C.XMP,C.IFRAME,C.NOEMBED,C.NOFRAMES,C.PLAINTEXT;var E;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(E||(E={}));const fe={DATA:E.DATA,RCDATA:E.RCDATA,RAWTEXT:E.RAWTEXT,SCRIPT_DATA:E.SCRIPT_DATA,PLAINTEXT:E.PLAINTEXT,CDATA_SECTION:E.CDATA_SECTION};function gf(e){return e>=g.DIGIT_0&&e<=g.DIGIT_9}function en(e){return e>=g.LATIN_CAPITAL_A&&e<=g.LATIN_CAPITAL_Z}function bf(e){return e>=g.LATIN_SMALL_A&&e<=g.LATIN_SMALL_Z}function tt(e){return bf(e)||en(e)}function zs(e){return tt(e)||gf(e)}function Dn(e){return e+32}function Ku(e){return e===g.SPACE||e===g.LINE_FEED||e===g.TABULATION||e===g.FORM_FEED}function $s(e){return Ku(e)||e===g.SOLIDUS||e===g.GREATER_THAN_SIGN}function Ef(e){return e===g.NULL?w.nullCharacterReference:e>1114111?w.characterReferenceOutsideUnicodeRange:Vu(e)?w.surrogateCharacterReference:Gu(e)?w.noncharacterCharacterReference:Wu(e)||e===g.CARRIAGE_RETURN?w.controlCharacterReference:null}class Tf{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=E.DATA,this.returnState=E.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new rf(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new hf(sf,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(w.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(w.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=Ef(r);i&&this._err(i,1)}}:void 0)}_err(t,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t?.())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r?.()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:J.START_TAG,tagName:"",tagID:l.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:J.END_TAG,tagName:"",tagID:l.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:J.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:J.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(Qu(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const i=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);i[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(w.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=Ht(t.tagName),t.type===J.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(w.endTagWithAttributes),t.selfClosing&&this._err(w.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case J.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case J.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case J.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:J.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=Ku(t)?J.WHITESPACE_CHARACTER:t===g.NULL?J.NULL_CHARACTER:J.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(J.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=E.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Ke.Attribute:Ke.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===E.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===E.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===E.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case E.DATA:{this._stateData(t);break}case E.RCDATA:{this._stateRcdata(t);break}case E.RAWTEXT:{this._stateRawtext(t);break}case E.SCRIPT_DATA:{this._stateScriptData(t);break}case E.PLAINTEXT:{this._statePlaintext(t);break}case E.TAG_OPEN:{this._stateTagOpen(t);break}case E.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case E.TAG_NAME:{this._stateTagName(t);break}case E.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case E.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case E.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case E.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case E.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case E.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case E.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case E.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case E.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case E.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case E.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case E.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case E.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case E.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case E.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case E.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case E.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case E.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case E.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case E.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case E.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case E.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case E.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case E.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case E.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case E.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case E.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case E.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case E.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case E.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case E.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case E.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case E.BOGUS_COMMENT:{this._stateBogusComment(t);break}case E.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case E.COMMENT_START:{this._stateCommentStart(t);break}case E.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case E.COMMENT:{this._stateComment(t);break}case E.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case E.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case E.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case E.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case E.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case E.COMMENT_END:{this._stateCommentEnd(t);break}case E.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case E.DOCTYPE:{this._stateDoctype(t);break}case E.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case E.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case E.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case E.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case E.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case E.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case E.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case E.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case E.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case E.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case E.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case E.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case E.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case E.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case E.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case E.CDATA_SECTION:{this._stateCdataSection(t);break}case E.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case E.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case E.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case E.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case g.LESS_THAN_SIGN:{this.state=E.TAG_OPEN;break}case g.AMPERSAND:{this._startCharacterReference();break}case g.NULL:{this._err(w.unexpectedNullCharacter),this._emitCodePoint(t);break}case g.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case g.AMPERSAND:{this._startCharacterReference();break}case g.LESS_THAN_SIGN:{this.state=E.RCDATA_LESS_THAN_SIGN;break}case g.NULL:{this._err(w.unexpectedNullCharacter),this._emitChars(de);break}case g.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case g.LESS_THAN_SIGN:{this.state=E.RAWTEXT_LESS_THAN_SIGN;break}case g.NULL:{this._err(w.unexpectedNullCharacter),this._emitChars(de);break}case g.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case g.LESS_THAN_SIGN:{this.state=E.SCRIPT_DATA_LESS_THAN_SIGN;break}case g.NULL:{this._err(w.unexpectedNullCharacter),this._emitChars(de);break}case g.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case g.NULL:{this._err(w.unexpectedNullCharacter),this._emitChars(de);break}case g.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(tt(t))this._createStartTagToken(),this.state=E.TAG_NAME,this._stateTagName(t);else switch(t){case g.EXCLAMATION_MARK:{this.state=E.MARKUP_DECLARATION_OPEN;break}case g.SOLIDUS:{this.state=E.END_TAG_OPEN;break}case g.QUESTION_MARK:{this._err(w.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=E.BOGUS_COMMENT,this._stateBogusComment(t);break}case g.EOF:{this._err(w.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(w.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=E.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(tt(t))this._createEndTagToken(),this.state=E.TAG_NAME,this._stateTagName(t);else switch(t){case g.GREATER_THAN_SIGN:{this._err(w.missingEndTagName),this.state=E.DATA;break}case g.EOF:{this._err(w.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(w.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=E.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:{this.state=E.BEFORE_ATTRIBUTE_NAME;break}case g.SOLIDUS:{this.state=E.SELF_CLOSING_START_TAG;break}case g.GREATER_THAN_SIGN:{this.state=E.DATA,this.emitCurrentTagToken();break}case g.NULL:{this._err(w.unexpectedNullCharacter),n.tagName+=de;break}case g.EOF:{this._err(w.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(en(t)?Dn(t):t)}}_stateRcdataLessThanSign(t){t===g.SOLIDUS?this.state=E.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=E.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){tt(t)?(this.state=E.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=E.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=E.BEFORE_ATTRIBUTE_NAME,!1;case g.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=E.SELF_CLOSING_START_TAG,!1;case g.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=E.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=E.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===g.SOLIDUS?this.state=E.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=E.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){tt(t)?(this.state=E.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=E.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=E.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case g.SOLIDUS:{this.state=E.SCRIPT_DATA_END_TAG_OPEN;break}case g.EXCLAMATION_MARK:{this.state=E.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=E.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){tt(t)?(this.state=E.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=E.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=E.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===g.HYPHEN_MINUS?(this.state=E.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=E.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===g.HYPHEN_MINUS?(this.state=E.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=E.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case g.HYPHEN_MINUS:{this.state=E.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case g.LESS_THAN_SIGN:{this.state=E.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case g.NULL:{this._err(w.unexpectedNullCharacter),this._emitChars(de);break}case g.EOF:{this._err(w.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case g.HYPHEN_MINUS:{this.state=E.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case g.LESS_THAN_SIGN:{this.state=E.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case g.NULL:{this._err(w.unexpectedNullCharacter),this.state=E.SCRIPT_DATA_ESCAPED,this._emitChars(de);break}case g.EOF:{this._err(w.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=E.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case g.HYPHEN_MINUS:{this._emitChars("-");break}case g.LESS_THAN_SIGN:{this.state=E.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case g.GREATER_THAN_SIGN:{this.state=E.SCRIPT_DATA,this._emitChars(">");break}case g.NULL:{this._err(w.unexpectedNullCharacter),this.state=E.SCRIPT_DATA_ESCAPED,this._emitChars(de);break}case g.EOF:{this._err(w.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=E.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===g.SOLIDUS?this.state=E.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:tt(t)?(this._emitChars("<"),this.state=E.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=E.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){tt(t)?(this.state=E.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=E.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=E.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(_e.SCRIPT,!1)&&$s(this.preprocessor.peek(_e.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<_e.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=E.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=E.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case g.HYPHEN_MINUS:{this.state=E.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case g.LESS_THAN_SIGN:{this.state=E.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case g.NULL:{this._err(w.unexpectedNullCharacter),this._emitChars(de);break}case g.EOF:{this._err(w.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case g.HYPHEN_MINUS:{this.state=E.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case g.LESS_THAN_SIGN:{this.state=E.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case g.NULL:{this._err(w.unexpectedNullCharacter),this.state=E.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(de);break}case g.EOF:{this._err(w.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=E.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case g.HYPHEN_MINUS:{this._emitChars("-");break}case g.LESS_THAN_SIGN:{this.state=E.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case g.GREATER_THAN_SIGN:{this.state=E.SCRIPT_DATA,this._emitChars(">");break}case g.NULL:{this._err(w.unexpectedNullCharacter),this.state=E.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(de);break}case g.EOF:{this._err(w.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=E.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===g.SOLIDUS?(this.state=E.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=E.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(_e.SCRIPT,!1)&&$s(this.preprocessor.peek(_e.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<_e.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=E.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=E.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.SOLIDUS:case g.GREATER_THAN_SIGN:case g.EOF:{this.state=E.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case g.EQUALS_SIGN:{this._err(w.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=E.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=E.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:case g.SOLIDUS:case g.GREATER_THAN_SIGN:case g.EOF:{this._leaveAttrName(),this.state=E.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case g.EQUALS_SIGN:{this._leaveAttrName(),this.state=E.BEFORE_ATTRIBUTE_VALUE;break}case g.QUOTATION_MARK:case g.APOSTROPHE:case g.LESS_THAN_SIGN:{this._err(w.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case g.NULL:{this._err(w.unexpectedNullCharacter),this.currentAttr.name+=de;break}default:this.currentAttr.name+=String.fromCodePoint(en(t)?Dn(t):t)}}_stateAfterAttributeName(t){switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.SOLIDUS:{this.state=E.SELF_CLOSING_START_TAG;break}case g.EQUALS_SIGN:{this.state=E.BEFORE_ATTRIBUTE_VALUE;break}case g.GREATER_THAN_SIGN:{this.state=E.DATA,this.emitCurrentTagToken();break}case g.EOF:{this._err(w.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=E.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.QUOTATION_MARK:{this.state=E.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case g.APOSTROPHE:{this.state=E.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case g.GREATER_THAN_SIGN:{this._err(w.missingAttributeValue),this.state=E.DATA,this.emitCurrentTagToken();break}default:this.state=E.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case g.QUOTATION_MARK:{this.state=E.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case g.AMPERSAND:{this._startCharacterReference();break}case g.NULL:{this._err(w.unexpectedNullCharacter),this.currentAttr.value+=de;break}case g.EOF:{this._err(w.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case g.APOSTROPHE:{this.state=E.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case g.AMPERSAND:{this._startCharacterReference();break}case g.NULL:{this._err(w.unexpectedNullCharacter),this.currentAttr.value+=de;break}case g.EOF:{this._err(w.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:{this._leaveAttrValue(),this.state=E.BEFORE_ATTRIBUTE_NAME;break}case g.AMPERSAND:{this._startCharacterReference();break}case g.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=E.DATA,this.emitCurrentTagToken();break}case g.NULL:{this._err(w.unexpectedNullCharacter),this.currentAttr.value+=de;break}case g.QUOTATION_MARK:case g.APOSTROPHE:case g.LESS_THAN_SIGN:case g.EQUALS_SIGN:case g.GRAVE_ACCENT:{this._err(w.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case g.EOF:{this._err(w.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:{this._leaveAttrValue(),this.state=E.BEFORE_ATTRIBUTE_NAME;break}case g.SOLIDUS:{this._leaveAttrValue(),this.state=E.SELF_CLOSING_START_TAG;break}case g.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=E.DATA,this.emitCurrentTagToken();break}case g.EOF:{this._err(w.eofInTag),this._emitEOFToken();break}default:this._err(w.missingWhitespaceBetweenAttributes),this.state=E.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case g.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=E.DATA,this.emitCurrentTagToken();break}case g.EOF:{this._err(w.eofInTag),this._emitEOFToken();break}default:this._err(w.unexpectedSolidusInTag),this.state=E.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case g.GREATER_THAN_SIGN:{this.state=E.DATA,this.emitCurrentComment(n);break}case g.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case g.NULL:{this._err(w.unexpectedNullCharacter),n.data+=de;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(_e.DASH_DASH,!0)?(this._createCommentToken(_e.DASH_DASH.length+1),this.state=E.COMMENT_START):this._consumeSequenceIfMatch(_e.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(_e.DOCTYPE.length+1),this.state=E.DOCTYPE):this._consumeSequenceIfMatch(_e.CDATA_START,!0)?this.inForeignNode?this.state=E.CDATA_SECTION:(this._err(w.cdataInHtmlContent),this._createCommentToken(_e.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=E.BOGUS_COMMENT):this._ensureHibernation()||(this._err(w.incorrectlyOpenedComment),this._createCommentToken(2),this.state=E.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case g.HYPHEN_MINUS:{this.state=E.COMMENT_START_DASH;break}case g.GREATER_THAN_SIGN:{this._err(w.abruptClosingOfEmptyComment),this.state=E.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=E.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case g.HYPHEN_MINUS:{this.state=E.COMMENT_END;break}case g.GREATER_THAN_SIGN:{this._err(w.abruptClosingOfEmptyComment),this.state=E.DATA,this.emitCurrentComment(n);break}case g.EOF:{this._err(w.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=E.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case g.HYPHEN_MINUS:{this.state=E.COMMENT_END_DASH;break}case g.LESS_THAN_SIGN:{n.data+="<",this.state=E.COMMENT_LESS_THAN_SIGN;break}case g.NULL:{this._err(w.unexpectedNullCharacter),n.data+=de;break}case g.EOF:{this._err(w.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case g.EXCLAMATION_MARK:{n.data+="!",this.state=E.COMMENT_LESS_THAN_SIGN_BANG;break}case g.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=E.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===g.HYPHEN_MINUS?this.state=E.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=E.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===g.HYPHEN_MINUS?this.state=E.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=E.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==g.GREATER_THAN_SIGN&&t!==g.EOF&&this._err(w.nestedComment),this.state=E.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case g.HYPHEN_MINUS:{this.state=E.COMMENT_END;break}case g.EOF:{this._err(w.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=E.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case g.GREATER_THAN_SIGN:{this.state=E.DATA,this.emitCurrentComment(n);break}case g.EXCLAMATION_MARK:{this.state=E.COMMENT_END_BANG;break}case g.HYPHEN_MINUS:{n.data+="-";break}case g.EOF:{this._err(w.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=E.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case g.HYPHEN_MINUS:{n.data+="--!",this.state=E.COMMENT_END_DASH;break}case g.GREATER_THAN_SIGN:{this._err(w.incorrectlyClosedComment),this.state=E.DATA,this.emitCurrentComment(n);break}case g.EOF:{this._err(w.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=E.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:{this.state=E.BEFORE_DOCTYPE_NAME;break}case g.GREATER_THAN_SIGN:{this.state=E.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case g.EOF:{this._err(w.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(w.missingWhitespaceBeforeDoctypeName),this.state=E.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(en(t))this._createDoctypeToken(String.fromCharCode(Dn(t))),this.state=E.DOCTYPE_NAME;else switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.NULL:{this._err(w.unexpectedNullCharacter),this._createDoctypeToken(de),this.state=E.DOCTYPE_NAME;break}case g.GREATER_THAN_SIGN:{this._err(w.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=E.DATA;break}case g.EOF:{this._err(w.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=E.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:{this.state=E.AFTER_DOCTYPE_NAME;break}case g.GREATER_THAN_SIGN:{this.state=E.DATA,this.emitCurrentDoctype(n);break}case g.NULL:{this._err(w.unexpectedNullCharacter),n.name+=de;break}case g.EOF:{this._err(w.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(en(t)?Dn(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.GREATER_THAN_SIGN:{this.state=E.DATA,this.emitCurrentDoctype(n);break}case g.EOF:{this._err(w.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(_e.PUBLIC,!1)?this.state=E.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(_e.SYSTEM,!1)?this.state=E.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(w.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=E.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:{this.state=E.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case g.QUOTATION_MARK:{this._err(w.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=E.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case g.APOSTROPHE:{this._err(w.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=E.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case g.GREATER_THAN_SIGN:{this._err(w.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=E.DATA,this.emitCurrentDoctype(n);break}case g.EOF:{this._err(w.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(w.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=E.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.QUOTATION_MARK:{n.publicId="",this.state=E.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case g.APOSTROPHE:{n.publicId="",this.state=E.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case g.GREATER_THAN_SIGN:{this._err(w.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=E.DATA,this.emitCurrentDoctype(n);break}case g.EOF:{this._err(w.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(w.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=E.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case g.QUOTATION_MARK:{this.state=E.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case g.NULL:{this._err(w.unexpectedNullCharacter),n.publicId+=de;break}case g.GREATER_THAN_SIGN:{this._err(w.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=E.DATA;break}case g.EOF:{this._err(w.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case g.APOSTROPHE:{this.state=E.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case g.NULL:{this._err(w.unexpectedNullCharacter),n.publicId+=de;break}case g.GREATER_THAN_SIGN:{this._err(w.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=E.DATA;break}case g.EOF:{this._err(w.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:{this.state=E.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case g.GREATER_THAN_SIGN:{this.state=E.DATA,this.emitCurrentDoctype(n);break}case g.QUOTATION_MARK:{this._err(w.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=E.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case g.APOSTROPHE:{this._err(w.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=E.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case g.EOF:{this._err(w.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(w.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=E.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=E.DATA;break}case g.QUOTATION_MARK:{n.systemId="",this.state=E.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case g.APOSTROPHE:{n.systemId="",this.state=E.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case g.EOF:{this._err(w.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(w.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=E.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:{this.state=E.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case g.QUOTATION_MARK:{this._err(w.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=E.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case g.APOSTROPHE:{this._err(w.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=E.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case g.GREATER_THAN_SIGN:{this._err(w.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=E.DATA,this.emitCurrentDoctype(n);break}case g.EOF:{this._err(w.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(w.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=E.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.QUOTATION_MARK:{n.systemId="",this.state=E.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case g.APOSTROPHE:{n.systemId="",this.state=E.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case g.GREATER_THAN_SIGN:{this._err(w.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=E.DATA,this.emitCurrentDoctype(n);break}case g.EOF:{this._err(w.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(w.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=E.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case g.QUOTATION_MARK:{this.state=E.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case g.NULL:{this._err(w.unexpectedNullCharacter),n.systemId+=de;break}case g.GREATER_THAN_SIGN:{this._err(w.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=E.DATA;break}case g.EOF:{this._err(w.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case g.APOSTROPHE:{this.state=E.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case g.NULL:{this._err(w.unexpectedNullCharacter),n.systemId+=de;break}case g.GREATER_THAN_SIGN:{this._err(w.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=E.DATA;break}case g.EOF:{this._err(w.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=E.DATA;break}case g.EOF:{this._err(w.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(w.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=E.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case g.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=E.DATA;break}case g.NULL:{this._err(w.unexpectedNullCharacter);break}case g.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case g.RIGHT_SQUARE_BRACKET:{this.state=E.CDATA_SECTION_BRACKET;break}case g.EOF:{this._err(w.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===g.RIGHT_SQUARE_BRACKET?this.state=E.CDATA_SECTION_END:(this._emitChars("]"),this.state=E.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case g.GREATER_THAN_SIGN:{this.state=E.DATA;break}case g.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=E.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(g.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&zs(this.preprocessor.peek(1))?E.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){zs(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===g.SEMICOLON&&this._err(w.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const Xu=new Set([l.DD,l.DT,l.LI,l.OPTGROUP,l.OPTION,l.P,l.RB,l.RP,l.RT,l.RTC]),Ys=new Set([...Xu,l.CAPTION,l.COLGROUP,l.TBODY,l.TD,l.TFOOT,l.TH,l.THEAD,l.TR]),Zn=new Set([l.APPLET,l.CAPTION,l.HTML,l.MARQUEE,l.OBJECT,l.TABLE,l.TD,l.TEMPLATE,l.TH]),xf=new Set([...Zn,l.OL,l.UL]),kf=new Set([...Zn,l.BUTTON]),qs=new Set([l.ANNOTATION_XML,l.MI,l.MN,l.MO,l.MS,l.MTEXT]),Vs=new Set([l.DESC,l.FOREIGN_OBJECT,l.TITLE]),yf=new Set([l.TR,l.TEMPLATE,l.HTML]),Af=new Set([l.TBODY,l.TFOOT,l.THEAD,l.TEMPLATE,l.HTML]),_f=new Set([l.TABLE,l.TEMPLATE,l.HTML]),Cf=new Set([l.TD,l.TH]);class Sf{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=l.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===l.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===D.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const i=this._indexOf(t)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==D.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(si,D.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Cf,D.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(_f,D.HTML)}clearBackToTableBodyContext(){this.clearBackTo(Af,D.HTML)}clearBackToTableRowContext(){this.clearBackTo(yf,D.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===l.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===l.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case D.HTML:{if(i===t)return!0;if(n.has(i))return!1;break}case D.SVG:{if(Vs.has(i))return!1;break}case D.MATHML:{if(qs.has(i))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Zn)}hasInListItemScope(t){return this.hasInDynamicScope(t,xf)}hasInButtonScope(t){return this.hasInDynamicScope(t,kf)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case D.HTML:{if(si.has(n))return!0;if(Zn.has(n))return!1;break}case D.SVG:{if(Vs.has(n))return!1;break}case D.MATHML:{if(qs.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===D.HTML)switch(this.tagIDs[n]){case t:return!0;case l.TABLE:case l.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===D.HTML)switch(this.tagIDs[t]){case l.TBODY:case l.THEAD:case l.TFOOT:return!0;case l.TABLE:case l.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===D.HTML)switch(this.tagIDs[n]){case t:return!0;case l.OPTION:case l.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Xu.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Ys.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&Ys.has(this.currentTagId);)this.pop()}}const Rr=3;var ze;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(ze||(ze={}));const Ws={type:ze.Marker};class Nf{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],i=n.length,s=this.treeAdapter.getTagName(t),a=this.treeAdapter.getNamespaceURI(t);for(let u=0;u<this.entries.length;u++){const o=this.entries[u];if(o.type===ze.Marker)break;const{element:c}=o;if(this.treeAdapter.getTagName(c)===s&&this.treeAdapter.getNamespaceURI(c)===a){const d=this.treeAdapter.getAttrList(c);d.length===i&&r.push({idx:u,attrs:d})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<Rr)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<Rr)return;const i=new Map(n.map(a=>[a.name,a.value]));let s=0;for(let a=0;a<r.length;a++){const u=r[a];u.attrs.every(o=>i.get(o.name)===o.value)&&(s+=1,s>=Rr&&this.entries.splice(u.idx,1))}}insertMarker(){this.entries.unshift(Ws)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:ze.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:ze.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(Ws);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===ze.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===ze.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===ze.Element&&n.element===t)}}const nt={createDocument(){return{nodeName:"#document",mode:Re.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const i=e.childNodes.find(s=>s.nodeName==="#documentType");if(i)i.name=t,i.publicId=n,i.systemId=r;else{const s={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};nt.appendChild(e,s)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(nt.isTextNode(n)){n.value+=t;return}}nt.appendChild(e,nt.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&nt.isTextNode(r)?r.value+=t:nt.insertBefore(e,nt.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},Zu="html",If="about:legacy-compat",wf="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",Ju=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],Lf=[...Ju,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],Rf=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),eo=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],Of=[...eo,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Gs(e,t){return t.some(n=>e.startsWith(n))}function Df(e){return e.name===Zu&&e.publicId===null&&(e.systemId===null||e.systemId===If)}function Pf(e){if(e.name!==Zu)return Re.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===wf)return Re.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),Rf.has(n))return Re.QUIRKS;let r=t===null?Lf:Ju;if(Gs(n,r))return Re.QUIRKS;if(r=t===null?eo:Of,Gs(n,r))return Re.LIMITED_QUIRKS}return Re.NO_QUIRKS}const Qs={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},vf="definitionurl",Mf="definitionURL",Bf=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),Ff=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:D.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:D.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:D.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:D.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:D.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:D.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:D.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:D.XML}],["xml:space",{prefix:"xml",name:"space",namespace:D.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:D.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:D.XMLNS}]]),Hf=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),Uf=new Set([l.B,l.BIG,l.BLOCKQUOTE,l.BODY,l.BR,l.CENTER,l.CODE,l.DD,l.DIV,l.DL,l.DT,l.EM,l.EMBED,l.H1,l.H2,l.H3,l.H4,l.H5,l.H6,l.HEAD,l.HR,l.I,l.IMG,l.LI,l.LISTING,l.MENU,l.META,l.NOBR,l.OL,l.P,l.PRE,l.RUBY,l.S,l.SMALL,l.SPAN,l.STRONG,l.STRIKE,l.SUB,l.SUP,l.TABLE,l.TT,l.U,l.UL,l.VAR]);function jf(e){const t=e.tagID;return t===l.FONT&&e.attrs.some(({name:r})=>r===mt.COLOR||r===mt.SIZE||r===mt.FACE)||Uf.has(t)}function to(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===vf){e.attrs[t].name=Mf;break}}function no(e){for(let t=0;t<e.attrs.length;t++){const n=Bf.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function Mi(e){for(let t=0;t<e.attrs.length;t++){const n=Ff.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function zf(e){const t=Hf.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Ht(e.tagName))}function $f(e,t){return t===D.MATHML&&(e===l.MI||e===l.MO||e===l.MN||e===l.MS||e===l.MTEXT)}function Yf(e,t,n){if(t===D.MATHML&&e===l.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===mt.ENCODING){const i=n[r].value.toLowerCase();return i===Qs.TEXT_HTML||i===Qs.APPLICATION_XML}}return t===D.SVG&&(e===l.FOREIGN_OBJECT||e===l.DESC||e===l.TITLE)}function qf(e,t,n,r){return(!r||r===D.HTML)&&Yf(e,t,n)||(!r||r===D.MATHML)&&$f(e,t)}const Vf="hidden",Wf=8,Gf=3;var T;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(T||(T={}));const Qf={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},ro=new Set([l.TABLE,l.TBODY,l.TFOOT,l.THEAD,l.TR]),Ks={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:nt,onParseError:null};class Xs{constructor(t,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,this.currentToken=null,this.stopped=!1,this.insertionMode=T.INITIAL,this.originalInsertionMode=T.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...Ks,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new Tf(this.options,this),this.activeFormattingElements=new Nf(this.treeAdapter),this.fragmentContextID=r?Ht(this.treeAdapter.getTagName(r)):l.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new Sf(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r={...Ks,...n};t??(t=r.treeAdapter.createElement(C.TEMPLATE,D.HTML,[]));const i=r.treeAdapter.createElement("documentmock",D.HTML,[]),s=new this(r,i,t);return s.fragmentContextID===l.TEMPLATE&&s.tmplInsertionModeStack.unshift(T.IN_TEMPLATE),s._initTokenizerForFragmentParsing(),s._insertFakeRootElement(),s._resetInsertionMode(),s._findFormInFragmentContext(),s}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var i;if(!this.onParseError)return;const s=(i=t.location)!==null&&i!==void 0?i:Qf,a={code:n,startLine:s.startLine,startCol:s.startCol,startOffset:s.startOffset,endLine:r?s.startLine:s.endLine,endCol:r?s.startCol:s.endCol,endOffset:r?s.startOffset:s.endOffset};this.onParseError(a)}onItemPush(t,n,r){var i,s;(s=(i=this.treeAdapter).onItemPush)===null||s===void 0||s.call(i,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,t,this.openElements.current),n){let s,a;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,a=this.fragmentContextID):{current:s,currentTagId:a}=this.openElements,this._setContextModes(s,a)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===D.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,D.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=T.TEXT}switchToPlaintextParsing(){this.insertionMode=T.TEXT,this.originalInsertionMode=T.IN_BODY,this.tokenizer.state=fe.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===C.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==D.HTML))switch(this.fragmentContextID){case l.TITLE:case l.TEXTAREA:{this.tokenizer.state=fe.RCDATA;break}case l.STYLE:case l.XMP:case l.IFRAME:case l.NOEMBED:case l.NOFRAMES:case l.NOSCRIPT:{this.tokenizer.state=fe.RAWTEXT;break}case l.SCRIPT:{this.tokenizer.state=fe.SCRIPT_DATA;break}case l.PLAINTEXT:{this.tokenizer.state=fe.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",i=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),t.location){const a=this.treeAdapter.getChildNodes(this.document).find(u=>this.treeAdapter.isDocumentTypeNode(u));a&&this.treeAdapter.setNodeSourceCodeLocation(a,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,D.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,D.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(C.HTML,D.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,l.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const i=this.treeAdapter.getChildNodes(n),s=r?i.lastIndexOf(r):i.length,a=i[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(a)){const{endLine:o,endCol:c,endOffset:d}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:o,endCol:c,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(t),s=n.type===J.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,s)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===l.SVG&&this.treeAdapter.getTagName(n)===C.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===D.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===l.MGLYPH||t.tagID===l.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,D.HTML)}_processToken(t){switch(t.type){case J.CHARACTER:{this.onCharacter(t);break}case J.NULL_CHARACTER:{this.onNullCharacter(t);break}case J.COMMENT:{this.onComment(t);break}case J.DOCTYPE:{this.onDoctype(t);break}case J.START_TAG:{this._processStartTag(t);break}case J.END_TAG:{this.onEndTag(t);break}case J.EOF:{this.onEof(t);break}case J.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const i=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return qf(t,i,s,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===ze.Marker||this.openElements.contains(i.element)),r=n===-1?t-1:n-1;for(let i=r;i>=0;i--){const s=this.activeFormattingElements.entries[i];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=T.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(l.P),this.openElements.popUntilTagNamePopped(l.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case l.TR:{this.insertionMode=T.IN_ROW;return}case l.TBODY:case l.THEAD:case l.TFOOT:{this.insertionMode=T.IN_TABLE_BODY;return}case l.CAPTION:{this.insertionMode=T.IN_CAPTION;return}case l.COLGROUP:{this.insertionMode=T.IN_COLUMN_GROUP;return}case l.TABLE:{this.insertionMode=T.IN_TABLE;return}case l.BODY:{this.insertionMode=T.IN_BODY;return}case l.FRAMESET:{this.insertionMode=T.IN_FRAMESET;return}case l.SELECT:{this._resetInsertionModeForSelect(t);return}case l.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case l.HTML:{this.insertionMode=this.headElement?T.AFTER_HEAD:T.BEFORE_HEAD;return}case l.TD:case l.TH:{if(t>0){this.insertionMode=T.IN_CELL;return}break}case l.HEAD:{if(t>0){this.insertionMode=T.IN_HEAD;return}break}}this.insertionMode=T.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===l.TEMPLATE)break;if(r===l.TABLE){this.insertionMode=T.IN_SELECT_IN_TABLE;return}}this.insertionMode=T.IN_SELECT}_isElementCausesFosterParenting(t){return ro.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case l.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===D.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case l.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return pf[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Cm(this,t);return}switch(this.insertionMode){case T.INITIAL:{Vt(this,t);break}case T.BEFORE_HTML:{rn(this,t);break}case T.BEFORE_HEAD:{sn(this,t);break}case T.IN_HEAD:{an(this,t);break}case T.IN_HEAD_NO_SCRIPT:{un(this,t);break}case T.AFTER_HEAD:{on(this,t);break}case T.IN_BODY:case T.IN_CAPTION:case T.IN_CELL:case T.IN_TEMPLATE:{so(this,t);break}case T.TEXT:case T.IN_SELECT:case T.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case T.IN_TABLE:case T.IN_TABLE_BODY:case T.IN_ROW:{Or(this,t);break}case T.IN_TABLE_TEXT:{ho(this,t);break}case T.IN_COLUMN_GROUP:{Jn(this,t);break}case T.AFTER_BODY:{er(this,t);break}case T.AFTER_AFTER_BODY:{$n(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){_m(this,t);return}switch(this.insertionMode){case T.INITIAL:{Vt(this,t);break}case T.BEFORE_HTML:{rn(this,t);break}case T.BEFORE_HEAD:{sn(this,t);break}case T.IN_HEAD:{an(this,t);break}case T.IN_HEAD_NO_SCRIPT:{un(this,t);break}case T.AFTER_HEAD:{on(this,t);break}case T.TEXT:{this._insertCharacters(t);break}case T.IN_TABLE:case T.IN_TABLE_BODY:case T.IN_ROW:{Or(this,t);break}case T.IN_COLUMN_GROUP:{Jn(this,t);break}case T.AFTER_BODY:{er(this,t);break}case T.AFTER_AFTER_BODY:{$n(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){ai(this,t);return}switch(this.insertionMode){case T.INITIAL:case T.BEFORE_HTML:case T.BEFORE_HEAD:case T.IN_HEAD:case T.IN_HEAD_NO_SCRIPT:case T.AFTER_HEAD:case T.IN_BODY:case T.IN_TABLE:case T.IN_CAPTION:case T.IN_COLUMN_GROUP:case T.IN_TABLE_BODY:case T.IN_ROW:case T.IN_CELL:case T.IN_SELECT:case T.IN_SELECT_IN_TABLE:case T.IN_TEMPLATE:case T.IN_FRAMESET:case T.AFTER_FRAMESET:{ai(this,t);break}case T.IN_TABLE_TEXT:{Wt(this,t);break}case T.AFTER_BODY:{n0(this,t);break}case T.AFTER_AFTER_BODY:case T.AFTER_AFTER_FRAMESET:{r0(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case T.INITIAL:{i0(this,t);break}case T.BEFORE_HEAD:case T.IN_HEAD:case T.IN_HEAD_NO_SCRIPT:case T.AFTER_HEAD:{this._err(t,w.misplacedDoctype);break}case T.IN_TABLE_TEXT:{Wt(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,w.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?Sm(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case T.INITIAL:{Vt(this,t);break}case T.BEFORE_HTML:{s0(this,t);break}case T.BEFORE_HEAD:{u0(this,t);break}case T.IN_HEAD:{Ue(this,t);break}case T.IN_HEAD_NO_SCRIPT:{c0(this,t);break}case T.AFTER_HEAD:{h0(this,t);break}case T.IN_BODY:{Te(this,t);break}case T.IN_TABLE:{vt(this,t);break}case T.IN_TABLE_TEXT:{Wt(this,t);break}case T.IN_CAPTION:{om(this,t);break}case T.IN_COLUMN_GROUP:{Hi(this,t);break}case T.IN_TABLE_BODY:{Er(this,t);break}case T.IN_ROW:{Tr(this,t);break}case T.IN_CELL:{dm(this,t);break}case T.IN_SELECT:{po(this,t);break}case T.IN_SELECT_IN_TABLE:{fm(this,t);break}case T.IN_TEMPLATE:{pm(this,t);break}case T.AFTER_BODY:{bm(this,t);break}case T.IN_FRAMESET:{Em(this,t);break}case T.AFTER_FRAMESET:{xm(this,t);break}case T.AFTER_AFTER_BODY:{ym(this,t);break}case T.AFTER_AFTER_FRAMESET:{Am(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?Nm(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case T.INITIAL:{Vt(this,t);break}case T.BEFORE_HTML:{a0(this,t);break}case T.BEFORE_HEAD:{o0(this,t);break}case T.IN_HEAD:{l0(this,t);break}case T.IN_HEAD_NO_SCRIPT:{d0(this,t);break}case T.AFTER_HEAD:{f0(this,t);break}case T.IN_BODY:{br(this,t);break}case T.TEXT:{Z0(this,t);break}case T.IN_TABLE:{gn(this,t);break}case T.IN_TABLE_TEXT:{Wt(this,t);break}case T.IN_CAPTION:{lm(this,t);break}case T.IN_COLUMN_GROUP:{cm(this,t);break}case T.IN_TABLE_BODY:{ui(this,t);break}case T.IN_ROW:{mo(this,t);break}case T.IN_CELL:{hm(this,t);break}case T.IN_SELECT:{go(this,t);break}case T.IN_SELECT_IN_TABLE:{mm(this,t);break}case T.IN_TEMPLATE:{gm(this,t);break}case T.AFTER_BODY:{Eo(this,t);break}case T.IN_FRAMESET:{Tm(this,t);break}case T.AFTER_FRAMESET:{km(this,t);break}case T.AFTER_AFTER_BODY:{$n(this,t);break}}}onEof(t){switch(this.insertionMode){case T.INITIAL:{Vt(this,t);break}case T.BEFORE_HTML:{rn(this,t);break}case T.BEFORE_HEAD:{sn(this,t);break}case T.IN_HEAD:{an(this,t);break}case T.IN_HEAD_NO_SCRIPT:{un(this,t);break}case T.AFTER_HEAD:{on(this,t);break}case T.IN_BODY:case T.IN_TABLE:case T.IN_CAPTION:case T.IN_COLUMN_GROUP:case T.IN_TABLE_BODY:case T.IN_ROW:case T.IN_CELL:case T.IN_SELECT:case T.IN_SELECT_IN_TABLE:{lo(this,t);break}case T.TEXT:{J0(this,t);break}case T.IN_TABLE_TEXT:{Wt(this,t);break}case T.IN_TEMPLATE:{bo(this,t);break}case T.AFTER_BODY:case T.IN_FRAMESET:case T.AFTER_FRAMESET:case T.AFTER_AFTER_BODY:case T.AFTER_AFTER_FRAMESET:{Fi(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===g.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case T.IN_HEAD:case T.IN_HEAD_NO_SCRIPT:case T.AFTER_HEAD:case T.TEXT:case T.IN_COLUMN_GROUP:case T.IN_SELECT:case T.IN_SELECT_IN_TABLE:case T.IN_FRAMESET:case T.AFTER_FRAMESET:{this._insertCharacters(t);break}case T.IN_BODY:case T.IN_CAPTION:case T.IN_CELL:case T.IN_TEMPLATE:case T.AFTER_BODY:case T.AFTER_AFTER_BODY:case T.AFTER_AFTER_FRAMESET:{io(this,t);break}case T.IN_TABLE:case T.IN_TABLE_BODY:case T.IN_ROW:{Or(this,t);break}case T.IN_TABLE_TEXT:{co(this,t);break}}}}function Kf(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):oo(e,t),n}function Xf(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function Zf(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let s=0,a=i;a!==n;s++,a=i){i=e.openElements.getCommonAncestor(a);const u=e.activeFormattingElements.getElementEntry(a),o=u&&s>=Gf;!u||o?(o&&e.activeFormattingElements.removeEntry(u),e.openElements.remove(a)):(a=Jf(e,u),r===t&&(e.activeFormattingElements.bookmark=u),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(a,r),r=a)}return r}function Jf(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function e0(e,t,n){const r=e.treeAdapter.getTagName(t),i=Ht(r);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);i===l.TEMPLATE&&s===D.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function t0(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,s=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,s),e.treeAdapter.appendChild(t,s),e.activeFormattingElements.insertElementAfterBookmark(s,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,s,i.tagID)}function Bi(e,t){for(let n=0;n<Wf;n++){const r=Kf(e,t);if(!r)break;const i=Xf(e,r);if(!i)break;e.activeFormattingElements.bookmark=r;const s=Zf(e,i,r.element),a=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(s),a&&e0(e,a,s),t0(e,i,r)}}function ai(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function n0(e,t){e._appendCommentNode(t,e.openElements.items[0])}function r0(e,t){e._appendCommentNode(t,e.document)}function Fi(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],i=e.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const s=e.openElements.items[1],a=e.treeAdapter.getNodeSourceCodeLocation(s);a&&!a.endTag&&e._setEndLocation(s,t)}}}}function i0(e,t){e._setDocumentType(t);const n=t.forceQuirks?Re.QUIRKS:Pf(t);Df(t)||e._err(t,w.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=T.BEFORE_HTML}function Vt(e,t){e._err(t,w.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Re.QUIRKS),e.insertionMode=T.BEFORE_HTML,e._processToken(t)}function s0(e,t){t.tagID===l.HTML?(e._insertElement(t,D.HTML),e.insertionMode=T.BEFORE_HEAD):rn(e,t)}function a0(e,t){const n=t.tagID;(n===l.HTML||n===l.HEAD||n===l.BODY||n===l.BR)&&rn(e,t)}function rn(e,t){e._insertFakeRootElement(),e.insertionMode=T.BEFORE_HEAD,e._processToken(t)}function u0(e,t){switch(t.tagID){case l.HTML:{Te(e,t);break}case l.HEAD:{e._insertElement(t,D.HTML),e.headElement=e.openElements.current,e.insertionMode=T.IN_HEAD;break}default:sn(e,t)}}function o0(e,t){const n=t.tagID;n===l.HEAD||n===l.BODY||n===l.HTML||n===l.BR?sn(e,t):e._err(t,w.endTagWithoutMatchingOpenElement)}function sn(e,t){e._insertFakeElement(C.HEAD,l.HEAD),e.headElement=e.openElements.current,e.insertionMode=T.IN_HEAD,e._processToken(t)}function Ue(e,t){switch(t.tagID){case l.HTML:{Te(e,t);break}case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:{e._appendElement(t,D.HTML),t.ackSelfClosing=!0;break}case l.TITLE:{e._switchToTextParsing(t,fe.RCDATA);break}case l.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,fe.RAWTEXT):(e._insertElement(t,D.HTML),e.insertionMode=T.IN_HEAD_NO_SCRIPT);break}case l.NOFRAMES:case l.STYLE:{e._switchToTextParsing(t,fe.RAWTEXT);break}case l.SCRIPT:{e._switchToTextParsing(t,fe.SCRIPT_DATA);break}case l.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=T.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(T.IN_TEMPLATE);break}case l.HEAD:{e._err(t,w.misplacedStartTagForHeadElement);break}default:an(e,t)}}function l0(e,t){switch(t.tagID){case l.HEAD:{e.openElements.pop(),e.insertionMode=T.AFTER_HEAD;break}case l.BODY:case l.BR:case l.HTML:{an(e,t);break}case l.TEMPLATE:{xt(e,t);break}default:e._err(t,w.endTagWithoutMatchingOpenElement)}}function xt(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==l.TEMPLATE&&e._err(t,w.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(l.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,w.endTagWithoutMatchingOpenElement)}function an(e,t){e.openElements.pop(),e.insertionMode=T.AFTER_HEAD,e._processToken(t)}function c0(e,t){switch(t.tagID){case l.HTML:{Te(e,t);break}case l.BASEFONT:case l.BGSOUND:case l.HEAD:case l.LINK:case l.META:case l.NOFRAMES:case l.STYLE:{Ue(e,t);break}case l.NOSCRIPT:{e._err(t,w.nestedNoscriptInHead);break}default:un(e,t)}}function d0(e,t){switch(t.tagID){case l.NOSCRIPT:{e.openElements.pop(),e.insertionMode=T.IN_HEAD;break}case l.BR:{un(e,t);break}default:e._err(t,w.endTagWithoutMatchingOpenElement)}}function un(e,t){const n=t.type===J.EOF?w.openElementsLeftAfterEof:w.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=T.IN_HEAD,e._processToken(t)}function h0(e,t){switch(t.tagID){case l.HTML:{Te(e,t);break}case l.BODY:{e._insertElement(t,D.HTML),e.framesetOk=!1,e.insertionMode=T.IN_BODY;break}case l.FRAMESET:{e._insertElement(t,D.HTML),e.insertionMode=T.IN_FRAMESET;break}case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:case l.NOFRAMES:case l.SCRIPT:case l.STYLE:case l.TEMPLATE:case l.TITLE:{e._err(t,w.abandonedHeadElementChild),e.openElements.push(e.headElement,l.HEAD),Ue(e,t),e.openElements.remove(e.headElement);break}case l.HEAD:{e._err(t,w.misplacedStartTagForHeadElement);break}default:on(e,t)}}function f0(e,t){switch(t.tagID){case l.BODY:case l.HTML:case l.BR:{on(e,t);break}case l.TEMPLATE:{xt(e,t);break}default:e._err(t,w.endTagWithoutMatchingOpenElement)}}function on(e,t){e._insertFakeElement(C.BODY,l.BODY),e.insertionMode=T.IN_BODY,gr(e,t)}function gr(e,t){switch(t.type){case J.CHARACTER:{so(e,t);break}case J.WHITESPACE_CHARACTER:{io(e,t);break}case J.COMMENT:{ai(e,t);break}case J.START_TAG:{Te(e,t);break}case J.END_TAG:{br(e,t);break}case J.EOF:{lo(e,t);break}}}function io(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function so(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function m0(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function p0(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function g0(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,D.HTML),e.insertionMode=T.IN_FRAMESET)}function b0(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,D.HTML)}function E0(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&si.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,D.HTML)}function T0(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,D.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function x0(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,D.HTML),n||(e.formElement=e.openElements.current))}function k0(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const i=e.openElements.tagIDs[r];if(n===l.LI&&i===l.LI||(n===l.DD||n===l.DT)&&(i===l.DD||i===l.DT)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(i!==l.ADDRESS&&i!==l.DIV&&i!==l.P&&e._isSpecialElement(e.openElements.items[r],i))break}e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,D.HTML)}function y0(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,D.HTML),e.tokenizer.state=fe.PLAINTEXT}function A0(e,t){e.openElements.hasInScope(l.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(l.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,D.HTML),e.framesetOk=!1}function _0(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(C.A);n&&(Bi(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,D.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function C0(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,D.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function S0(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(l.NOBR)&&(Bi(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,D.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function N0(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,D.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function I0(e,t){e.treeAdapter.getDocumentMode(e.document)!==Re.QUIRKS&&e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,D.HTML),e.framesetOk=!1,e.insertionMode=T.IN_TABLE}function ao(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,D.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function uo(e){const t=Qu(e,mt.TYPE);return t!=null&&t.toLowerCase()===Vf}function w0(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,D.HTML),uo(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function L0(e,t){e._appendElement(t,D.HTML),t.ackSelfClosing=!0}function R0(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._appendElement(t,D.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function O0(e,t){t.tagName=C.IMG,t.tagID=l.IMG,ao(e,t)}function D0(e,t){e._insertElement(t,D.HTML),e.skipNextNewLine=!0,e.tokenizer.state=fe.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=T.TEXT}function P0(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,fe.RAWTEXT)}function v0(e,t){e.framesetOk=!1,e._switchToTextParsing(t,fe.RAWTEXT)}function Zs(e,t){e._switchToTextParsing(t,fe.RAWTEXT)}function M0(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,D.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===T.IN_TABLE||e.insertionMode===T.IN_CAPTION||e.insertionMode===T.IN_TABLE_BODY||e.insertionMode===T.IN_ROW||e.insertionMode===T.IN_CELL?T.IN_SELECT_IN_TABLE:T.IN_SELECT}function B0(e,t){e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,D.HTML)}function F0(e,t){e.openElements.hasInScope(l.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,D.HTML)}function H0(e,t){e.openElements.hasInScope(l.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(l.RTC),e._insertElement(t,D.HTML)}function U0(e,t){e._reconstructActiveFormattingElements(),to(t),Mi(t),t.selfClosing?e._appendElement(t,D.MATHML):e._insertElement(t,D.MATHML),t.ackSelfClosing=!0}function j0(e,t){e._reconstructActiveFormattingElements(),no(t),Mi(t),t.selfClosing?e._appendElement(t,D.SVG):e._insertElement(t,D.SVG),t.ackSelfClosing=!0}function Js(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,D.HTML)}function Te(e,t){switch(t.tagID){case l.I:case l.S:case l.B:case l.U:case l.EM:case l.TT:case l.BIG:case l.CODE:case l.FONT:case l.SMALL:case l.STRIKE:case l.STRONG:{C0(e,t);break}case l.A:{_0(e,t);break}case l.H1:case l.H2:case l.H3:case l.H4:case l.H5:case l.H6:{E0(e,t);break}case l.P:case l.DL:case l.OL:case l.UL:case l.DIV:case l.DIR:case l.NAV:case l.MAIN:case l.MENU:case l.ASIDE:case l.CENTER:case l.FIGURE:case l.FOOTER:case l.HEADER:case l.HGROUP:case l.DIALOG:case l.DETAILS:case l.ADDRESS:case l.ARTICLE:case l.SEARCH:case l.SECTION:case l.SUMMARY:case l.FIELDSET:case l.BLOCKQUOTE:case l.FIGCAPTION:{b0(e,t);break}case l.LI:case l.DD:case l.DT:{k0(e,t);break}case l.BR:case l.IMG:case l.WBR:case l.AREA:case l.EMBED:case l.KEYGEN:{ao(e,t);break}case l.HR:{R0(e,t);break}case l.RB:case l.RTC:{F0(e,t);break}case l.RT:case l.RP:{H0(e,t);break}case l.PRE:case l.LISTING:{T0(e,t);break}case l.XMP:{P0(e,t);break}case l.SVG:{j0(e,t);break}case l.HTML:{m0(e,t);break}case l.BASE:case l.LINK:case l.META:case l.STYLE:case l.TITLE:case l.SCRIPT:case l.BGSOUND:case l.BASEFONT:case l.TEMPLATE:{Ue(e,t);break}case l.BODY:{p0(e,t);break}case l.FORM:{x0(e,t);break}case l.NOBR:{S0(e,t);break}case l.MATH:{U0(e,t);break}case l.TABLE:{I0(e,t);break}case l.INPUT:{w0(e,t);break}case l.PARAM:case l.TRACK:case l.SOURCE:{L0(e,t);break}case l.IMAGE:{O0(e,t);break}case l.BUTTON:{A0(e,t);break}case l.APPLET:case l.OBJECT:case l.MARQUEE:{N0(e,t);break}case l.IFRAME:{v0(e,t);break}case l.SELECT:{M0(e,t);break}case l.OPTION:case l.OPTGROUP:{B0(e,t);break}case l.NOEMBED:case l.NOFRAMES:{Zs(e,t);break}case l.FRAMESET:{g0(e,t);break}case l.TEXTAREA:{D0(e,t);break}case l.NOSCRIPT:{e.options.scriptingEnabled?Zs(e,t):Js(e,t);break}case l.PLAINTEXT:{y0(e,t);break}case l.COL:case l.TH:case l.TD:case l.TR:case l.HEAD:case l.FRAME:case l.TBODY:case l.TFOOT:case l.THEAD:case l.CAPTION:case l.COLGROUP:break;default:Js(e,t)}}function z0(e,t){if(e.openElements.hasInScope(l.BODY)&&(e.insertionMode=T.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function $0(e,t){e.openElements.hasInScope(l.BODY)&&(e.insertionMode=T.AFTER_BODY,Eo(e,t))}function Y0(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function q0(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(l.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(l.FORM):n&&e.openElements.remove(n))}function V0(e){e.openElements.hasInButtonScope(l.P)||e._insertFakeElement(C.P,l.P),e._closePElement()}function W0(e){e.openElements.hasInListItemScope(l.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(l.LI),e.openElements.popUntilTagNamePopped(l.LI))}function G0(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Q0(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function K0(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function X0(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(C.BR,l.BR),e.openElements.pop(),e.framesetOk=!1}function oo(e,t){const n=t.tagName,r=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){const s=e.openElements.items[i],a=e.openElements.tagIDs[i];if(r===a&&(r!==l.UNKNOWN||e.treeAdapter.getTagName(s)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=i&&e.openElements.shortenToLength(i);break}if(e._isSpecialElement(s,a))break}}function br(e,t){switch(t.tagID){case l.A:case l.B:case l.I:case l.S:case l.U:case l.EM:case l.TT:case l.BIG:case l.CODE:case l.FONT:case l.NOBR:case l.SMALL:case l.STRIKE:case l.STRONG:{Bi(e,t);break}case l.P:{V0(e);break}case l.DL:case l.UL:case l.OL:case l.DIR:case l.DIV:case l.NAV:case l.PRE:case l.MAIN:case l.MENU:case l.ASIDE:case l.BUTTON:case l.CENTER:case l.FIGURE:case l.FOOTER:case l.HEADER:case l.HGROUP:case l.DIALOG:case l.ADDRESS:case l.ARTICLE:case l.DETAILS:case l.SEARCH:case l.SECTION:case l.SUMMARY:case l.LISTING:case l.FIELDSET:case l.BLOCKQUOTE:case l.FIGCAPTION:{Y0(e,t);break}case l.LI:{W0(e);break}case l.DD:case l.DT:{G0(e,t);break}case l.H1:case l.H2:case l.H3:case l.H4:case l.H5:case l.H6:{Q0(e);break}case l.BR:{X0(e);break}case l.BODY:{z0(e,t);break}case l.HTML:{$0(e,t);break}case l.FORM:{q0(e);break}case l.APPLET:case l.OBJECT:case l.MARQUEE:{K0(e,t);break}case l.TEMPLATE:{xt(e,t);break}default:oo(e,t)}}function lo(e,t){e.tmplInsertionModeStack.length>0?bo(e,t):Fi(e,t)}function Z0(e,t){var n;t.tagID===l.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function J0(e,t){e._err(t,w.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Or(e,t){if(e.openElements.currentTagId!==void 0&&ro.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=T.IN_TABLE_TEXT,t.type){case J.CHARACTER:{ho(e,t);break}case J.WHITESPACE_CHARACTER:{co(e,t);break}}else _n(e,t)}function em(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,D.HTML),e.insertionMode=T.IN_CAPTION}function tm(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,D.HTML),e.insertionMode=T.IN_COLUMN_GROUP}function nm(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(C.COLGROUP,l.COLGROUP),e.insertionMode=T.IN_COLUMN_GROUP,Hi(e,t)}function rm(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,D.HTML),e.insertionMode=T.IN_TABLE_BODY}function im(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(C.TBODY,l.TBODY),e.insertionMode=T.IN_TABLE_BODY,Er(e,t)}function sm(e,t){e.openElements.hasInTableScope(l.TABLE)&&(e.openElements.popUntilTagNamePopped(l.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function am(e,t){uo(t)?e._appendElement(t,D.HTML):_n(e,t),t.ackSelfClosing=!0}function um(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,D.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function vt(e,t){switch(t.tagID){case l.TD:case l.TH:case l.TR:{im(e,t);break}case l.STYLE:case l.SCRIPT:case l.TEMPLATE:{Ue(e,t);break}case l.COL:{nm(e,t);break}case l.FORM:{um(e,t);break}case l.TABLE:{sm(e,t);break}case l.TBODY:case l.TFOOT:case l.THEAD:{rm(e,t);break}case l.INPUT:{am(e,t);break}case l.CAPTION:{em(e,t);break}case l.COLGROUP:{tm(e,t);break}default:_n(e,t)}}function gn(e,t){switch(t.tagID){case l.TABLE:{e.openElements.hasInTableScope(l.TABLE)&&(e.openElements.popUntilTagNamePopped(l.TABLE),e._resetInsertionMode());break}case l.TEMPLATE:{xt(e,t);break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TBODY:case l.TD:case l.TFOOT:case l.TH:case l.THEAD:case l.TR:break;default:_n(e,t)}}function _n(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,gr(e,t),e.fosterParentingEnabled=n}function co(e,t){e.pendingCharacterTokens.push(t)}function ho(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Wt(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)_n(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const fo=new Set([l.CAPTION,l.COL,l.COLGROUP,l.TBODY,l.TD,l.TFOOT,l.TH,l.THEAD,l.TR]);function om(e,t){const n=t.tagID;fo.has(n)?e.openElements.hasInTableScope(l.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(l.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=T.IN_TABLE,vt(e,t)):Te(e,t)}function lm(e,t){const n=t.tagID;switch(n){case l.CAPTION:case l.TABLE:{e.openElements.hasInTableScope(l.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(l.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=T.IN_TABLE,n===l.TABLE&&gn(e,t));break}case l.BODY:case l.COL:case l.COLGROUP:case l.HTML:case l.TBODY:case l.TD:case l.TFOOT:case l.TH:case l.THEAD:case l.TR:break;default:br(e,t)}}function Hi(e,t){switch(t.tagID){case l.HTML:{Te(e,t);break}case l.COL:{e._appendElement(t,D.HTML),t.ackSelfClosing=!0;break}case l.TEMPLATE:{Ue(e,t);break}default:Jn(e,t)}}function cm(e,t){switch(t.tagID){case l.COLGROUP:{e.openElements.currentTagId===l.COLGROUP&&(e.openElements.pop(),e.insertionMode=T.IN_TABLE);break}case l.TEMPLATE:{xt(e,t);break}case l.COL:break;default:Jn(e,t)}}function Jn(e,t){e.openElements.currentTagId===l.COLGROUP&&(e.openElements.pop(),e.insertionMode=T.IN_TABLE,e._processToken(t))}function Er(e,t){switch(t.tagID){case l.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,D.HTML),e.insertionMode=T.IN_ROW;break}case l.TH:case l.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(C.TR,l.TR),e.insertionMode=T.IN_ROW,Tr(e,t);break}case l.CAPTION:case l.COL:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=T.IN_TABLE,vt(e,t));break}default:vt(e,t)}}function ui(e,t){const n=t.tagID;switch(t.tagID){case l.TBODY:case l.TFOOT:case l.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=T.IN_TABLE);break}case l.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=T.IN_TABLE,gn(e,t));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TD:case l.TH:case l.TR:break;default:gn(e,t)}}function Tr(e,t){switch(t.tagID){case l.TH:case l.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,D.HTML),e.insertionMode=T.IN_CELL,e.activeFormattingElements.insertMarker();break}case l.CAPTION:case l.COL:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:case l.TR:{e.openElements.hasInTableScope(l.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=T.IN_TABLE_BODY,Er(e,t));break}default:vt(e,t)}}function mo(e,t){switch(t.tagID){case l.TR:{e.openElements.hasInTableScope(l.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=T.IN_TABLE_BODY);break}case l.TABLE:{e.openElements.hasInTableScope(l.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=T.IN_TABLE_BODY,ui(e,t));break}case l.TBODY:case l.TFOOT:case l.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(l.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=T.IN_TABLE_BODY,ui(e,t));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TD:case l.TH:break;default:gn(e,t)}}function dm(e,t){const n=t.tagID;fo.has(n)?(e.openElements.hasInTableScope(l.TD)||e.openElements.hasInTableScope(l.TH))&&(e._closeTableCell(),Tr(e,t)):Te(e,t)}function hm(e,t){const n=t.tagID;switch(n){case l.TD:case l.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=T.IN_ROW);break}case l.TABLE:case l.TBODY:case l.TFOOT:case l.THEAD:case l.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),mo(e,t));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:break;default:br(e,t)}}function po(e,t){switch(t.tagID){case l.HTML:{Te(e,t);break}case l.OPTION:{e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e._insertElement(t,D.HTML);break}case l.OPTGROUP:{e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e.openElements.currentTagId===l.OPTGROUP&&e.openElements.pop(),e._insertElement(t,D.HTML);break}case l.HR:{e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e.openElements.currentTagId===l.OPTGROUP&&e.openElements.pop(),e._appendElement(t,D.HTML),t.ackSelfClosing=!0;break}case l.INPUT:case l.KEYGEN:case l.TEXTAREA:case l.SELECT:{e.openElements.hasInSelectScope(l.SELECT)&&(e.openElements.popUntilTagNamePopped(l.SELECT),e._resetInsertionMode(),t.tagID!==l.SELECT&&e._processStartTag(t));break}case l.SCRIPT:case l.TEMPLATE:{Ue(e,t);break}}}function go(e,t){switch(t.tagID){case l.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===l.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===l.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===l.OPTGROUP&&e.openElements.pop();break}case l.OPTION:{e.openElements.currentTagId===l.OPTION&&e.openElements.pop();break}case l.SELECT:{e.openElements.hasInSelectScope(l.SELECT)&&(e.openElements.popUntilTagNamePopped(l.SELECT),e._resetInsertionMode());break}case l.TEMPLATE:{xt(e,t);break}}}function fm(e,t){const n=t.tagID;n===l.CAPTION||n===l.TABLE||n===l.TBODY||n===l.TFOOT||n===l.THEAD||n===l.TR||n===l.TD||n===l.TH?(e.openElements.popUntilTagNamePopped(l.SELECT),e._resetInsertionMode(),e._processStartTag(t)):po(e,t)}function mm(e,t){const n=t.tagID;n===l.CAPTION||n===l.TABLE||n===l.TBODY||n===l.TFOOT||n===l.THEAD||n===l.TR||n===l.TD||n===l.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(l.SELECT),e._resetInsertionMode(),e.onEndTag(t)):go(e,t)}function pm(e,t){switch(t.tagID){case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:case l.NOFRAMES:case l.SCRIPT:case l.STYLE:case l.TEMPLATE:case l.TITLE:{Ue(e,t);break}case l.CAPTION:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:{e.tmplInsertionModeStack[0]=T.IN_TABLE,e.insertionMode=T.IN_TABLE,vt(e,t);break}case l.COL:{e.tmplInsertionModeStack[0]=T.IN_COLUMN_GROUP,e.insertionMode=T.IN_COLUMN_GROUP,Hi(e,t);break}case l.TR:{e.tmplInsertionModeStack[0]=T.IN_TABLE_BODY,e.insertionMode=T.IN_TABLE_BODY,Er(e,t);break}case l.TD:case l.TH:{e.tmplInsertionModeStack[0]=T.IN_ROW,e.insertionMode=T.IN_ROW,Tr(e,t);break}default:e.tmplInsertionModeStack[0]=T.IN_BODY,e.insertionMode=T.IN_BODY,Te(e,t)}}function gm(e,t){t.tagID===l.TEMPLATE&&xt(e,t)}function bo(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(l.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Fi(e,t)}function bm(e,t){t.tagID===l.HTML?Te(e,t):er(e,t)}function Eo(e,t){var n;if(t.tagID===l.HTML){if(e.fragmentContext||(e.insertionMode=T.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===l.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else er(e,t)}function er(e,t){e.insertionMode=T.IN_BODY,gr(e,t)}function Em(e,t){switch(t.tagID){case l.HTML:{Te(e,t);break}case l.FRAMESET:{e._insertElement(t,D.HTML);break}case l.FRAME:{e._appendElement(t,D.HTML),t.ackSelfClosing=!0;break}case l.NOFRAMES:{Ue(e,t);break}}}function Tm(e,t){t.tagID===l.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==l.FRAMESET&&(e.insertionMode=T.AFTER_FRAMESET))}function xm(e,t){switch(t.tagID){case l.HTML:{Te(e,t);break}case l.NOFRAMES:{Ue(e,t);break}}}function km(e,t){t.tagID===l.HTML&&(e.insertionMode=T.AFTER_AFTER_FRAMESET)}function ym(e,t){t.tagID===l.HTML?Te(e,t):$n(e,t)}function $n(e,t){e.insertionMode=T.IN_BODY,gr(e,t)}function Am(e,t){switch(t.tagID){case l.HTML:{Te(e,t);break}case l.NOFRAMES:{Ue(e,t);break}}}function _m(e,t){t.chars=de,e._insertCharacters(t)}function Cm(e,t){e._insertCharacters(t),e.framesetOk=!1}function To(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==D.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Sm(e,t){if(jf(t))To(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===D.MATHML?to(t):r===D.SVG&&(zf(t),no(t)),Mi(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function Nm(e,t){if(t.tagID===l.P||t.tagID===l.BR){To(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===D.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}C.AREA,C.BASE,C.BASEFONT,C.BGSOUND,C.BR,C.COL,C.EMBED,C.FRAME,C.HR,C.IMG,C.INPUT,C.KEYGEN,C.LINK,C.META,C.PARAM,C.SOURCE,C.TRACK,C.WBR;const xr=xo("end"),Ye=xo("start");function xo(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function ko(e){const t=Ye(e),n=xr(e);if(t&&n)return{start:t,end:n}}const Im=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,wm=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),ea={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function yo(e,t){const n=Hm(e),r=Yu("type",{handlers:{root:Lm,element:Rm,text:Om,comment:_o,doctype:Dm,raw:vm},unknown:Mm}),i={parser:n?new Xs(ea):Xs.getFragmentParser(void 0,ea),handle(u){r(u,i)},stitches:!1,options:t||{}};r(e,i),Ut(i,Ye());const s=n?i.parser.document:i.parser.getFragment(),a=Hh(s,{file:i.options.file});return i.stitches&&st(a,"comment",function(u,o,c){const d=u;if(d.value.stitch&&c&&o!==void 0){const h=c.children;return h[o]=d.value.stitch,o}}),a.type==="root"&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function Ao(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function Lm(e,t){Ao(e.children,t)}function Rm(e,t){Bm(e,t),Ao(e.children,t),Fm(e,t)}function Om(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:J.CHARACTER,chars:e.value,location:Cn(e)};Ut(t,Ye(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Dm(e,t){const n={type:J.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Cn(e)};Ut(t,Ye(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Pm(e,t){t.stitches=!0;const n=Um(e);if("children"in e&&"children"in n){const r=yo({type:"root",children:e.children},t.options);n.children=r.children}_o({type:"comment",value:{stitch:n}},t)}function _o(e,t){const n=e.value,r={type:J.COMMENT,data:n,location:Cn(e)};Ut(t,Ye(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function vm(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,Co(t,Ye(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(Im,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function Mm(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))Pm(n,t);else{let r="";throw wm.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Ut(e,t){Co(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=fe.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function Co(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function Bm(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===fe.PLAINTEXT)return;Ut(t,Ye(e));const r=t.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:ft.html;i===ft.html&&n==="svg"&&(i=ft.svg);const s=Yh({...e,children:[]},{space:i===ft.svg?"svg":"html"}),a={type:J.START_TAG,tagName:n,tagID:Ht(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:Cn(e)};t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function Fm(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&Zh.includes(n)||t.parser.tokenizer.state===fe.PLAINTEXT)return;Ut(t,xr(e));const r={type:J.END_TAG,tagName:n,tagID:Ht(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Cn(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===fe.RCDATA||t.parser.tokenizer.state===fe.RAWTEXT||t.parser.tokenizer.state===fe.SCRIPT_DATA)&&(t.parser.tokenizer.state=fe.DATA)}function Hm(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Cn(e){const t=Ye(e)||{line:void 0,column:void 0,offset:void 0},n=xr(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function Um(e){return"children"in e?pt({...e,children:[]}):pt(e)}function oi(e){return function(t,n){return yo(t,{...e,file:n})}}const dt=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],ln={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...dt,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...dt],h2:[["className","sr-only"]],img:[...dt,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...dt,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...dt],table:[...dt],ul:[...dt,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},rt={}.hasOwnProperty;function jm(e,t){let n={type:"root",children:[]};const r={schema:t?{...ln,...t}:ln,stack:[]},i=So(r,e);return i&&(Array.isArray(i)?i.length===1?n=i[0]:n.children=i:n=i),n}function So(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return zm(e,n);case"doctype":return $m(e,n);case"element":return Ym(e,n);case"root":return qm(e,n);case"text":return Vm(e,n)}}}function zm(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),s={type:"comment",value:r<0?n:n.slice(0,r)};return Sn(s,t),s}}function $m(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return Sn(n,t),n}}function Ym(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=No(e,t.children),i=Wm(e,t.properties);e.stack.pop();let s=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(s=!0,e.schema.ancestors&&rt.call(e.schema.ancestors,n))){const u=e.schema.ancestors[n];let o=-1;for(s=!1;++o<u.length;)e.stack.includes(u[o])&&(s=!0)}if(!s)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const a={type:"element",tagName:n,properties:i,children:r};return Sn(a,t),a}function qm(e,t){const r={type:"root",children:No(e,t.children)};return Sn(r,t),r}function Vm(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return Sn(r,t),r}function No(e,t){const n=[];if(Array.isArray(t)){const r=t;let i=-1;for(;++i<r.length;){const s=So(e,r[i]);s&&(Array.isArray(s)?n.push(...s):n.push(s))}}return n}function Wm(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,s=r&&rt.call(r,n)?r[n]:void 0,a=r&&rt.call(r,"*")?r["*"]:void 0,u=t&&typeof t=="object"?t:{},o={};let c;for(c in u)if(rt.call(u,c)){const d=u[c];let h=ta(e,na(s,c),c,d);h==null&&(h=ta(e,na(a,c),c,d)),h!=null&&(o[c]=h)}if(i&&rt.call(i,n)){const d=i[n];for(c in d)rt.call(d,c)&&!rt.call(o,c)&&(o[c]=d[c])}return o}function ta(e,t,n,r){return t?Array.isArray(r)?Gm(e,t,n,r):Io(e,t,n,r):void 0}function Gm(e,t,n,r){let i=-1;const s=[];for(;++i<r.length;){const a=Io(e,t,n,r[i]);(typeof a=="number"||typeof a=="string")&&s.push(a)}return s}function Io(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&Qm(e,n,r)){if(typeof t=="object"&&t.length>1){let i=!1,s=0;for(;++s<t.length;){const a=t[s];if(a&&typeof a=="object"&&"flags"in a){if(a.test(String(r))){i=!0;break}}else if(a===r){i=!0;break}}if(!i)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function Qm(e,t,n){const r=e.schema.protocols&&rt.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const i=String(n),s=i.indexOf(":"),a=i.indexOf("?"),u=i.indexOf("#"),o=i.indexOf("/");if(s<0||o>-1&&s>o||a>-1&&s>a||u>-1&&s>u)return!0;let c=-1;for(;++c<r.length;){const d=r[c];if(s===d.length&&i.slice(0,d.length)===d)return!0}return!1}function Sn(e,t){const n=ko(t);t.data&&(e.data=pt(t.data)),n&&(e.position=n)}function na(e,t){let n,r=-1;if(e)for(;++r<e.length;){const i=e[r],s=typeof i=="string"?i:i[0];if(s===t)return i;s==="data*"&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function wo(e){return function(t){return jm(t,e)}}function ra(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const ye=ot(/[A-Za-z]/),Ee=ot(/[\dA-Za-z]/),Km=ot(/[#-'*+\--9=?A-Z^-~]/);function tr(e){return e!==null&&(e<32||e===127)}const li=ot(/\d/),Xm=ot(/[\dA-Fa-f]/),Zm=ot(/[!-/:-@[-`{-~]/);function q(e){return e!==null&&e<-2}function le(e){return e!==null&&(e<0||e===32)}function ee(e){return e===-2||e===-1||e===32}const kr=ot(new RegExp("\\p{P}|\\p{S}","u")),gt=ot(/\s/);function ot(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Jm(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function ep(e,t,n){const i=hr((n||{}).ignore||[]),s=tp(t);let a=-1;for(;++a<s.length;)Ii(e,"text",u);function u(c,d){let h=-1,f;for(;++h<d.length;){const m=d[h],b=f?f.children:void 0;if(i(m,b?b.indexOf(m):void 0,f))return;f=m}if(f)return o(c,d)}function o(c,d){const h=d[d.length-1],f=s[a][0],m=s[a][1];let b=0;const S=h.children.indexOf(c);let _=!1,L=[];f.lastIndex=0;let I=f.exec(c.value);for(;I;){const B=I.index,z={index:I.index,input:I.input,stack:[...d,c]};let R=m(...I,z);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?f.lastIndex=B+1:(b!==B&&L.push({type:"text",value:c.value.slice(b,B)}),Array.isArray(R)?L.push(...R):R&&L.push(R),b=B+I[0].length,_=!0),!f.global)break;I=f.exec(c.value)}return _?(b<c.value.length&&L.push({type:"text",value:c.value.slice(b)}),h.children.splice(S,1,...L)):L=[c],S+L.length}}function tp(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([np(i[0]),rp(i[1])])}return t}function np(e){return typeof e=="string"?new RegExp(Jm(e),"g"):e}function rp(e){return typeof e=="function"?e:function(){return e}}const Dr="phrasing",Pr=["autolink","link","image","label"];function ip(){return{transforms:[dp],enter:{literalAutolink:ap,literalAutolinkEmail:vr,literalAutolinkHttp:vr,literalAutolinkWww:vr},exit:{literalAutolink:cp,literalAutolinkEmail:lp,literalAutolinkHttp:up,literalAutolinkWww:op}}}function sp(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Dr,notInConstruct:Pr},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Dr,notInConstruct:Pr},{character:":",before:"[ps]",after:"\\/",inConstruct:Dr,notInConstruct:Pr}]}}function ap(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function vr(e){this.config.enter.autolinkProtocol.call(this,e)}function up(e){this.config.exit.autolinkProtocol.call(this,e)}function op(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function lp(e){this.config.exit.autolinkEmail.call(this,e)}function cp(e){this.exit(e)}function dp(e){ep(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,hp],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),fp]],{ignore:["link","linkReference"]})}function hp(e,t,n,r,i){let s="";if(!Lo(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!mp(n)))return!1;const a=pp(n+r);if(!a[0])return!1;const u={type:"link",title:null,url:s+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[u,{type:"text",value:a[1]}]:u}function fp(e,t,n,r){return!Lo(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function mp(e){const 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 pp(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=ra(e,"(");let s=ra(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function Lo(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||gt(n)||kr(n))&&(!t||n!==47)}function He(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}Ro.peek=_p;function gp(){this.buffer()}function bp(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Ep(){this.buffer()}function Tp(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function xp(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=He(this.sliceSerialize(e)).toLowerCase(),n.label=t}function kp(e){this.exit(e)}function yp(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=He(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Ap(e){this.exit(e)}function _p(){return"["}function Ro(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const a=n.enter("footnoteReference"),u=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),u(),a(),s+=i.move("]"),s}function Cp(){return{enter:{gfmFootnoteCallString:gp,gfmFootnoteCall:bp,gfmFootnoteDefinitionLabelString:Ep,gfmFootnoteDefinition:Tp},exit:{gfmFootnoteCallString:xp,gfmFootnoteCall:kp,gfmFootnoteDefinitionLabelString:yp,gfmFootnoteDefinition:Ap}}}function Sp(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Ro},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,a){const u=s.createTracker(a);let o=u.move("[^");const c=s.enter("footnoteDefinition"),d=s.enter("label");return o+=u.move(s.safe(s.associationId(r),{before:o,after:"]"})),d(),o+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),o+=u.move((t?`
|
|
7
|
-
`:" ")+s.indentLines(s.containerFlow(r,u.current()),t?
|
|
8
|
-
`)}function
|
|
9
|
-
`&&
|
|
10
|
-
`}function
|
|
5
|
+
color: hsl(${Math.max(0,Math.min(120-120*S,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(s&&n.skipInitialOnChange)&&n.onChange(i),s=!1,i}return a.updateDeps=u=>{r=u},a}function Ns(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Jd=(e,t)=>Math.abs(e-t)<1.01,eh=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},Is=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},th=e=>e,nh=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let i=t;i<=n;i++)r.push(i);return r},rh=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const i=a=>{const{width:u,height:o}=a;t({width:Math.round(u),height:Math.round(o)})};if(i(Is(n)),!r.ResizeObserver)return()=>{};const s=new r.ResizeObserver(a=>{const u=()=>{const o=a[0];if(o?.borderBoxSize){const c=o.borderBoxSize[0];if(c){i({width:c.inlineSize,height:c.blockSize});return}}i(Is(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(u):u()});return s.observe(n,{box:"border-box"}),()=>{s.unobserve(n)}},ws={passive:!0},Ls=typeof window>"u"?!0:"onscrollend"in window,ih=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let i=0;const s=e.options.useScrollendEvent&&Ls?()=>{}:eh(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),a=d=>()=>{const{horizontal:h,isRtl:f}=e.options;i=h?n.scrollLeft*(f&&-1||1):n.scrollTop,s(),t(i,d)},u=a(!0),o=a(!1);n.addEventListener("scroll",u,ws);const c=e.options.useScrollendEvent&&Ls;return c&&n.addEventListener("scrollend",o,ws),()=>{n.removeEventListener("scroll",u),c&&n.removeEventListener("scrollend",o)}},sh=(e,t,n)=>{if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},ah=(e,{adjustments:t=0,behavior:n},r)=>{var i,s;const a=e+t;(s=(i=r.scrollElement)==null?void 0:i.scrollTo)==null||s.call(i,{[r.options.horizontal?"left":"top"]:a,behavior:n})};class uh{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(i=>{i.forEach(s=>{const a=()=>{this._measureElement(s.target,s)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var i;(i=r())==null||i.disconnect(),n=null},observe:i=>{var s;return(s=r())==null?void 0:s.observe(i,{box:"border-box"})},unobserve:i=>{var s;return(s=r())==null?void 0:s.unobserve(i)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,i])=>{typeof i>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:th,rangeExtractor:nh,onChange:()=>{},measureElement:sh,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,n)},this.maybeNotify=Nt(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,s)=>{this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=s,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const i=new Map,s=new Map;for(let a=r-1;a>=0;a--){const u=n[a];if(i.has(u.lane))continue;const o=s.get(u.lane);if(o==null||u.end>o.end?s.set(u.lane,u):u.end<o.end&&i.set(u.lane,!0),i.size===this.options.lanes)break}return s.size===this.options.lanes?Array.from(s.values()).sort((a,u)=>a.end===u.end?a.index-u.index:a.end-u.end)[0]:void 0},this.getMeasurementOptions=Nt(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,i,s,a,u)=>(this.prevLanes!==void 0&&this.prevLanes!==u&&(this.lanesChangedFlag=!0),this.prevLanes=u,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:i,getItemKey:s,enabled:a,lanes:u}),{key:!1}),this.getMeasurements=Nt(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:i,getItemKey:s,enabled:a,lanes:u},o)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const f of this.laneAssignments.keys())f>=n&&this.laneAssignments.delete(f);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(f=>{this.itemSizeCache.set(f.key,f.size)}));const c=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const d=this.measurementsCache.slice(0,c),h=new Array(u).fill(void 0);for(let f=0;f<c;f++){const m=d[f];m&&(h[m.lane]=f)}for(let f=c;f<n;f++){const m=s(f),b=this.laneAssignments.get(f);let k,S;if(b!==void 0&&this.options.lanes>1){k=b;const B=h[k],z=B!==void 0?d[B]:void 0;S=z?z.end+this.options.gap:r+i}else{const B=this.options.lanes===1?d[f-1]:this.getFurthestMeasurement(d,f);S=B?B.end+this.options.gap:r+i,k=B?B.lane:f%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(f,k)}const _=o.get(m),L=typeof _=="number"?_:this.options.estimateSize(f),I=S+L;d[f]={index:f,start:S,size:L,end:I,key:m,lane:k},h[k]=f}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Nt(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,i,s)=>this.range=n.length>0&&r>0?oh({measurements:n,outerSize:r,scrollOffset:i,lanes:s}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Nt(()=>{let n=null,r=null;const i=this.calculateRange();return i&&(n=i.startIndex,r=i.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,i,s,a)=>s===null||a===null?[]:n({startIndex:s,endIndex:a,overscan:r,count:i}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,i=n.getAttribute(r);return i?parseInt(i,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const i=this.indexFromElement(n),s=this.measurementsCache[i];if(!s)return;const a=s.key,u=this.elementsCache.get(a);u!==n&&(u&&this.observer.unobserve(u),this.observer.observe(n),this.elementsCache.set(a,n)),n.isConnected&&this.resizeItem(i,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const i=this.measurementsCache[n];if(!i)return;const s=this.itemSizeCache.get(i.key)??i.size,a=r-s;a!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(i,a,this):i.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(i.index),this.itemSizeCache=new Map(this.itemSizeCache.set(i.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,i)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(i))});return}this._measureElement(n,void 0)},this.getVirtualItems=Nt(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const i=[];for(let s=0,a=n.length;s<a;s++){const u=n[s],o=r[u];i.push(o)}return i},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return Ns(r[Ou(0,r.length-1,i=>Ns(r[i]).start,n)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(n,r,i=0)=>{if(!this.scrollElement)return 0;const s=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=n>=a+s?"end":"start"),r==="center"?n+=(i-s)/2:r==="end"&&(n-=s);const u=this.getMaxScrollOffset();return Math.max(Math.min(u,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const i=this.measurementsCache[n];if(!i)return;const s=this.getSize(),a=this.getScrollOffset();if(r==="auto")if(i.end>=a+s-this.options.scrollPaddingEnd)r="end";else if(i.start<=a+this.options.scrollPaddingStart)r="start";else return[a,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const u=r==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(u,r,i.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:r="start",behavior:i}={})=>{i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:i})},this.scrollToIndex=(n,{align:r="auto",behavior:i}={})=>{i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1)),this.currentScrollToIndex=n;let s=0;const a=10,u=c=>{if(!this.targetWindow)return;const d=this.getOffsetForIndex(n,c);if(!d){console.warn("Failed to get offset for index:",n);return}const[h,f]=d;this._scrollToOffset(h,{adjustments:void 0,behavior:i}),this.targetWindow.requestAnimationFrame(()=>{const m=()=>{if(this.currentScrollToIndex!==n)return;const b=this.getScrollOffset(),k=this.getOffsetForIndex(n,f);if(!k){console.warn("Failed to get offset for index:",n);return}Jd(k[0],b)||o(f)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(m):m()})},o=c=>{this.targetWindow&&this.currentScrollToIndex===n&&(s++,s<a?this.targetWindow.requestAnimationFrame(()=>u(c)):console.warn(`Failed to scroll to index ${n} after ${a} attempts.`))};u(r)},this.scrollBy=(n,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let i;if(r.length===0)i=this.options.paddingStart;else if(this.options.lanes===1)i=((n=r[r.length-1])==null?void 0:n.end)??0;else{const s=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&s.some(u=>u===null);){const u=r[a];s[u.lane]===null&&(s[u.lane]=u.end),a--}i=Math.max(...s.filter(u=>u!==null))}return Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:i})=>{this.options.scrollToFn(n,{behavior:i,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}}const Ou=(e,t,n,r)=>{for(;e<=t;){const i=(e+t)/2|0,s=n(i);if(s<r)e=i+1;else if(s>r)t=i-1;else return i}return e>0?e-1:0};function oh({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const i=e.length-1,s=o=>e[o].start;if(e.length<=r)return{startIndex:0,endIndex:i};let a=Ou(0,i,s,n),u=a;if(r===1)for(;u<i&&e[u].end<n+t;)u++;else if(r>1){const o=Array(r).fill(0);for(;u<i&&o.some(d=>d<n+t);){const d=e[u];o[d.lane]=d.end,u++}const c=Array(r).fill(n+t);for(;a>=0&&c.some(d=>d>=n);){const d=e[a];c[d.lane]=d.start,a--}a=Math.max(0,a-a%r),u=Math.min(i,u+(r-1-u%r))}return{startIndex:a,endIndex:u}}const Rs=typeof document<"u"?y.useLayoutEffect:y.useEffect;function lh({useFlushSync:e=!0,...t}){const n=y.useReducer(()=>({}),{})[1],r={...t,onChange:(s,a)=>{var u;e&&a?fd.flushSync(n):n(),(u=t.onChange)==null||u.call(t,s,a)}},[i]=y.useState(()=>new uh(r));return i.setOptions(r),Rs(()=>i._didMount(),[]),Rs(()=>i._willUpdate()),i}function ch(e){return lh({observeElementRect:rh,observeElementOffset:ih,scrollToFn:ah,...e})}function dh(e,t,n){const r=n,i=r.getScrollOffset()+r.scrollAdjustments;return e.end+t<=i}const mr=(function(e){if(e==null)return ph;if(typeof e=="function")return pr(e);if(typeof e=="object")return Array.isArray(e)?hh(e):fh(e);if(typeof e=="string")return mh(e);throw new Error("Expected function, string, or object as test")});function hh(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=mr(e[n]);return pr(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function fh(e){const t=e;return pr(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function mh(e){return pr(t);function t(n){return n&&n.type===e}}function pr(e){return t;function t(n,r,i){return!!(gh(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function ph(){return!0}function gh(e){return e!==null&&typeof e=="object"&&"type"in e}const Du=[],en=!0,ti=!1,Jn="skip";function wi(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=mr(i),a=r?-1:1;u(e,void 0,[])();function u(o,c,d){const h=o&&typeof o=="object"?o:{};if(typeof h.type=="string"){const m=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(o.type+(m?"<"+m+">":""))+")"})}return f;function f(){let m=Du,b,k,S;if((!t||s(o,c,d[d.length-1]||void 0))&&(m=bh(n(o,d)),m[0]===ti))return m;if("children"in o&&o.children){const _=o;if(_.children&&m[0]!==Jn)for(k=(r?_.children.length:-1)+a,S=d.concat(_);k>-1&&k<_.children.length;){const L=_.children[k];if(b=u(L,k,S)(),b[0]===ti)return b;k=typeof b[1]=="number"?b[1]:k+a}}return m}}}function bh(e){return Array.isArray(e)?e:typeof e=="number"?[en,e]:e==null?Du:[e]}function st(e,t,n,r){let i,s,a;typeof t=="function"&&typeof n!="function"?(s=void 0,a=t,i=n):(s=t,a=n,i=r),wi(e,s,u,i);function u(o,c){const d=c[c.length-1],h=d?d.children.indexOf(o):void 0;return a(o,h,d)}}function Eh({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],blockedImageClass:s="inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm",blockedLinkClass:a="text-gray-500"}){const u=t.length&&!t.every(c=>c==="*"),o=n.length&&!n.every(c=>c==="*");if(!e&&(u||o))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return c=>{const d=yh(e,t,n,r,i,s,a);st(c,d)}}function Os(e,t){if(typeof e!="string")return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))try{return new URL(e,"http://example.com")}catch{return null}return null}}function Th(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}const xh=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),kh=new Set(["javascript:","data:","file:","vbscript:"]);function Ds(e,t,n,r=!1,i=!1,s=[]){if(!e)return null;if(typeof e=="string"&&e.startsWith("#")&&!i)try{if(new URL(e,"http://example.com").hash===e)return e}catch{}if(typeof e=="string"&&e.startsWith("data:"))return i&&r&&e.startsWith("data:image/")?e:null;if(typeof e=="string"&&e.startsWith("blob:")){try{if(new URL(e).protocol==="blob:"&&e.length>5){const d=e.substring(5);if(d&&d.length>0&&d!=="invalid")return e}}catch{return null}return null}const a=Os(e,n);if(!a||kh.has(a.protocol)||!(xh.has(a.protocol)||s.includes(a.protocol)||s.includes("*")))return null;if(a.protocol==="mailto:"||!a.protocol.match(/^https?:$/))return a.href;const o=Th(e);return a&&t.some(c=>{const d=Os(c,n);return!d||d.origin!==a.origin?!1:a.href.startsWith(d.href)})?o?a.pathname+a.search+a.hash:a.href:t.includes("*")?a.protocol!=="https:"&&a.protocol!=="http:"?null:o?a.pathname+a.search+a.hash:a.href:null}const Rr=Symbol("node-seen"),yh=(e,t,n,r,i,s,a)=>{const u=(o,c,d)=>{if(o.type!=="element"||o[Rr])return en;if(o.tagName==="a"){const h=Ds(o.properties.href,t,e,!1,!1,i);return h===null?(o[Rr]=!0,st(o,u),d&&typeof c=="number"&&(d.children[c]={type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(o.properties.href),class:a},children:[...o.children,{type:"text",value:" [blocked]"}]}),Jn):(o.properties.href=h,o.properties.target="_blank",o.properties.rel="noopener noreferrer",en)}if(o.tagName==="img"){const h=Ds(o.properties.src,n,e,r,!0,i);return h===null?(o[Rr]=!0,st(o,u),d&&typeof c=="number"&&(d.children[c]={type:"element",tagName:"span",properties:{class:s},children:[{type:"text",value:"[Image blocked: "+String(o.properties.alt||"No description")+"]"}]}),Jn):(o.properties.src=h,en)}return en};return u},Pu=-1,gr=0,rn=1,er=2,Li=3,Ri=4,Oi=5,Di=6,vu=7,Mu=8,Ps=typeof self=="object"?self:globalThis,Ah=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,a]=t[i];switch(s){case gr:case Pu:return n(a,i);case rn:{const u=n([],i);for(const o of a)u.push(r(o));return u}case er:{const u=n({},i);for(const[o,c]of a)u[r(o)]=r(c);return u}case Li:return n(new Date(a),i);case Ri:{const{source:u,flags:o}=a;return n(new RegExp(u,o),i)}case Oi:{const u=n(new Map,i);for(const[o,c]of a)u.set(r(o),r(c));return u}case Di:{const u=n(new Set,i);for(const o of a)u.add(r(o));return u}case vu:{const{name:u,message:o}=a;return n(new Ps[u](o),i)}case Mu:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:u}=new Uint8Array(a);return n(new DataView(u),a)}}return n(new Ps[s](a),i)};return r},vs=e=>Ah(new Map,e)(0),It="",{toString:_h}={},{keys:Ch}=Object,Vt=e=>{const t=typeof e;if(t!=="object"||!e)return[gr,t];const n=_h.call(e).slice(8,-1);switch(n){case"Array":return[rn,It];case"Object":return[er,It];case"Date":return[Li,It];case"RegExp":return[Ri,It];case"Map":return[Oi,It];case"Set":return[Di,It];case"DataView":return[rn,n]}return n.includes("Array")?[rn,n]:n.includes("Error")?[vu,n]:[er,n]},vn=([e,t])=>e===gr&&(t==="function"||t==="symbol"),Sh=(e,t,n,r)=>{const i=(a,u)=>{const o=r.push(a)-1;return n.set(u,o),o},s=a=>{if(n.has(a))return n.get(a);let[u,o]=Vt(a);switch(u){case gr:{let d=a;switch(o){case"bigint":u=Mu,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+o);d=null;break;case"undefined":return i([Pu],a)}return i([u,d],a)}case rn:{if(o){let f=a;return o==="DataView"?f=new Uint8Array(a.buffer):o==="ArrayBuffer"&&(f=new Uint8Array(a)),i([o,[...f]],a)}const d=[],h=i([u,d],a);for(const f of a)d.push(s(f));return h}case er:{if(o)switch(o){case"BigInt":return i([o,a.toString()],a);case"Boolean":case"Number":case"String":return i([o,a.valueOf()],a)}if(t&&"toJSON"in a)return s(a.toJSON());const d=[],h=i([u,d],a);for(const f of Ch(a))(e||!vn(Vt(a[f])))&&d.push([s(f),s(a[f])]);return h}case Li:return i([u,a.toISOString()],a);case Ri:{const{source:d,flags:h}=a;return i([u,{source:d,flags:h}],a)}case Oi:{const d=[],h=i([u,d],a);for(const[f,m]of a)(e||!(vn(Vt(f))||vn(Vt(m))))&&d.push([s(f),s(m)]);return h}case Di:{const d=[],h=i([u,d],a);for(const f of a)(e||!vn(Vt(f)))&&d.push(s(f));return h}}const{message:c}=a;return i([u,{name:o,message:c}],a)};return s},Ms=(e,{json:t,lossy:n}={})=>{const r=[];return Sh(!(t||n),!!t,new Map,r)(e),r},gt=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?vs(Ms(e,t)):structuredClone(e):(e,t)=>vs(Ms(e,t));class _n{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}_n.prototype.normal={};_n.prototype.property={};_n.prototype.space=void 0;function Bu(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new _n(n,r,t)}function gn(e){return e.toLowerCase()}class Se{constructor(t,n){this.attribute=n,this.property=t}}Se.prototype.attribute="";Se.prototype.booleanish=!1;Se.prototype.boolean=!1;Se.prototype.commaOrSpaceSeparated=!1;Se.prototype.commaSeparated=!1;Se.prototype.defined=!1;Se.prototype.mustUseProperty=!1;Se.prototype.number=!1;Se.prototype.overloadedBoolean=!1;Se.prototype.property="";Se.prototype.spaceSeparated=!1;Se.prototype.space=void 0;let Nh=0;const Z=xt(),me=xt(),ni=xt(),M=xt(),ce=xt(),Dt=xt(),we=xt();function xt(){return 2**++Nh}const ri=Object.freeze(Object.defineProperty({__proto__:null,boolean:Z,booleanish:me,commaOrSpaceSeparated:we,commaSeparated:Dt,number:M,overloadedBoolean:ni,spaceSeparated:ce},Symbol.toStringTag,{value:"Module"})),Or=Object.keys(ri);class Pi extends Se{constructor(t,n,r,i){let s=-1;if(super(t,n),Bs(this,"space",i),typeof r=="number")for(;++s<Or.length;){const a=Or[s];Bs(this,Or[s],(r&ri[a])===ri[a])}}}Pi.prototype.defined=!0;function Bs(e,t,n){n&&(e[t]=n)}function Ft(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new Pi(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[gn(r)]=r,n[gn(s.attribute)]=r}return new _n(t,n,e.space)}const Fu=Ft({properties:{ariaActiveDescendant:null,ariaAtomic:me,ariaAutoComplete:null,ariaBusy:me,ariaChecked:me,ariaColCount:M,ariaColIndex:M,ariaColSpan:M,ariaControls:ce,ariaCurrent:null,ariaDescribedBy:ce,ariaDetails:null,ariaDisabled:me,ariaDropEffect:ce,ariaErrorMessage:null,ariaExpanded:me,ariaFlowTo:ce,ariaGrabbed:me,ariaHasPopup:null,ariaHidden:me,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ce,ariaLevel:M,ariaLive:null,ariaModal:me,ariaMultiLine:me,ariaMultiSelectable:me,ariaOrientation:null,ariaOwns:ce,ariaPlaceholder:null,ariaPosInSet:M,ariaPressed:me,ariaReadOnly:me,ariaRelevant:null,ariaRequired:me,ariaRoleDescription:ce,ariaRowCount:M,ariaRowIndex:M,ariaRowSpan:M,ariaSelected:me,ariaSetSize:M,ariaSort:null,ariaValueMax:M,ariaValueMin:M,ariaValueNow:M,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Hu(e,t){return t in e?e[t]:t}function Uu(e,t){return Hu(e,t.toLowerCase())}const Ih=Ft({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Dt,acceptCharset:ce,accessKey:ce,action:null,allow:null,allowFullScreen:Z,allowPaymentRequest:Z,allowUserMedia:Z,alt:null,as:null,async:Z,autoCapitalize:null,autoComplete:ce,autoFocus:Z,autoPlay:Z,blocking:ce,capture:null,charSet:null,checked:Z,cite:null,className:ce,cols:M,colSpan:null,content:null,contentEditable:me,controls:Z,controlsList:ce,coords:M|Dt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Z,defer:Z,dir:null,dirName:null,disabled:Z,download:ni,draggable:me,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Z,formTarget:null,headers:ce,height:M,hidden:ni,high:M,href:null,hrefLang:null,htmlFor:ce,httpEquiv:ce,id:null,imageSizes:null,imageSrcSet:null,inert:Z,inputMode:null,integrity:null,is:null,isMap:Z,itemId:null,itemProp:ce,itemRef:ce,itemScope:Z,itemType:ce,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Z,low:M,manifest:null,max:null,maxLength:M,media:null,method:null,min:null,minLength:M,multiple:Z,muted:Z,name:null,nonce:null,noModule:Z,noValidate:Z,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:Z,optimum:M,pattern:null,ping:ce,placeholder:null,playsInline:Z,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Z,referrerPolicy:null,rel:ce,required:Z,reversed:Z,rows:M,rowSpan:M,sandbox:ce,scope:null,scoped:Z,seamless:Z,selected:Z,shadowRootClonable:Z,shadowRootDelegatesFocus:Z,shadowRootMode:null,shape:null,size:M,sizes:null,slot:null,span:M,spellCheck:me,src:null,srcDoc:null,srcLang:null,srcSet:null,start:M,step:null,style:null,tabIndex:M,target:null,title:null,translate:null,type:null,typeMustMatch:Z,useMap:null,value:me,width:M,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ce,axis:null,background:null,bgColor:null,border:M,borderColor:null,bottomMargin:M,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Z,declare:Z,event:null,face:null,frame:null,frameBorder:null,hSpace:M,leftMargin:M,link:null,longDesc:null,lowSrc:null,marginHeight:M,marginWidth:M,noResize:Z,noHref:Z,noShade:Z,noWrap:Z,object:null,profile:null,prompt:null,rev:null,rightMargin:M,rules:null,scheme:null,scrolling:me,standby:null,summary:null,text:null,topMargin:M,valueType:null,version:null,vAlign:null,vLink:null,vSpace:M,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Z,disableRemotePlayback:Z,prefix:null,property:null,results:M,security:null,unselectable:null},space:"html",transform:Uu}),wh=Ft({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",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:we,accentHeight:M,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:M,amplitude:M,arabicForm:null,ascent:M,attributeName:null,attributeType:null,azimuth:M,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:M,by:null,calcMode:null,capHeight:M,className:ce,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:M,diffuseConstant:M,direction:null,display:null,dur:null,divisor:M,dominantBaseline:null,download:Z,dx:null,dy:null,edgeMode:null,editable:null,elevation:M,enableBackground:null,end:null,event:null,exponent:M,externalResourcesRequired:null,fill:null,fillOpacity:M,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:Dt,g2:Dt,glyphName:Dt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:M,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:M,horizOriginX:M,horizOriginY:M,id:null,ideographic:M,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:M,k:M,k1:M,k2:M,k3:M,k4:M,kernelMatrix:we,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:M,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:M,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:M,overlineThickness:M,paintOrder:null,panose1:null,path:null,pathLength:M,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ce,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:M,pointsAtY:M,pointsAtZ:M,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:we,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:we,rev:we,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:we,requiredFeatures:we,requiredFonts:we,requiredFormats:we,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:M,specularExponent:M,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:M,strikethroughThickness:M,string:null,stroke:null,strokeDashArray:we,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:M,strokeOpacity:M,strokeWidth:null,style:null,surfaceScale:M,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:we,tabIndex:M,tableValues:null,target:null,targetX:M,targetY:M,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:we,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:M,underlineThickness:M,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:M,values:null,vAlphabetic:M,vMathematical:M,vectorEffect:null,vHanging:M,vIdeographic:M,version:null,vertAdvY:M,vertOriginX:M,vertOriginY:M,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:M,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Hu}),ju=Ft({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()}}),zu=Ft({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Uu}),$u=Ft({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Lh={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"},Rh=/[A-Z]/g,Fs=/-[a-z]/g,Oh=/^data[-\w.:]+$/i;function br(e,t){const n=gn(t);let r=t,i=Se;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Oh.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(Fs,Ph);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!Fs.test(s)){let a=s.replace(Rh,Dh);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Pi}return new i(r,t)}function Dh(e){return"-"+e.toLowerCase()}function Ph(e){return e.charAt(1).toUpperCase()}const Cn=Bu([Fu,Ih,ju,zu,$u],"html"),ut=Bu([Fu,wh,ju,zu,$u],"svg");function Hs(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,s=!1;for(;!s;){r===-1&&(r=n.length,s=!0);const a=n.slice(i,r).trim();(a||!s)&&t.push(a),i=r+1,r=n.indexOf(",",i)}return t}function Yu(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Us=/[#.]/g;function vh(e,t){const n=e||"",r={};let i=0,s,a;for(;i<n.length;){Us.lastIndex=i;const u=Us.exec(n),o=n.slice(i,u?u.index:n.length);o&&(s?s==="#"?r.id=o:Array.isArray(r.className)?r.className.push(o):r.className=[o]:a=o,i+=o.length),u&&(s=u[0],i++)}return{type:"element",tagName:a||t||"div",properties:r,children:[]}}function js(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function qu(e){return e.join(" ").trim()}function Vu(e,t,n){const r=n?Hh(n):void 0;function i(s,a,...u){let o;if(s==null){o={type:"root",children:[]};const c=a;u.unshift(c)}else{o=vh(s,t);const c=o.tagName.toLowerCase(),d=r?r.get(c):void 0;if(o.tagName=d||c,Mh(a))u.unshift(a);else for(const[h,f]of Object.entries(a))Bh(e,o.properties,h,f)}for(const c of u)ii(o.children,c);return o.type==="element"&&o.tagName==="template"&&(o.content={type:"root",children:o.children},o.children=[]),o}return i}function Mh(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const i=t[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const s=i;for(const a of s)if(typeof a!="number"&&typeof a!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function Bh(e,t,n,r){const i=br(e,n);let s;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;s=r}else typeof r=="boolean"?s=r:typeof r=="string"?i.spaceSeparated?s=js(r):i.commaSeparated?s=Hs(r):i.commaOrSpaceSeparated?s=js(Hs(r).join(" ")):s=zs(i,i.property,r):Array.isArray(r)?s=[...r]:s=i.property==="style"?Fh(r):String(r);if(Array.isArray(s)){const a=[];for(const u of s)a.push(zs(i,i.property,u));s=a}i.property==="className"&&Array.isArray(t.className)&&(s=t.className.concat(s)),t[i.property]=s}}function ii(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)ii(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?ii(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function zs(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||gn(n)===gn(t)))return!0}return n}function Fh(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function Hh(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const Uh=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],jh=Vu(Cn,"div"),zh=Vu(ut,"g",Uh);function $h(e){const t=String(e),n=[];return{toOffset:i,toPoint:r};function r(s){if(typeof s=="number"&&s>-1&&s<=t.length){let a=0;for(;;){let u=n[a];if(u===void 0){const o=$s(t,n[a-1]);u=o===-1?t.length+1:o+1,n[a]=u}if(u>s)return{line:a+1,column:s-(a>0?n[a-1]:0)+1,offset:s};a++}}}function i(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length<s.line;){const u=n[n.length-1],o=$s(t,u),c=o===-1?t.length+1:o+1;if(u===c)break;n.push(c)}const a=(s.line>1?n[s.line-2]:0)+s.column-1;if(a<n[s.line-1])return a}}}function $s(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
|
|
6
|
+
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const mt={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},Wu={}.hasOwnProperty,Yh=Object.prototype;function qh(e,t){const n=t||{};return vi({file:n.file||void 0,location:!1,schema:n.space==="svg"?ut:Cn,verbose:n.verbose||!1},e)}function vi(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},qn(e,r,n),n}case"#document":case"#document-fragment":{const r=t,i="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:Gu(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){const s=String(e.file),a=$h(s),u=a.toPoint(0),o=a.toPoint(s.length);n.position={start:u,end:o}}return n}case"#documentType":{const r=t;return n={type:"doctype"},qn(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},qn(e,r,n),n}default:return n=Vh(e,t),n}}function Gu(e,t){let n=-1;const r=[];for(;++n<t.length;){const i=vi(e,t[n]);r.push(i)}return r}function Vh(e,t){const n=e.schema;e.schema=t.namespaceURI===mt.svg?ut:Cn;let r=-1;const i={};for(;++r<t.attrs.length;){const u=t.attrs[r],o=(u.prefix?u.prefix+":":"")+u.name;Wu.call(Yh,o)||(i[o]=u.value)}const a=(e.schema.space==="svg"?zh:jh)(t.tagName,i,Gu(e,t.childNodes));if(qn(e,t,a),a.tagName==="template"){const u=t,o=u.sourceCodeLocation,c=o&&o.startTag&&Rt(o.startTag),d=o&&o.endTag&&Rt(o.endTag),h=vi(e,u.content);c&&d&&e.file&&(h.position={start:c.end,end:d.start}),a.content=h}return e.schema=n,a}function qn(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=Wh(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function Wh(e,t,n){const r=Rt(n);if(t.type==="element"){const i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){const s={};let a;if(n.attrs)for(a in n.attrs)Wu.call(n.attrs,a)&&(s[br(e.schema,a).property]=Rt(n.attrs[a]));n.startTag;const u=Rt(n.startTag),o=n.endTag?Rt(n.endTag):void 0,c={opening:u};o&&(c.closing=o),c.properties=s,t.data={position:c}}}return r}function Rt(e){const t=Ys({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=Ys({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function Ys(e){return e.line&&e.column?e:void 0}const qs={}.hasOwnProperty;function Qu(e,t){const n=t||{};function r(i,...s){let a=r.invalid;const u=r.handlers;if(i&&qs.call(i,e)){const o=String(i[e]);a=qs.call(u,o)?u[o]:r.unknown}if(a)return a.call(this,i,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Gh={},Qh={}.hasOwnProperty,Ku=Qu("type",{handlers:{root:Xh,element:nf,text:ef,comment:tf,doctype:Jh}});function Kh(e,t){const r=(t||Gh).space;return Ku(e,r==="svg"?ut:Cn)}function Xh(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Mi(e.children,n,t),Ht(e,n),n}function Zh(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Mi(e.children,n,t),Ht(e,n),n}function Jh(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Ht(e,t),t}function ef(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Ht(e,t),t}function tf(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Ht(e,t),t}function nf(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=ut);const i=[];let s;if(e.properties){for(s in e.properties)if(s!=="children"&&Qh.call(e.properties,s)){const o=rf(r,s,e.properties[s]);o&&i.push(o)}}const a=r.space,u={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:mt[a],childNodes:[],parentNode:null};return u.childNodes=Mi(e.children,u,r),Ht(e,u),e.tagName==="template"&&e.content&&(u.content=Zh(e.content,r)),u}function rf(e,t,n){const r=br(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?Yu(n):qu(n));const i={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const s=i.name.indexOf(":");s<0?i.prefix="":(i.name=i.name.slice(s+1),i.prefix=r.attribute.slice(0,s)),i.namespace=mt[r.space]}return i}function Mi(e,t,n){let r=-1;const i=[];if(e)for(;++r<e.length;){const s=Ku(e[r],n);s.parentNode=t,i.push(s)}return i}function Ht(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const sf=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],af=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),de="�";var g;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(g||(g={}));const _e={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function Xu(e){return e>=55296&&e<=57343}function uf(e){return e>=56320&&e<=57343}function of(e,t){return(e-55296)*1024+9216+t}function Zu(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function Ju(e){return e>=64976&&e<=65007||af.has(e)}var w;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(w||(w={}));const lf=65536;class cf{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=lf,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:i,offset:s}=this,a=i+n,u=s+n;return{code:t,startLine:r,endLine:r,startCol:a,endCol:a,startOffset:u,endOffset:u}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(uf(n))return this.pos++,this._addGap(),of(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,g.EOF;return this._err(w.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,g.EOF;const r=this.html.charCodeAt(n);return r===g.CARRIAGE_RETURN?g.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,g.EOF;let t=this.html.charCodeAt(this.pos);return t===g.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,g.LINE_FEED):t===g.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Xu(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===g.LINE_FEED||t===g.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){Zu(t)?this._err(w.controlCharacterInInputStream):Ju(t)&&this._err(w.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var J;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(J||(J={}));function eo(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const df=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),hf=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function ff(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=hf.get(e))!==null&&t!==void 0?t:e}var ge;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(ge||(ge={}));const mf=32;var it;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(it||(it={}));function si(e){return e>=ge.ZERO&&e<=ge.NINE}function pf(e){return e>=ge.UPPER_A&&e<=ge.UPPER_F||e>=ge.LOWER_A&&e<=ge.LOWER_F}function gf(e){return e>=ge.UPPER_A&&e<=ge.UPPER_Z||e>=ge.LOWER_A&&e<=ge.LOWER_Z||si(e)}function bf(e){return e===ge.EQUALS||gf(e)}var pe;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(pe||(pe={}));var Ke;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Ke||(Ke={}));class Ef{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=pe.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ke.Strict}startEntity(t){this.decodeMode=t,this.state=pe.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case pe.EntityStart:return t.charCodeAt(n)===ge.NUM?(this.state=pe.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=pe.NamedEntity,this.stateNamedEntity(t,n));case pe.NumericStart:return this.stateNumericStart(t,n);case pe.NumericDecimal:return this.stateNumericDecimal(t,n);case pe.NumericHex:return this.stateNumericHex(t,n);case pe.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|mf)===ge.LOWER_X?(this.state=pe.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=pe.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,i){if(n!==r){const s=r-n;this.result=this.result*Math.pow(i,s)+Number.parseInt(t.substr(n,s),i),this.consumed+=s}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(si(i)||pf(i))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(si(i))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===ge.SEMI)this.consumed+=1;else if(this.decodeMode===Ke.Strict)return 0;return this.emitCodePoint(ff(this.result),this.consumed),this.errors&&(t!==ge.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let i=r[this.treeIndex],s=(i&it.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const a=t.charCodeAt(n);if(this.treeIndex=Tf(r,i,this.treeIndex+Math.max(1,s),a),this.treeIndex<0)return this.result===0||this.decodeMode===Ke.Attribute&&(s===0||bf(a))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],s=(i&it.VALUE_LENGTH)>>14,s!==0){if(a===ge.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Ke.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&it.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~it.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case pe.NamedEntity:return this.result!==0&&(this.decodeMode!==Ke.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case pe.NumericDecimal:return this.emitNumericEntity(0,2);case pe.NumericHex:return this.emitNumericEntity(0,3);case pe.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case pe.EntityStart:return 0}}}function Tf(e,t,n,r){const i=(t&it.BRANCH_LENGTH)>>7,s=t&it.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const o=r-s;return o<0||o>=i?-1:e[n+o]-1}let a=n,u=a+i-1;for(;a<=u;){const o=a+u>>>1,c=e[o];if(c<r)a=o+1;else if(c>r)u=o-1;else return e[o+i]}return-1}var D;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(D||(D={}));var pt;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(pt||(pt={}));var Re;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Re||(Re={}));var C;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(C||(C={}));var l;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(l||(l={}));const xf=new Map([[C.A,l.A],[C.ADDRESS,l.ADDRESS],[C.ANNOTATION_XML,l.ANNOTATION_XML],[C.APPLET,l.APPLET],[C.AREA,l.AREA],[C.ARTICLE,l.ARTICLE],[C.ASIDE,l.ASIDE],[C.B,l.B],[C.BASE,l.BASE],[C.BASEFONT,l.BASEFONT],[C.BGSOUND,l.BGSOUND],[C.BIG,l.BIG],[C.BLOCKQUOTE,l.BLOCKQUOTE],[C.BODY,l.BODY],[C.BR,l.BR],[C.BUTTON,l.BUTTON],[C.CAPTION,l.CAPTION],[C.CENTER,l.CENTER],[C.CODE,l.CODE],[C.COL,l.COL],[C.COLGROUP,l.COLGROUP],[C.DD,l.DD],[C.DESC,l.DESC],[C.DETAILS,l.DETAILS],[C.DIALOG,l.DIALOG],[C.DIR,l.DIR],[C.DIV,l.DIV],[C.DL,l.DL],[C.DT,l.DT],[C.EM,l.EM],[C.EMBED,l.EMBED],[C.FIELDSET,l.FIELDSET],[C.FIGCAPTION,l.FIGCAPTION],[C.FIGURE,l.FIGURE],[C.FONT,l.FONT],[C.FOOTER,l.FOOTER],[C.FOREIGN_OBJECT,l.FOREIGN_OBJECT],[C.FORM,l.FORM],[C.FRAME,l.FRAME],[C.FRAMESET,l.FRAMESET],[C.H1,l.H1],[C.H2,l.H2],[C.H3,l.H3],[C.H4,l.H4],[C.H5,l.H5],[C.H6,l.H6],[C.HEAD,l.HEAD],[C.HEADER,l.HEADER],[C.HGROUP,l.HGROUP],[C.HR,l.HR],[C.HTML,l.HTML],[C.I,l.I],[C.IMG,l.IMG],[C.IMAGE,l.IMAGE],[C.INPUT,l.INPUT],[C.IFRAME,l.IFRAME],[C.KEYGEN,l.KEYGEN],[C.LABEL,l.LABEL],[C.LI,l.LI],[C.LINK,l.LINK],[C.LISTING,l.LISTING],[C.MAIN,l.MAIN],[C.MALIGNMARK,l.MALIGNMARK],[C.MARQUEE,l.MARQUEE],[C.MATH,l.MATH],[C.MENU,l.MENU],[C.META,l.META],[C.MGLYPH,l.MGLYPH],[C.MI,l.MI],[C.MO,l.MO],[C.MN,l.MN],[C.MS,l.MS],[C.MTEXT,l.MTEXT],[C.NAV,l.NAV],[C.NOBR,l.NOBR],[C.NOFRAMES,l.NOFRAMES],[C.NOEMBED,l.NOEMBED],[C.NOSCRIPT,l.NOSCRIPT],[C.OBJECT,l.OBJECT],[C.OL,l.OL],[C.OPTGROUP,l.OPTGROUP],[C.OPTION,l.OPTION],[C.P,l.P],[C.PARAM,l.PARAM],[C.PLAINTEXT,l.PLAINTEXT],[C.PRE,l.PRE],[C.RB,l.RB],[C.RP,l.RP],[C.RT,l.RT],[C.RTC,l.RTC],[C.RUBY,l.RUBY],[C.S,l.S],[C.SCRIPT,l.SCRIPT],[C.SEARCH,l.SEARCH],[C.SECTION,l.SECTION],[C.SELECT,l.SELECT],[C.SOURCE,l.SOURCE],[C.SMALL,l.SMALL],[C.SPAN,l.SPAN],[C.STRIKE,l.STRIKE],[C.STRONG,l.STRONG],[C.STYLE,l.STYLE],[C.SUB,l.SUB],[C.SUMMARY,l.SUMMARY],[C.SUP,l.SUP],[C.TABLE,l.TABLE],[C.TBODY,l.TBODY],[C.TEMPLATE,l.TEMPLATE],[C.TEXTAREA,l.TEXTAREA],[C.TFOOT,l.TFOOT],[C.TD,l.TD],[C.TH,l.TH],[C.THEAD,l.THEAD],[C.TITLE,l.TITLE],[C.TR,l.TR],[C.TRACK,l.TRACK],[C.TT,l.TT],[C.U,l.U],[C.UL,l.UL],[C.SVG,l.SVG],[C.VAR,l.VAR],[C.WBR,l.WBR],[C.XMP,l.XMP]]);function Ut(e){var t;return(t=xf.get(e))!==null&&t!==void 0?t:l.UNKNOWN}const P=l,kf={[D.HTML]:new Set([P.ADDRESS,P.APPLET,P.AREA,P.ARTICLE,P.ASIDE,P.BASE,P.BASEFONT,P.BGSOUND,P.BLOCKQUOTE,P.BODY,P.BR,P.BUTTON,P.CAPTION,P.CENTER,P.COL,P.COLGROUP,P.DD,P.DETAILS,P.DIR,P.DIV,P.DL,P.DT,P.EMBED,P.FIELDSET,P.FIGCAPTION,P.FIGURE,P.FOOTER,P.FORM,P.FRAME,P.FRAMESET,P.H1,P.H2,P.H3,P.H4,P.H5,P.H6,P.HEAD,P.HEADER,P.HGROUP,P.HR,P.HTML,P.IFRAME,P.IMG,P.INPUT,P.LI,P.LINK,P.LISTING,P.MAIN,P.MARQUEE,P.MENU,P.META,P.NAV,P.NOEMBED,P.NOFRAMES,P.NOSCRIPT,P.OBJECT,P.OL,P.P,P.PARAM,P.PLAINTEXT,P.PRE,P.SCRIPT,P.SECTION,P.SELECT,P.SOURCE,P.STYLE,P.SUMMARY,P.TABLE,P.TBODY,P.TD,P.TEMPLATE,P.TEXTAREA,P.TFOOT,P.TH,P.THEAD,P.TITLE,P.TR,P.TRACK,P.UL,P.WBR,P.XMP]),[D.MATHML]:new Set([P.MI,P.MO,P.MN,P.MS,P.MTEXT,P.ANNOTATION_XML]),[D.SVG]:new Set([P.TITLE,P.FOREIGN_OBJECT,P.DESC]),[D.XLINK]:new Set,[D.XML]:new Set,[D.XMLNS]:new Set},ai=new Set([P.H1,P.H2,P.H3,P.H4,P.H5,P.H6]);C.STYLE,C.SCRIPT,C.XMP,C.IFRAME,C.NOEMBED,C.NOFRAMES,C.PLAINTEXT;var E;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(E||(E={}));const fe={DATA:E.DATA,RCDATA:E.RCDATA,RAWTEXT:E.RAWTEXT,SCRIPT_DATA:E.SCRIPT_DATA,PLAINTEXT:E.PLAINTEXT,CDATA_SECTION:E.CDATA_SECTION};function yf(e){return e>=g.DIGIT_0&&e<=g.DIGIT_9}function tn(e){return e>=g.LATIN_CAPITAL_A&&e<=g.LATIN_CAPITAL_Z}function Af(e){return e>=g.LATIN_SMALL_A&&e<=g.LATIN_SMALL_Z}function tt(e){return Af(e)||tn(e)}function Vs(e){return tt(e)||yf(e)}function Mn(e){return e+32}function to(e){return e===g.SPACE||e===g.LINE_FEED||e===g.TABULATION||e===g.FORM_FEED}function Ws(e){return to(e)||e===g.SOLIDUS||e===g.GREATER_THAN_SIGN}function _f(e){return e===g.NULL?w.nullCharacterReference:e>1114111?w.characterReferenceOutsideUnicodeRange:Xu(e)?w.surrogateCharacterReference:Ju(e)?w.noncharacterCharacterReference:Zu(e)||e===g.CARRIAGE_RETURN?w.controlCharacterReference:null}class Cf{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=E.DATA,this.returnState=E.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new cf(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Ef(df,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(w.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(w.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=_f(r);i&&this._err(i,1)}}:void 0)}_err(t,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t?.())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r?.()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:J.START_TAG,tagName:"",tagID:l.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:J.END_TAG,tagName:"",tagID:l.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:J.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:J.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(eo(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const i=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);i[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(w.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=Ut(t.tagName),t.type===J.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(w.endTagWithAttributes),t.selfClosing&&this._err(w.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case J.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case J.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case J.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:J.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=to(t)?J.WHITESPACE_CHARACTER:t===g.NULL?J.NULL_CHARACTER:J.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(J.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=E.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Ke.Attribute:Ke.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===E.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===E.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===E.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case E.DATA:{this._stateData(t);break}case E.RCDATA:{this._stateRcdata(t);break}case E.RAWTEXT:{this._stateRawtext(t);break}case E.SCRIPT_DATA:{this._stateScriptData(t);break}case E.PLAINTEXT:{this._statePlaintext(t);break}case E.TAG_OPEN:{this._stateTagOpen(t);break}case E.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case E.TAG_NAME:{this._stateTagName(t);break}case E.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case E.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case E.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case E.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case E.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case E.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case E.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case E.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case E.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case E.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case E.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case E.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case E.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case E.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case E.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case E.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case E.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case E.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case E.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case E.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case E.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case E.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case E.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case E.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case E.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case E.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case E.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case E.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case E.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case E.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case E.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case E.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case E.BOGUS_COMMENT:{this._stateBogusComment(t);break}case E.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case E.COMMENT_START:{this._stateCommentStart(t);break}case E.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case E.COMMENT:{this._stateComment(t);break}case E.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case E.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case E.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case E.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case E.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case E.COMMENT_END:{this._stateCommentEnd(t);break}case E.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case E.DOCTYPE:{this._stateDoctype(t);break}case E.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case E.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case E.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case E.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case E.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case E.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case E.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case E.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case E.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case E.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case E.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case E.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case E.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case E.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case E.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case E.CDATA_SECTION:{this._stateCdataSection(t);break}case E.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case E.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case E.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case E.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case g.LESS_THAN_SIGN:{this.state=E.TAG_OPEN;break}case g.AMPERSAND:{this._startCharacterReference();break}case g.NULL:{this._err(w.unexpectedNullCharacter),this._emitCodePoint(t);break}case g.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case g.AMPERSAND:{this._startCharacterReference();break}case g.LESS_THAN_SIGN:{this.state=E.RCDATA_LESS_THAN_SIGN;break}case g.NULL:{this._err(w.unexpectedNullCharacter),this._emitChars(de);break}case g.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case g.LESS_THAN_SIGN:{this.state=E.RAWTEXT_LESS_THAN_SIGN;break}case g.NULL:{this._err(w.unexpectedNullCharacter),this._emitChars(de);break}case g.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case g.LESS_THAN_SIGN:{this.state=E.SCRIPT_DATA_LESS_THAN_SIGN;break}case g.NULL:{this._err(w.unexpectedNullCharacter),this._emitChars(de);break}case g.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case g.NULL:{this._err(w.unexpectedNullCharacter),this._emitChars(de);break}case g.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(tt(t))this._createStartTagToken(),this.state=E.TAG_NAME,this._stateTagName(t);else switch(t){case g.EXCLAMATION_MARK:{this.state=E.MARKUP_DECLARATION_OPEN;break}case g.SOLIDUS:{this.state=E.END_TAG_OPEN;break}case g.QUESTION_MARK:{this._err(w.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=E.BOGUS_COMMENT,this._stateBogusComment(t);break}case g.EOF:{this._err(w.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(w.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=E.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(tt(t))this._createEndTagToken(),this.state=E.TAG_NAME,this._stateTagName(t);else switch(t){case g.GREATER_THAN_SIGN:{this._err(w.missingEndTagName),this.state=E.DATA;break}case g.EOF:{this._err(w.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(w.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=E.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:{this.state=E.BEFORE_ATTRIBUTE_NAME;break}case g.SOLIDUS:{this.state=E.SELF_CLOSING_START_TAG;break}case g.GREATER_THAN_SIGN:{this.state=E.DATA,this.emitCurrentTagToken();break}case g.NULL:{this._err(w.unexpectedNullCharacter),n.tagName+=de;break}case g.EOF:{this._err(w.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(tn(t)?Mn(t):t)}}_stateRcdataLessThanSign(t){t===g.SOLIDUS?this.state=E.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=E.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){tt(t)?(this.state=E.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=E.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=E.BEFORE_ATTRIBUTE_NAME,!1;case g.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=E.SELF_CLOSING_START_TAG,!1;case g.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=E.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=E.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===g.SOLIDUS?this.state=E.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=E.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){tt(t)?(this.state=E.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=E.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=E.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case g.SOLIDUS:{this.state=E.SCRIPT_DATA_END_TAG_OPEN;break}case g.EXCLAMATION_MARK:{this.state=E.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=E.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){tt(t)?(this.state=E.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=E.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=E.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===g.HYPHEN_MINUS?(this.state=E.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=E.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===g.HYPHEN_MINUS?(this.state=E.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=E.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case g.HYPHEN_MINUS:{this.state=E.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case g.LESS_THAN_SIGN:{this.state=E.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case g.NULL:{this._err(w.unexpectedNullCharacter),this._emitChars(de);break}case g.EOF:{this._err(w.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case g.HYPHEN_MINUS:{this.state=E.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case g.LESS_THAN_SIGN:{this.state=E.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case g.NULL:{this._err(w.unexpectedNullCharacter),this.state=E.SCRIPT_DATA_ESCAPED,this._emitChars(de);break}case g.EOF:{this._err(w.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=E.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case g.HYPHEN_MINUS:{this._emitChars("-");break}case g.LESS_THAN_SIGN:{this.state=E.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case g.GREATER_THAN_SIGN:{this.state=E.SCRIPT_DATA,this._emitChars(">");break}case g.NULL:{this._err(w.unexpectedNullCharacter),this.state=E.SCRIPT_DATA_ESCAPED,this._emitChars(de);break}case g.EOF:{this._err(w.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=E.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===g.SOLIDUS?this.state=E.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:tt(t)?(this._emitChars("<"),this.state=E.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=E.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){tt(t)?(this.state=E.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=E.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=E.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(_e.SCRIPT,!1)&&Ws(this.preprocessor.peek(_e.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<_e.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=E.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=E.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case g.HYPHEN_MINUS:{this.state=E.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case g.LESS_THAN_SIGN:{this.state=E.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case g.NULL:{this._err(w.unexpectedNullCharacter),this._emitChars(de);break}case g.EOF:{this._err(w.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case g.HYPHEN_MINUS:{this.state=E.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case g.LESS_THAN_SIGN:{this.state=E.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case g.NULL:{this._err(w.unexpectedNullCharacter),this.state=E.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(de);break}case g.EOF:{this._err(w.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=E.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case g.HYPHEN_MINUS:{this._emitChars("-");break}case g.LESS_THAN_SIGN:{this.state=E.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case g.GREATER_THAN_SIGN:{this.state=E.SCRIPT_DATA,this._emitChars(">");break}case g.NULL:{this._err(w.unexpectedNullCharacter),this.state=E.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(de);break}case g.EOF:{this._err(w.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=E.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===g.SOLIDUS?(this.state=E.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=E.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(_e.SCRIPT,!1)&&Ws(this.preprocessor.peek(_e.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<_e.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=E.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=E.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.SOLIDUS:case g.GREATER_THAN_SIGN:case g.EOF:{this.state=E.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case g.EQUALS_SIGN:{this._err(w.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=E.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=E.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:case g.SOLIDUS:case g.GREATER_THAN_SIGN:case g.EOF:{this._leaveAttrName(),this.state=E.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case g.EQUALS_SIGN:{this._leaveAttrName(),this.state=E.BEFORE_ATTRIBUTE_VALUE;break}case g.QUOTATION_MARK:case g.APOSTROPHE:case g.LESS_THAN_SIGN:{this._err(w.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case g.NULL:{this._err(w.unexpectedNullCharacter),this.currentAttr.name+=de;break}default:this.currentAttr.name+=String.fromCodePoint(tn(t)?Mn(t):t)}}_stateAfterAttributeName(t){switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.SOLIDUS:{this.state=E.SELF_CLOSING_START_TAG;break}case g.EQUALS_SIGN:{this.state=E.BEFORE_ATTRIBUTE_VALUE;break}case g.GREATER_THAN_SIGN:{this.state=E.DATA,this.emitCurrentTagToken();break}case g.EOF:{this._err(w.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=E.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.QUOTATION_MARK:{this.state=E.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case g.APOSTROPHE:{this.state=E.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case g.GREATER_THAN_SIGN:{this._err(w.missingAttributeValue),this.state=E.DATA,this.emitCurrentTagToken();break}default:this.state=E.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case g.QUOTATION_MARK:{this.state=E.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case g.AMPERSAND:{this._startCharacterReference();break}case g.NULL:{this._err(w.unexpectedNullCharacter),this.currentAttr.value+=de;break}case g.EOF:{this._err(w.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case g.APOSTROPHE:{this.state=E.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case g.AMPERSAND:{this._startCharacterReference();break}case g.NULL:{this._err(w.unexpectedNullCharacter),this.currentAttr.value+=de;break}case g.EOF:{this._err(w.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:{this._leaveAttrValue(),this.state=E.BEFORE_ATTRIBUTE_NAME;break}case g.AMPERSAND:{this._startCharacterReference();break}case g.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=E.DATA,this.emitCurrentTagToken();break}case g.NULL:{this._err(w.unexpectedNullCharacter),this.currentAttr.value+=de;break}case g.QUOTATION_MARK:case g.APOSTROPHE:case g.LESS_THAN_SIGN:case g.EQUALS_SIGN:case g.GRAVE_ACCENT:{this._err(w.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case g.EOF:{this._err(w.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:{this._leaveAttrValue(),this.state=E.BEFORE_ATTRIBUTE_NAME;break}case g.SOLIDUS:{this._leaveAttrValue(),this.state=E.SELF_CLOSING_START_TAG;break}case g.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=E.DATA,this.emitCurrentTagToken();break}case g.EOF:{this._err(w.eofInTag),this._emitEOFToken();break}default:this._err(w.missingWhitespaceBetweenAttributes),this.state=E.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case g.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=E.DATA,this.emitCurrentTagToken();break}case g.EOF:{this._err(w.eofInTag),this._emitEOFToken();break}default:this._err(w.unexpectedSolidusInTag),this.state=E.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case g.GREATER_THAN_SIGN:{this.state=E.DATA,this.emitCurrentComment(n);break}case g.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case g.NULL:{this._err(w.unexpectedNullCharacter),n.data+=de;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(_e.DASH_DASH,!0)?(this._createCommentToken(_e.DASH_DASH.length+1),this.state=E.COMMENT_START):this._consumeSequenceIfMatch(_e.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(_e.DOCTYPE.length+1),this.state=E.DOCTYPE):this._consumeSequenceIfMatch(_e.CDATA_START,!0)?this.inForeignNode?this.state=E.CDATA_SECTION:(this._err(w.cdataInHtmlContent),this._createCommentToken(_e.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=E.BOGUS_COMMENT):this._ensureHibernation()||(this._err(w.incorrectlyOpenedComment),this._createCommentToken(2),this.state=E.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case g.HYPHEN_MINUS:{this.state=E.COMMENT_START_DASH;break}case g.GREATER_THAN_SIGN:{this._err(w.abruptClosingOfEmptyComment),this.state=E.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=E.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case g.HYPHEN_MINUS:{this.state=E.COMMENT_END;break}case g.GREATER_THAN_SIGN:{this._err(w.abruptClosingOfEmptyComment),this.state=E.DATA,this.emitCurrentComment(n);break}case g.EOF:{this._err(w.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=E.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case g.HYPHEN_MINUS:{this.state=E.COMMENT_END_DASH;break}case g.LESS_THAN_SIGN:{n.data+="<",this.state=E.COMMENT_LESS_THAN_SIGN;break}case g.NULL:{this._err(w.unexpectedNullCharacter),n.data+=de;break}case g.EOF:{this._err(w.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case g.EXCLAMATION_MARK:{n.data+="!",this.state=E.COMMENT_LESS_THAN_SIGN_BANG;break}case g.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=E.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===g.HYPHEN_MINUS?this.state=E.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=E.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===g.HYPHEN_MINUS?this.state=E.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=E.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==g.GREATER_THAN_SIGN&&t!==g.EOF&&this._err(w.nestedComment),this.state=E.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case g.HYPHEN_MINUS:{this.state=E.COMMENT_END;break}case g.EOF:{this._err(w.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=E.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case g.GREATER_THAN_SIGN:{this.state=E.DATA,this.emitCurrentComment(n);break}case g.EXCLAMATION_MARK:{this.state=E.COMMENT_END_BANG;break}case g.HYPHEN_MINUS:{n.data+="-";break}case g.EOF:{this._err(w.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=E.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case g.HYPHEN_MINUS:{n.data+="--!",this.state=E.COMMENT_END_DASH;break}case g.GREATER_THAN_SIGN:{this._err(w.incorrectlyClosedComment),this.state=E.DATA,this.emitCurrentComment(n);break}case g.EOF:{this._err(w.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=E.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:{this.state=E.BEFORE_DOCTYPE_NAME;break}case g.GREATER_THAN_SIGN:{this.state=E.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case g.EOF:{this._err(w.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(w.missingWhitespaceBeforeDoctypeName),this.state=E.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(tn(t))this._createDoctypeToken(String.fromCharCode(Mn(t))),this.state=E.DOCTYPE_NAME;else switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.NULL:{this._err(w.unexpectedNullCharacter),this._createDoctypeToken(de),this.state=E.DOCTYPE_NAME;break}case g.GREATER_THAN_SIGN:{this._err(w.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=E.DATA;break}case g.EOF:{this._err(w.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=E.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:{this.state=E.AFTER_DOCTYPE_NAME;break}case g.GREATER_THAN_SIGN:{this.state=E.DATA,this.emitCurrentDoctype(n);break}case g.NULL:{this._err(w.unexpectedNullCharacter),n.name+=de;break}case g.EOF:{this._err(w.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(tn(t)?Mn(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.GREATER_THAN_SIGN:{this.state=E.DATA,this.emitCurrentDoctype(n);break}case g.EOF:{this._err(w.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(_e.PUBLIC,!1)?this.state=E.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(_e.SYSTEM,!1)?this.state=E.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(w.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=E.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:{this.state=E.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case g.QUOTATION_MARK:{this._err(w.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=E.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case g.APOSTROPHE:{this._err(w.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=E.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case g.GREATER_THAN_SIGN:{this._err(w.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=E.DATA,this.emitCurrentDoctype(n);break}case g.EOF:{this._err(w.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(w.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=E.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.QUOTATION_MARK:{n.publicId="",this.state=E.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case g.APOSTROPHE:{n.publicId="",this.state=E.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case g.GREATER_THAN_SIGN:{this._err(w.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=E.DATA,this.emitCurrentDoctype(n);break}case g.EOF:{this._err(w.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(w.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=E.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case g.QUOTATION_MARK:{this.state=E.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case g.NULL:{this._err(w.unexpectedNullCharacter),n.publicId+=de;break}case g.GREATER_THAN_SIGN:{this._err(w.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=E.DATA;break}case g.EOF:{this._err(w.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case g.APOSTROPHE:{this.state=E.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case g.NULL:{this._err(w.unexpectedNullCharacter),n.publicId+=de;break}case g.GREATER_THAN_SIGN:{this._err(w.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=E.DATA;break}case g.EOF:{this._err(w.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:{this.state=E.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case g.GREATER_THAN_SIGN:{this.state=E.DATA,this.emitCurrentDoctype(n);break}case g.QUOTATION_MARK:{this._err(w.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=E.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case g.APOSTROPHE:{this._err(w.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=E.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case g.EOF:{this._err(w.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(w.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=E.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=E.DATA;break}case g.QUOTATION_MARK:{n.systemId="",this.state=E.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case g.APOSTROPHE:{n.systemId="",this.state=E.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case g.EOF:{this._err(w.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(w.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=E.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:{this.state=E.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case g.QUOTATION_MARK:{this._err(w.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=E.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case g.APOSTROPHE:{this._err(w.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=E.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case g.GREATER_THAN_SIGN:{this._err(w.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=E.DATA,this.emitCurrentDoctype(n);break}case g.EOF:{this._err(w.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(w.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=E.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.QUOTATION_MARK:{n.systemId="",this.state=E.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case g.APOSTROPHE:{n.systemId="",this.state=E.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case g.GREATER_THAN_SIGN:{this._err(w.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=E.DATA,this.emitCurrentDoctype(n);break}case g.EOF:{this._err(w.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(w.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=E.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case g.QUOTATION_MARK:{this.state=E.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case g.NULL:{this._err(w.unexpectedNullCharacter),n.systemId+=de;break}case g.GREATER_THAN_SIGN:{this._err(w.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=E.DATA;break}case g.EOF:{this._err(w.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case g.APOSTROPHE:{this.state=E.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case g.NULL:{this._err(w.unexpectedNullCharacter),n.systemId+=de;break}case g.GREATER_THAN_SIGN:{this._err(w.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=E.DATA;break}case g.EOF:{this._err(w.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=E.DATA;break}case g.EOF:{this._err(w.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(w.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=E.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case g.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=E.DATA;break}case g.NULL:{this._err(w.unexpectedNullCharacter);break}case g.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case g.RIGHT_SQUARE_BRACKET:{this.state=E.CDATA_SECTION_BRACKET;break}case g.EOF:{this._err(w.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===g.RIGHT_SQUARE_BRACKET?this.state=E.CDATA_SECTION_END:(this._emitChars("]"),this.state=E.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case g.GREATER_THAN_SIGN:{this.state=E.DATA;break}case g.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=E.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(g.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Vs(this.preprocessor.peek(1))?E.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){Vs(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===g.SEMICOLON&&this._err(w.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const no=new Set([l.DD,l.DT,l.LI,l.OPTGROUP,l.OPTION,l.P,l.RB,l.RP,l.RT,l.RTC]),Gs=new Set([...no,l.CAPTION,l.COLGROUP,l.TBODY,l.TD,l.TFOOT,l.TH,l.THEAD,l.TR]),tr=new Set([l.APPLET,l.CAPTION,l.HTML,l.MARQUEE,l.OBJECT,l.TABLE,l.TD,l.TEMPLATE,l.TH]),Sf=new Set([...tr,l.OL,l.UL]),Nf=new Set([...tr,l.BUTTON]),Qs=new Set([l.ANNOTATION_XML,l.MI,l.MN,l.MO,l.MS,l.MTEXT]),Ks=new Set([l.DESC,l.FOREIGN_OBJECT,l.TITLE]),If=new Set([l.TR,l.TEMPLATE,l.HTML]),wf=new Set([l.TBODY,l.TFOOT,l.THEAD,l.TEMPLATE,l.HTML]),Lf=new Set([l.TABLE,l.TEMPLATE,l.HTML]),Rf=new Set([l.TD,l.TH]);class Of{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=l.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===l.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===D.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const i=this._indexOf(t)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==D.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(ai,D.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Rf,D.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(Lf,D.HTML)}clearBackToTableBodyContext(){this.clearBackTo(wf,D.HTML)}clearBackToTableRowContext(){this.clearBackTo(If,D.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===l.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===l.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case D.HTML:{if(i===t)return!0;if(n.has(i))return!1;break}case D.SVG:{if(Ks.has(i))return!1;break}case D.MATHML:{if(Qs.has(i))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,tr)}hasInListItemScope(t){return this.hasInDynamicScope(t,Sf)}hasInButtonScope(t){return this.hasInDynamicScope(t,Nf)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case D.HTML:{if(ai.has(n))return!0;if(tr.has(n))return!1;break}case D.SVG:{if(Ks.has(n))return!1;break}case D.MATHML:{if(Qs.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===D.HTML)switch(this.tagIDs[n]){case t:return!0;case l.TABLE:case l.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===D.HTML)switch(this.tagIDs[t]){case l.TBODY:case l.THEAD:case l.TFOOT:return!0;case l.TABLE:case l.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===D.HTML)switch(this.tagIDs[n]){case t:return!0;case l.OPTION:case l.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&no.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Gs.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&Gs.has(this.currentTagId);)this.pop()}}const Dr=3;var ze;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(ze||(ze={}));const Xs={type:ze.Marker};class Df{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],i=n.length,s=this.treeAdapter.getTagName(t),a=this.treeAdapter.getNamespaceURI(t);for(let u=0;u<this.entries.length;u++){const o=this.entries[u];if(o.type===ze.Marker)break;const{element:c}=o;if(this.treeAdapter.getTagName(c)===s&&this.treeAdapter.getNamespaceURI(c)===a){const d=this.treeAdapter.getAttrList(c);d.length===i&&r.push({idx:u,attrs:d})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<Dr)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<Dr)return;const i=new Map(n.map(a=>[a.name,a.value]));let s=0;for(let a=0;a<r.length;a++){const u=r[a];u.attrs.every(o=>i.get(o.name)===o.value)&&(s+=1,s>=Dr&&this.entries.splice(u.idx,1))}}insertMarker(){this.entries.unshift(Xs)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:ze.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:ze.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(Xs);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===ze.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===ze.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===ze.Element&&n.element===t)}}const nt={createDocument(){return{nodeName:"#document",mode:Re.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const i=e.childNodes.find(s=>s.nodeName==="#documentType");if(i)i.name=t,i.publicId=n,i.systemId=r;else{const s={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};nt.appendChild(e,s)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(nt.isTextNode(n)){n.value+=t;return}}nt.appendChild(e,nt.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&nt.isTextNode(r)?r.value+=t:nt.insertBefore(e,nt.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},ro="html",Pf="about:legacy-compat",vf="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",io=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],Mf=[...io,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],Bf=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),so=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],Ff=[...so,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Zs(e,t){return t.some(n=>e.startsWith(n))}function Hf(e){return e.name===ro&&e.publicId===null&&(e.systemId===null||e.systemId===Pf)}function Uf(e){if(e.name!==ro)return Re.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===vf)return Re.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),Bf.has(n))return Re.QUIRKS;let r=t===null?Mf:io;if(Zs(n,r))return Re.QUIRKS;if(r=t===null?so:Ff,Zs(n,r))return Re.LIMITED_QUIRKS}return Re.NO_QUIRKS}const Js={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},jf="definitionurl",zf="definitionURL",$f=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),Yf=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:D.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:D.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:D.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:D.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:D.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:D.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:D.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:D.XML}],["xml:space",{prefix:"xml",name:"space",namespace:D.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:D.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:D.XMLNS}]]),qf=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),Vf=new Set([l.B,l.BIG,l.BLOCKQUOTE,l.BODY,l.BR,l.CENTER,l.CODE,l.DD,l.DIV,l.DL,l.DT,l.EM,l.EMBED,l.H1,l.H2,l.H3,l.H4,l.H5,l.H6,l.HEAD,l.HR,l.I,l.IMG,l.LI,l.LISTING,l.MENU,l.META,l.NOBR,l.OL,l.P,l.PRE,l.RUBY,l.S,l.SMALL,l.SPAN,l.STRONG,l.STRIKE,l.SUB,l.SUP,l.TABLE,l.TT,l.U,l.UL,l.VAR]);function Wf(e){const t=e.tagID;return t===l.FONT&&e.attrs.some(({name:r})=>r===pt.COLOR||r===pt.SIZE||r===pt.FACE)||Vf.has(t)}function ao(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===jf){e.attrs[t].name=zf;break}}function uo(e){for(let t=0;t<e.attrs.length;t++){const n=$f.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function Bi(e){for(let t=0;t<e.attrs.length;t++){const n=Yf.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function Gf(e){const t=qf.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Ut(e.tagName))}function Qf(e,t){return t===D.MATHML&&(e===l.MI||e===l.MO||e===l.MN||e===l.MS||e===l.MTEXT)}function Kf(e,t,n){if(t===D.MATHML&&e===l.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===pt.ENCODING){const i=n[r].value.toLowerCase();return i===Js.TEXT_HTML||i===Js.APPLICATION_XML}}return t===D.SVG&&(e===l.FOREIGN_OBJECT||e===l.DESC||e===l.TITLE)}function Xf(e,t,n,r){return(!r||r===D.HTML)&&Kf(e,t,n)||(!r||r===D.MATHML)&&Qf(e,t)}const Zf="hidden",Jf=8,e0=3;var T;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(T||(T={}));const t0={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},oo=new Set([l.TABLE,l.TBODY,l.TFOOT,l.THEAD,l.TR]),ea={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:nt,onParseError:null};class ta{constructor(t,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,this.currentToken=null,this.stopped=!1,this.insertionMode=T.INITIAL,this.originalInsertionMode=T.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...ea,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new Cf(this.options,this),this.activeFormattingElements=new Df(this.treeAdapter),this.fragmentContextID=r?Ut(this.treeAdapter.getTagName(r)):l.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new Of(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r={...ea,...n};t??(t=r.treeAdapter.createElement(C.TEMPLATE,D.HTML,[]));const i=r.treeAdapter.createElement("documentmock",D.HTML,[]),s=new this(r,i,t);return s.fragmentContextID===l.TEMPLATE&&s.tmplInsertionModeStack.unshift(T.IN_TEMPLATE),s._initTokenizerForFragmentParsing(),s._insertFakeRootElement(),s._resetInsertionMode(),s._findFormInFragmentContext(),s}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var i;if(!this.onParseError)return;const s=(i=t.location)!==null&&i!==void 0?i:t0,a={code:n,startLine:s.startLine,startCol:s.startCol,startOffset:s.startOffset,endLine:r?s.startLine:s.endLine,endCol:r?s.startCol:s.endCol,endOffset:r?s.startOffset:s.endOffset};this.onParseError(a)}onItemPush(t,n,r){var i,s;(s=(i=this.treeAdapter).onItemPush)===null||s===void 0||s.call(i,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,t,this.openElements.current),n){let s,a;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,a=this.fragmentContextID):{current:s,currentTagId:a}=this.openElements,this._setContextModes(s,a)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===D.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,D.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=T.TEXT}switchToPlaintextParsing(){this.insertionMode=T.TEXT,this.originalInsertionMode=T.IN_BODY,this.tokenizer.state=fe.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===C.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==D.HTML))switch(this.fragmentContextID){case l.TITLE:case l.TEXTAREA:{this.tokenizer.state=fe.RCDATA;break}case l.STYLE:case l.XMP:case l.IFRAME:case l.NOEMBED:case l.NOFRAMES:case l.NOSCRIPT:{this.tokenizer.state=fe.RAWTEXT;break}case l.SCRIPT:{this.tokenizer.state=fe.SCRIPT_DATA;break}case l.PLAINTEXT:{this.tokenizer.state=fe.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",i=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),t.location){const a=this.treeAdapter.getChildNodes(this.document).find(u=>this.treeAdapter.isDocumentTypeNode(u));a&&this.treeAdapter.setNodeSourceCodeLocation(a,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,D.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,D.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(C.HTML,D.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,l.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const i=this.treeAdapter.getChildNodes(n),s=r?i.lastIndexOf(r):i.length,a=i[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(a)){const{endLine:o,endCol:c,endOffset:d}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:o,endCol:c,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(t),s=n.type===J.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,s)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===l.SVG&&this.treeAdapter.getTagName(n)===C.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===D.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===l.MGLYPH||t.tagID===l.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,D.HTML)}_processToken(t){switch(t.type){case J.CHARACTER:{this.onCharacter(t);break}case J.NULL_CHARACTER:{this.onNullCharacter(t);break}case J.COMMENT:{this.onComment(t);break}case J.DOCTYPE:{this.onDoctype(t);break}case J.START_TAG:{this._processStartTag(t);break}case J.END_TAG:{this.onEndTag(t);break}case J.EOF:{this.onEof(t);break}case J.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const i=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return Xf(t,i,s,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===ze.Marker||this.openElements.contains(i.element)),r=n===-1?t-1:n-1;for(let i=r;i>=0;i--){const s=this.activeFormattingElements.entries[i];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=T.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(l.P),this.openElements.popUntilTagNamePopped(l.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case l.TR:{this.insertionMode=T.IN_ROW;return}case l.TBODY:case l.THEAD:case l.TFOOT:{this.insertionMode=T.IN_TABLE_BODY;return}case l.CAPTION:{this.insertionMode=T.IN_CAPTION;return}case l.COLGROUP:{this.insertionMode=T.IN_COLUMN_GROUP;return}case l.TABLE:{this.insertionMode=T.IN_TABLE;return}case l.BODY:{this.insertionMode=T.IN_BODY;return}case l.FRAMESET:{this.insertionMode=T.IN_FRAMESET;return}case l.SELECT:{this._resetInsertionModeForSelect(t);return}case l.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case l.HTML:{this.insertionMode=this.headElement?T.AFTER_HEAD:T.BEFORE_HEAD;return}case l.TD:case l.TH:{if(t>0){this.insertionMode=T.IN_CELL;return}break}case l.HEAD:{if(t>0){this.insertionMode=T.IN_HEAD;return}break}}this.insertionMode=T.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===l.TEMPLATE)break;if(r===l.TABLE){this.insertionMode=T.IN_SELECT_IN_TABLE;return}}this.insertionMode=T.IN_SELECT}_isElementCausesFosterParenting(t){return oo.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case l.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===D.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case l.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return kf[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Rm(this,t);return}switch(this.insertionMode){case T.INITIAL:{Wt(this,t);break}case T.BEFORE_HTML:{sn(this,t);break}case T.BEFORE_HEAD:{an(this,t);break}case T.IN_HEAD:{un(this,t);break}case T.IN_HEAD_NO_SCRIPT:{on(this,t);break}case T.AFTER_HEAD:{ln(this,t);break}case T.IN_BODY:case T.IN_CAPTION:case T.IN_CELL:case T.IN_TEMPLATE:{co(this,t);break}case T.TEXT:case T.IN_SELECT:case T.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case T.IN_TABLE:case T.IN_TABLE_BODY:case T.IN_ROW:{Pr(this,t);break}case T.IN_TABLE_TEXT:{bo(this,t);break}case T.IN_COLUMN_GROUP:{nr(this,t);break}case T.AFTER_BODY:{rr(this,t);break}case T.AFTER_AFTER_BODY:{Vn(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Lm(this,t);return}switch(this.insertionMode){case T.INITIAL:{Wt(this,t);break}case T.BEFORE_HTML:{sn(this,t);break}case T.BEFORE_HEAD:{an(this,t);break}case T.IN_HEAD:{un(this,t);break}case T.IN_HEAD_NO_SCRIPT:{on(this,t);break}case T.AFTER_HEAD:{ln(this,t);break}case T.TEXT:{this._insertCharacters(t);break}case T.IN_TABLE:case T.IN_TABLE_BODY:case T.IN_ROW:{Pr(this,t);break}case T.IN_COLUMN_GROUP:{nr(this,t);break}case T.AFTER_BODY:{rr(this,t);break}case T.AFTER_AFTER_BODY:{Vn(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){ui(this,t);return}switch(this.insertionMode){case T.INITIAL:case T.BEFORE_HTML:case T.BEFORE_HEAD:case T.IN_HEAD:case T.IN_HEAD_NO_SCRIPT:case T.AFTER_HEAD:case T.IN_BODY:case T.IN_TABLE:case T.IN_CAPTION:case T.IN_COLUMN_GROUP:case T.IN_TABLE_BODY:case T.IN_ROW:case T.IN_CELL:case T.IN_SELECT:case T.IN_SELECT_IN_TABLE:case T.IN_TEMPLATE:case T.IN_FRAMESET:case T.AFTER_FRAMESET:{ui(this,t);break}case T.IN_TABLE_TEXT:{Gt(this,t);break}case T.AFTER_BODY:{o0(this,t);break}case T.AFTER_AFTER_BODY:case T.AFTER_AFTER_FRAMESET:{l0(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case T.INITIAL:{c0(this,t);break}case T.BEFORE_HEAD:case T.IN_HEAD:case T.IN_HEAD_NO_SCRIPT:case T.AFTER_HEAD:{this._err(t,w.misplacedDoctype);break}case T.IN_TABLE_TEXT:{Gt(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,w.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?Om(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case T.INITIAL:{Wt(this,t);break}case T.BEFORE_HTML:{d0(this,t);break}case T.BEFORE_HEAD:{f0(this,t);break}case T.IN_HEAD:{Ue(this,t);break}case T.IN_HEAD_NO_SCRIPT:{g0(this,t);break}case T.AFTER_HEAD:{E0(this,t);break}case T.IN_BODY:{Te(this,t);break}case T.IN_TABLE:{Mt(this,t);break}case T.IN_TABLE_TEXT:{Gt(this,t);break}case T.IN_CAPTION:{mm(this,t);break}case T.IN_COLUMN_GROUP:{Ui(this,t);break}case T.IN_TABLE_BODY:{xr(this,t);break}case T.IN_ROW:{kr(this,t);break}case T.IN_CELL:{bm(this,t);break}case T.IN_SELECT:{xo(this,t);break}case T.IN_SELECT_IN_TABLE:{Tm(this,t);break}case T.IN_TEMPLATE:{km(this,t);break}case T.AFTER_BODY:{Am(this,t);break}case T.IN_FRAMESET:{_m(this,t);break}case T.AFTER_FRAMESET:{Sm(this,t);break}case T.AFTER_AFTER_BODY:{Im(this,t);break}case T.AFTER_AFTER_FRAMESET:{wm(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?Dm(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case T.INITIAL:{Wt(this,t);break}case T.BEFORE_HTML:{h0(this,t);break}case T.BEFORE_HEAD:{m0(this,t);break}case T.IN_HEAD:{p0(this,t);break}case T.IN_HEAD_NO_SCRIPT:{b0(this,t);break}case T.AFTER_HEAD:{T0(this,t);break}case T.IN_BODY:{Tr(this,t);break}case T.TEXT:{im(this,t);break}case T.IN_TABLE:{bn(this,t);break}case T.IN_TABLE_TEXT:{Gt(this,t);break}case T.IN_CAPTION:{pm(this,t);break}case T.IN_COLUMN_GROUP:{gm(this,t);break}case T.IN_TABLE_BODY:{oi(this,t);break}case T.IN_ROW:{To(this,t);break}case T.IN_CELL:{Em(this,t);break}case T.IN_SELECT:{ko(this,t);break}case T.IN_SELECT_IN_TABLE:{xm(this,t);break}case T.IN_TEMPLATE:{ym(this,t);break}case T.AFTER_BODY:{Ao(this,t);break}case T.IN_FRAMESET:{Cm(this,t);break}case T.AFTER_FRAMESET:{Nm(this,t);break}case T.AFTER_AFTER_BODY:{Vn(this,t);break}}}onEof(t){switch(this.insertionMode){case T.INITIAL:{Wt(this,t);break}case T.BEFORE_HTML:{sn(this,t);break}case T.BEFORE_HEAD:{an(this,t);break}case T.IN_HEAD:{un(this,t);break}case T.IN_HEAD_NO_SCRIPT:{on(this,t);break}case T.AFTER_HEAD:{ln(this,t);break}case T.IN_BODY:case T.IN_TABLE:case T.IN_CAPTION:case T.IN_COLUMN_GROUP:case T.IN_TABLE_BODY:case T.IN_ROW:case T.IN_CELL:case T.IN_SELECT:case T.IN_SELECT_IN_TABLE:{po(this,t);break}case T.TEXT:{sm(this,t);break}case T.IN_TABLE_TEXT:{Gt(this,t);break}case T.IN_TEMPLATE:{yo(this,t);break}case T.AFTER_BODY:case T.IN_FRAMESET:case T.AFTER_FRAMESET:case T.AFTER_AFTER_BODY:case T.AFTER_AFTER_FRAMESET:{Hi(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===g.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case T.IN_HEAD:case T.IN_HEAD_NO_SCRIPT:case T.AFTER_HEAD:case T.TEXT:case T.IN_COLUMN_GROUP:case T.IN_SELECT:case T.IN_SELECT_IN_TABLE:case T.IN_FRAMESET:case T.AFTER_FRAMESET:{this._insertCharacters(t);break}case T.IN_BODY:case T.IN_CAPTION:case T.IN_CELL:case T.IN_TEMPLATE:case T.AFTER_BODY:case T.AFTER_AFTER_BODY:case T.AFTER_AFTER_FRAMESET:{lo(this,t);break}case T.IN_TABLE:case T.IN_TABLE_BODY:case T.IN_ROW:{Pr(this,t);break}case T.IN_TABLE_TEXT:{go(this,t);break}}}}function n0(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):mo(e,t),n}function r0(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function i0(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let s=0,a=i;a!==n;s++,a=i){i=e.openElements.getCommonAncestor(a);const u=e.activeFormattingElements.getElementEntry(a),o=u&&s>=e0;!u||o?(o&&e.activeFormattingElements.removeEntry(u),e.openElements.remove(a)):(a=s0(e,u),r===t&&(e.activeFormattingElements.bookmark=u),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(a,r),r=a)}return r}function s0(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function a0(e,t,n){const r=e.treeAdapter.getTagName(t),i=Ut(r);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);i===l.TEMPLATE&&s===D.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function u0(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,s=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,s),e.treeAdapter.appendChild(t,s),e.activeFormattingElements.insertElementAfterBookmark(s,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,s,i.tagID)}function Fi(e,t){for(let n=0;n<Jf;n++){const r=n0(e,t);if(!r)break;const i=r0(e,r);if(!i)break;e.activeFormattingElements.bookmark=r;const s=i0(e,i,r.element),a=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(s),a&&a0(e,a,s),u0(e,i,r)}}function ui(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function o0(e,t){e._appendCommentNode(t,e.openElements.items[0])}function l0(e,t){e._appendCommentNode(t,e.document)}function Hi(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],i=e.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const s=e.openElements.items[1],a=e.treeAdapter.getNodeSourceCodeLocation(s);a&&!a.endTag&&e._setEndLocation(s,t)}}}}function c0(e,t){e._setDocumentType(t);const n=t.forceQuirks?Re.QUIRKS:Uf(t);Hf(t)||e._err(t,w.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=T.BEFORE_HTML}function Wt(e,t){e._err(t,w.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Re.QUIRKS),e.insertionMode=T.BEFORE_HTML,e._processToken(t)}function d0(e,t){t.tagID===l.HTML?(e._insertElement(t,D.HTML),e.insertionMode=T.BEFORE_HEAD):sn(e,t)}function h0(e,t){const n=t.tagID;(n===l.HTML||n===l.HEAD||n===l.BODY||n===l.BR)&&sn(e,t)}function sn(e,t){e._insertFakeRootElement(),e.insertionMode=T.BEFORE_HEAD,e._processToken(t)}function f0(e,t){switch(t.tagID){case l.HTML:{Te(e,t);break}case l.HEAD:{e._insertElement(t,D.HTML),e.headElement=e.openElements.current,e.insertionMode=T.IN_HEAD;break}default:an(e,t)}}function m0(e,t){const n=t.tagID;n===l.HEAD||n===l.BODY||n===l.HTML||n===l.BR?an(e,t):e._err(t,w.endTagWithoutMatchingOpenElement)}function an(e,t){e._insertFakeElement(C.HEAD,l.HEAD),e.headElement=e.openElements.current,e.insertionMode=T.IN_HEAD,e._processToken(t)}function Ue(e,t){switch(t.tagID){case l.HTML:{Te(e,t);break}case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:{e._appendElement(t,D.HTML),t.ackSelfClosing=!0;break}case l.TITLE:{e._switchToTextParsing(t,fe.RCDATA);break}case l.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,fe.RAWTEXT):(e._insertElement(t,D.HTML),e.insertionMode=T.IN_HEAD_NO_SCRIPT);break}case l.NOFRAMES:case l.STYLE:{e._switchToTextParsing(t,fe.RAWTEXT);break}case l.SCRIPT:{e._switchToTextParsing(t,fe.SCRIPT_DATA);break}case l.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=T.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(T.IN_TEMPLATE);break}case l.HEAD:{e._err(t,w.misplacedStartTagForHeadElement);break}default:un(e,t)}}function p0(e,t){switch(t.tagID){case l.HEAD:{e.openElements.pop(),e.insertionMode=T.AFTER_HEAD;break}case l.BODY:case l.BR:case l.HTML:{un(e,t);break}case l.TEMPLATE:{kt(e,t);break}default:e._err(t,w.endTagWithoutMatchingOpenElement)}}function kt(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==l.TEMPLATE&&e._err(t,w.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(l.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,w.endTagWithoutMatchingOpenElement)}function un(e,t){e.openElements.pop(),e.insertionMode=T.AFTER_HEAD,e._processToken(t)}function g0(e,t){switch(t.tagID){case l.HTML:{Te(e,t);break}case l.BASEFONT:case l.BGSOUND:case l.HEAD:case l.LINK:case l.META:case l.NOFRAMES:case l.STYLE:{Ue(e,t);break}case l.NOSCRIPT:{e._err(t,w.nestedNoscriptInHead);break}default:on(e,t)}}function b0(e,t){switch(t.tagID){case l.NOSCRIPT:{e.openElements.pop(),e.insertionMode=T.IN_HEAD;break}case l.BR:{on(e,t);break}default:e._err(t,w.endTagWithoutMatchingOpenElement)}}function on(e,t){const n=t.type===J.EOF?w.openElementsLeftAfterEof:w.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=T.IN_HEAD,e._processToken(t)}function E0(e,t){switch(t.tagID){case l.HTML:{Te(e,t);break}case l.BODY:{e._insertElement(t,D.HTML),e.framesetOk=!1,e.insertionMode=T.IN_BODY;break}case l.FRAMESET:{e._insertElement(t,D.HTML),e.insertionMode=T.IN_FRAMESET;break}case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:case l.NOFRAMES:case l.SCRIPT:case l.STYLE:case l.TEMPLATE:case l.TITLE:{e._err(t,w.abandonedHeadElementChild),e.openElements.push(e.headElement,l.HEAD),Ue(e,t),e.openElements.remove(e.headElement);break}case l.HEAD:{e._err(t,w.misplacedStartTagForHeadElement);break}default:ln(e,t)}}function T0(e,t){switch(t.tagID){case l.BODY:case l.HTML:case l.BR:{ln(e,t);break}case l.TEMPLATE:{kt(e,t);break}default:e._err(t,w.endTagWithoutMatchingOpenElement)}}function ln(e,t){e._insertFakeElement(C.BODY,l.BODY),e.insertionMode=T.IN_BODY,Er(e,t)}function Er(e,t){switch(t.type){case J.CHARACTER:{co(e,t);break}case J.WHITESPACE_CHARACTER:{lo(e,t);break}case J.COMMENT:{ui(e,t);break}case J.START_TAG:{Te(e,t);break}case J.END_TAG:{Tr(e,t);break}case J.EOF:{po(e,t);break}}}function lo(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function co(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function x0(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function k0(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function y0(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,D.HTML),e.insertionMode=T.IN_FRAMESET)}function A0(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,D.HTML)}function _0(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&ai.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,D.HTML)}function C0(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,D.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function S0(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,D.HTML),n||(e.formElement=e.openElements.current))}function N0(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const i=e.openElements.tagIDs[r];if(n===l.LI&&i===l.LI||(n===l.DD||n===l.DT)&&(i===l.DD||i===l.DT)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(i!==l.ADDRESS&&i!==l.DIV&&i!==l.P&&e._isSpecialElement(e.openElements.items[r],i))break}e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,D.HTML)}function I0(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,D.HTML),e.tokenizer.state=fe.PLAINTEXT}function w0(e,t){e.openElements.hasInScope(l.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(l.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,D.HTML),e.framesetOk=!1}function L0(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(C.A);n&&(Fi(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,D.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function R0(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,D.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function O0(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(l.NOBR)&&(Fi(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,D.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function D0(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,D.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function P0(e,t){e.treeAdapter.getDocumentMode(e.document)!==Re.QUIRKS&&e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,D.HTML),e.framesetOk=!1,e.insertionMode=T.IN_TABLE}function ho(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,D.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function fo(e){const t=eo(e,pt.TYPE);return t!=null&&t.toLowerCase()===Zf}function v0(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,D.HTML),fo(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function M0(e,t){e._appendElement(t,D.HTML),t.ackSelfClosing=!0}function B0(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._appendElement(t,D.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function F0(e,t){t.tagName=C.IMG,t.tagID=l.IMG,ho(e,t)}function H0(e,t){e._insertElement(t,D.HTML),e.skipNextNewLine=!0,e.tokenizer.state=fe.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=T.TEXT}function U0(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,fe.RAWTEXT)}function j0(e,t){e.framesetOk=!1,e._switchToTextParsing(t,fe.RAWTEXT)}function na(e,t){e._switchToTextParsing(t,fe.RAWTEXT)}function z0(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,D.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===T.IN_TABLE||e.insertionMode===T.IN_CAPTION||e.insertionMode===T.IN_TABLE_BODY||e.insertionMode===T.IN_ROW||e.insertionMode===T.IN_CELL?T.IN_SELECT_IN_TABLE:T.IN_SELECT}function $0(e,t){e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,D.HTML)}function Y0(e,t){e.openElements.hasInScope(l.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,D.HTML)}function q0(e,t){e.openElements.hasInScope(l.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(l.RTC),e._insertElement(t,D.HTML)}function V0(e,t){e._reconstructActiveFormattingElements(),ao(t),Bi(t),t.selfClosing?e._appendElement(t,D.MATHML):e._insertElement(t,D.MATHML),t.ackSelfClosing=!0}function W0(e,t){e._reconstructActiveFormattingElements(),uo(t),Bi(t),t.selfClosing?e._appendElement(t,D.SVG):e._insertElement(t,D.SVG),t.ackSelfClosing=!0}function ra(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,D.HTML)}function Te(e,t){switch(t.tagID){case l.I:case l.S:case l.B:case l.U:case l.EM:case l.TT:case l.BIG:case l.CODE:case l.FONT:case l.SMALL:case l.STRIKE:case l.STRONG:{R0(e,t);break}case l.A:{L0(e,t);break}case l.H1:case l.H2:case l.H3:case l.H4:case l.H5:case l.H6:{_0(e,t);break}case l.P:case l.DL:case l.OL:case l.UL:case l.DIV:case l.DIR:case l.NAV:case l.MAIN:case l.MENU:case l.ASIDE:case l.CENTER:case l.FIGURE:case l.FOOTER:case l.HEADER:case l.HGROUP:case l.DIALOG:case l.DETAILS:case l.ADDRESS:case l.ARTICLE:case l.SEARCH:case l.SECTION:case l.SUMMARY:case l.FIELDSET:case l.BLOCKQUOTE:case l.FIGCAPTION:{A0(e,t);break}case l.LI:case l.DD:case l.DT:{N0(e,t);break}case l.BR:case l.IMG:case l.WBR:case l.AREA:case l.EMBED:case l.KEYGEN:{ho(e,t);break}case l.HR:{B0(e,t);break}case l.RB:case l.RTC:{Y0(e,t);break}case l.RT:case l.RP:{q0(e,t);break}case l.PRE:case l.LISTING:{C0(e,t);break}case l.XMP:{U0(e,t);break}case l.SVG:{W0(e,t);break}case l.HTML:{x0(e,t);break}case l.BASE:case l.LINK:case l.META:case l.STYLE:case l.TITLE:case l.SCRIPT:case l.BGSOUND:case l.BASEFONT:case l.TEMPLATE:{Ue(e,t);break}case l.BODY:{k0(e,t);break}case l.FORM:{S0(e,t);break}case l.NOBR:{O0(e,t);break}case l.MATH:{V0(e,t);break}case l.TABLE:{P0(e,t);break}case l.INPUT:{v0(e,t);break}case l.PARAM:case l.TRACK:case l.SOURCE:{M0(e,t);break}case l.IMAGE:{F0(e,t);break}case l.BUTTON:{w0(e,t);break}case l.APPLET:case l.OBJECT:case l.MARQUEE:{D0(e,t);break}case l.IFRAME:{j0(e,t);break}case l.SELECT:{z0(e,t);break}case l.OPTION:case l.OPTGROUP:{$0(e,t);break}case l.NOEMBED:case l.NOFRAMES:{na(e,t);break}case l.FRAMESET:{y0(e,t);break}case l.TEXTAREA:{H0(e,t);break}case l.NOSCRIPT:{e.options.scriptingEnabled?na(e,t):ra(e,t);break}case l.PLAINTEXT:{I0(e,t);break}case l.COL:case l.TH:case l.TD:case l.TR:case l.HEAD:case l.FRAME:case l.TBODY:case l.TFOOT:case l.THEAD:case l.CAPTION:case l.COLGROUP:break;default:ra(e,t)}}function G0(e,t){if(e.openElements.hasInScope(l.BODY)&&(e.insertionMode=T.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function Q0(e,t){e.openElements.hasInScope(l.BODY)&&(e.insertionMode=T.AFTER_BODY,Ao(e,t))}function K0(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function X0(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(l.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(l.FORM):n&&e.openElements.remove(n))}function Z0(e){e.openElements.hasInButtonScope(l.P)||e._insertFakeElement(C.P,l.P),e._closePElement()}function J0(e){e.openElements.hasInListItemScope(l.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(l.LI),e.openElements.popUntilTagNamePopped(l.LI))}function em(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function tm(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function nm(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function rm(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(C.BR,l.BR),e.openElements.pop(),e.framesetOk=!1}function mo(e,t){const n=t.tagName,r=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){const s=e.openElements.items[i],a=e.openElements.tagIDs[i];if(r===a&&(r!==l.UNKNOWN||e.treeAdapter.getTagName(s)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=i&&e.openElements.shortenToLength(i);break}if(e._isSpecialElement(s,a))break}}function Tr(e,t){switch(t.tagID){case l.A:case l.B:case l.I:case l.S:case l.U:case l.EM:case l.TT:case l.BIG:case l.CODE:case l.FONT:case l.NOBR:case l.SMALL:case l.STRIKE:case l.STRONG:{Fi(e,t);break}case l.P:{Z0(e);break}case l.DL:case l.UL:case l.OL:case l.DIR:case l.DIV:case l.NAV:case l.PRE:case l.MAIN:case l.MENU:case l.ASIDE:case l.BUTTON:case l.CENTER:case l.FIGURE:case l.FOOTER:case l.HEADER:case l.HGROUP:case l.DIALOG:case l.ADDRESS:case l.ARTICLE:case l.DETAILS:case l.SEARCH:case l.SECTION:case l.SUMMARY:case l.LISTING:case l.FIELDSET:case l.BLOCKQUOTE:case l.FIGCAPTION:{K0(e,t);break}case l.LI:{J0(e);break}case l.DD:case l.DT:{em(e,t);break}case l.H1:case l.H2:case l.H3:case l.H4:case l.H5:case l.H6:{tm(e);break}case l.BR:{rm(e);break}case l.BODY:{G0(e,t);break}case l.HTML:{Q0(e,t);break}case l.FORM:{X0(e);break}case l.APPLET:case l.OBJECT:case l.MARQUEE:{nm(e,t);break}case l.TEMPLATE:{kt(e,t);break}default:mo(e,t)}}function po(e,t){e.tmplInsertionModeStack.length>0?yo(e,t):Hi(e,t)}function im(e,t){var n;t.tagID===l.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function sm(e,t){e._err(t,w.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Pr(e,t){if(e.openElements.currentTagId!==void 0&&oo.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=T.IN_TABLE_TEXT,t.type){case J.CHARACTER:{bo(e,t);break}case J.WHITESPACE_CHARACTER:{go(e,t);break}}else Sn(e,t)}function am(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,D.HTML),e.insertionMode=T.IN_CAPTION}function um(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,D.HTML),e.insertionMode=T.IN_COLUMN_GROUP}function om(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(C.COLGROUP,l.COLGROUP),e.insertionMode=T.IN_COLUMN_GROUP,Ui(e,t)}function lm(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,D.HTML),e.insertionMode=T.IN_TABLE_BODY}function cm(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(C.TBODY,l.TBODY),e.insertionMode=T.IN_TABLE_BODY,xr(e,t)}function dm(e,t){e.openElements.hasInTableScope(l.TABLE)&&(e.openElements.popUntilTagNamePopped(l.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function hm(e,t){fo(t)?e._appendElement(t,D.HTML):Sn(e,t),t.ackSelfClosing=!0}function fm(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,D.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Mt(e,t){switch(t.tagID){case l.TD:case l.TH:case l.TR:{cm(e,t);break}case l.STYLE:case l.SCRIPT:case l.TEMPLATE:{Ue(e,t);break}case l.COL:{om(e,t);break}case l.FORM:{fm(e,t);break}case l.TABLE:{dm(e,t);break}case l.TBODY:case l.TFOOT:case l.THEAD:{lm(e,t);break}case l.INPUT:{hm(e,t);break}case l.CAPTION:{am(e,t);break}case l.COLGROUP:{um(e,t);break}default:Sn(e,t)}}function bn(e,t){switch(t.tagID){case l.TABLE:{e.openElements.hasInTableScope(l.TABLE)&&(e.openElements.popUntilTagNamePopped(l.TABLE),e._resetInsertionMode());break}case l.TEMPLATE:{kt(e,t);break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TBODY:case l.TD:case l.TFOOT:case l.TH:case l.THEAD:case l.TR:break;default:Sn(e,t)}}function Sn(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Er(e,t),e.fosterParentingEnabled=n}function go(e,t){e.pendingCharacterTokens.push(t)}function bo(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Gt(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)Sn(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const Eo=new Set([l.CAPTION,l.COL,l.COLGROUP,l.TBODY,l.TD,l.TFOOT,l.TH,l.THEAD,l.TR]);function mm(e,t){const n=t.tagID;Eo.has(n)?e.openElements.hasInTableScope(l.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(l.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=T.IN_TABLE,Mt(e,t)):Te(e,t)}function pm(e,t){const n=t.tagID;switch(n){case l.CAPTION:case l.TABLE:{e.openElements.hasInTableScope(l.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(l.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=T.IN_TABLE,n===l.TABLE&&bn(e,t));break}case l.BODY:case l.COL:case l.COLGROUP:case l.HTML:case l.TBODY:case l.TD:case l.TFOOT:case l.TH:case l.THEAD:case l.TR:break;default:Tr(e,t)}}function Ui(e,t){switch(t.tagID){case l.HTML:{Te(e,t);break}case l.COL:{e._appendElement(t,D.HTML),t.ackSelfClosing=!0;break}case l.TEMPLATE:{Ue(e,t);break}default:nr(e,t)}}function gm(e,t){switch(t.tagID){case l.COLGROUP:{e.openElements.currentTagId===l.COLGROUP&&(e.openElements.pop(),e.insertionMode=T.IN_TABLE);break}case l.TEMPLATE:{kt(e,t);break}case l.COL:break;default:nr(e,t)}}function nr(e,t){e.openElements.currentTagId===l.COLGROUP&&(e.openElements.pop(),e.insertionMode=T.IN_TABLE,e._processToken(t))}function xr(e,t){switch(t.tagID){case l.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,D.HTML),e.insertionMode=T.IN_ROW;break}case l.TH:case l.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(C.TR,l.TR),e.insertionMode=T.IN_ROW,kr(e,t);break}case l.CAPTION:case l.COL:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=T.IN_TABLE,Mt(e,t));break}default:Mt(e,t)}}function oi(e,t){const n=t.tagID;switch(t.tagID){case l.TBODY:case l.TFOOT:case l.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=T.IN_TABLE);break}case l.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=T.IN_TABLE,bn(e,t));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TD:case l.TH:case l.TR:break;default:bn(e,t)}}function kr(e,t){switch(t.tagID){case l.TH:case l.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,D.HTML),e.insertionMode=T.IN_CELL,e.activeFormattingElements.insertMarker();break}case l.CAPTION:case l.COL:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:case l.TR:{e.openElements.hasInTableScope(l.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=T.IN_TABLE_BODY,xr(e,t));break}default:Mt(e,t)}}function To(e,t){switch(t.tagID){case l.TR:{e.openElements.hasInTableScope(l.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=T.IN_TABLE_BODY);break}case l.TABLE:{e.openElements.hasInTableScope(l.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=T.IN_TABLE_BODY,oi(e,t));break}case l.TBODY:case l.TFOOT:case l.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(l.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=T.IN_TABLE_BODY,oi(e,t));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TD:case l.TH:break;default:bn(e,t)}}function bm(e,t){const n=t.tagID;Eo.has(n)?(e.openElements.hasInTableScope(l.TD)||e.openElements.hasInTableScope(l.TH))&&(e._closeTableCell(),kr(e,t)):Te(e,t)}function Em(e,t){const n=t.tagID;switch(n){case l.TD:case l.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=T.IN_ROW);break}case l.TABLE:case l.TBODY:case l.TFOOT:case l.THEAD:case l.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),To(e,t));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:break;default:Tr(e,t)}}function xo(e,t){switch(t.tagID){case l.HTML:{Te(e,t);break}case l.OPTION:{e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e._insertElement(t,D.HTML);break}case l.OPTGROUP:{e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e.openElements.currentTagId===l.OPTGROUP&&e.openElements.pop(),e._insertElement(t,D.HTML);break}case l.HR:{e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e.openElements.currentTagId===l.OPTGROUP&&e.openElements.pop(),e._appendElement(t,D.HTML),t.ackSelfClosing=!0;break}case l.INPUT:case l.KEYGEN:case l.TEXTAREA:case l.SELECT:{e.openElements.hasInSelectScope(l.SELECT)&&(e.openElements.popUntilTagNamePopped(l.SELECT),e._resetInsertionMode(),t.tagID!==l.SELECT&&e._processStartTag(t));break}case l.SCRIPT:case l.TEMPLATE:{Ue(e,t);break}}}function ko(e,t){switch(t.tagID){case l.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===l.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===l.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===l.OPTGROUP&&e.openElements.pop();break}case l.OPTION:{e.openElements.currentTagId===l.OPTION&&e.openElements.pop();break}case l.SELECT:{e.openElements.hasInSelectScope(l.SELECT)&&(e.openElements.popUntilTagNamePopped(l.SELECT),e._resetInsertionMode());break}case l.TEMPLATE:{kt(e,t);break}}}function Tm(e,t){const n=t.tagID;n===l.CAPTION||n===l.TABLE||n===l.TBODY||n===l.TFOOT||n===l.THEAD||n===l.TR||n===l.TD||n===l.TH?(e.openElements.popUntilTagNamePopped(l.SELECT),e._resetInsertionMode(),e._processStartTag(t)):xo(e,t)}function xm(e,t){const n=t.tagID;n===l.CAPTION||n===l.TABLE||n===l.TBODY||n===l.TFOOT||n===l.THEAD||n===l.TR||n===l.TD||n===l.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(l.SELECT),e._resetInsertionMode(),e.onEndTag(t)):ko(e,t)}function km(e,t){switch(t.tagID){case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:case l.NOFRAMES:case l.SCRIPT:case l.STYLE:case l.TEMPLATE:case l.TITLE:{Ue(e,t);break}case l.CAPTION:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:{e.tmplInsertionModeStack[0]=T.IN_TABLE,e.insertionMode=T.IN_TABLE,Mt(e,t);break}case l.COL:{e.tmplInsertionModeStack[0]=T.IN_COLUMN_GROUP,e.insertionMode=T.IN_COLUMN_GROUP,Ui(e,t);break}case l.TR:{e.tmplInsertionModeStack[0]=T.IN_TABLE_BODY,e.insertionMode=T.IN_TABLE_BODY,xr(e,t);break}case l.TD:case l.TH:{e.tmplInsertionModeStack[0]=T.IN_ROW,e.insertionMode=T.IN_ROW,kr(e,t);break}default:e.tmplInsertionModeStack[0]=T.IN_BODY,e.insertionMode=T.IN_BODY,Te(e,t)}}function ym(e,t){t.tagID===l.TEMPLATE&&kt(e,t)}function yo(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(l.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Hi(e,t)}function Am(e,t){t.tagID===l.HTML?Te(e,t):rr(e,t)}function Ao(e,t){var n;if(t.tagID===l.HTML){if(e.fragmentContext||(e.insertionMode=T.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===l.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else rr(e,t)}function rr(e,t){e.insertionMode=T.IN_BODY,Er(e,t)}function _m(e,t){switch(t.tagID){case l.HTML:{Te(e,t);break}case l.FRAMESET:{e._insertElement(t,D.HTML);break}case l.FRAME:{e._appendElement(t,D.HTML),t.ackSelfClosing=!0;break}case l.NOFRAMES:{Ue(e,t);break}}}function Cm(e,t){t.tagID===l.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==l.FRAMESET&&(e.insertionMode=T.AFTER_FRAMESET))}function Sm(e,t){switch(t.tagID){case l.HTML:{Te(e,t);break}case l.NOFRAMES:{Ue(e,t);break}}}function Nm(e,t){t.tagID===l.HTML&&(e.insertionMode=T.AFTER_AFTER_FRAMESET)}function Im(e,t){t.tagID===l.HTML?Te(e,t):Vn(e,t)}function Vn(e,t){e.insertionMode=T.IN_BODY,Er(e,t)}function wm(e,t){switch(t.tagID){case l.HTML:{Te(e,t);break}case l.NOFRAMES:{Ue(e,t);break}}}function Lm(e,t){t.chars=de,e._insertCharacters(t)}function Rm(e,t){e._insertCharacters(t),e.framesetOk=!1}function _o(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==D.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Om(e,t){if(Wf(t))_o(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===D.MATHML?ao(t):r===D.SVG&&(Gf(t),uo(t)),Bi(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function Dm(e,t){if(t.tagID===l.P||t.tagID===l.BR){_o(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===D.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}C.AREA,C.BASE,C.BASEFONT,C.BGSOUND,C.BR,C.COL,C.EMBED,C.FRAME,C.HR,C.IMG,C.INPUT,C.KEYGEN,C.LINK,C.META,C.PARAM,C.SOURCE,C.TRACK,C.WBR;const yr=Co("end"),Ye=Co("start");function Co(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function So(e){const t=Ye(e),n=yr(e);if(t&&n)return{start:t,end:n}}const Pm=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,vm=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),ia={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function No(e,t){const n=qm(e),r=Qu("type",{handlers:{root:Mm,element:Bm,text:Fm,comment:wo,doctype:Hm,raw:jm},unknown:zm}),i={parser:n?new ta(ia):ta.getFragmentParser(void 0,ia),handle(u){r(u,i)},stitches:!1,options:t||{}};r(e,i),jt(i,Ye());const s=n?i.parser.document:i.parser.getFragment(),a=qh(s,{file:i.options.file});return i.stitches&&st(a,"comment",function(u,o,c){const d=u;if(d.value.stitch&&c&&o!==void 0){const h=c.children;return h[o]=d.value.stitch,o}}),a.type==="root"&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function Io(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function Mm(e,t){Io(e.children,t)}function Bm(e,t){$m(e,t),Io(e.children,t),Ym(e,t)}function Fm(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:J.CHARACTER,chars:e.value,location:Nn(e)};jt(t,Ye(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Hm(e,t){const n={type:J.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Nn(e)};jt(t,Ye(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Um(e,t){t.stitches=!0;const n=Vm(e);if("children"in e&&"children"in n){const r=No({type:"root",children:e.children},t.options);n.children=r.children}wo({type:"comment",value:{stitch:n}},t)}function wo(e,t){const n=e.value,r={type:J.COMMENT,data:n,location:Nn(e)};jt(t,Ye(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function jm(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,Lo(t,Ye(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(Pm,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function zm(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))Um(n,t);else{let r="";throw vm.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function jt(e,t){Lo(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=fe.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function Lo(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function $m(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===fe.PLAINTEXT)return;jt(t,Ye(e));const r=t.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:mt.html;i===mt.html&&n==="svg"&&(i=mt.svg);const s=Kh({...e,children:[]},{space:i===mt.svg?"svg":"html"}),a={type:J.START_TAG,tagName:n,tagID:Ut(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:Nn(e)};t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function Ym(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&sf.includes(n)||t.parser.tokenizer.state===fe.PLAINTEXT)return;jt(t,yr(e));const r={type:J.END_TAG,tagName:n,tagID:Ut(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Nn(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===fe.RCDATA||t.parser.tokenizer.state===fe.RAWTEXT||t.parser.tokenizer.state===fe.SCRIPT_DATA)&&(t.parser.tokenizer.state=fe.DATA)}function qm(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Nn(e){const t=Ye(e)||{line:void 0,column:void 0,offset:void 0},n=yr(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function Vm(e){return"children"in e?gt({...e,children:[]}):gt(e)}function li(e){return function(t,n){return No(t,{...e,file:n})}}const dt=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],cn={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...dt,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...dt],h2:[["className","sr-only"]],img:[...dt,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...dt,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...dt],table:[...dt],ul:[...dt,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},rt={}.hasOwnProperty;function Wm(e,t){let n={type:"root",children:[]};const r={schema:t?{...cn,...t}:cn,stack:[]},i=Ro(r,e);return i&&(Array.isArray(i)?i.length===1?n=i[0]:n.children=i:n=i),n}function Ro(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return Gm(e,n);case"doctype":return Qm(e,n);case"element":return Km(e,n);case"root":return Xm(e,n);case"text":return Zm(e,n)}}}function Gm(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),s={type:"comment",value:r<0?n:n.slice(0,r)};return In(s,t),s}}function Qm(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return In(n,t),n}}function Km(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=Oo(e,t.children),i=Jm(e,t.properties);e.stack.pop();let s=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(s=!0,e.schema.ancestors&&rt.call(e.schema.ancestors,n))){const u=e.schema.ancestors[n];let o=-1;for(s=!1;++o<u.length;)e.stack.includes(u[o])&&(s=!0)}if(!s)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const a={type:"element",tagName:n,properties:i,children:r};return In(a,t),a}function Xm(e,t){const r={type:"root",children:Oo(e,t.children)};return In(r,t),r}function Zm(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return In(r,t),r}function Oo(e,t){const n=[];if(Array.isArray(t)){const r=t;let i=-1;for(;++i<r.length;){const s=Ro(e,r[i]);s&&(Array.isArray(s)?n.push(...s):n.push(s))}}return n}function Jm(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,s=r&&rt.call(r,n)?r[n]:void 0,a=r&&rt.call(r,"*")?r["*"]:void 0,u=t&&typeof t=="object"?t:{},o={};let c;for(c in u)if(rt.call(u,c)){const d=u[c];let h=sa(e,aa(s,c),c,d);h==null&&(h=sa(e,aa(a,c),c,d)),h!=null&&(o[c]=h)}if(i&&rt.call(i,n)){const d=i[n];for(c in d)rt.call(d,c)&&!rt.call(o,c)&&(o[c]=d[c])}return o}function sa(e,t,n,r){return t?Array.isArray(r)?ep(e,t,n,r):Do(e,t,n,r):void 0}function ep(e,t,n,r){let i=-1;const s=[];for(;++i<r.length;){const a=Do(e,t,n,r[i]);(typeof a=="number"||typeof a=="string")&&s.push(a)}return s}function Do(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&tp(e,n,r)){if(typeof t=="object"&&t.length>1){let i=!1,s=0;for(;++s<t.length;){const a=t[s];if(a&&typeof a=="object"&&"flags"in a){if(a.test(String(r))){i=!0;break}}else if(a===r){i=!0;break}}if(!i)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function tp(e,t,n){const r=e.schema.protocols&&rt.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const i=String(n),s=i.indexOf(":"),a=i.indexOf("?"),u=i.indexOf("#"),o=i.indexOf("/");if(s<0||o>-1&&s>o||a>-1&&s>a||u>-1&&s>u)return!0;let c=-1;for(;++c<r.length;){const d=r[c];if(s===d.length&&i.slice(0,d.length)===d)return!0}return!1}function In(e,t){const n=So(t);t.data&&(e.data=gt(t.data)),n&&(e.position=n)}function aa(e,t){let n,r=-1;if(e)for(;++r<e.length;){const i=e[r],s=typeof i=="string"?i:i[0];if(s===t)return i;s==="data*"&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function Po(e){return function(t){return Wm(t,e)}}function ua(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const ye=ot(/[A-Za-z]/),Ee=ot(/[\dA-Za-z]/),np=ot(/[#-'*+\--9=?A-Z^-~]/);function ir(e){return e!==null&&(e<32||e===127)}const ci=ot(/\d/),rp=ot(/[\dA-Fa-f]/),ip=ot(/[!-/:-@[-`{-~]/);function q(e){return e!==null&&e<-2}function le(e){return e!==null&&(e<0||e===32)}function ee(e){return e===-2||e===-1||e===32}const Ar=ot(new RegExp("\\p{P}|\\p{S}","u")),bt=ot(/\s/);function ot(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function sp(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function ap(e,t,n){const i=mr((n||{}).ignore||[]),s=up(t);let a=-1;for(;++a<s.length;)wi(e,"text",u);function u(c,d){let h=-1,f;for(;++h<d.length;){const m=d[h],b=f?f.children:void 0;if(i(m,b?b.indexOf(m):void 0,f))return;f=m}if(f)return o(c,d)}function o(c,d){const h=d[d.length-1],f=s[a][0],m=s[a][1];let b=0;const S=h.children.indexOf(c);let _=!1,L=[];f.lastIndex=0;let I=f.exec(c.value);for(;I;){const B=I.index,z={index:I.index,input:I.input,stack:[...d,c]};let R=m(...I,z);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?f.lastIndex=B+1:(b!==B&&L.push({type:"text",value:c.value.slice(b,B)}),Array.isArray(R)?L.push(...R):R&&L.push(R),b=B+I[0].length,_=!0),!f.global)break;I=f.exec(c.value)}return _?(b<c.value.length&&L.push({type:"text",value:c.value.slice(b)}),h.children.splice(S,1,...L)):L=[c],S+L.length}}function up(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([op(i[0]),lp(i[1])])}return t}function op(e){return typeof e=="string"?new RegExp(sp(e),"g"):e}function lp(e){return typeof e=="function"?e:function(){return e}}const vr="phrasing",Mr=["autolink","link","image","label"];function cp(){return{transforms:[bp],enter:{literalAutolink:hp,literalAutolinkEmail:Br,literalAutolinkHttp:Br,literalAutolinkWww:Br},exit:{literalAutolink:gp,literalAutolinkEmail:pp,literalAutolinkHttp:fp,literalAutolinkWww:mp}}}function dp(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:vr,notInConstruct:Mr},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:vr,notInConstruct:Mr},{character:":",before:"[ps]",after:"\\/",inConstruct:vr,notInConstruct:Mr}]}}function hp(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Br(e){this.config.enter.autolinkProtocol.call(this,e)}function fp(e){this.config.exit.autolinkProtocol.call(this,e)}function mp(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function pp(e){this.config.exit.autolinkEmail.call(this,e)}function gp(e){this.exit(e)}function bp(e){ap(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Ep],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Tp]],{ignore:["link","linkReference"]})}function Ep(e,t,n,r,i){let s="";if(!vo(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!xp(n)))return!1;const a=kp(n+r);if(!a[0])return!1;const u={type:"link",title:null,url:s+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[u,{type:"text",value:a[1]}]:u}function Tp(e,t,n,r){return!vo(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function xp(e){const 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 kp(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=ua(e,"(");let s=ua(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function vo(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||bt(n)||Ar(n))&&(!t||n!==47)}function He(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}Mo.peek=Lp;function yp(){this.buffer()}function Ap(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function _p(){this.buffer()}function Cp(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Sp(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=He(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Np(e){this.exit(e)}function Ip(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=He(this.sliceSerialize(e)).toLowerCase(),n.label=t}function wp(e){this.exit(e)}function Lp(){return"["}function Mo(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const a=n.enter("footnoteReference"),u=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),u(),a(),s+=i.move("]"),s}function Rp(){return{enter:{gfmFootnoteCallString:yp,gfmFootnoteCall:Ap,gfmFootnoteDefinitionLabelString:_p,gfmFootnoteDefinition:Cp},exit:{gfmFootnoteCallString:Sp,gfmFootnoteCall:Np,gfmFootnoteDefinitionLabelString:Ip,gfmFootnoteDefinition:wp}}}function Op(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Mo},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,a){const u=s.createTracker(a);let o=u.move("[^");const c=s.enter("footnoteDefinition"),d=s.enter("label");return o+=u.move(s.safe(s.associationId(r),{before:o,after:"]"})),d(),o+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),o+=u.move((t?`
|
|
7
|
+
`:" ")+s.indentLines(s.containerFlow(r,u.current()),t?Bo:Dp))),c(),o}}function Dp(e,t,n){return t===0?e:Bo(e,t,n)}function Bo(e,t,n){return(n?"":" ")+e}const Pp=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Fo.peek=Hp;function vp(){return{canContainEols:["delete"],enter:{strikethrough:Bp},exit:{strikethrough:Fp}}}function Mp(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Pp}],handlers:{delete:Fo}}}function Bp(e){this.enter({type:"delete",children:[]},e)}function Fp(e){this.exit(e)}function Fo(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),s(),a}function Hp(){return"~"}function Up(e){return e.length}function jp(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Up,s=[],a=[],u=[],o=[];let c=0,d=-1;for(;++d<e.length;){const k=[],S=[];let _=-1;for(e[d].length>c&&(c=e[d].length);++_<e[d].length;){const L=zp(e[d][_]);if(n.alignDelimiters!==!1){const I=i(L);S[_]=I,(o[_]===void 0||I>o[_])&&(o[_]=I)}k.push(L)}a[d]=k,u[d]=S}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<c;)s[h]=oa(r[h]);else{const k=oa(r);for(;++h<c;)s[h]=k}h=-1;const f=[],m=[];for(;++h<c;){const k=s[h];let S="",_="";k===99?(S=":",_=":"):k===108?S=":":k===114&&(_=":");let L=n.alignDelimiters===!1?1:Math.max(1,o[h]-S.length-_.length);const I=S+"-".repeat(L)+_;n.alignDelimiters!==!1&&(L=S.length+L+_.length,L>o[h]&&(o[h]=L),m[h]=L),f[h]=I}a.splice(1,0,f),u.splice(1,0,m),d=-1;const b=[];for(;++d<a.length;){const k=a[d],S=u[d];h=-1;const _=[];for(;++h<c;){const L=k[h]||"";let I="",B="";if(n.alignDelimiters!==!1){const z=o[h]-(S[h]||0),R=s[h];R===114?I=" ".repeat(z):R===99?z%2?(I=" ".repeat(z/2+.5),B=" ".repeat(z/2-.5)):(I=" ".repeat(z/2),B=I):B=" ".repeat(z)}n.delimiterStart!==!1&&!h&&_.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&L==="")&&(n.delimiterStart!==!1||h)&&_.push(" "),n.alignDelimiters!==!1&&_.push(I),_.push(L),n.alignDelimiters!==!1&&_.push(B),n.padding!==!1&&_.push(" "),(n.delimiterEnd!==!1||h!==c-1)&&_.push("|")}b.push(n.delimiterEnd===!1?_.join("").replace(/ +$/,""):_.join(""))}return b.join(`
|
|
8
|
+
`)}function zp(e){return e==null?"":String(e)}function oa(e){const 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 $p(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const a=n.indentLines(n.containerFlow(e,s.current()),Yp);return i(),a}function Yp(e,t,n){return">"+(n?"":" ")+e}function qp(e,t){return la(e,t.inConstruct,!0)&&!la(e,t.notInConstruct,!1)}function la(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 ca(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
9
|
+
`&&qp(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
10
|
+
`}function Vp(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>a&&(a=s):s=1,i=r+t.length,r=n.indexOf(t,i);return a}function Wp(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 Gp(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Qp(e,t,n,r){const i=Gp(n),s=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(Wp(e,n)){const h=n.enter("codeIndented"),f=n.indentLines(s,Kp);return h(),f}const u=n.createTracker(r),o=i.repeat(Math.max(Vp(s,i)+1,3)),c=n.enter("codeFenced");let d=u.move(o);if(e.lang){const h=n.enter(`codeFencedLang${a}`);d+=u.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...u.current()})),h()}if(e.lang&&e.meta){const h=n.enter(`codeFencedMeta${a}`);d+=u.move(" "),d+=u.move(n.safe(e.meta,{before:d,after:`
|
|
11
11
|
`,encode:["`"],...u.current()})),h()}return d+=u.move(`
|
|
12
12
|
`),s&&(d+=u.move(s+`
|
|
13
|
-
`)),d+=u.move(o),c(),d}function
|
|
14
|
-
`,...o.current()}))),u(),e.title&&(u=n.enter(`title${s}`),c+=o.move(" "+i),c+=o.move(n.safe(e.title,{before:c,after:i,...o.current()})),c+=o.move(i),u()),a(),c}function
|
|
13
|
+
`)),d+=u.move(o),c(),d}function Kp(e,t,n){return(n?"":" ")+e}function ji(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Xp(e,t,n,r){const i=ji(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let u=n.enter("label");const o=n.createTracker(r);let c=o.move("[");return c+=o.move(n.safe(n.associationId(e),{before:c,after:"]",...o.current()})),c+=o.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(n.safe(e.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(u=n.enter("destinationRaw"),c+=o.move(n.safe(e.url,{before:c,after:e.title?" ":`
|
|
14
|
+
`,...o.current()}))),u(),e.title&&(u=n.enter(`title${s}`),c+=o.move(" "+i),c+=o.move(n.safe(e.title,{before:c,after:i,...o.current()})),c+=o.move(i),u()),a(),c}function Zp(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function En(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Bt(e){if(e===null||le(e)||bt(e))return 1;if(Ar(e))return 2}function sr(e,t,n){const r=Bt(e),i=Bt(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}}Ho.peek=Jp;function Ho(e,t,n,r){const i=Zp(n),s=n.enter("emphasis"),a=n.createTracker(r),u=a.move(i);let o=a.move(n.containerPhrasing(e,{after:i,before:u,...a.current()}));const c=o.charCodeAt(0),d=sr(r.before.charCodeAt(r.before.length-1),c,i);d.inside&&(o=En(c)+o.slice(1));const h=o.charCodeAt(o.length-1),f=sr(r.after.charCodeAt(0),h,i);f.inside&&(o=o.slice(0,-1)+En(h));const m=a.move(i);return s(),n.attentionEncodeSurroundingInfo={after:f.outside,before:d.outside},u+o+m}function Jp(e,t,n){return n.options.emphasis||"*"}const e1={};function zi(e,t){const n=e1,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Uo(e,r,i)}function Uo(e,t,n){if(t1(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 da(e.children,t,n)}return Array.isArray(e)?da(e,t,n):""}function da(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Uo(e[i],t,n);return r.join("")}function t1(e){return!!(e&&typeof e=="object")}function n1(e,t){let n=!1;return st(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,ti}),!!((!e.depth||e.depth<3)&&zi(e)&&(t.options.setext||n))}function r1(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(n1(e,n)){const d=n.enter("headingSetext"),h=n.enter("phrasing"),f=n.containerPhrasing(e,{...s.current(),before:`
|
|
15
15
|
`,after:`
|
|
16
16
|
`});return h(),d(),f+`
|
|
17
17
|
`+(i===1?"=":"-").repeat(f.length-(Math.max(f.lastIndexOf("\r"),f.lastIndexOf(`
|
|
18
18
|
`))+1))}const a="#".repeat(i),u=n.enter("headingAtx"),o=n.enter("phrasing");s.move(a+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
|
|
19
|
-
`,...s.current()});return/^[\t ]/.test(c)&&(c=
|
|
20
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:f,table:a,tableCell:o,tableRow:u}};function a(m,b,
|
|
21
|
-
`))}function o(m,b,A,S){const _=A.enter("tableCell"),L=A.enter("phrasing"),I=A.containerPhrasing(m,{...S,before:s,after:s});return L(),_(),I}function c(m,b){return vp(m,{align:b,alignDelimiters:r,padding:n,stringLength:i})}function d(m,b,A){const S=m.children;let _=-1;const L=[],I=b.enter("table");for(;++_<S.length;)L[_]=h(S[_],b,A);return I(),L}function h(m,b,A){const S=m.children;let _=-1;const L=[],I=b.enter("tableRow");for(;++_<S.length;)L[_]=o(S[_],m,b,A);return I(),L}function f(m,b,A){let S=qo.inlineCode(m,b,A);return A.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function N1(){return{exit:{taskListCheckValueChecked:ca,taskListCheckValueUnchecked:ca,paragraph:w1}}}function I1(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:L1}}}function ca(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function w1(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,a;for(;++s<i.length;){const u=i[s];if(u.type==="paragraph"){a=u;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function L1(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",u=n.createTracker(r);s&&u.move(a);let o=qo.listItem(e,t,n,{...r,...u.current()});return s&&(o=o.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),o;function c(d){return d+a}}function R1(){return[ip(),Cp(),wp(),x1(),N1()]}function O1(e){return{extensions:[sp(),Sp(e),Lp(),S1(e),I1()]}}function Le(e,t,n,r){const i=e.length;let s=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);s<r.length;)a=r.slice(s,s+1e4),a.unshift(t,0),e.splice(...a),s+=1e4,t+=1e4}function Oe(e,t){return e.length>0?(Le(e,e.length,0,t),e):t}const da={}.hasOwnProperty;function Wo(e){const t={};let n=-1;for(;++n<e.length;)D1(t,e[n]);return t}function D1(e,t){let n;for(n in t){const i=(da.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let a;if(s)for(a in s){da.call(i,a)||(i[a]=[]);const u=s[a];P1(i[a],Array.isArray(u)?u:u?[u]:[])}}}function P1(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Le(e,0,0,r)}const v1={tokenize:j1,partial:!0},Go={tokenize:z1,partial:!0},Qo={tokenize:$1,partial:!0},Ko={tokenize:Y1,partial:!0},M1={tokenize:q1,partial:!0},Xo={name:"wwwAutolink",tokenize:H1,previous:Jo},Zo={name:"protocolAutolink",tokenize:U1,previous:el},Ze={name:"emailAutolink",tokenize:F1,previous:tl},qe={};function B1(){return{text:qe}}let ht=48;for(;ht<123;)qe[ht]=Ze,ht++,ht===58?ht=65:ht===91&&(ht=97);qe[43]=Ze;qe[45]=Ze;qe[46]=Ze;qe[95]=Ze;qe[72]=[Ze,Zo];qe[104]=[Ze,Zo];qe[87]=[Ze,Xo];qe[119]=[Ze,Xo];function F1(e,t,n){const r=this;let i,s;return a;function a(h){return!ci(h)||!tl.call(r,r.previous)||Yi(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(h))}function u(h){return ci(h)?(e.consume(h),u):h===64?(e.consume(h),o):n(h)}function o(h){return h===46?e.check(M1,d,c)(h):h===45||h===95||Ee(h)?(s=!0,e.consume(h),o):d(h)}function c(h){return e.consume(h),i=!0,o}function d(h){return s&&i&&ye(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function H1(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!Jo.call(r,r.previous)||Yi(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(v1,e.attempt(Go,e.attempt(Qo,s),n),n)(a))}function s(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function U1(e,t,n){const r=this;let i="",s=!1;return a;function a(h){return(h===72||h===104)&&el.call(r,r.previous)&&!Yi(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),u):n(h)}function u(h){if(ye(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),u;if(h===58){const f=i.toLowerCase();if(f==="http"||f==="https")return e.consume(h),o}return n(h)}function o(h){return h===47?(e.consume(h),s?c:(s=!0,o)):n(h)}function c(h){return h===null||tr(h)||le(h)||gt(h)||kr(h)?n(h):e.attempt(Go,e.attempt(Qo,d),n)(h)}function d(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function j1(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),s):n(a)}function s(a){return a===null?n(a):t(a)}}function z1(e,t,n){let r,i,s;return a;function a(c){return c===46||c===95?e.check(Ko,o,u)(c):c===null||le(c)||gt(c)||c!==45&&kr(c)?o(c):(s=!0,e.consume(c),a)}function u(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),a}function o(c){return i||r||!s?n(c):t(c)}}function $1(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?s(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(Ko,t,s)(a):a===null||le(a)||gt(a)?t(a):(e.consume(a),i)}function s(a){return a===41&&r++,e.consume(a),i}}function Y1(e,t,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(e.consume(u),r):u===38?(e.consume(u),s):u===93?(e.consume(u),i):u===60||u===null||le(u)||gt(u)?t(u):n(u)}function i(u){return u===null||u===40||u===91||le(u)||gt(u)?t(u):r(u)}function s(u){return ye(u)?a(u):n(u)}function a(u){return u===59?(e.consume(u),r):ye(u)?(e.consume(u),a):n(u)}}function q1(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return Ee(s)?n(s):t(s)}}function Jo(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||le(e)}function el(e){return!ye(e)}function tl(e){return!(e===47||ci(e))}function ci(e){return e===43||e===45||e===46||e===95||Ee(e)}function Yi(e){let t=e.length,n=!1;for(;t--;){const 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}function jt(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let a="";if(s===37&&Ee(e.charCodeAt(n+1))&&Ee(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const u=e.charCodeAt(n+1);s<56320&&u>56319&&u<57344?(a=String.fromCharCode(s,u),i=1):a="�"}else a=String.fromCharCode(s);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function yr(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const di={name:"attention",resolveAll:V1,tokenize:W1};function V1(e,t){let n=-1,r,i,s,a,u,o,c,d;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;o=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},f={...e[n][1].start};ha(h,-o),ha(f,o),a={type:o>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},u={type:o>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},s={type:o>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:o>1?"strong":"emphasis",start:{...a.start},end:{...u.end}},e[r][1].end={...a.start},e[n][1].start={...u.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Oe(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Oe(c,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",s,t]]),c=Oe(c,yr(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Oe(c,[["exit",s,t],["enter",u,t],["exit",u,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=Oe(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Le(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function W1(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Mt(r);let s;return a;function a(o){return s=o,e.enter("attentionSequence"),u(o)}function u(o){if(o===s)return e.consume(o),u;const c=e.exit("attentionSequence"),d=Mt(o),h=!d||d===2&&i||n.includes(o),f=!i||i===2&&d||n.includes(r);return c._open=!!(s===42?h:h&&(i||!f)),c._close=!!(s===42?f:f&&(d||!h)),t(o)}}function ha(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const G1={name:"autolink",tokenize:Q1};function Q1(e,t,n){let r=0;return i;function i(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(m){return ye(m)?(e.consume(m),a):m===64?n(m):c(m)}function a(m){return m===43||m===45||m===46||Ee(m)?(r=1,u(m)):c(m)}function u(m){return m===58?(e.consume(m),r=0,o):(m===43||m===45||m===46||Ee(m))&&r++<32?(e.consume(m),u):(r=0,c(m))}function o(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||tr(m)?n(m):(e.consume(m),o)}function c(m){return m===64?(e.consume(m),d):Km(m)?(e.consume(m),c):n(m)}function d(m){return Ee(m)?h(m):n(m)}function h(m){return m===46?(e.consume(m),r=0,d):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):f(m)}function f(m){if((m===45||Ee(m))&&r++<63){const b=m===45?f:h;return e.consume(m),b}return n(m)}}function ne(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(o){return ee(o)?(e.enter(n),u(o)):t(o)}function u(o){return ee(o)&&s++<i?(e.consume(o),u):(e.exit(n),t(o))}}const Nn={partial:!0,tokenize:K1};function K1(e,t,n){return r;function r(s){return ee(s)?ne(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||q(s)?t(s):n(s)}}const nl={continuation:{tokenize:Z1},exit:J1,name:"blockQuote",tokenize:X1};function X1(e,t,n){const r=this;return i;function i(a){if(a===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),s}return n(a)}function s(a){return ee(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function Z1(e,t,n){const r=this;return i;function i(a){return ee(a)?ne(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return e.attempt(nl,t,n)(a)}}function J1(e){e.exit("blockQuote")}const rl={name:"characterEscape",tokenize:eg};function eg(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return Zm(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const il={name:"characterReference",tokenize:tg};function tg(e,t,n){const r=this;let i=0,s,a;return u;function u(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),o}function o(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),s=31,a=Ee,d(h))}function c(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,a=Xm,d):(e.enter("characterReferenceValue"),s=7,a=li,d(h))}function d(h){if(h===59&&i){const f=e.exit("characterReferenceValue");return a===Ee&&!$i(r.sliceSerialize(f))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(h)&&i++<s?(e.consume(h),d):n(h)}}const fa={partial:!0,tokenize:rg},ma={concrete:!0,name:"codeFenced",tokenize:ng};function ng(e,t,n){const r=this,i={partial:!0,tokenize:z};let s=0,a=0,u;return o;function o(R){return c(R)}function c(R){const $=r.events[r.events.length-1];return s=$&&$[1].type==="linePrefix"?$[2].sliceSerialize($[1],!0).length:0,u=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(R)}function d(R){return R===u?(a++,e.consume(R),d):a<3?n(R):(e.exit("codeFencedFenceSequence"),ee(R)?ne(e,h,"whitespace")(R):h(R))}function h(R){return R===null||q(R)?(e.exit("codeFencedFence"),r.interrupt?t(R):e.check(fa,A,B)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(R))}function f(R){return R===null||q(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(R)):ee(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ne(e,m,"whitespace")(R)):R===96&&R===u?n(R):(e.consume(R),f)}function m(R){return R===null||q(R)?h(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(R))}function b(R){return R===null||q(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(R)):R===96&&R===u?n(R):(e.consume(R),b)}function A(R){return e.attempt(i,B,S)(R)}function S(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),_}function _(R){return s>0&&ee(R)?ne(e,L,"linePrefix",s+1)(R):L(R)}function L(R){return R===null||q(R)?e.check(fa,A,B)(R):(e.enter("codeFlowValue"),I(R))}function I(R){return R===null||q(R)?(e.exit("codeFlowValue"),L(R)):(e.consume(R),I)}function B(R){return e.exit("codeFenced"),t(R)}function z(R,$,G){let K=0;return N;function N(j){return R.enter("lineEnding"),R.consume(j),R.exit("lineEnding"),U}function U(j){return R.enter("codeFencedFence"),ee(j)?ne(R,v,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):v(j)}function v(j){return j===u?(R.enter("codeFencedFenceSequence"),V(j)):G(j)}function V(j){return j===u?(K++,R.consume(j),V):K>=a?(R.exit("codeFencedFenceSequence"),ee(j)?ne(R,Y,"whitespace")(j):Y(j)):G(j)}function Y(j){return j===null||q(j)?(R.exit("codeFencedFence"),$(j)):G(j)}}}function rg(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const Br={name:"codeIndented",tokenize:sg},ig={partial:!0,tokenize:ag};function sg(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),ne(e,s,"linePrefix",5)(c)}function s(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?o(c):q(c)?e.attempt(ig,a,o)(c):(e.enter("codeFlowValue"),u(c))}function u(c){return c===null||q(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),u)}function o(c){return e.exit("codeIndented"),t(c)}}function ag(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):q(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):ne(e,s,"linePrefix",5)(a)}function s(a){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(a):q(a)?i(a):n(a)}}const ug={name:"codeText",previous:lg,resolve:og,tokenize:cg};function og(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 lg(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function cg(e,t,n){let r=0,i,s;return a;function a(h){return e.enter("codeText"),e.enter("codeTextSequence"),u(h)}function u(h){return h===96?(e.consume(h),r++,u):(e.exit("codeTextSequence"),o(h))}function o(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),o):h===96?(s=e.enter("codeTextSequence"),i=0,d(h)):q(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),o):(e.enter("codeTextData"),c(h))}function c(h){return h===null||h===32||h===96||q(h)?(e.exit("codeTextData"),o(h)):(e.consume(h),c)}function d(h){return h===96?(e.consume(h),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(s.type="codeTextData",c(h))}}class dg{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Gt(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Gt(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Gt(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Gt(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Gt(this.left,n.reverse())}}}function Gt(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 sl(e){const t={};let n=-1,r,i,s,a,u,o,c;const d=new dg(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(o=r[1]._tokenizer.events,s=0,s<o.length&&o[s][1].type==="lineEndingBlank"&&(s+=2),s<o.length&&o[s][1].type==="content"))for(;++s<o.length&&o[s][1].type!=="content";)o[s][1].type==="chunkText"&&(o[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,hg(d,n)),n=t[n],c=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(a=d.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},u=d.slice(i,n),u.unshift(r),d.splice(i,n-i+1,u))}}return Le(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!c}function hg(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const u=a.events,o=[],c={};let d,h,f=-1,m=n,b=0,A=0;const S=[A];for(;m;){for(;e.get(++i)[1]!==m;);s.push(i),m._tokenizer||(d=r.sliceStream(m),m.next||d.push(null),h&&a.defineSkip(m.start),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(d),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),h=m,m=m.next}for(m=n;++f<u.length;)u[f][0]==="exit"&&u[f-1][0]==="enter"&&u[f][1].type===u[f-1][1].type&&u[f][1].start.line!==u[f][1].end.line&&(A=f+1,S.push(A),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(a.events=[],m?(m._tokenizer=void 0,m.previous=void 0):S.pop(),f=S.length;f--;){const _=u.slice(S[f],S[f+1]),L=s.pop();o.push([L,L+_.length-1]),e.splice(L,2,_)}for(o.reverse(),f=-1;++f<o.length;)c[b+o[f][0]]=b+o[f][1],b+=o[f][1]-o[f][0]-1;return c}const fg={resolve:pg,tokenize:gg},mg={partial:!0,tokenize:bg};function pg(e){return sl(e),e}function gg(e,t){let n;return r;function r(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(u)}function i(u){return u===null?s(u):q(u)?e.check(mg,a,s)(u):(e.consume(u),i)}function s(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function a(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function bg(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ne(e,s,"linePrefix")}function s(a){if(a===null||q(a))return n(a);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function al(e,t,n,r,i,s,a,u,o){const c=o||Number.POSITIVE_INFINITY;let d=0;return h;function h(_){return _===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(_),e.exit(s),f):_===null||_===32||_===41||tr(_)?n(_):(e.enter(r),e.enter(a),e.enter(u),e.enter("chunkString",{contentType:"string"}),A(_))}function f(_){return _===62?(e.enter(s),e.consume(_),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),m(_))}function m(_){return _===62?(e.exit("chunkString"),e.exit(u),f(_)):_===null||_===60||q(_)?n(_):(e.consume(_),_===92?b:m)}function b(_){return _===60||_===62||_===92?(e.consume(_),m):m(_)}function A(_){return!d&&(_===null||_===41||le(_))?(e.exit("chunkString"),e.exit(u),e.exit(a),e.exit(r),t(_)):d<c&&_===40?(e.consume(_),d++,A):_===41?(e.consume(_),d--,A):_===null||_===32||_===40||tr(_)?n(_):(e.consume(_),_===92?S:A)}function S(_){return _===40||_===41||_===92?(e.consume(_),A):A(_)}}function ul(e,t,n,r,i,s){const a=this;let u=0,o;return c;function c(m){return e.enter(r),e.enter(i),e.consume(m),e.exit(i),e.enter(s),d}function d(m){return u>999||m===null||m===91||m===93&&!o||m===94&&!u&&"_hiddenFootnoteSupport"in a.parser.constructs?n(m):m===93?(e.exit(s),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):q(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),h(m))}function h(m){return m===null||m===91||m===93||q(m)||u++>999?(e.exit("chunkString"),d(m)):(e.consume(m),o||(o=!ee(m)),m===92?f:h)}function f(m){return m===91||m===92||m===93?(e.consume(m),u++,h):h(m)}}function ol(e,t,n,r,i,s){let a;return u;function u(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),a=f===40?41:f,o):n(f)}function o(f){return f===a?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(s),c(f))}function c(f){return f===a?(e.exit(s),o(a)):f===null?n(f):q(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),ne(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===a||f===null||q(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?h:d)}function h(f){return f===a||f===92?(e.consume(f),d):d(f)}}function cn(e,t){let n;return r;function r(i){return q(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ee(i)?ne(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Eg={name:"definition",tokenize:xg},Tg={partial:!0,tokenize:kg};function xg(e,t,n){const r=this;let i;return s;function s(m){return e.enter("definition"),a(m)}function a(m){return ul.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function u(m){return i=He(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),o):n(m)}function o(m){return le(m)?cn(e,c)(m):c(m)}function c(m){return al(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return e.attempt(Tg,h,h)(m)}function h(m){return ee(m)?ne(e,f,"whitespace")(m):f(m)}function f(m){return m===null||q(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function kg(e,t,n){return r;function r(u){return le(u)?cn(e,i)(u):n(u)}function i(u){return ol(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function s(u){return ee(u)?ne(e,a,"whitespace")(u):a(u)}function a(u){return u===null||q(u)?t(u):n(u)}}const yg={name:"hardBreakEscape",tokenize:Ag};function Ag(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return q(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const _g={name:"headingAtx",resolve:Cg,tokenize:Sg};function Cg(e,t){let n=e.length-2,r=3,i,s;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},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Le(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function Sg(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(e.consume(d),a):d===null||le(d)?(e.exit("atxHeadingSequence"),u(d)):n(d)}function u(d){return d===35?(e.enter("atxHeadingSequence"),o(d)):d===null||q(d)?(e.exit("atxHeading"),t(d)):ee(d)?ne(e,u,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function o(d){return d===35?(e.consume(d),o):(e.exit("atxHeadingSequence"),u(d))}function c(d){return d===null||d===35||le(d)?(e.exit("atxHeadingText"),u(d)):(e.consume(d),c)}}const Ng=["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"],pa=["pre","script","style","textarea"],Ig={concrete:!0,name:"htmlFlow",resolveTo:Rg,tokenize:Og},wg={partial:!0,tokenize:Pg},Lg={partial:!0,tokenize:Dg};function Rg(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 Og(e,t,n){const r=this;let i,s,a,u,o;return c;function c(y){return d(y)}function d(y){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(y),h}function h(y){return y===33?(e.consume(y),f):y===47?(e.consume(y),s=!0,A):y===63?(e.consume(y),i=3,r.interrupt?t:x):ye(y)?(e.consume(y),a=String.fromCharCode(y),S):n(y)}function f(y){return y===45?(e.consume(y),i=2,m):y===91?(e.consume(y),i=5,u=0,b):ye(y)?(e.consume(y),i=4,r.interrupt?t:x):n(y)}function m(y){return y===45?(e.consume(y),r.interrupt?t:x):n(y)}function b(y){const ve="CDATA[";return y===ve.charCodeAt(u++)?(e.consume(y),u===ve.length?r.interrupt?t:v:b):n(y)}function A(y){return ye(y)?(e.consume(y),a=String.fromCharCode(y),S):n(y)}function S(y){if(y===null||y===47||y===62||le(y)){const ve=y===47,lt=a.toLowerCase();return!ve&&!s&&pa.includes(lt)?(i=1,r.interrupt?t(y):v(y)):Ng.includes(a.toLowerCase())?(i=6,ve?(e.consume(y),_):r.interrupt?t(y):v(y)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(y):s?L(y):I(y))}return y===45||Ee(y)?(e.consume(y),a+=String.fromCharCode(y),S):n(y)}function _(y){return y===62?(e.consume(y),r.interrupt?t:v):n(y)}function L(y){return ee(y)?(e.consume(y),L):N(y)}function I(y){return y===47?(e.consume(y),N):y===58||y===95||ye(y)?(e.consume(y),B):ee(y)?(e.consume(y),I):N(y)}function B(y){return y===45||y===46||y===58||y===95||Ee(y)?(e.consume(y),B):z(y)}function z(y){return y===61?(e.consume(y),R):ee(y)?(e.consume(y),z):I(y)}function R(y){return y===null||y===60||y===61||y===62||y===96?n(y):y===34||y===39?(e.consume(y),o=y,$):ee(y)?(e.consume(y),R):G(y)}function $(y){return y===o?(e.consume(y),o=null,K):y===null||q(y)?n(y):(e.consume(y),$)}function G(y){return y===null||y===34||y===39||y===47||y===60||y===61||y===62||y===96||le(y)?z(y):(e.consume(y),G)}function K(y){return y===47||y===62||ee(y)?I(y):n(y)}function N(y){return y===62?(e.consume(y),U):n(y)}function U(y){return y===null||q(y)?v(y):ee(y)?(e.consume(y),U):n(y)}function v(y){return y===45&&i===2?(e.consume(y),F):y===60&&i===1?(e.consume(y),W):y===62&&i===4?(e.consume(y),Ne):y===63&&i===3?(e.consume(y),x):y===93&&i===5?(e.consume(y),re):q(y)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(wg,Ve,V)(y)):y===null||q(y)?(e.exit("htmlFlowData"),V(y)):(e.consume(y),v)}function V(y){return e.check(Lg,Y,Ve)(y)}function Y(y){return e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),j}function j(y){return y===null||q(y)?V(y):(e.enter("htmlFlowData"),v(y))}function F(y){return y===45?(e.consume(y),x):v(y)}function W(y){return y===47?(e.consume(y),a="",ue):v(y)}function ue(y){if(y===62){const ve=a.toLowerCase();return pa.includes(ve)?(e.consume(y),Ne):v(y)}return ye(y)&&a.length<8?(e.consume(y),a+=String.fromCharCode(y),ue):v(y)}function re(y){return y===93?(e.consume(y),x):v(y)}function x(y){return y===62?(e.consume(y),Ne):y===45&&i===2?(e.consume(y),x):v(y)}function Ne(y){return y===null||q(y)?(e.exit("htmlFlowData"),Ve(y)):(e.consume(y),Ne)}function Ve(y){return e.exit("htmlFlow"),t(y)}}function Dg(e,t,n){const r=this;return i;function i(a){return q(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function Pg(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Nn,t,n)}}const vg={name:"htmlText",tokenize:Mg};function Mg(e,t,n){const r=this;let i,s,a;return u;function u(x){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(x),o}function o(x){return x===33?(e.consume(x),c):x===47?(e.consume(x),z):x===63?(e.consume(x),I):ye(x)?(e.consume(x),G):n(x)}function c(x){return x===45?(e.consume(x),d):x===91?(e.consume(x),s=0,b):ye(x)?(e.consume(x),L):n(x)}function d(x){return x===45?(e.consume(x),m):n(x)}function h(x){return x===null?n(x):x===45?(e.consume(x),f):q(x)?(a=h,W(x)):(e.consume(x),h)}function f(x){return x===45?(e.consume(x),m):h(x)}function m(x){return x===62?F(x):x===45?f(x):h(x)}function b(x){const Ne="CDATA[";return x===Ne.charCodeAt(s++)?(e.consume(x),s===Ne.length?A:b):n(x)}function A(x){return x===null?n(x):x===93?(e.consume(x),S):q(x)?(a=A,W(x)):(e.consume(x),A)}function S(x){return x===93?(e.consume(x),_):A(x)}function _(x){return x===62?F(x):x===93?(e.consume(x),_):A(x)}function L(x){return x===null||x===62?F(x):q(x)?(a=L,W(x)):(e.consume(x),L)}function I(x){return x===null?n(x):x===63?(e.consume(x),B):q(x)?(a=I,W(x)):(e.consume(x),I)}function B(x){return x===62?F(x):I(x)}function z(x){return ye(x)?(e.consume(x),R):n(x)}function R(x){return x===45||Ee(x)?(e.consume(x),R):$(x)}function $(x){return q(x)?(a=$,W(x)):ee(x)?(e.consume(x),$):F(x)}function G(x){return x===45||Ee(x)?(e.consume(x),G):x===47||x===62||le(x)?K(x):n(x)}function K(x){return x===47?(e.consume(x),F):x===58||x===95||ye(x)?(e.consume(x),N):q(x)?(a=K,W(x)):ee(x)?(e.consume(x),K):F(x)}function N(x){return x===45||x===46||x===58||x===95||Ee(x)?(e.consume(x),N):U(x)}function U(x){return x===61?(e.consume(x),v):q(x)?(a=U,W(x)):ee(x)?(e.consume(x),U):K(x)}function v(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),i=x,V):q(x)?(a=v,W(x)):ee(x)?(e.consume(x),v):(e.consume(x),Y)}function V(x){return x===i?(e.consume(x),i=void 0,j):x===null?n(x):q(x)?(a=V,W(x)):(e.consume(x),V)}function Y(x){return x===null||x===34||x===39||x===60||x===61||x===96?n(x):x===47||x===62||le(x)?K(x):(e.consume(x),Y)}function j(x){return x===47||x===62||le(x)?K(x):n(x)}function F(x){return x===62?(e.consume(x),e.exit("htmlTextData"),e.exit("htmlText"),t):n(x)}function W(x){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),ue}function ue(x){return ee(x)?ne(e,re,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):re(x)}function re(x){return e.enter("htmlTextData"),a(x)}}const qi={name:"labelEnd",resolveAll:Ug,resolveTo:jg,tokenize:zg},Bg={tokenize:$g},Fg={tokenize:Yg},Hg={tokenize:qg};function Ug(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Le(e,0,e.length,n),e}function jg(e,t){let n=e.length,r=0,i,s,a,u;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const o={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[s][1].start},end:{...e[a][1].end}},d={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[a-2][1].start}};return u=[["enter",o,t],["enter",c,t]],u=Oe(u,e.slice(s+1,s+r+3)),u=Oe(u,[["enter",d,t]]),u=Oe(u,yr(t.parser.constructs.insideSpan.null,e.slice(s+r+4,a-3),t)),u=Oe(u,[["exit",d,t],e[a-2],e[a-1],["exit",c,t]]),u=Oe(u,e.slice(a+1)),u=Oe(u,[["exit",o,t]]),Le(e,s,e.length,u),e}function zg(e,t,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return u;function u(f){return s?s._inactive?h(f):(a=r.parser.defined.includes(He(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),o):n(f)}function o(f){return f===40?e.attempt(Bg,d,a?d:h)(f):f===91?e.attempt(Fg,d,a?c:h)(f):a?d(f):h(f)}function c(f){return e.attempt(Hg,d,h)(f)}function d(f){return t(f)}function h(f){return s._balanced=!0,n(f)}}function $g(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return le(h)?cn(e,s)(h):s(h)}function s(h){return h===41?d(h):al(e,a,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function a(h){return le(h)?cn(e,o)(h):d(h)}function u(h){return n(h)}function o(h){return h===34||h===39||h===40?ol(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function c(h){return le(h)?cn(e,d)(h):d(h)}function d(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function Yg(e,t,n){const r=this;return i;function i(u){return ul.call(r,e,s,a,"reference","referenceMarker","referenceString")(u)}function s(u){return r.parser.defined.includes(He(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function a(u){return n(u)}}function qg(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const Vg={name:"labelStartImage",resolveAll:qi.resolveAll,tokenize:Wg};function Wg(e,t,n){const r=this;return i;function i(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),s}function s(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),a):n(u)}function a(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const Gg={name:"labelStartLink",resolveAll:qi.resolveAll,tokenize:Qg};function Qg(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Fr={name:"lineEnding",tokenize:Kg};function Kg(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ne(e,t,"linePrefix")}}const Yn={name:"thematicBreak",tokenize:Xg};function Xg(e,t,n){let r=0,i;return s;function s(c){return e.enter("thematicBreak"),a(c)}function a(c){return i=c,u(c)}function u(c){return c===i?(e.enter("thematicBreakSequence"),o(c)):r>=3&&(c===null||q(c))?(e.exit("thematicBreak"),t(c)):n(c)}function o(c){return c===i?(e.consume(c),r++,o):(e.exit("thematicBreakSequence"),ee(c)?ne(e,u,"whitespace")(c):u(c))}}const Ce={continuation:{tokenize:tb},exit:rb,name:"list",tokenize:eb},Zg={partial:!0,tokenize:ib},Jg={partial:!0,tokenize:nb};function eb(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return u;function u(m){const b=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:li(m)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Yn,n,c)(m):c(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),o(m)}return n(m)}function o(m){return li(m)&&++a<10?(e.consume(m),o):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):n(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(Nn,r.interrupt?n:d,e.attempt(Zg,f,h))}function d(m){return r.containerState.initialBlankLine=!0,s++,f(m)}function h(m){return ee(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),f):n(m)}function f(m){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function tb(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Nn,i,s);function i(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ne(e,t,"listItemIndent",r.containerState.size+1)(u)}function s(u){return r.containerState.furtherBlankLines||!ee(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Jg,t,a)(u))}function a(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,ne(e,e.attempt(Ce,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function nb(e,t,n){const r=this;return ne(e,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(s):n(s)}}function rb(e){e.exit(this.containerState.type)}function ib(e,t,n){const r=this;return ne(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!ee(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const ga={name:"setextUnderline",resolveTo:sb,tokenize:ab};function sb(e,t){let n=e.length,r,i,s;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),!s&&e[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",a,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function ab(e,t,n){const r=this;let i;return s;function s(c){let d=r.events.length,h;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){h=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),u(c)}function u(c){return c===i?(e.consume(c),u):(e.exit("setextHeadingLineSequence"),ee(c)?ne(e,o,"lineSuffix")(c):o(c))}function o(c){return c===null||q(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const ub={tokenize:pb,partial:!0};function ob(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:hb,continuation:{tokenize:fb},exit:mb}},text:{91:{name:"gfmFootnoteCall",tokenize:db},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:lb,resolveTo:cb}}}}function lb(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const o=r.events[i][1];if(o.type==="labelImage"){a=o;break}if(o.type==="gfmFootnoteCall"||o.type==="labelLink"||o.type==="label"||o.type==="image"||o.type==="link")break}return u;function u(o){if(!a||!a._balanced)return n(o);const c=He(r.sliceSerialize({start:a.end,end:r.now()}));return c.codePointAt(0)!==94||!s.includes(c.slice(1))?n(o):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),t(o))}}function cb(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";const 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++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},u=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...u),e}function db(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,a;return u;function u(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),o}function o(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(h){if(s>999||h===93&&!a||h===null||h===91||le(h))return n(h);if(h===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return i.includes(He(r.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return le(h)||(a=!0),s++,e.consume(h),h===92?d:c}function d(h){return h===91||h===92||h===93?(e.consume(h),s++,c):c(h)}}function hb(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,a=0,u;return o;function o(b){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(b){return b===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(b)}function d(b){if(a>999||b===93&&!u||b===null||b===91||le(b))return n(b);if(b===93){e.exit("chunkString");const A=e.exit("gfmFootnoteDefinitionLabelString");return s=He(r.sliceSerialize(A)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return le(b)||(u=!0),a++,e.consume(b),b===92?h:d}function h(b){return b===91||b===92||b===93?(e.consume(b),a++,d):d(b)}function f(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),i.includes(s)||i.push(s),ne(e,m,"gfmFootnoteDefinitionWhitespace")):n(b)}function m(b){return t(b)}}function fb(e,t,n){return e.check(Nn,t,e.attempt(ub,t,n))}function mb(e){e.exit("gfmFootnoteDefinition")}function pb(e,t,n){const r=this;return ne(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(s):n(s)}}function gb(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,u){let o=-1;for(;++o<a.length;)if(a[o][0]==="enter"&&a[o][1].type==="strikethroughSequenceTemporary"&&a[o][1]._close){let c=o;for(;c--;)if(a[c][0]==="exit"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._open&&a[o][1].end.offset-a[o][1].start.offset===a[c][1].end.offset-a[c][1].start.offset){a[o][1].type="strikethroughSequence",a[c][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},a[c][1].start),end:Object.assign({},a[o][1].end)},h={type:"strikethroughText",start:Object.assign({},a[c][1].end),end:Object.assign({},a[o][1].start)},f=[["enter",d,u],["enter",a[c][1],u],["exit",a[c][1],u],["enter",h,u]],m=u.parser.constructs.insideSpan.null;m&&Le(f,f.length,0,yr(m,a.slice(c+1,o),u)),Le(f,f.length,0,[["exit",h,u],["enter",a[o][1],u],["exit",a[o][1],u],["exit",d,u]]),Le(a,c-1,o-c+3,f),o=c+f.length-2;break}}for(o=-1;++o<a.length;)a[o][1].type==="strikethroughSequenceTemporary"&&(a[o][1].type="data");return a}function s(a,u,o){const c=this.previous,d=this.events;let h=0;return f;function f(b){return c===126&&d[d.length-1][1].type!=="characterEscape"?o(b):(a.enter("strikethroughSequenceTemporary"),m(b))}function m(b){const A=Mt(c);if(b===126)return h>1?o(b):(a.consume(b),h++,m);if(h<2&&!n)return o(b);const S=a.exit("strikethroughSequenceTemporary"),_=Mt(b);return S._open=!_||_===2&&!!A,S._close=!A||A===2&&!!_,u(b)}}}class bb{constructor(){this.map=[]}add(t,n,r){Eb(this,t,n,r)}consume(t){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function Eb(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 Tb(e,t){let n=!1;const r=[];for(;t<e.length;){const 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"){const s=r.length-1;r[s]=r[s]==="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 xb(){return{flow:{null:{name:"table",tokenize:kb,resolveAll:yb}}}}function kb(e,t,n){const r=this;let i=0,s=0,a;return u;function u(N){let U=r.events.length-1;for(;U>-1;){const Y=r.events[U][1].type;if(Y==="lineEnding"||Y==="linePrefix")U--;else break}const v=U>-1?r.events[U][1].type:null,V=v==="tableHead"||v==="tableRow"?R:o;return V===R&&r.parser.lazy[r.now().line]?n(N):V(N)}function o(N){return e.enter("tableHead"),e.enter("tableRow"),c(N)}function c(N){return N===124||(a=!0,s+=1),d(N)}function d(N){return N===null?n(N):q(N)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),m):n(N):ee(N)?ne(e,d,"whitespace")(N):(s+=1,a&&(a=!1,i+=1),N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),h(N)))}function h(N){return N===null||N===124||le(N)?(e.exit("data"),d(N)):(e.consume(N),N===92?f:h)}function f(N){return N===92||N===124?(e.consume(N),h):h(N)}function m(N){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(N):(e.enter("tableDelimiterRow"),a=!1,ee(N)?ne(e,b,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):b(N))}function b(N){return N===45||N===58?S(N):N===124?(a=!0,e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),A):z(N)}function A(N){return ee(N)?ne(e,S,"whitespace")(N):S(N)}function S(N){return N===58?(s+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),_):N===45?(s+=1,_(N)):N===null||q(N)?B(N):z(N)}function _(N){return N===45?(e.enter("tableDelimiterFiller"),L(N)):z(N)}function L(N){return N===45?(e.consume(N),L):N===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),I):(e.exit("tableDelimiterFiller"),I(N))}function I(N){return ee(N)?ne(e,B,"whitespace")(N):B(N)}function B(N){return N===124?b(N):N===null||q(N)?!a||i!==s?z(N):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(N)):z(N)}function z(N){return n(N)}function R(N){return e.enter("tableRow"),$(N)}function $(N){return N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),$):N===null||q(N)?(e.exit("tableRow"),t(N)):ee(N)?ne(e,$,"whitespace")(N):(e.enter("data"),G(N))}function G(N){return N===null||N===124||le(N)?(e.exit("data"),$(N)):(e.consume(N),N===92?K:G)}function K(N){return N===92||N===124?(e.consume(N),G):G(N)}}function yb(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],u=!1,o=0,c,d,h;const f=new bb;for(;++n<e.length;){const m=e[n],b=m[1];m[0]==="enter"?b.type==="tableHead"?(u=!1,o!==0&&(ba(f,t,o,c,d),d=void 0,o=0),c={type:"table",start:Object.assign({},b.start),end:Object.assign({},b.end)},f.add(n,0,[["enter",c,t]])):b.type==="tableRow"||b.type==="tableDelimiterRow"?(r=!0,h=void 0,s=[0,0,0,0],a=[0,n+1,0,0],u&&(u=!1,d={type:"tableBody",start:Object.assign({},b.start),end:Object.assign({},b.end)},f.add(n,0,[["enter",d,t]])),i=b.type==="tableDelimiterRow"?2:d?3:1):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(s[1]!==0&&(a[0]=a[1],h=Pn(f,t,s,i,void 0,h),s=[0,0,0,0]),a[2]=n)):b.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(a[0]=a[1],h=Pn(f,t,s,i,void 0,h)),s=a,a=[s[1],n,0,0])):b.type==="tableHead"?(u=!0,o=n):b.type==="tableRow"||b.type==="tableDelimiterRow"?(o=n,s[1]!==0?(a[0]=a[1],h=Pn(f,t,s,i,n,h)):a[1]!==0&&(h=Pn(f,t,a,i,n,h)),i=0):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(a[3]=n)}for(o!==0&&ba(f,t,o,c,d),f.consume(t.events),n=-1;++n<t.events.length;){const m=t.events[n];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=Tb(t.events,n))}return e}function Pn(e,t,n,r,i,s){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(s.end=Object.assign({},wt(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const o=wt(t.events,n[1]);if(s={type:a,start:Object.assign({},o),end:Object.assign({},o)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const c=wt(t.events,n[2]),d=wt(t.events,n[3]),h={type:u,start:Object.assign({},c),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const f=t.events[n[2]],m=t.events[n[3]];if(f[1].end=Object.assign({},m[1].end),f[1].type="chunkText",f[1].contentType="text",n[3]>n[2]+1){const b=n[2]+1,A=n[3]-n[2]-1;e.add(b,A,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return i!==void 0&&(s.end=Object.assign({},wt(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function ba(e,t,n,r,i){const s=[],a=wt(t.events,n);i&&(i.end=Object.assign({},a),s.push(["exit",i,t])),r.end=Object.assign({},a),s.push(["exit",r,t]),e.add(n+1,0,s)}function wt(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Ab={name:"tasklistCheck",tokenize:Cb};function _b(){return{text:{91:Ab}}}function Cb(e,t,n){const r=this;return i;function i(o){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(o):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(o),e.exit("taskListCheckMarker"),s)}function s(o){return le(o)?(e.enter("taskListCheckValueUnchecked"),e.consume(o),e.exit("taskListCheckValueUnchecked"),a):o===88||o===120?(e.enter("taskListCheckValueChecked"),e.consume(o),e.exit("taskListCheckValueChecked"),a):n(o)}function a(o){return o===93?(e.enter("taskListCheckMarker"),e.consume(o),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(o)}function u(o){return q(o)?t(o):ee(o)?e.check({tokenize:Sb},t,n)(o):n(o)}}function Sb(e,t,n){return ne(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function Nb(e){return Wo([B1(),ob(),gb(e),xb(),_b()])}const Ib={};function wb(e){const t=this,n=e||Ib,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Nb(n)),s.push(R1()),a.push(O1(n))}var Lb=Object.defineProperty,Rb=Object.defineProperties,Ob=Object.getOwnPropertyDescriptors,Ea=Object.getOwnPropertySymbols,Db=Object.prototype.hasOwnProperty,Pb=Object.prototype.propertyIsEnumerable,Ta=(e,t,n)=>t in e?Lb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ll=(e,t)=>{for(var n in t||(t={}))Db.call(t,n)&&Ta(e,n,t[n]);if(Ea)for(var n of Ea(t))Pb.call(t,n)&&Ta(e,n,t[n]);return e},cl=(e,t)=>Rb(e,Ob(t)),vb=/(\*\*)([^*]*\*?)$/,Mb=/(__)([^_]*?)$/,Bb=/(\*\*\*)([^*]*?)$/,Fb=/(\*)([^*]*?)$/,Hb=/(_)([^_]*?)$/,Ub=/(`)([^`]*?)$/,jb=/(~~)([^~]*?)$/,kt=/^[\s_~*`]*$/,dl=/^[\s]*[-*+][\s]+$/,zb=/[\p{L}\p{N}_]/u,$b=/^```[^`\n]*```?$/,Yb=/^\*{4,}$/,qb=/(__)([^_]+)_$/,Vb=/(~~)([^~]+)~$/,Wb=/__/g,xa=/~~/g,at=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95?!0:zb.test(e)},bt=(e,t)=>{let n=!1;for(let r=0;r<t;r+=1)e[r]==="`"&&e[r+1]==="`"&&e[r+2]==="`"&&(n=!n,r+=2);return n},Gb=(e,t)=>{let n=1;for(let r=t-1;r>=0;r-=1)if(e[r]==="]")n+=1;else if(e[r]==="["&&(n-=1,n===0))return r;return-1},hl=(e,t)=>{let n=1;for(let r=t+1;r<e.length;r+=1)if(e[r]==="[")n+=1;else if(e[r]==="]"&&(n-=1,n===0))return r;return-1},Ar=(e,t)=>{let n=!1,r=!1;for(let i=0;i<e.length&&i<t;i+=1){if(e[i]==="\\"&&e[i+1]==="$"){i+=1;continue}e[i]==="$"&&(e[i+1]==="$"?(r=!r,i+=1,n=!1):r||(n=!n))}return n||r},Qb=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===")")return!0;if(e[n]===`
|
|
22
|
-
`)return!1}return!1},
|
|
23
|
-
`)return!1}return!1},
|
|
19
|
+
`,...s.current()});return/^[\t ]/.test(c)&&(c=En(c.charCodeAt(0))+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),o(),u(),c}jo.peek=i1;function jo(e){return e.value||""}function i1(){return"<"}zo.peek=s1;function zo(e,t,n,r){const i=ji(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let u=n.enter("label");const o=n.createTracker(r);let c=o.move("![");return c+=o.move(n.safe(e.alt,{before:c,after:"]",...o.current()})),c+=o.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(n.safe(e.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(u=n.enter("destinationRaw"),c+=o.move(n.safe(e.url,{before:c,after:e.title?" ":")",...o.current()}))),u(),e.title&&(u=n.enter(`title${s}`),c+=o.move(" "+i),c+=o.move(n.safe(e.title,{before:c,after:i,...o.current()})),c+=o.move(i),u()),c+=o.move(")"),a(),c}function s1(){return"!"}$o.peek=a1;function $o(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let a=n.enter("label");const u=n.createTracker(r);let o=u.move("![");const c=n.safe(e.alt,{before:o,after:"]",...u.current()});o+=u.move(c+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const h=n.safe(n.associationId(e),{before:o,after:"]",...u.current()});return a(),n.stack=d,s(),i==="full"||!c||c!==h?o+=u.move(h+"]"):i==="shortcut"?o=o.slice(0,-1):o+=u.move("]"),o}function a1(){return"!"}Yo.peek=u1;function Yo(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const a=n.unsafe[s],u=n.compilePattern(a);let o;if(a.atBreak)for(;o=u.exec(r);){let c=o.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(o.index+1)}}return i+r+i}function u1(){return"`"}function qo(e,t){const n=zi(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))}Vo.peek=o1;function Vo(e,t,n,r){const i=ji(n),s=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let u,o;if(qo(e,n)){const d=n.stack;n.stack=[],u=n.enter("autolink");let h=a.move("<");return h+=a.move(n.containerPhrasing(e,{before:h,after:">",...a.current()})),h+=a.move(">"),u(),n.stack=d,h}u=n.enter("link"),o=n.enter("label");let c=a.move("[");return c+=a.move(n.containerPhrasing(e,{before:c,after:"](",...a.current()})),c+=a.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(o=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:e.title?" ":")",...a.current()}))),o(),e.title&&(o=n.enter(`title${s}`),c+=a.move(" "+i),c+=a.move(n.safe(e.title,{before:c,after:i,...a.current()})),c+=a.move(i),o()),c+=a.move(")"),u(),c}function o1(e,t,n){return qo(e,n)?"<":"["}Wo.peek=l1;function Wo(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let a=n.enter("label");const u=n.createTracker(r);let o=u.move("[");const c=n.containerPhrasing(e,{before:o,after:"]",...u.current()});o+=u.move(c+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const h=n.safe(n.associationId(e),{before:o,after:"]",...u.current()});return a(),n.stack=d,s(),i==="full"||!c||c!==h?o+=u.move(h+"]"):i==="shortcut"?o=o.slice(0,-1):o+=u.move("]"),o}function l1(){return"["}function $i(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function c1(e){const t=$i(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function d1(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Go(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function h1(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let a=e.ordered?d1(n):$i(n);const u=e.ordered?a==="."?")":".":c1(n);let o=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.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&&(o=!0),Go(n)===a&&d){let h=-1;for(;++h<e.children.length;){const f=e.children[h];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){o=!0;break}}}}o&&(a=u),n.bulletCurrent=a;const c=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=s,i(),c}function f1(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function m1(e,t,n,r){const i=f1(n);let s=n.bulletCurrent||$i(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let a=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const u=n.createTracker(r);u.move(s+" ".repeat(a-s.length)),u.shift(a);const o=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,u.current()),d);return o(),c;function d(h,f,m){return f?(m?"":" ".repeat(a))+h:(m?s:s+" ".repeat(a-s.length))+h}}function p1(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(e,r);return s(),i(),a}const g1=mr(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function b1(e,t,n,r){return(e.children.some(function(a){return g1(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function E1(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Qo.peek=T1;function Qo(e,t,n,r){const i=E1(n),s=n.enter("strong"),a=n.createTracker(r),u=a.move(i+i);let o=a.move(n.containerPhrasing(e,{after:i,before:u,...a.current()}));const c=o.charCodeAt(0),d=sr(r.before.charCodeAt(r.before.length-1),c,i);d.inside&&(o=En(c)+o.slice(1));const h=o.charCodeAt(o.length-1),f=sr(r.after.charCodeAt(0),h,i);f.inside&&(o=o.slice(0,-1)+En(h));const m=a.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:f.outside,before:d.outside},u+o+m}function T1(e,t,n){return n.options.strong||"*"}function x1(e,t,n,r){return n.safe(e.value,r)}function k1(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function y1(e,t,n){const r=(Go(n)+(n.options.ruleSpaces?" ":"")).repeat(k1(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Ko={blockquote:$p,break:ca,code:Qp,definition:Xp,emphasis:Ho,hardBreak:ca,heading:r1,html:jo,image:zo,imageReference:$o,inlineCode:Yo,link:Vo,linkReference:Wo,list:h1,listItem:m1,paragraph:p1,root:b1,strong:Qo,text:x1,thematicBreak:y1},ha=document.createElement("i");function Yi(e){const t="&"+e+";";ha.innerHTML=t;const n=ha.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Xo(e,t){const 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)}const A1=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function _1(e){return e.replace(A1,C1)}function C1(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return Xo(n.slice(s?2:1),s?16:10)}return Yi(n)||e}function S1(){return{enter:{table:N1,tableData:fa,tableHeader:fa,tableRow:w1},exit:{codeText:L1,table:I1,tableData:Fr,tableHeader:Fr,tableRow:Fr}}}function N1(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function I1(e){this.exit(e),this.data.inTable=void 0}function w1(e){this.enter({type:"tableRow",children:[]},e)}function Fr(e){this.exit(e)}function fa(e){this.enter({type:"tableCell",children:[]},e)}function L1(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,R1));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function R1(e,t){return t==="|"?t:e}function O1(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
20
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:f,table:a,tableCell:o,tableRow:u}};function a(m,b,k,S){return c(d(m,k,S),m.align)}function u(m,b,k,S){const _=h(m,k,S),L=c([_]);return L.slice(0,L.indexOf(`
|
|
21
|
+
`))}function o(m,b,k,S){const _=k.enter("tableCell"),L=k.enter("phrasing"),I=k.containerPhrasing(m,{...S,before:s,after:s});return L(),_(),I}function c(m,b){return jp(m,{align:b,alignDelimiters:r,padding:n,stringLength:i})}function d(m,b,k){const S=m.children;let _=-1;const L=[],I=b.enter("table");for(;++_<S.length;)L[_]=h(S[_],b,k);return I(),L}function h(m,b,k){const S=m.children;let _=-1;const L=[],I=b.enter("tableRow");for(;++_<S.length;)L[_]=o(S[_],m,b,k);return I(),L}function f(m,b,k){let S=Ko.inlineCode(m,b,k);return k.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function D1(){return{exit:{taskListCheckValueChecked:ma,taskListCheckValueUnchecked:ma,paragraph:v1}}}function P1(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:M1}}}function ma(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function v1(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,a;for(;++s<i.length;){const u=i[s];if(u.type==="paragraph"){a=u;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function M1(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",u=n.createTracker(r);s&&u.move(a);let o=Ko.listItem(e,t,n,{...r,...u.current()});return s&&(o=o.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),o;function c(d){return d+a}}function B1(){return[cp(),Rp(),vp(),S1(),D1()]}function F1(e){return{extensions:[dp(),Op(e),Mp(),O1(e),P1()]}}function Le(e,t,n,r){const i=e.length;let s=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);s<r.length;)a=r.slice(s,s+1e4),a.unshift(t,0),e.splice(...a),s+=1e4,t+=1e4}function Oe(e,t){return e.length>0?(Le(e,e.length,0,t),e):t}const pa={}.hasOwnProperty;function Zo(e){const t={};let n=-1;for(;++n<e.length;)H1(t,e[n]);return t}function H1(e,t){let n;for(n in t){const i=(pa.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let a;if(s)for(a in s){pa.call(i,a)||(i[a]=[]);const u=s[a];U1(i[a],Array.isArray(u)?u:u?[u]:[])}}}function U1(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Le(e,0,0,r)}const j1={tokenize:W1,partial:!0},Jo={tokenize:G1,partial:!0},el={tokenize:Q1,partial:!0},tl={tokenize:K1,partial:!0},z1={tokenize:X1,partial:!0},nl={name:"wwwAutolink",tokenize:q1,previous:il},rl={name:"protocolAutolink",tokenize:V1,previous:sl},Ze={name:"emailAutolink",tokenize:Y1,previous:al},qe={};function $1(){return{text:qe}}let ht=48;for(;ht<123;)qe[ht]=Ze,ht++,ht===58?ht=65:ht===91&&(ht=97);qe[43]=Ze;qe[45]=Ze;qe[46]=Ze;qe[95]=Ze;qe[72]=[Ze,rl];qe[104]=[Ze,rl];qe[87]=[Ze,nl];qe[119]=[Ze,nl];function Y1(e,t,n){const r=this;let i,s;return a;function a(h){return!di(h)||!al.call(r,r.previous)||qi(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(h))}function u(h){return di(h)?(e.consume(h),u):h===64?(e.consume(h),o):n(h)}function o(h){return h===46?e.check(z1,d,c)(h):h===45||h===95||Ee(h)?(s=!0,e.consume(h),o):d(h)}function c(h){return e.consume(h),i=!0,o}function d(h){return s&&i&&ye(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function q1(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!il.call(r,r.previous)||qi(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(j1,e.attempt(Jo,e.attempt(el,s),n),n)(a))}function s(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function V1(e,t,n){const r=this;let i="",s=!1;return a;function a(h){return(h===72||h===104)&&sl.call(r,r.previous)&&!qi(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),u):n(h)}function u(h){if(ye(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),u;if(h===58){const f=i.toLowerCase();if(f==="http"||f==="https")return e.consume(h),o}return n(h)}function o(h){return h===47?(e.consume(h),s?c:(s=!0,o)):n(h)}function c(h){return h===null||ir(h)||le(h)||bt(h)||Ar(h)?n(h):e.attempt(Jo,e.attempt(el,d),n)(h)}function d(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function W1(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),s):n(a)}function s(a){return a===null?n(a):t(a)}}function G1(e,t,n){let r,i,s;return a;function a(c){return c===46||c===95?e.check(tl,o,u)(c):c===null||le(c)||bt(c)||c!==45&&Ar(c)?o(c):(s=!0,e.consume(c),a)}function u(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),a}function o(c){return i||r||!s?n(c):t(c)}}function Q1(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?s(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(tl,t,s)(a):a===null||le(a)||bt(a)?t(a):(e.consume(a),i)}function s(a){return a===41&&r++,e.consume(a),i}}function K1(e,t,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(e.consume(u),r):u===38?(e.consume(u),s):u===93?(e.consume(u),i):u===60||u===null||le(u)||bt(u)?t(u):n(u)}function i(u){return u===null||u===40||u===91||le(u)||bt(u)?t(u):r(u)}function s(u){return ye(u)?a(u):n(u)}function a(u){return u===59?(e.consume(u),r):ye(u)?(e.consume(u),a):n(u)}}function X1(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return Ee(s)?n(s):t(s)}}function il(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||le(e)}function sl(e){return!ye(e)}function al(e){return!(e===47||di(e))}function di(e){return e===43||e===45||e===46||e===95||Ee(e)}function qi(e){let t=e.length,n=!1;for(;t--;){const 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}function zt(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let a="";if(s===37&&Ee(e.charCodeAt(n+1))&&Ee(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const u=e.charCodeAt(n+1);s<56320&&u>56319&&u<57344?(a=String.fromCharCode(s,u),i=1):a="�"}else a=String.fromCharCode(s);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function _r(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const hi={name:"attention",resolveAll:Z1,tokenize:J1};function Z1(e,t){let n=-1,r,i,s,a,u,o,c,d;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;o=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},f={...e[n][1].start};ga(h,-o),ga(f,o),a={type:o>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},u={type:o>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},s={type:o>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:o>1?"strong":"emphasis",start:{...a.start},end:{...u.end}},e[r][1].end={...a.start},e[n][1].start={...u.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Oe(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Oe(c,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",s,t]]),c=Oe(c,_r(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Oe(c,[["exit",s,t],["enter",u,t],["exit",u,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=Oe(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Le(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function J1(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Bt(r);let s;return a;function a(o){return s=o,e.enter("attentionSequence"),u(o)}function u(o){if(o===s)return e.consume(o),u;const c=e.exit("attentionSequence"),d=Bt(o),h=!d||d===2&&i||n.includes(o),f=!i||i===2&&d||n.includes(r);return c._open=!!(s===42?h:h&&(i||!f)),c._close=!!(s===42?f:f&&(d||!h)),t(o)}}function ga(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const eg={name:"autolink",tokenize:tg};function tg(e,t,n){let r=0;return i;function i(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(m){return ye(m)?(e.consume(m),a):m===64?n(m):c(m)}function a(m){return m===43||m===45||m===46||Ee(m)?(r=1,u(m)):c(m)}function u(m){return m===58?(e.consume(m),r=0,o):(m===43||m===45||m===46||Ee(m))&&r++<32?(e.consume(m),u):(r=0,c(m))}function o(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||ir(m)?n(m):(e.consume(m),o)}function c(m){return m===64?(e.consume(m),d):np(m)?(e.consume(m),c):n(m)}function d(m){return Ee(m)?h(m):n(m)}function h(m){return m===46?(e.consume(m),r=0,d):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):f(m)}function f(m){if((m===45||Ee(m))&&r++<63){const b=m===45?f:h;return e.consume(m),b}return n(m)}}function ne(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(o){return ee(o)?(e.enter(n),u(o)):t(o)}function u(o){return ee(o)&&s++<i?(e.consume(o),u):(e.exit(n),t(o))}}const wn={partial:!0,tokenize:ng};function ng(e,t,n){return r;function r(s){return ee(s)?ne(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||q(s)?t(s):n(s)}}const ul={continuation:{tokenize:ig},exit:sg,name:"blockQuote",tokenize:rg};function rg(e,t,n){const r=this;return i;function i(a){if(a===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),s}return n(a)}function s(a){return ee(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function ig(e,t,n){const r=this;return i;function i(a){return ee(a)?ne(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return e.attempt(ul,t,n)(a)}}function sg(e){e.exit("blockQuote")}const ol={name:"characterEscape",tokenize:ag};function ag(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return ip(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const ll={name:"characterReference",tokenize:ug};function ug(e,t,n){const r=this;let i=0,s,a;return u;function u(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),o}function o(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),s=31,a=Ee,d(h))}function c(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,a=rp,d):(e.enter("characterReferenceValue"),s=7,a=ci,d(h))}function d(h){if(h===59&&i){const f=e.exit("characterReferenceValue");return a===Ee&&!Yi(r.sliceSerialize(f))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(h)&&i++<s?(e.consume(h),d):n(h)}}const ba={partial:!0,tokenize:lg},Ea={concrete:!0,name:"codeFenced",tokenize:og};function og(e,t,n){const r=this,i={partial:!0,tokenize:z};let s=0,a=0,u;return o;function o(R){return c(R)}function c(R){const $=r.events[r.events.length-1];return s=$&&$[1].type==="linePrefix"?$[2].sliceSerialize($[1],!0).length:0,u=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(R)}function d(R){return R===u?(a++,e.consume(R),d):a<3?n(R):(e.exit("codeFencedFenceSequence"),ee(R)?ne(e,h,"whitespace")(R):h(R))}function h(R){return R===null||q(R)?(e.exit("codeFencedFence"),r.interrupt?t(R):e.check(ba,k,B)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(R))}function f(R){return R===null||q(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(R)):ee(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ne(e,m,"whitespace")(R)):R===96&&R===u?n(R):(e.consume(R),f)}function m(R){return R===null||q(R)?h(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(R))}function b(R){return R===null||q(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(R)):R===96&&R===u?n(R):(e.consume(R),b)}function k(R){return e.attempt(i,B,S)(R)}function S(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),_}function _(R){return s>0&&ee(R)?ne(e,L,"linePrefix",s+1)(R):L(R)}function L(R){return R===null||q(R)?e.check(ba,k,B)(R):(e.enter("codeFlowValue"),I(R))}function I(R){return R===null||q(R)?(e.exit("codeFlowValue"),L(R)):(e.consume(R),I)}function B(R){return e.exit("codeFenced"),t(R)}function z(R,$,G){let K=0;return N;function N(j){return R.enter("lineEnding"),R.consume(j),R.exit("lineEnding"),U}function U(j){return R.enter("codeFencedFence"),ee(j)?ne(R,v,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):v(j)}function v(j){return j===u?(R.enter("codeFencedFenceSequence"),V(j)):G(j)}function V(j){return j===u?(K++,R.consume(j),V):K>=a?(R.exit("codeFencedFenceSequence"),ee(j)?ne(R,Y,"whitespace")(j):Y(j)):G(j)}function Y(j){return j===null||q(j)?(R.exit("codeFencedFence"),$(j)):G(j)}}}function lg(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const Hr={name:"codeIndented",tokenize:dg},cg={partial:!0,tokenize:hg};function dg(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),ne(e,s,"linePrefix",5)(c)}function s(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?o(c):q(c)?e.attempt(cg,a,o)(c):(e.enter("codeFlowValue"),u(c))}function u(c){return c===null||q(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),u)}function o(c){return e.exit("codeIndented"),t(c)}}function hg(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):q(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):ne(e,s,"linePrefix",5)(a)}function s(a){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(a):q(a)?i(a):n(a)}}const fg={name:"codeText",previous:pg,resolve:mg,tokenize:gg};function mg(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 pg(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function gg(e,t,n){let r=0,i,s;return a;function a(h){return e.enter("codeText"),e.enter("codeTextSequence"),u(h)}function u(h){return h===96?(e.consume(h),r++,u):(e.exit("codeTextSequence"),o(h))}function o(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),o):h===96?(s=e.enter("codeTextSequence"),i=0,d(h)):q(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),o):(e.enter("codeTextData"),c(h))}function c(h){return h===null||h===32||h===96||q(h)?(e.exit("codeTextData"),o(h)):(e.consume(h),c)}function d(h){return h===96?(e.consume(h),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(s.type="codeTextData",c(h))}}class bg{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Qt(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Qt(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Qt(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Qt(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Qt(this.left,n.reverse())}}}function Qt(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 cl(e){const t={};let n=-1,r,i,s,a,u,o,c;const d=new bg(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(o=r[1]._tokenizer.events,s=0,s<o.length&&o[s][1].type==="lineEndingBlank"&&(s+=2),s<o.length&&o[s][1].type==="content"))for(;++s<o.length&&o[s][1].type!=="content";)o[s][1].type==="chunkText"&&(o[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Eg(d,n)),n=t[n],c=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(a=d.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},u=d.slice(i,n),u.unshift(r),d.splice(i,n-i+1,u))}}return Le(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!c}function Eg(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const u=a.events,o=[],c={};let d,h,f=-1,m=n,b=0,k=0;const S=[k];for(;m;){for(;e.get(++i)[1]!==m;);s.push(i),m._tokenizer||(d=r.sliceStream(m),m.next||d.push(null),h&&a.defineSkip(m.start),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(d),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),h=m,m=m.next}for(m=n;++f<u.length;)u[f][0]==="exit"&&u[f-1][0]==="enter"&&u[f][1].type===u[f-1][1].type&&u[f][1].start.line!==u[f][1].end.line&&(k=f+1,S.push(k),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(a.events=[],m?(m._tokenizer=void 0,m.previous=void 0):S.pop(),f=S.length;f--;){const _=u.slice(S[f],S[f+1]),L=s.pop();o.push([L,L+_.length-1]),e.splice(L,2,_)}for(o.reverse(),f=-1;++f<o.length;)c[b+o[f][0]]=b+o[f][1],b+=o[f][1]-o[f][0]-1;return c}const Tg={resolve:kg,tokenize:yg},xg={partial:!0,tokenize:Ag};function kg(e){return cl(e),e}function yg(e,t){let n;return r;function r(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(u)}function i(u){return u===null?s(u):q(u)?e.check(xg,a,s)(u):(e.consume(u),i)}function s(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function a(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Ag(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ne(e,s,"linePrefix")}function s(a){if(a===null||q(a))return n(a);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function dl(e,t,n,r,i,s,a,u,o){const c=o||Number.POSITIVE_INFINITY;let d=0;return h;function h(_){return _===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(_),e.exit(s),f):_===null||_===32||_===41||ir(_)?n(_):(e.enter(r),e.enter(a),e.enter(u),e.enter("chunkString",{contentType:"string"}),k(_))}function f(_){return _===62?(e.enter(s),e.consume(_),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),m(_))}function m(_){return _===62?(e.exit("chunkString"),e.exit(u),f(_)):_===null||_===60||q(_)?n(_):(e.consume(_),_===92?b:m)}function b(_){return _===60||_===62||_===92?(e.consume(_),m):m(_)}function k(_){return!d&&(_===null||_===41||le(_))?(e.exit("chunkString"),e.exit(u),e.exit(a),e.exit(r),t(_)):d<c&&_===40?(e.consume(_),d++,k):_===41?(e.consume(_),d--,k):_===null||_===32||_===40||ir(_)?n(_):(e.consume(_),_===92?S:k)}function S(_){return _===40||_===41||_===92?(e.consume(_),k):k(_)}}function hl(e,t,n,r,i,s){const a=this;let u=0,o;return c;function c(m){return e.enter(r),e.enter(i),e.consume(m),e.exit(i),e.enter(s),d}function d(m){return u>999||m===null||m===91||m===93&&!o||m===94&&!u&&"_hiddenFootnoteSupport"in a.parser.constructs?n(m):m===93?(e.exit(s),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):q(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),h(m))}function h(m){return m===null||m===91||m===93||q(m)||u++>999?(e.exit("chunkString"),d(m)):(e.consume(m),o||(o=!ee(m)),m===92?f:h)}function f(m){return m===91||m===92||m===93?(e.consume(m),u++,h):h(m)}}function fl(e,t,n,r,i,s){let a;return u;function u(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),a=f===40?41:f,o):n(f)}function o(f){return f===a?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(s),c(f))}function c(f){return f===a?(e.exit(s),o(a)):f===null?n(f):q(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),ne(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===a||f===null||q(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?h:d)}function h(f){return f===a||f===92?(e.consume(f),d):d(f)}}function dn(e,t){let n;return r;function r(i){return q(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ee(i)?ne(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const _g={name:"definition",tokenize:Sg},Cg={partial:!0,tokenize:Ng};function Sg(e,t,n){const r=this;let i;return s;function s(m){return e.enter("definition"),a(m)}function a(m){return hl.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function u(m){return i=He(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),o):n(m)}function o(m){return le(m)?dn(e,c)(m):c(m)}function c(m){return dl(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return e.attempt(Cg,h,h)(m)}function h(m){return ee(m)?ne(e,f,"whitespace")(m):f(m)}function f(m){return m===null||q(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function Ng(e,t,n){return r;function r(u){return le(u)?dn(e,i)(u):n(u)}function i(u){return fl(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function s(u){return ee(u)?ne(e,a,"whitespace")(u):a(u)}function a(u){return u===null||q(u)?t(u):n(u)}}const Ig={name:"hardBreakEscape",tokenize:wg};function wg(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return q(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const Lg={name:"headingAtx",resolve:Rg,tokenize:Og};function Rg(e,t){let n=e.length-2,r=3,i,s;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},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Le(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function Og(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(e.consume(d),a):d===null||le(d)?(e.exit("atxHeadingSequence"),u(d)):n(d)}function u(d){return d===35?(e.enter("atxHeadingSequence"),o(d)):d===null||q(d)?(e.exit("atxHeading"),t(d)):ee(d)?ne(e,u,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function o(d){return d===35?(e.consume(d),o):(e.exit("atxHeadingSequence"),u(d))}function c(d){return d===null||d===35||le(d)?(e.exit("atxHeadingText"),u(d)):(e.consume(d),c)}}const Dg=["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"],Ta=["pre","script","style","textarea"],Pg={concrete:!0,name:"htmlFlow",resolveTo:Bg,tokenize:Fg},vg={partial:!0,tokenize:Ug},Mg={partial:!0,tokenize:Hg};function Bg(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 Fg(e,t,n){const r=this;let i,s,a,u,o;return c;function c(A){return d(A)}function d(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),h}function h(A){return A===33?(e.consume(A),f):A===47?(e.consume(A),s=!0,k):A===63?(e.consume(A),i=3,r.interrupt?t:x):ye(A)?(e.consume(A),a=String.fromCharCode(A),S):n(A)}function f(A){return A===45?(e.consume(A),i=2,m):A===91?(e.consume(A),i=5,u=0,b):ye(A)?(e.consume(A),i=4,r.interrupt?t:x):n(A)}function m(A){return A===45?(e.consume(A),r.interrupt?t:x):n(A)}function b(A){const ve="CDATA[";return A===ve.charCodeAt(u++)?(e.consume(A),u===ve.length?r.interrupt?t:v:b):n(A)}function k(A){return ye(A)?(e.consume(A),a=String.fromCharCode(A),S):n(A)}function S(A){if(A===null||A===47||A===62||le(A)){const ve=A===47,lt=a.toLowerCase();return!ve&&!s&&Ta.includes(lt)?(i=1,r.interrupt?t(A):v(A)):Dg.includes(a.toLowerCase())?(i=6,ve?(e.consume(A),_):r.interrupt?t(A):v(A)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(A):s?L(A):I(A))}return A===45||Ee(A)?(e.consume(A),a+=String.fromCharCode(A),S):n(A)}function _(A){return A===62?(e.consume(A),r.interrupt?t:v):n(A)}function L(A){return ee(A)?(e.consume(A),L):N(A)}function I(A){return A===47?(e.consume(A),N):A===58||A===95||ye(A)?(e.consume(A),B):ee(A)?(e.consume(A),I):N(A)}function B(A){return A===45||A===46||A===58||A===95||Ee(A)?(e.consume(A),B):z(A)}function z(A){return A===61?(e.consume(A),R):ee(A)?(e.consume(A),z):I(A)}function R(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),o=A,$):ee(A)?(e.consume(A),R):G(A)}function $(A){return A===o?(e.consume(A),o=null,K):A===null||q(A)?n(A):(e.consume(A),$)}function G(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||le(A)?z(A):(e.consume(A),G)}function K(A){return A===47||A===62||ee(A)?I(A):n(A)}function N(A){return A===62?(e.consume(A),U):n(A)}function U(A){return A===null||q(A)?v(A):ee(A)?(e.consume(A),U):n(A)}function v(A){return A===45&&i===2?(e.consume(A),F):A===60&&i===1?(e.consume(A),W):A===62&&i===4?(e.consume(A),Ne):A===63&&i===3?(e.consume(A),x):A===93&&i===5?(e.consume(A),re):q(A)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(vg,Ve,V)(A)):A===null||q(A)?(e.exit("htmlFlowData"),V(A)):(e.consume(A),v)}function V(A){return e.check(Mg,Y,Ve)(A)}function Y(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),j}function j(A){return A===null||q(A)?V(A):(e.enter("htmlFlowData"),v(A))}function F(A){return A===45?(e.consume(A),x):v(A)}function W(A){return A===47?(e.consume(A),a="",ue):v(A)}function ue(A){if(A===62){const ve=a.toLowerCase();return Ta.includes(ve)?(e.consume(A),Ne):v(A)}return ye(A)&&a.length<8?(e.consume(A),a+=String.fromCharCode(A),ue):v(A)}function re(A){return A===93?(e.consume(A),x):v(A)}function x(A){return A===62?(e.consume(A),Ne):A===45&&i===2?(e.consume(A),x):v(A)}function Ne(A){return A===null||q(A)?(e.exit("htmlFlowData"),Ve(A)):(e.consume(A),Ne)}function Ve(A){return e.exit("htmlFlow"),t(A)}}function Hg(e,t,n){const r=this;return i;function i(a){return q(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function Ug(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(wn,t,n)}}const jg={name:"htmlText",tokenize:zg};function zg(e,t,n){const r=this;let i,s,a;return u;function u(x){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(x),o}function o(x){return x===33?(e.consume(x),c):x===47?(e.consume(x),z):x===63?(e.consume(x),I):ye(x)?(e.consume(x),G):n(x)}function c(x){return x===45?(e.consume(x),d):x===91?(e.consume(x),s=0,b):ye(x)?(e.consume(x),L):n(x)}function d(x){return x===45?(e.consume(x),m):n(x)}function h(x){return x===null?n(x):x===45?(e.consume(x),f):q(x)?(a=h,W(x)):(e.consume(x),h)}function f(x){return x===45?(e.consume(x),m):h(x)}function m(x){return x===62?F(x):x===45?f(x):h(x)}function b(x){const Ne="CDATA[";return x===Ne.charCodeAt(s++)?(e.consume(x),s===Ne.length?k:b):n(x)}function k(x){return x===null?n(x):x===93?(e.consume(x),S):q(x)?(a=k,W(x)):(e.consume(x),k)}function S(x){return x===93?(e.consume(x),_):k(x)}function _(x){return x===62?F(x):x===93?(e.consume(x),_):k(x)}function L(x){return x===null||x===62?F(x):q(x)?(a=L,W(x)):(e.consume(x),L)}function I(x){return x===null?n(x):x===63?(e.consume(x),B):q(x)?(a=I,W(x)):(e.consume(x),I)}function B(x){return x===62?F(x):I(x)}function z(x){return ye(x)?(e.consume(x),R):n(x)}function R(x){return x===45||Ee(x)?(e.consume(x),R):$(x)}function $(x){return q(x)?(a=$,W(x)):ee(x)?(e.consume(x),$):F(x)}function G(x){return x===45||Ee(x)?(e.consume(x),G):x===47||x===62||le(x)?K(x):n(x)}function K(x){return x===47?(e.consume(x),F):x===58||x===95||ye(x)?(e.consume(x),N):q(x)?(a=K,W(x)):ee(x)?(e.consume(x),K):F(x)}function N(x){return x===45||x===46||x===58||x===95||Ee(x)?(e.consume(x),N):U(x)}function U(x){return x===61?(e.consume(x),v):q(x)?(a=U,W(x)):ee(x)?(e.consume(x),U):K(x)}function v(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),i=x,V):q(x)?(a=v,W(x)):ee(x)?(e.consume(x),v):(e.consume(x),Y)}function V(x){return x===i?(e.consume(x),i=void 0,j):x===null?n(x):q(x)?(a=V,W(x)):(e.consume(x),V)}function Y(x){return x===null||x===34||x===39||x===60||x===61||x===96?n(x):x===47||x===62||le(x)?K(x):(e.consume(x),Y)}function j(x){return x===47||x===62||le(x)?K(x):n(x)}function F(x){return x===62?(e.consume(x),e.exit("htmlTextData"),e.exit("htmlText"),t):n(x)}function W(x){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),ue}function ue(x){return ee(x)?ne(e,re,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):re(x)}function re(x){return e.enter("htmlTextData"),a(x)}}const Vi={name:"labelEnd",resolveAll:Vg,resolveTo:Wg,tokenize:Gg},$g={tokenize:Qg},Yg={tokenize:Kg},qg={tokenize:Xg};function Vg(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Le(e,0,e.length,n),e}function Wg(e,t){let n=e.length,r=0,i,s,a,u;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const o={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[s][1].start},end:{...e[a][1].end}},d={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[a-2][1].start}};return u=[["enter",o,t],["enter",c,t]],u=Oe(u,e.slice(s+1,s+r+3)),u=Oe(u,[["enter",d,t]]),u=Oe(u,_r(t.parser.constructs.insideSpan.null,e.slice(s+r+4,a-3),t)),u=Oe(u,[["exit",d,t],e[a-2],e[a-1],["exit",c,t]]),u=Oe(u,e.slice(a+1)),u=Oe(u,[["exit",o,t]]),Le(e,s,e.length,u),e}function Gg(e,t,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return u;function u(f){return s?s._inactive?h(f):(a=r.parser.defined.includes(He(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),o):n(f)}function o(f){return f===40?e.attempt($g,d,a?d:h)(f):f===91?e.attempt(Yg,d,a?c:h)(f):a?d(f):h(f)}function c(f){return e.attempt(qg,d,h)(f)}function d(f){return t(f)}function h(f){return s._balanced=!0,n(f)}}function Qg(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return le(h)?dn(e,s)(h):s(h)}function s(h){return h===41?d(h):dl(e,a,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function a(h){return le(h)?dn(e,o)(h):d(h)}function u(h){return n(h)}function o(h){return h===34||h===39||h===40?fl(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function c(h){return le(h)?dn(e,d)(h):d(h)}function d(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function Kg(e,t,n){const r=this;return i;function i(u){return hl.call(r,e,s,a,"reference","referenceMarker","referenceString")(u)}function s(u){return r.parser.defined.includes(He(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function a(u){return n(u)}}function Xg(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const Zg={name:"labelStartImage",resolveAll:Vi.resolveAll,tokenize:Jg};function Jg(e,t,n){const r=this;return i;function i(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),s}function s(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),a):n(u)}function a(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const eb={name:"labelStartLink",resolveAll:Vi.resolveAll,tokenize:tb};function tb(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Ur={name:"lineEnding",tokenize:nb};function nb(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ne(e,t,"linePrefix")}}const Wn={name:"thematicBreak",tokenize:rb};function rb(e,t,n){let r=0,i;return s;function s(c){return e.enter("thematicBreak"),a(c)}function a(c){return i=c,u(c)}function u(c){return c===i?(e.enter("thematicBreakSequence"),o(c)):r>=3&&(c===null||q(c))?(e.exit("thematicBreak"),t(c)):n(c)}function o(c){return c===i?(e.consume(c),r++,o):(e.exit("thematicBreakSequence"),ee(c)?ne(e,u,"whitespace")(c):u(c))}}const Ce={continuation:{tokenize:ub},exit:lb,name:"list",tokenize:ab},ib={partial:!0,tokenize:cb},sb={partial:!0,tokenize:ob};function ab(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return u;function u(m){const b=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:ci(m)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Wn,n,c)(m):c(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),o(m)}return n(m)}function o(m){return ci(m)&&++a<10?(e.consume(m),o):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):n(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(wn,r.interrupt?n:d,e.attempt(ib,f,h))}function d(m){return r.containerState.initialBlankLine=!0,s++,f(m)}function h(m){return ee(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),f):n(m)}function f(m){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function ub(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(wn,i,s);function i(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ne(e,t,"listItemIndent",r.containerState.size+1)(u)}function s(u){return r.containerState.furtherBlankLines||!ee(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(sb,t,a)(u))}function a(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,ne(e,e.attempt(Ce,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function ob(e,t,n){const r=this;return ne(e,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(s):n(s)}}function lb(e){e.exit(this.containerState.type)}function cb(e,t,n){const r=this;return ne(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!ee(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const xa={name:"setextUnderline",resolveTo:db,tokenize:hb};function db(e,t){let n=e.length,r,i,s;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),!s&&e[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",a,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function hb(e,t,n){const r=this;let i;return s;function s(c){let d=r.events.length,h;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){h=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),u(c)}function u(c){return c===i?(e.consume(c),u):(e.exit("setextHeadingLineSequence"),ee(c)?ne(e,o,"lineSuffix")(c):o(c))}function o(c){return c===null||q(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const fb={tokenize:kb,partial:!0};function mb(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Eb,continuation:{tokenize:Tb},exit:xb}},text:{91:{name:"gfmFootnoteCall",tokenize:bb},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:pb,resolveTo:gb}}}}function pb(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const o=r.events[i][1];if(o.type==="labelImage"){a=o;break}if(o.type==="gfmFootnoteCall"||o.type==="labelLink"||o.type==="label"||o.type==="image"||o.type==="link")break}return u;function u(o){if(!a||!a._balanced)return n(o);const c=He(r.sliceSerialize({start:a.end,end:r.now()}));return c.codePointAt(0)!==94||!s.includes(c.slice(1))?n(o):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),t(o))}}function gb(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";const 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++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},u=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...u),e}function bb(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,a;return u;function u(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),o}function o(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(h){if(s>999||h===93&&!a||h===null||h===91||le(h))return n(h);if(h===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return i.includes(He(r.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return le(h)||(a=!0),s++,e.consume(h),h===92?d:c}function d(h){return h===91||h===92||h===93?(e.consume(h),s++,c):c(h)}}function Eb(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,a=0,u;return o;function o(b){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(b){return b===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(b)}function d(b){if(a>999||b===93&&!u||b===null||b===91||le(b))return n(b);if(b===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return s=He(r.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return le(b)||(u=!0),a++,e.consume(b),b===92?h:d}function h(b){return b===91||b===92||b===93?(e.consume(b),a++,d):d(b)}function f(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),i.includes(s)||i.push(s),ne(e,m,"gfmFootnoteDefinitionWhitespace")):n(b)}function m(b){return t(b)}}function Tb(e,t,n){return e.check(wn,t,e.attempt(fb,t,n))}function xb(e){e.exit("gfmFootnoteDefinition")}function kb(e,t,n){const r=this;return ne(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(s):n(s)}}function yb(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,u){let o=-1;for(;++o<a.length;)if(a[o][0]==="enter"&&a[o][1].type==="strikethroughSequenceTemporary"&&a[o][1]._close){let c=o;for(;c--;)if(a[c][0]==="exit"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._open&&a[o][1].end.offset-a[o][1].start.offset===a[c][1].end.offset-a[c][1].start.offset){a[o][1].type="strikethroughSequence",a[c][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},a[c][1].start),end:Object.assign({},a[o][1].end)},h={type:"strikethroughText",start:Object.assign({},a[c][1].end),end:Object.assign({},a[o][1].start)},f=[["enter",d,u],["enter",a[c][1],u],["exit",a[c][1],u],["enter",h,u]],m=u.parser.constructs.insideSpan.null;m&&Le(f,f.length,0,_r(m,a.slice(c+1,o),u)),Le(f,f.length,0,[["exit",h,u],["enter",a[o][1],u],["exit",a[o][1],u],["exit",d,u]]),Le(a,c-1,o-c+3,f),o=c+f.length-2;break}}for(o=-1;++o<a.length;)a[o][1].type==="strikethroughSequenceTemporary"&&(a[o][1].type="data");return a}function s(a,u,o){const c=this.previous,d=this.events;let h=0;return f;function f(b){return c===126&&d[d.length-1][1].type!=="characterEscape"?o(b):(a.enter("strikethroughSequenceTemporary"),m(b))}function m(b){const k=Bt(c);if(b===126)return h>1?o(b):(a.consume(b),h++,m);if(h<2&&!n)return o(b);const S=a.exit("strikethroughSequenceTemporary"),_=Bt(b);return S._open=!_||_===2&&!!k,S._close=!k||k===2&&!!_,u(b)}}}class Ab{constructor(){this.map=[]}add(t,n,r){_b(this,t,n,r)}consume(t){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function _b(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 Cb(e,t){let n=!1;const r=[];for(;t<e.length;){const 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"){const s=r.length-1;r[s]=r[s]==="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 Sb(){return{flow:{null:{name:"table",tokenize:Nb,resolveAll:Ib}}}}function Nb(e,t,n){const r=this;let i=0,s=0,a;return u;function u(N){let U=r.events.length-1;for(;U>-1;){const Y=r.events[U][1].type;if(Y==="lineEnding"||Y==="linePrefix")U--;else break}const v=U>-1?r.events[U][1].type:null,V=v==="tableHead"||v==="tableRow"?R:o;return V===R&&r.parser.lazy[r.now().line]?n(N):V(N)}function o(N){return e.enter("tableHead"),e.enter("tableRow"),c(N)}function c(N){return N===124||(a=!0,s+=1),d(N)}function d(N){return N===null?n(N):q(N)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),m):n(N):ee(N)?ne(e,d,"whitespace")(N):(s+=1,a&&(a=!1,i+=1),N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),h(N)))}function h(N){return N===null||N===124||le(N)?(e.exit("data"),d(N)):(e.consume(N),N===92?f:h)}function f(N){return N===92||N===124?(e.consume(N),h):h(N)}function m(N){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(N):(e.enter("tableDelimiterRow"),a=!1,ee(N)?ne(e,b,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):b(N))}function b(N){return N===45||N===58?S(N):N===124?(a=!0,e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),k):z(N)}function k(N){return ee(N)?ne(e,S,"whitespace")(N):S(N)}function S(N){return N===58?(s+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),_):N===45?(s+=1,_(N)):N===null||q(N)?B(N):z(N)}function _(N){return N===45?(e.enter("tableDelimiterFiller"),L(N)):z(N)}function L(N){return N===45?(e.consume(N),L):N===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),I):(e.exit("tableDelimiterFiller"),I(N))}function I(N){return ee(N)?ne(e,B,"whitespace")(N):B(N)}function B(N){return N===124?b(N):N===null||q(N)?!a||i!==s?z(N):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(N)):z(N)}function z(N){return n(N)}function R(N){return e.enter("tableRow"),$(N)}function $(N){return N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),$):N===null||q(N)?(e.exit("tableRow"),t(N)):ee(N)?ne(e,$,"whitespace")(N):(e.enter("data"),G(N))}function G(N){return N===null||N===124||le(N)?(e.exit("data"),$(N)):(e.consume(N),N===92?K:G)}function K(N){return N===92||N===124?(e.consume(N),G):G(N)}}function Ib(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],u=!1,o=0,c,d,h;const f=new Ab;for(;++n<e.length;){const m=e[n],b=m[1];m[0]==="enter"?b.type==="tableHead"?(u=!1,o!==0&&(ka(f,t,o,c,d),d=void 0,o=0),c={type:"table",start:Object.assign({},b.start),end:Object.assign({},b.end)},f.add(n,0,[["enter",c,t]])):b.type==="tableRow"||b.type==="tableDelimiterRow"?(r=!0,h=void 0,s=[0,0,0,0],a=[0,n+1,0,0],u&&(u=!1,d={type:"tableBody",start:Object.assign({},b.start),end:Object.assign({},b.end)},f.add(n,0,[["enter",d,t]])),i=b.type==="tableDelimiterRow"?2:d?3:1):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(s[1]!==0&&(a[0]=a[1],h=Bn(f,t,s,i,void 0,h),s=[0,0,0,0]),a[2]=n)):b.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(a[0]=a[1],h=Bn(f,t,s,i,void 0,h)),s=a,a=[s[1],n,0,0])):b.type==="tableHead"?(u=!0,o=n):b.type==="tableRow"||b.type==="tableDelimiterRow"?(o=n,s[1]!==0?(a[0]=a[1],h=Bn(f,t,s,i,n,h)):a[1]!==0&&(h=Bn(f,t,a,i,n,h)),i=0):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(a[3]=n)}for(o!==0&&ka(f,t,o,c,d),f.consume(t.events),n=-1;++n<t.events.length;){const m=t.events[n];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=Cb(t.events,n))}return e}function Bn(e,t,n,r,i,s){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(s.end=Object.assign({},Lt(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const o=Lt(t.events,n[1]);if(s={type:a,start:Object.assign({},o),end:Object.assign({},o)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const c=Lt(t.events,n[2]),d=Lt(t.events,n[3]),h={type:u,start:Object.assign({},c),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const f=t.events[n[2]],m=t.events[n[3]];if(f[1].end=Object.assign({},m[1].end),f[1].type="chunkText",f[1].contentType="text",n[3]>n[2]+1){const b=n[2]+1,k=n[3]-n[2]-1;e.add(b,k,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return i!==void 0&&(s.end=Object.assign({},Lt(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function ka(e,t,n,r,i){const s=[],a=Lt(t.events,n);i&&(i.end=Object.assign({},a),s.push(["exit",i,t])),r.end=Object.assign({},a),s.push(["exit",r,t]),e.add(n+1,0,s)}function Lt(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const wb={name:"tasklistCheck",tokenize:Rb};function Lb(){return{text:{91:wb}}}function Rb(e,t,n){const r=this;return i;function i(o){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(o):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(o),e.exit("taskListCheckMarker"),s)}function s(o){return le(o)?(e.enter("taskListCheckValueUnchecked"),e.consume(o),e.exit("taskListCheckValueUnchecked"),a):o===88||o===120?(e.enter("taskListCheckValueChecked"),e.consume(o),e.exit("taskListCheckValueChecked"),a):n(o)}function a(o){return o===93?(e.enter("taskListCheckMarker"),e.consume(o),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(o)}function u(o){return q(o)?t(o):ee(o)?e.check({tokenize:Ob},t,n)(o):n(o)}}function Ob(e,t,n){return ne(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function Db(e){return Zo([$1(),mb(),yb(e),Sb(),Lb()])}const Pb={};function vb(e){const t=this,n=e||Pb,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Db(n)),s.push(B1()),a.push(F1(n))}var Mb=Object.defineProperty,Bb=Object.defineProperties,Fb=Object.getOwnPropertyDescriptors,ya=Object.getOwnPropertySymbols,Hb=Object.prototype.hasOwnProperty,Ub=Object.prototype.propertyIsEnumerable,Aa=(e,t,n)=>t in e?Mb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ml=(e,t)=>{for(var n in t||(t={}))Hb.call(t,n)&&Aa(e,n,t[n]);if(ya)for(var n of ya(t))Ub.call(t,n)&&Aa(e,n,t[n]);return e},pl=(e,t)=>Bb(e,Fb(t)),jb=/(\*\*)([^*]*\*?)$/,zb=/(__)([^_]*?)$/,$b=/(\*\*\*)([^*]*?)$/,Yb=/(\*)([^*]*?)$/,qb=/(_)([^_]*?)$/,Vb=/(`)([^`]*?)$/,Wb=/(~~)([^~]*?)$/,yt=/^[\s_~*`]*$/,gl=/^[\s]*[-*+][\s]+$/,Gb=/[\p{L}\p{N}_]/u,Qb=/^```[^`\n]*```?$/,Kb=/^\*{4,}$/,Xb=/(__)([^_]+)_$/,Zb=/(~~)([^~]+)~$/,Jb=/__/g,_a=/~~/g,at=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95?!0:Gb.test(e)},Et=(e,t)=>{let n=!1;for(let r=0;r<t;r+=1)e[r]==="`"&&e[r+1]==="`"&&e[r+2]==="`"&&(n=!n,r+=2);return n},eE=(e,t)=>{let n=1;for(let r=t-1;r>=0;r-=1)if(e[r]==="]")n+=1;else if(e[r]==="["&&(n-=1,n===0))return r;return-1},bl=(e,t)=>{let n=1;for(let r=t+1;r<e.length;r+=1)if(e[r]==="[")n+=1;else if(e[r]==="]"&&(n-=1,n===0))return r;return-1},Cr=(e,t)=>{let n=!1,r=!1;for(let i=0;i<e.length&&i<t;i+=1){if(e[i]==="\\"&&e[i+1]==="$"){i+=1;continue}e[i]==="$"&&(e[i+1]==="$"?(r=!r,i+=1,n=!1):r||(n=!n))}return n||r},tE=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===")")return!0;if(e[n]===`
|
|
22
|
+
`)return!1}return!1},El=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===")")return!1;if(e[n]==="(")return n>0&&e[n-1]==="]"?tE(e,t):!1;if(e[n]===`
|
|
23
|
+
`)return!1}return!1},Wi=(e,t,n)=>{let r=0;for(let o=t-1;o>=0;o-=1)if(e[o]===`
|
|
24
24
|
`){r=o+1;break}let i=e.length;for(let o=t;o<e.length;o+=1)if(e[o]===`
|
|
25
|
-
`){i=o;break}let s=e.substring(r,i),a=0,u=!1;for(let o of s)if(o===n)a+=1;else if(o!==" "&&o!==" "){u=!0;break}return a>=3&&!u},
|
|
26
|
-
`){r=i+1;break}for(let i=r;i<t;i+=1)if(e[i]!==" "&&e[i]!==" ")return!1;return!0},
|
|
25
|
+
`){i=o;break}let s=e.substring(r,i),a=0,u=!1;for(let o of s)if(o===n)a+=1;else if(o!==" "&&o!==" "){u=!0;break}return a>=3&&!u},nE=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,rE=e=>!e||typeof e!="string"||!e.includes(">")?e:e.replace(nE,(t,n,r,i)=>Et(e,i)?t:`${n}\\>${r}`),iE=(e,t,n)=>{if(n!==" "&&n!==" ")return!1;let r=0;for(let i=t-1;i>=0;i-=1)if(e[i]===`
|
|
26
|
+
`){r=i+1;break}for(let i=r;i<t;i+=1)if(e[i]!==" "&&e[i]!==" ")return!1;return!0},sE=(e,t,n,r)=>n==="\\"||e.includes("$")&&Cr(e,t)?!0:n!=="*"&&r==="*"?(t<e.length-2?e[t+2]:"")!=="*":!!(n==="*"||n&&r&&at(n)&&at(r)||(!n||n===" "||n===" "||n===`
|
|
27
27
|
`)&&(!r||r===" "||r===" "||r===`
|
|
28
|
-
`)||
|
|
29
|
-
`),i=r===-1?0:r+1,s=e.substring(i,n);return
|
|
30
|
-
`)?!0:
|
|
31
|
-
`),i=r===-1?0:r+1,s=e.substring(i,n);return
|
|
32
|
-
`)?!0:
|
|
28
|
+
`)||iE(e,t,r)),Tl=e=>{let t=0,n=e.length;for(let r=0;r<n;r+=1){if(e[r]!=="*")continue;let i=r>0?e[r-1]:"",s=r<n-1?e[r+1]:"";sE(e,r,i,s)||(t+=1)}return t},aE=(e,t,n,r)=>!!(n==="\\"||e.includes("$")&&Cr(e,t)||El(e,t)||n==="_"||r==="_"||n&&r&&at(n)&&at(r)),uE=e=>{let t=0,n=e.length;for(let r=0;r<n;r+=1){if(e[r]!=="_")continue;let i=r>0?e[r-1]:"",s=r<n-1?e[r+1]:"";aE(e,r,i,s)||(t+=1)}return t},oE=e=>{let t=0,n=0;for(let r=0;r<e.length;r+=1)e[r]==="*"?n+=1:(n>=3&&(t+=Math.floor(n/3)),n=0);return n>=3&&(t+=Math.floor(n/3)),t},lE=(e,t,n)=>{if(!t||yt.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
29
|
+
`),i=r===-1?0:r+1,s=e.substring(i,n);return gl.test(s)&&t.includes(`
|
|
30
|
+
`)?!0:Wi(e,n,"*")},cE=e=>{let t=e.match(jb);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return Et(e,r)||lE(e,n,r)?e:(e.match(/\*\*/g)||[]).length%2===1?n.endsWith("*")?`${e}*`:`${e}**`:e},dE=(e,t,n)=>{if(!t||yt.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
31
|
+
`),i=r===-1?0:r+1,s=e.substring(i,n);return gl.test(s)&&t.includes(`
|
|
32
|
+
`)?!0:Wi(e,n,"_")},hE=e=>{let t=e.match(zb);if(!t){let i=e.match(Xb);if(i){let s=e.lastIndexOf(i[1]);if(!Et(e,s)&&(e.match(Jb)||[]).length%2===1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return Et(e,r)||dE(e,n,r)?e:(e.match(/__/g)||[]).length%2===1?`${e}__`:e},fE=e=>{for(let t=0;t<e.length;t+=1)if(e[t]==="*"&&e[t-1]!=="*"&&e[t+1]!=="*"&&e[t-1]!=="\\"&&!Cr(e,t)){let n=t>0?e[t-1]:"",r=t<e.length-1?e[t+1]:"";if((!n||n===" "||n===" "||n===`
|
|
33
33
|
`)&&(!r||r===" "||r===" "||r===`
|
|
34
|
-
`)||n&&r&&at(n)&&at(r))continue;return t}return-1},
|
|
35
|
-
`;)t-=1;if(t<e.length){let n=e.slice(0,t),r=e.slice(t);return`${n}_${r}`}return`${e}_`},
|
|
36
|
-
`)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,
|
|
34
|
+
`)||n&&r&&at(n)&&at(r))continue;return t}return-1},mE=e=>{if(!e.match(Yb))return e;let t=fE(e);if(t===-1||Et(e,t))return e;let n=e.substring(t+1);return!n||yt.test(n)?e:Tl(e)%2===1?`${e}*`:e},xl=e=>{for(let t=0;t<e.length;t+=1)if(e[t]==="_"&&e[t-1]!=="_"&&e[t+1]!=="_"&&e[t-1]!=="\\"&&!Cr(e,t)&&!El(e,t)){let n=t>0?e[t-1]:"",r=t<e.length-1?e[t+1]:"";if(n&&r&&at(n)&&at(r))continue;return t}return-1},pE=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
35
|
+
`;)t-=1;if(t<e.length){let n=e.slice(0,t),r=e.slice(t);return`${n}_${r}`}return`${e}_`},gE=e=>{if(!e.endsWith("**"))return null;let t=e.slice(0,-2);if((t.match(/\*\*/g)||[]).length%2!==1)return null;let n=t.indexOf("**"),r=xl(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},bE=e=>{if(!e.match(qb))return e;let t=xl(e);if(t===-1||Et(e,t))return e;let n=e.substring(t+1);if(!n||yt.test(n))return e;if(uE(e)%2===1){let r=gE(e);return r!==null?r:pE(e)}return e},EE=e=>{let t=(e.match(/\*\*/g)||[]).length,n=Tl(e);return t%2===0&&n%2===0},TE=(e,t,n)=>!t||yt.test(t)||Et(e,n)?!0:Wi(e,n,"*"),xE=e=>{if(Kb.test(e))return e;let t=e.match($b);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return TE(e,n,r)?e:oE(e)%2===1?EE(e)?e:`${e}***`:e},Tn=(e,t)=>{let n=!1,r=!1;for(let i=0;i<t;i+=1){if(e.substring(i,i+3)==="```"){r=!r,i+=2;continue}!r&&e[i]==="`"&&(n=!n)}return n||r},kE=(e,t)=>{let n=e.substring(t,t+3)==="```",r=t>0&&e.substring(t-1,t+2)==="```",i=t>1&&e.substring(t-2,t+1)==="```";return n||r||i},yE=e=>{let t=0;for(let n=0;n<e.length;n+=1)e[n]==="`"&&!kE(e,n)&&(t+=1);return t},AE=/<[a-zA-Z/][^>]*$/,_E=e=>{let t=e.match(AE);return!t||t.index===void 0||Tn(e,t.index)?e:e.substring(0,t.index).trimEnd()},CE=e=>!e.match(Qb)||e.includes(`
|
|
36
|
+
`)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,SE=e=>(e.match(/```/g)||[]).length%2===1,NE=e=>{let t=CE(e);if(t!==null)return t;let n=e.match(Vb);if(n&&!SE(e)){let r=n[2];if(!r||yt.test(r))return e;if(yE(e)%2===1)return`${e}\``}return e},IE=(e,t)=>t>=2&&e.substring(t-2,t+1)==="```"||t>=1&&e.substring(t-1,t+2)==="```"||t<=e.length-3&&e.substring(t,t+3)==="```",wE=e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)e[r]==="`"&&!IE(e,r)&&(n=!n),!n&&e[r]==="$"&&e[r+1]==="$"&&(t+=1,r+=1);return t},LE=e=>{let t=e.indexOf("$$");return t!==-1&&e.indexOf(`
|
|
37
37
|
`,t)!==-1&&!e.endsWith(`
|
|
38
38
|
`)?`${e}
|
|
39
|
-
$$`:`${e}$$`},
|
|
40
|
-
`);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),i=n.trim();if(
|
|
41
|
-
`).at(-1);if(s&&s.trim().length>0)return`${e}`}if(
|
|
42
|
-
`).at(-1);if(s&&s.trim().length>0)return`${e}`}return e},
|
|
43
|
-
`,c="/",d="*",h="",f="comment",m="declaration";function b(S,_){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];_=_||{};var L=1,I=1;function B(Y){var j=Y.match(t);j&&(L+=j.length);var F=Y.lastIndexOf(o);I=~F?Y.length-F:I+Y.length}function z(){var Y={line:L,column:I};return function(j){return j.position=new R(Y),K(),j}}function R(Y){this.start=Y,this.end={line:L,column:I},this.source=_.source}R.prototype.content=S;function $(Y){var j=new Error(_.source+":"+L+":"+I+": "+Y);if(j.reason=Y,j.filename=_.source,j.line=L,j.column=I,j.source=S,!_.silent)throw j}function G(Y){var j=Y.exec(S);if(j){var F=j[0];return B(F),S=S.slice(F.length),j}}function K(){G(n)}function N(Y){var j;for(Y=Y||[];j=U();)j!==!1&&Y.push(j);return Y}function U(){var Y=z();if(!(c!=S.charAt(0)||d!=S.charAt(1))){for(var j=2;h!=S.charAt(j)&&(d!=S.charAt(j)||c!=S.charAt(j+1));)++j;if(j+=2,h===S.charAt(j-1))return $("End of comment missing");var F=S.slice(2,j-2);return I+=2,B(F),S=S.slice(j),I+=2,Y({type:f,comment:F})}}function v(){var Y=z(),j=G(r);if(j){if(U(),!G(i))return $("property missing ':'");var F=G(s),W=Y({type:m,property:A(j[0].replace(e,h)),value:F?A(F[0].replace(e,h)):h});return G(a),W}}function V(){var Y=[];N(Y);for(var j;j=v();)j!==!1&&(Y.push(j),N(Y));return Y}return K(),V()}function A(S){return S?S.replace(u,h):h}return Ur=b,Ur}var Ca;function YE(){if(Ca)return It;Ca=1;var e=It&&It.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(It,"__esModule",{value:!0}),It.default=n;const t=e($E());function n(r,i){let s=null;if(!r||typeof r!="string")return s;const a=(0,t.default)(r),u=typeof i=="function";return a.forEach(o=>{if(o.type!=="declaration")return;const{property:c,value:d}=o;u?i(c,d,o):d&&(s=s||{},s[c]=d)}),s}return It}var Qt={},Sa;function qE(){if(Sa)return Qt;Sa=1,Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(c){return!c||n.test(c)||e.test(c)},a=function(c,d){return d.toUpperCase()},u=function(c,d){return"".concat(d,"-")},o=function(c,d){return d===void 0&&(d={}),s(c)?c:(c=c.toLowerCase(),d.reactCompat?c=c.replace(i,u):c=c.replace(r,u),c.replace(t,a))};return Qt.camelCase=o,Qt}var Kt,Na;function VE(){if(Na)return Kt;Na=1;var e=Kt&&Kt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(YE()),n=qE();function r(i,s){var a={};return!i||typeof i!="string"||(0,t.default)(i,function(u,o){u&&o&&(a[(0,n.camelCase)(u,s)]=o)}),a}return r.default=r,Kt=r,Kt}var WE=VE();const GE=Eu(WE);function dn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ia(e.position):"start"in e||"end"in e?Ia(e):"line"in e||"column"in e?hi(e):""}function hi(e){return wa(e&&e.line)+":"+wa(e&&e.column)}function Ia(e){return hi(e&&e.start)+"-"+hi(e&&e.end)}function wa(e){return e&&typeof e=="number"?e:1}class xe extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(a=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const o=r.indexOf(":");o===-1?s.ruleId=r:(s.source=r.slice(0,o),s.ruleId=r.slice(o+1))}if(!s.place&&s.ancestors&&s.ancestors){const o=s.ancestors[s.ancestors.length-1];o&&(s.place=o.position)}const u=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=u?u.line:void 0,this.name=dn(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}xe.prototype.file="";xe.prototype.name="";xe.prototype.reason="";xe.prototype.message="";xe.prototype.stack="";xe.prototype.column=void 0;xe.prototype.line=void 0;xe.prototype.ancestors=void 0;xe.prototype.cause=void 0;xe.prototype.fatal=void 0;xe.prototype.place=void 0;xe.prototype.ruleId=void 0;xe.prototype.source=void 0;const Wi={}.hasOwnProperty,QE=new Map,KE=/[A-Z]/g,XE=new Set(["table","tbody","thead","tfoot","tr"]),ZE=new Set(["td","th"]),bl="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function JE(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=uT(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=aT(n,t.jsx,t.jsxs)}const 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"?ut:An,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=El(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function El(e,t,n){if(t.type==="element")return eT(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return tT(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return rT(e,t,n);if(t.type==="mdxjsEsm")return nT(e,t);if(t.type==="root")return iT(e,t,n);if(t.type==="text")return sT(e,t)}function eT(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=ut,e.schema=i),e.ancestors.push(t);const s=xl(e,t.tagName,!1),a=oT(e,t);let u=Qi(e,t);return XE.has(t.tagName)&&(u=u.filter(function(o){return typeof o=="string"?!zE(o):!0})),Tl(e,a,s,t),Gi(a,u),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function tT(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Tn(e,t.position)}function nT(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Tn(e,t.position)}function rT(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=ut,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:xl(e,t.name,!0),a=lT(e,t),u=Qi(e,t);return Tl(e,a,s,t),Gi(a,u),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function iT(e,t,n){const r={};return Gi(r,Qi(e,t)),e.create(t,e.Fragment,r,n)}function sT(e,t){return t.value}function Tl(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Gi(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function aT(e,t,n){return r;function r(i,s,a,u){const c=Array.isArray(a.children)?n:t;return u?c(s,a,u):c(s,a)}}function uT(e,t){return n;function n(r,i,s,a){const u=Array.isArray(s.children),o=Ye(r);return t(i,s,a,u,{columnNumber:o?o.column-1:void 0,fileName:e,lineNumber:o?o.line:void 0},void 0)}}function oT(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Wi.call(t.properties,i)){const s=cT(e,i,t.properties[i]);if(s){const[a,u]=s;e.tableCellAlignToStyle&&a==="align"&&typeof u=="string"&&ZE.has(t.tagName)?r=u:n[a]=u}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function lT(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const u=a.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else Tn(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,s=e.evaluater.evaluateExpression(u.expression)}else Tn(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function Qi(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:QE;for(;++r<t.children.length;){const s=t.children[r];let a;if(e.passKeys){const o=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(o){const c=i.get(o)||0;a=o+"-"+c,i.set(o,c+1)}}const u=El(e,s,a);u!==void 0&&n.push(u)}return n}function cT(e,t,n){const r=pr(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Hu(n):Uu(n)),r.property==="style"){let i=typeof n=="object"?n:dT(e,String(n));return e.stylePropertyNameCase==="css"&&(i=hT(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?_h[r.property]||r.property:r.attribute,n]}}function dT(e,t){try{return GE(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new xe("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=bl+"#cannot-parse-style-attribute",i}}function xl(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,a;for(;++s<i.length;){const u=ya(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};a=a?{type:"MemberExpression",object:a,property:u,computed:!!(s&&u.type==="Literal"),optional:!1}:u}r=a}else r=ya(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Wi.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Tn(e)}function Tn(e,t){const n=new xe("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=bl+"#cannot-handle-mdx-estrees-without-createevaluater",n}function hT(e){const t={};let n;for(n in e)Wi.call(e,n)&&(t[fT(n)]=e[n]);return t}function fT(e){let t=e.replace(KE,mT);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function mT(e){return"-"+e.toLowerCase()}const jr={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"]},pT={tokenize:gT};function gT(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),ne(e,t,"linePrefix")}function i(u){return e.enter("paragraph"),s(u)}function s(u){const o=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=o),n=o,a(u)}function a(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return q(u)?(e.consume(u),e.exit("chunkText"),s):(e.consume(u),a)}}const bT={tokenize:ET},La={tokenize:TT};function ET(e){const t=this,n=[];let r=0,i,s,a;return u;function u(I){if(r<n.length){const B=n[r];return t.containerState=B[1],e.attempt(B[0].continuation,o,c)(I)}return c(I)}function o(I){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&L();const B=t.events.length;let z=B,R;for(;z--;)if(t.events[z][0]==="exit"&&t.events[z][1].type==="chunkFlow"){R=t.events[z][1].end;break}_(r);let $=B;for(;$<t.events.length;)t.events[$][1].end={...R},$++;return Le(t.events,z+1,0,t.events.slice(B)),t.events.length=$,c(I)}return u(I)}function c(I){if(r===n.length){if(!i)return f(I);if(i.currentConstruct&&i.currentConstruct.concrete)return b(I);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(La,d,h)(I)}function d(I){return i&&L(),_(r),f(I)}function h(I){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,b(I)}function f(I){return t.containerState={},e.attempt(La,m,b)(I)}function m(I){return r++,n.push([t.currentConstruct,t.containerState]),f(I)}function b(I){if(I===null){i&&L(),_(0),e.consume(I);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),A(I)}function A(I){if(I===null){S(e.exit("chunkFlow"),!0),_(0),e.consume(I);return}return q(I)?(e.consume(I),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(I),A)}function S(I,B){const z=t.sliceStream(I);if(B&&z.push(null),I.previous=s,s&&(s.next=I),s=I,i.defineSkip(I.start),i.write(z),t.parser.lazy[I.start.line]){let R=i.events.length;for(;R--;)if(i.events[R][1].start.offset<a&&(!i.events[R][1].end||i.events[R][1].end.offset>a))return;const $=t.events.length;let G=$,K,N;for(;G--;)if(t.events[G][0]==="exit"&&t.events[G][1].type==="chunkFlow"){if(K){N=t.events[G][1].end;break}K=!0}for(_(r),R=$;R<t.events.length;)t.events[R][1].end={...N},R++;Le(t.events,G+1,0,t.events.slice($)),t.events.length=R}}function _(I){let B=n.length;for(;B-- >I;){const z=n[B];t.containerState=z[1],z[0].exit.call(t,e)}n.length=I}function L(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function TT(e,t,n){return ne(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const xT={tokenize:kT};function kT(e){const t=this,n=e.attempt(Nn,r,e.attempt(this.parser.constructs.flowInitial,i,ne(e,e.attempt(this.parser.constructs.flow,i,e.attempt(fg,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const yT={resolveAll:yl()},AT=kl("string"),_T=kl("text");function kl(e){return{resolveAll:yl(e==="text"?CT:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,a,u);return a;function a(d){return c(d)?s(d):u(d)}function u(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),o}function o(d){return c(d)?(n.exit("data"),s(d)):(n.consume(d),o)}function c(d){if(d===null)return!0;const h=i[d];let f=-1;if(h)for(;++f<h.length;){const m=h[f];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function yl(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function CT(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,a=-1,u=0,o;for(;s--;){const c=i[s];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)u++,a--;if(a)break;a=-1}else if(c===-2)o=!0,u++;else if(c!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const c={type:n===e.length||o||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:r.start._bufferIndex+a,_index:r.start._index+s,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const ST={42:Ce,43:Ce,45:Ce,48:Ce,49:Ce,50:Ce,51:Ce,52:Ce,53:Ce,54:Ce,55:Ce,56:Ce,57:Ce,62:nl},NT={91:Eg},IT={[-2]:Br,[-1]:Br,32:Br},wT={35:_g,42:Yn,45:[ga,Yn],60:Ig,61:ga,95:Yn,96:ma,126:ma},LT={38:il,92:rl},RT={[-5]:Fr,[-4]:Fr,[-3]:Fr,33:Vg,38:il,42:di,60:[G1,vg],91:Gg,92:[yg,rl],93:qi,95:di,96:ug},OT={null:[di,yT]},DT={null:[42,95]},PT={null:[]},vT=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:DT,contentInitial:NT,disable:PT,document:ST,flow:wT,flowInitial:IT,insideSpan:OT,string:LT,text:RT},Symbol.toStringTag,{value:"Module"}));function MT(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let a=[],u=[];const o={attempt:$(z),check:$(R),consume:L,enter:I,exit:B,interrupt:$(R,{interrupt:!0})},c={code:null,containerState:{},defineSkip:A,events:[],now:b,parser:e,previous:null,sliceSerialize:f,sliceStream:m,write:h};let d=t.tokenize.call(c,o);return t.resolveAll&&s.push(t),c;function h(U){return a=Oe(a,U),S(),a[a.length-1]!==null?[]:(G(t,0),c.events=yr(s,c.events,c),c.events)}function f(U,v){return FT(m(U),v)}function m(U){return BT(a,U)}function b(){const{_bufferIndex:U,_index:v,line:V,column:Y,offset:j}=r;return{_bufferIndex:U,_index:v,line:V,column:Y,offset:j}}function A(U){i[U.line]=U.column,N()}function S(){let U;for(;r._index<a.length;){const v=a[r._index];if(typeof v=="string")for(U=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===U&&r._bufferIndex<v.length;)_(v.charCodeAt(r._bufferIndex));else _(v)}}function _(U){d=d(U)}function L(U){q(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,N()):U!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=U}function I(U,v){const V=v||{};return V.type=U,V.start=b(),c.events.push(["enter",V,c]),u.push(V),V}function B(U){const v=u.pop();return v.end=b(),c.events.push(["exit",v,c]),v}function z(U,v){G(U,v.from)}function R(U,v){v.restore()}function $(U,v){return V;function V(Y,j,F){let W,ue,re,x;return Array.isArray(Y)?Ve(Y):"tokenize"in Y?Ve([Y]):Ne(Y);function Ne(be){return zt;function zt(Je){const At=Je!==null&&be[Je],_t=Je!==null&&be.null,Ln=[...Array.isArray(At)?At:At?[At]:[],...Array.isArray(_t)?_t:_t?[_t]:[]];return Ve(Ln)(Je)}}function Ve(be){return W=be,ue=0,be.length===0?F:y(be[ue])}function y(be){return zt;function zt(Je){return x=K(),re=be,be.partial||(c.currentConstruct=be),be.name&&c.parser.constructs.disable.null.includes(be.name)?lt():be.tokenize.call(v?Object.assign(Object.create(c),v):c,o,ve,lt)(Je)}}function ve(be){return U(re,x),j}function lt(be){return x.restore(),++ue<W.length?y(W[ue]):F}}}function G(U,v){U.resolveAll&&!s.includes(U)&&s.push(U),U.resolve&&Le(c.events,v,c.events.length-v,U.resolve(c.events.slice(v),c)),U.resolveTo&&(c.events=U.resolveTo(c.events,c))}function K(){const U=b(),v=c.previous,V=c.currentConstruct,Y=c.events.length,j=Array.from(u);return{from:Y,restore:F};function F(){r=U,c.previous=v,c.currentConstruct=V,c.events.length=Y,u=j,N()}}function N(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function BT(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,s)];else{if(a=e.slice(n,i),r>-1){const u=a[0];typeof u=="string"?a[0]=u.slice(r):a.shift()}s>0&&a.push(e[i].slice(0,s))}return a}function FT(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=`
|
|
39
|
+
$$`:`${e}$$`},RE=e=>wE(e)%2===0?e:LE(e),OE=(e,t,n)=>{if(e.substring(t+2).includes(")"))return null;let r=eE(e,t);if(r===-1||Tn(e,r))return null;let i=r>0&&e[r-1]==="!",s=i?r-1:r,a=e.substring(0,s);if(i)return a;let u=e.substring(r+1,t);return n==="text-only"?`${a}${u}`:`${a}[${u}](streamdown:incomplete-link)`},Ca=(e,t)=>{for(let n=0;n<=t;n++)if(e[n]==="["&&!Tn(e,n)){if(n>0&&e[n-1]==="!")continue;let r=bl(e,n);if(r===-1)return n;if(r+1<e.length&&e[r+1]==="("){let i=e.indexOf(")",r+2);i!==-1&&(n=i)}}return-1},DE=(e,t,n)=>{let r=t>0&&e[t-1]==="!",i=r?t-1:t,s=e.substring(t+1);if(!s.includes("]")){let a=e.substring(0,i);if(r)return a;if(n==="text-only"){let u=Ca(e,t);return u!==-1?e.substring(0,u)+e.substring(u+1):`${a}${s}`}return`${e}](streamdown:incomplete-link)`}if(bl(e,t)===-1){let a=e.substring(0,i);if(r)return a;if(n==="text-only"){let u=Ca(e,t);if(u!==-1)return e.substring(0,u)+e.substring(u+1);let o=e.substring(t+1);return`${a}${o}`}return`${e}](streamdown:incomplete-link)`}return null},kl=(e,t="protocol")=>{let n=e.lastIndexOf("](");if(n!==-1&&!Tn(e,n)){let r=OE(e,n,t);if(r!==null)return r}for(let r=e.length-1;r>=0;r-=1)if(e[r]==="["&&!Tn(e,r)){let i=DE(e,r,t);if(i!==null)return i}return e},PE=/^-{1,2}$/,vE=/^[\s]*-{1,2}[\s]+$/,ME=/^={1,2}$/,BE=/^[\s]*={1,2}[\s]+$/,FE=e=>{if(!e||typeof e!="string")return e;let t=e.lastIndexOf(`
|
|
40
|
+
`);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),i=n.trim();if(PE.test(i)&&!n.match(vE)){let s=r.split(`
|
|
41
|
+
`).at(-1);if(s&&s.trim().length>0)return`${e}`}if(ME.test(i)&&!n.match(BE)){let s=r.split(`
|
|
42
|
+
`).at(-1);if(s&&s.trim().length>0)return`${e}`}return e},HE=e=>{let t=e.match(Wb);if(t){let n=t[2];if(!n||yt.test(n))return e;if((e.match(_a)||[]).length%2===1)return`${e}~~`}else if(e.match(Zb)&&(e.match(_a)||[]).length%2===1)return`${e}~`;return e},jr=e=>e!==!1,ke={COMPARISON_OPERATORS:-10,HTML_TAGS:-5,SETEXT_HEADINGS:0,LINKS:10,BOLD_ITALIC:20,BOLD:30,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,DEFAULT:100},UE=[{handler:{name:"comparisonOperators",handle:rE,priority:ke.COMPARISON_OPERATORS},optionKey:"comparisonOperators"},{handler:{name:"htmlTags",handle:_E,priority:ke.HTML_TAGS},optionKey:"htmlTags"},{handler:{name:"setextHeadings",handle:FE,priority:ke.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:kl,priority:ke.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:xE,priority:ke.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:cE,priority:ke.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:hE,priority:ke.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:mE,priority:ke.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:bE,priority:ke.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:NE,priority:ke.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:HE,priority:ke.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:RE,priority:ke.KATEX},optionKey:"katex"}],jE=e=>{var t;let n=(t=e?.linkMode)!=null?t:"protocol";return UE.filter(({handler:r,optionKey:i})=>r.name==="links"?jr(e?.links)||jr(e?.images):jr(e?.[i])).map(({handler:r,earlyReturn:i})=>r.name==="links"?{handler:pl(ml({},r),{handle:s=>kl(s,n)}),earlyReturn:n==="protocol"?i:void 0}:{handler:r,earlyReturn:i})},zE=(e,t)=>{var n;if(!e||typeof e!="string")return e;let r=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,i=jE(t),s=((n=t?.handlers)!=null?n:[]).map(u=>{var o;return{handler:pl(ml({},u),{priority:(o=u.priority)!=null?o:ke.DEFAULT}),earlyReturn:void 0}}),a=[...i,...s].sort((u,o)=>{var c,d;return((c=u.handler.priority)!=null?c:ke.DEFAULT)-((d=o.handler.priority)!=null?d:ke.DEFAULT)});for(let{handler:u,earlyReturn:o}of a)if(r=u.handle(r),o!=null&&o(r))return r;return r},$E=zE;const YE=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qE=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,VE={};function Sa(e,t){return(VE.jsx?qE:YE).test(e)}const WE=/[ \t\n\f\r]/g;function GE(e){return typeof e=="object"?e.type==="text"?Na(e.value):!1:Na(e)}function Na(e){return e.replace(WE,"")===""}var wt={},zr,Ia;function QE(){if(Ia)return zr;Ia=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,u=/^\s+|\s+$/g,o=`
|
|
43
|
+
`,c="/",d="*",h="",f="comment",m="declaration";function b(S,_){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];_=_||{};var L=1,I=1;function B(Y){var j=Y.match(t);j&&(L+=j.length);var F=Y.lastIndexOf(o);I=~F?Y.length-F:I+Y.length}function z(){var Y={line:L,column:I};return function(j){return j.position=new R(Y),K(),j}}function R(Y){this.start=Y,this.end={line:L,column:I},this.source=_.source}R.prototype.content=S;function $(Y){var j=new Error(_.source+":"+L+":"+I+": "+Y);if(j.reason=Y,j.filename=_.source,j.line=L,j.column=I,j.source=S,!_.silent)throw j}function G(Y){var j=Y.exec(S);if(j){var F=j[0];return B(F),S=S.slice(F.length),j}}function K(){G(n)}function N(Y){var j;for(Y=Y||[];j=U();)j!==!1&&Y.push(j);return Y}function U(){var Y=z();if(!(c!=S.charAt(0)||d!=S.charAt(1))){for(var j=2;h!=S.charAt(j)&&(d!=S.charAt(j)||c!=S.charAt(j+1));)++j;if(j+=2,h===S.charAt(j-1))return $("End of comment missing");var F=S.slice(2,j-2);return I+=2,B(F),S=S.slice(j),I+=2,Y({type:f,comment:F})}}function v(){var Y=z(),j=G(r);if(j){if(U(),!G(i))return $("property missing ':'");var F=G(s),W=Y({type:m,property:k(j[0].replace(e,h)),value:F?k(F[0].replace(e,h)):h});return G(a),W}}function V(){var Y=[];N(Y);for(var j;j=v();)j!==!1&&(Y.push(j),N(Y));return Y}return K(),V()}function k(S){return S?S.replace(u,h):h}return zr=b,zr}var wa;function KE(){if(wa)return wt;wa=1;var e=wt&&wt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(wt,"__esModule",{value:!0}),wt.default=n;const t=e(QE());function n(r,i){let s=null;if(!r||typeof r!="string")return s;const a=(0,t.default)(r),u=typeof i=="function";return a.forEach(o=>{if(o.type!=="declaration")return;const{property:c,value:d}=o;u?i(c,d,o):d&&(s=s||{},s[c]=d)}),s}return wt}var Kt={},La;function XE(){if(La)return Kt;La=1,Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(c){return!c||n.test(c)||e.test(c)},a=function(c,d){return d.toUpperCase()},u=function(c,d){return"".concat(d,"-")},o=function(c,d){return d===void 0&&(d={}),s(c)?c:(c=c.toLowerCase(),d.reactCompat?c=c.replace(i,u):c=c.replace(r,u),c.replace(t,a))};return Kt.camelCase=o,Kt}var Xt,Ra;function ZE(){if(Ra)return Xt;Ra=1;var e=Xt&&Xt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(KE()),n=XE();function r(i,s){var a={};return!i||typeof i!="string"||(0,t.default)(i,function(u,o){u&&o&&(a[(0,n.camelCase)(u,s)]=o)}),a}return r.default=r,Xt=r,Xt}var JE=ZE();const eT=Au(JE);function hn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Oa(e.position):"start"in e||"end"in e?Oa(e):"line"in e||"column"in e?fi(e):""}function fi(e){return Da(e&&e.line)+":"+Da(e&&e.column)}function Oa(e){return fi(e&&e.start)+"-"+fi(e&&e.end)}function Da(e){return e&&typeof e=="number"?e:1}class xe extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(a=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const o=r.indexOf(":");o===-1?s.ruleId=r:(s.source=r.slice(0,o),s.ruleId=r.slice(o+1))}if(!s.place&&s.ancestors&&s.ancestors){const o=s.ancestors[s.ancestors.length-1];o&&(s.place=o.position)}const u=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=u?u.line:void 0,this.name=hn(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}xe.prototype.file="";xe.prototype.name="";xe.prototype.reason="";xe.prototype.message="";xe.prototype.stack="";xe.prototype.column=void 0;xe.prototype.line=void 0;xe.prototype.ancestors=void 0;xe.prototype.cause=void 0;xe.prototype.fatal=void 0;xe.prototype.place=void 0;xe.prototype.ruleId=void 0;xe.prototype.source=void 0;const Gi={}.hasOwnProperty,tT=new Map,nT=/[A-Z]/g,rT=new Set(["table","tbody","thead","tfoot","tr"]),iT=new Set(["td","th"]),yl="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function sT(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=fT(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=hT(n,t.jsx,t.jsxs)}const 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"?ut:Cn,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=Al(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function Al(e,t,n){if(t.type==="element")return aT(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return uT(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return lT(e,t,n);if(t.type==="mdxjsEsm")return oT(e,t);if(t.type==="root")return cT(e,t,n);if(t.type==="text")return dT(e,t)}function aT(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=ut,e.schema=i),e.ancestors.push(t);const s=Cl(e,t.tagName,!1),a=mT(e,t);let u=Ki(e,t);return rT.has(t.tagName)&&(u=u.filter(function(o){return typeof o=="string"?!GE(o):!0})),_l(e,a,s,t),Qi(a,u),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function uT(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}xn(e,t.position)}function oT(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);xn(e,t.position)}function lT(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=ut,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:Cl(e,t.name,!0),a=pT(e,t),u=Ki(e,t);return _l(e,a,s,t),Qi(a,u),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function cT(e,t,n){const r={};return Qi(r,Ki(e,t)),e.create(t,e.Fragment,r,n)}function dT(e,t){return t.value}function _l(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Qi(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function hT(e,t,n){return r;function r(i,s,a,u){const c=Array.isArray(a.children)?n:t;return u?c(s,a,u):c(s,a)}}function fT(e,t){return n;function n(r,i,s,a){const u=Array.isArray(s.children),o=Ye(r);return t(i,s,a,u,{columnNumber:o?o.column-1:void 0,fileName:e,lineNumber:o?o.line:void 0},void 0)}}function mT(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Gi.call(t.properties,i)){const s=gT(e,i,t.properties[i]);if(s){const[a,u]=s;e.tableCellAlignToStyle&&a==="align"&&typeof u=="string"&&iT.has(t.tagName)?r=u:n[a]=u}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function pT(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const u=a.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else xn(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,s=e.evaluater.evaluateExpression(u.expression)}else xn(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function Ki(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:tT;for(;++r<t.children.length;){const s=t.children[r];let a;if(e.passKeys){const o=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(o){const c=i.get(o)||0;a=o+"-"+c,i.set(o,c+1)}}const u=Al(e,s,a);u!==void 0&&n.push(u)}return n}function gT(e,t,n){const r=br(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Yu(n):qu(n)),r.property==="style"){let i=typeof n=="object"?n:bT(e,String(n));return e.stylePropertyNameCase==="css"&&(i=ET(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Lh[r.property]||r.property:r.attribute,n]}}function bT(e,t){try{return eT(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new xe("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=yl+"#cannot-parse-style-attribute",i}}function Cl(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,a;for(;++s<i.length;){const u=Sa(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};a=a?{type:"MemberExpression",object:a,property:u,computed:!!(s&&u.type==="Literal"),optional:!1}:u}r=a}else r=Sa(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Gi.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);xn(e)}function xn(e,t){const n=new xe("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=yl+"#cannot-handle-mdx-estrees-without-createevaluater",n}function ET(e){const t={};let n;for(n in e)Gi.call(e,n)&&(t[TT(n)]=e[n]);return t}function TT(e){let t=e.replace(nT,xT);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function xT(e){return"-"+e.toLowerCase()}const $r={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"]},kT={tokenize:yT};function yT(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),ne(e,t,"linePrefix")}function i(u){return e.enter("paragraph"),s(u)}function s(u){const o=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=o),n=o,a(u)}function a(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return q(u)?(e.consume(u),e.exit("chunkText"),s):(e.consume(u),a)}}const AT={tokenize:_T},Pa={tokenize:CT};function _T(e){const t=this,n=[];let r=0,i,s,a;return u;function u(I){if(r<n.length){const B=n[r];return t.containerState=B[1],e.attempt(B[0].continuation,o,c)(I)}return c(I)}function o(I){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&L();const B=t.events.length;let z=B,R;for(;z--;)if(t.events[z][0]==="exit"&&t.events[z][1].type==="chunkFlow"){R=t.events[z][1].end;break}_(r);let $=B;for(;$<t.events.length;)t.events[$][1].end={...R},$++;return Le(t.events,z+1,0,t.events.slice(B)),t.events.length=$,c(I)}return u(I)}function c(I){if(r===n.length){if(!i)return f(I);if(i.currentConstruct&&i.currentConstruct.concrete)return b(I);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Pa,d,h)(I)}function d(I){return i&&L(),_(r),f(I)}function h(I){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,b(I)}function f(I){return t.containerState={},e.attempt(Pa,m,b)(I)}function m(I){return r++,n.push([t.currentConstruct,t.containerState]),f(I)}function b(I){if(I===null){i&&L(),_(0),e.consume(I);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),k(I)}function k(I){if(I===null){S(e.exit("chunkFlow"),!0),_(0),e.consume(I);return}return q(I)?(e.consume(I),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(I),k)}function S(I,B){const z=t.sliceStream(I);if(B&&z.push(null),I.previous=s,s&&(s.next=I),s=I,i.defineSkip(I.start),i.write(z),t.parser.lazy[I.start.line]){let R=i.events.length;for(;R--;)if(i.events[R][1].start.offset<a&&(!i.events[R][1].end||i.events[R][1].end.offset>a))return;const $=t.events.length;let G=$,K,N;for(;G--;)if(t.events[G][0]==="exit"&&t.events[G][1].type==="chunkFlow"){if(K){N=t.events[G][1].end;break}K=!0}for(_(r),R=$;R<t.events.length;)t.events[R][1].end={...N},R++;Le(t.events,G+1,0,t.events.slice($)),t.events.length=R}}function _(I){let B=n.length;for(;B-- >I;){const z=n[B];t.containerState=z[1],z[0].exit.call(t,e)}n.length=I}function L(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function CT(e,t,n){return ne(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const ST={tokenize:NT};function NT(e){const t=this,n=e.attempt(wn,r,e.attempt(this.parser.constructs.flowInitial,i,ne(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Tg,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const IT={resolveAll:Nl()},wT=Sl("string"),LT=Sl("text");function Sl(e){return{resolveAll:Nl(e==="text"?RT:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,a,u);return a;function a(d){return c(d)?s(d):u(d)}function u(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),o}function o(d){return c(d)?(n.exit("data"),s(d)):(n.consume(d),o)}function c(d){if(d===null)return!0;const h=i[d];let f=-1;if(h)for(;++f<h.length;){const m=h[f];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function Nl(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function RT(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,a=-1,u=0,o;for(;s--;){const c=i[s];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)u++,a--;if(a)break;a=-1}else if(c===-2)o=!0,u++;else if(c!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const c={type:n===e.length||o||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:r.start._bufferIndex+a,_index:r.start._index+s,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const OT={42:Ce,43:Ce,45:Ce,48:Ce,49:Ce,50:Ce,51:Ce,52:Ce,53:Ce,54:Ce,55:Ce,56:Ce,57:Ce,62:ul},DT={91:_g},PT={[-2]:Hr,[-1]:Hr,32:Hr},vT={35:Lg,42:Wn,45:[xa,Wn],60:Pg,61:xa,95:Wn,96:Ea,126:Ea},MT={38:ll,92:ol},BT={[-5]:Ur,[-4]:Ur,[-3]:Ur,33:Zg,38:ll,42:hi,60:[eg,jg],91:eb,92:[Ig,ol],93:Vi,95:hi,96:fg},FT={null:[hi,IT]},HT={null:[42,95]},UT={null:[]},jT=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:HT,contentInitial:DT,disable:UT,document:OT,flow:vT,flowInitial:PT,insideSpan:FT,string:MT,text:BT},Symbol.toStringTag,{value:"Module"}));function zT(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let a=[],u=[];const o={attempt:$(z),check:$(R),consume:L,enter:I,exit:B,interrupt:$(R,{interrupt:!0})},c={code:null,containerState:{},defineSkip:k,events:[],now:b,parser:e,previous:null,sliceSerialize:f,sliceStream:m,write:h};let d=t.tokenize.call(c,o);return t.resolveAll&&s.push(t),c;function h(U){return a=Oe(a,U),S(),a[a.length-1]!==null?[]:(G(t,0),c.events=_r(s,c.events,c),c.events)}function f(U,v){return YT(m(U),v)}function m(U){return $T(a,U)}function b(){const{_bufferIndex:U,_index:v,line:V,column:Y,offset:j}=r;return{_bufferIndex:U,_index:v,line:V,column:Y,offset:j}}function k(U){i[U.line]=U.column,N()}function S(){let U;for(;r._index<a.length;){const v=a[r._index];if(typeof v=="string")for(U=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===U&&r._bufferIndex<v.length;)_(v.charCodeAt(r._bufferIndex));else _(v)}}function _(U){d=d(U)}function L(U){q(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,N()):U!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=U}function I(U,v){const V=v||{};return V.type=U,V.start=b(),c.events.push(["enter",V,c]),u.push(V),V}function B(U){const v=u.pop();return v.end=b(),c.events.push(["exit",v,c]),v}function z(U,v){G(U,v.from)}function R(U,v){v.restore()}function $(U,v){return V;function V(Y,j,F){let W,ue,re,x;return Array.isArray(Y)?Ve(Y):"tokenize"in Y?Ve([Y]):Ne(Y);function Ne(be){return $t;function $t(Je){const _t=Je!==null&&be[Je],Ct=Je!==null&&be.null,On=[...Array.isArray(_t)?_t:_t?[_t]:[],...Array.isArray(Ct)?Ct:Ct?[Ct]:[]];return Ve(On)(Je)}}function Ve(be){return W=be,ue=0,be.length===0?F:A(be[ue])}function A(be){return $t;function $t(Je){return x=K(),re=be,be.partial||(c.currentConstruct=be),be.name&&c.parser.constructs.disable.null.includes(be.name)?lt():be.tokenize.call(v?Object.assign(Object.create(c),v):c,o,ve,lt)(Je)}}function ve(be){return U(re,x),j}function lt(be){return x.restore(),++ue<W.length?A(W[ue]):F}}}function G(U,v){U.resolveAll&&!s.includes(U)&&s.push(U),U.resolve&&Le(c.events,v,c.events.length-v,U.resolve(c.events.slice(v),c)),U.resolveTo&&(c.events=U.resolveTo(c.events,c))}function K(){const U=b(),v=c.previous,V=c.currentConstruct,Y=c.events.length,j=Array.from(u);return{from:Y,restore:F};function F(){r=U,c.previous=v,c.currentConstruct=V,c.events.length=Y,u=j,N()}}function N(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function $T(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,s)];else{if(a=e.slice(n,i),r>-1){const u=a[0];typeof u=="string"?a[0]=u.slice(r):a.shift()}s>0&&a.push(e[i].slice(0,s))}return a}function YT(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=`
|
|
44
44
|
`;break}case-3:{a=`\r
|
|
45
|
-
`;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(s)}i=s===-2,r.push(a)}return r.join("")}function HT(e){const r={constructs:Wo([vT,...(e||{}).extensions||[]]),content:i(pT),defined:[],document:i(bT),flow:i(xT),lazy:{},string:i(AT),text:i(_T)};return r;function i(s){return a;function a(u){return MT(r,s,u)}}}function UT(e){for(;!sl(e););return e}const Ra=/[\0\t\n\r]/g;function jT(){let e=1,t="",n=!0,r;return i;function i(s,a,u){const o=[];let c,d,h,f,m;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),h=0,t="",n&&(s.charCodeAt(0)===65279&&h++,n=void 0);h<s.length;){if(Ra.lastIndex=h,c=Ra.exec(s),f=c&&c.index!==void 0?c.index:s.length,m=s.charCodeAt(f),!c){t=s.slice(h);break}if(m===10&&h===f&&r)o.push(-3),r=void 0;else switch(r&&(o.push(-5),r=void 0),h<f&&(o.push(s.slice(h,f)),e+=f-h),m){case 0:{o.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,o.push(-2);e++<d;)o.push(-1);break}case 10:{o.push(-4),e=1;break}default:r=!0,e=1}h=f+1}return u&&(r&&o.push(-5),t&&o.push(t),o.push(null)),o}}const Al={}.hasOwnProperty;function zT(e,t,n){return typeof t!="string"&&(n=t,t=void 0),$T(n)(UT(HT(n).document().write(jT()(e,t,!0))))}function $T(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(bs),autolinkProtocol:K,autolinkEmail:K,atxHeading:s(ms),blockQuote:s(_t),characterEscape:K,characterReference:K,codeFenced:s(Ln),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(Ln,a),codeText:s(jc,a),codeTextData:K,data:K,codeFlowValue:K,definition:s(zc),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s($c),hardBreakEscape:s(ps),hardBreakTrailing:s(ps),htmlFlow:s(gs,a),htmlFlowData:K,htmlText:s(gs,a),htmlTextData:K,image:s(Yc),label:a,link:s(bs),listItem:s(qc),listItemValue:f,listOrdered:s(Es,h),listUnordered:s(Es),paragraph:s(Vc),reference:y,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(ms),strong:s(Wc),thematicBreak:s(Qc)},exit:{atxHeading:o(),atxHeadingSequence:z,autolink:o(),autolinkEmail:At,autolinkProtocol:Je,blockQuote:o(),characterEscapeValue:N,characterReferenceMarkerHexadecimal:lt,characterReferenceMarkerNumeric:lt,characterReferenceValue:be,characterReference:zt,codeFenced:o(S),codeFencedFence:A,codeFencedFenceInfo:m,codeFencedFenceMeta:b,codeFlowValue:N,codeIndented:o(_),codeText:o(j),codeTextData:N,data:N,definition:o(),definitionDestinationString:B,definitionLabelString:L,definitionTitleString:I,emphasis:o(),hardBreakEscape:o(v),hardBreakTrailing:o(v),htmlFlow:o(V),htmlFlowData:N,htmlText:o(Y),htmlTextData:N,image:o(W),label:re,labelText:ue,lineEnding:U,link:o(F),listItem:o(),listOrdered:o(),listUnordered:o(),paragraph:o(),referenceString:ve,resourceDestinationString:x,resourceTitleString:Ne,resource:Ve,setextHeading:o(G),setextHeadingLineSequence:$,setextHeadingText:R,strong:o(),thematicBreak:o()}};_l(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(O){let H={type:"root",children:[]};const X={stack:[H],tokenStack:[],config:t,enter:u,exit:c,buffer:a,resume:d,data:n},te=[];let oe=-1;for(;++oe<O.length;)if(O[oe][1].type==="listOrdered"||O[oe][1].type==="listUnordered")if(O[oe][0]==="enter")te.push(oe);else{const Me=te.pop();oe=i(O,Me,oe)}for(oe=-1;++oe<O.length;){const Me=t[O[oe][0]];Al.call(Me,O[oe][1].type)&&Me[O[oe][1].type].call(Object.assign({sliceSerialize:O[oe][2].sliceSerialize},X),O[oe][1])}if(X.tokenStack.length>0){const Me=X.tokenStack[X.tokenStack.length-1];(Me[1]||Oa).call(X,void 0,Me[0])}for(H.position={start:et(O.length>0?O[0][1].start:{line:1,column:1,offset:0}),end:et(O.length>0?O[O.length-2][1].end:{line:1,column:1,offset:0})},oe=-1;++oe<t.transforms.length;)H=t.transforms[oe](H)||H;return H}function i(O,H,X){let te=H-1,oe=-1,Me=!1,ct,We,$t,Yt;for(;++te<=X;){const Ie=O[te];switch(Ie[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ie[0]==="enter"?oe++:oe--,Yt=void 0;break}case"lineEndingBlank":{Ie[0]==="enter"&&(ct&&!Yt&&!oe&&!$t&&($t=te),Yt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Yt=void 0}if(!oe&&Ie[0]==="enter"&&Ie[1].type==="listItemPrefix"||oe===-1&&Ie[0]==="exit"&&(Ie[1].type==="listUnordered"||Ie[1].type==="listOrdered")){if(ct){let Ct=te;for(We=void 0;Ct--;){const Ge=O[Ct];if(Ge[1].type==="lineEnding"||Ge[1].type==="lineEndingBlank"){if(Ge[0]==="exit")continue;We&&(O[We][1].type="lineEndingBlank",Me=!0),Ge[1].type="lineEnding",We=Ct}else if(!(Ge[1].type==="linePrefix"||Ge[1].type==="blockQuotePrefix"||Ge[1].type==="blockQuotePrefixWhitespace"||Ge[1].type==="blockQuoteMarker"||Ge[1].type==="listItemIndent"))break}$t&&(!We||$t<We)&&(ct._spread=!0),ct.end=Object.assign({},We?O[We][1].start:Ie[1].end),O.splice(We||te,0,["exit",ct,Ie[2]]),te++,X++}if(Ie[1].type==="listItemPrefix"){const Ct={type:"listItem",_spread:!1,start:Object.assign({},Ie[1].start),end:void 0};ct=Ct,O.splice(te,0,["enter",Ct,Ie[2]]),te++,X++,$t=void 0,Yt=!0}}}return O[H][1]._spread=Me,X}function s(O,H){return X;function X(te){u.call(this,O(te),te),H&&H.call(this,te)}}function a(){this.stack.push({type:"fragment",children:[]})}function u(O,H,X){this.stack[this.stack.length-1].children.push(O),this.stack.push(O),this.tokenStack.push([H,X||void 0]),O.position={start:et(H.start),end:void 0}}function o(O){return H;function H(X){O&&O.call(this,X),c.call(this,X)}}function c(O,H){const X=this.stack.pop(),te=this.tokenStack.pop();if(te)te[0].type!==O.type&&(H?H.call(this,O,te[0]):(te[1]||Oa).call(this,O,te[0]));else throw new Error("Cannot close `"+O.type+"` ("+dn({start:O.start,end:O.end})+"): it’s not open");X.position.end=et(O.end)}function d(){return ji(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function f(O){if(this.data.expectingFirstListItemValue){const H=this.stack[this.stack.length-2];H.start=Number.parseInt(this.sliceSerialize(O),10),this.data.expectingFirstListItemValue=void 0}}function m(){const O=this.resume(),H=this.stack[this.stack.length-1];H.lang=O}function b(){const O=this.resume(),H=this.stack[this.stack.length-1];H.meta=O}function A(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const O=this.resume(),H=this.stack[this.stack.length-1];H.value=O.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const O=this.resume(),H=this.stack[this.stack.length-1];H.value=O.replace(/(\r?\n|\r)$/g,"")}function L(O){const H=this.resume(),X=this.stack[this.stack.length-1];X.label=H,X.identifier=He(this.sliceSerialize(O)).toLowerCase()}function I(){const O=this.resume(),H=this.stack[this.stack.length-1];H.title=O}function B(){const O=this.resume(),H=this.stack[this.stack.length-1];H.url=O}function z(O){const H=this.stack[this.stack.length-1];if(!H.depth){const X=this.sliceSerialize(O).length;H.depth=X}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function $(O){const H=this.stack[this.stack.length-1];H.depth=this.sliceSerialize(O).codePointAt(0)===61?1:2}function G(){this.data.setextHeadingSlurpLineEnding=void 0}function K(O){const X=this.stack[this.stack.length-1].children;let te=X[X.length-1];(!te||te.type!=="text")&&(te=Gc(),te.position={start:et(O.start),end:void 0},X.push(te)),this.stack.push(te)}function N(O){const H=this.stack.pop();H.value+=this.sliceSerialize(O),H.position.end=et(O.end)}function U(O){const H=this.stack[this.stack.length-1];if(this.data.atHardBreak){const X=H.children[H.children.length-1];X.position.end=et(O.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(H.type)&&(K.call(this,O),N.call(this,O))}function v(){this.data.atHardBreak=!0}function V(){const O=this.resume(),H=this.stack[this.stack.length-1];H.value=O}function Y(){const O=this.resume(),H=this.stack[this.stack.length-1];H.value=O}function j(){const O=this.resume(),H=this.stack[this.stack.length-1];H.value=O}function F(){const O=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=H,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function W(){const O=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=H,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function ue(O){const H=this.sliceSerialize(O),X=this.stack[this.stack.length-2];X.label=E1(H),X.identifier=He(H).toLowerCase()}function re(){const O=this.stack[this.stack.length-1],H=this.resume(),X=this.stack[this.stack.length-1];if(this.data.inReference=!0,X.type==="link"){const te=O.children;X.children=te}else X.alt=H}function x(){const O=this.resume(),H=this.stack[this.stack.length-1];H.url=O}function Ne(){const O=this.resume(),H=this.stack[this.stack.length-1];H.title=O}function Ve(){this.data.inReference=void 0}function y(){this.data.referenceType="collapsed"}function ve(O){const H=this.resume(),X=this.stack[this.stack.length-1];X.label=H,X.identifier=He(this.sliceSerialize(O)).toLowerCase(),this.data.referenceType="full"}function lt(O){this.data.characterReferenceType=O.type}function be(O){const H=this.sliceSerialize(O),X=this.data.characterReferenceType;let te;X?(te=Vo(H,X==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):te=$i(H);const oe=this.stack[this.stack.length-1];oe.value+=te}function zt(O){const H=this.stack.pop();H.position.end=et(O.end)}function Je(O){N.call(this,O);const H=this.stack[this.stack.length-1];H.url=this.sliceSerialize(O)}function At(O){N.call(this,O);const H=this.stack[this.stack.length-1];H.url="mailto:"+this.sliceSerialize(O)}function _t(){return{type:"blockquote",children:[]}}function Ln(){return{type:"code",lang:null,meta:null,value:""}}function jc(){return{type:"inlineCode",value:""}}function zc(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function $c(){return{type:"emphasis",children:[]}}function ms(){return{type:"heading",depth:0,children:[]}}function ps(){return{type:"break"}}function gs(){return{type:"html",value:""}}function Yc(){return{type:"image",title:null,url:"",alt:null}}function bs(){return{type:"link",title:null,url:"",children:[]}}function Es(O){return{type:"list",ordered:O.type==="listOrdered",start:null,spread:O._spread,children:[]}}function qc(O){return{type:"listItem",spread:O._spread,checked:null,children:[]}}function Vc(){return{type:"paragraph",children:[]}}function Wc(){return{type:"strong",children:[]}}function Gc(){return{type:"text",value:""}}function Qc(){return{type:"thematicBreak"}}}function et(e){return{line:e.line,column:e.column,offset:e.offset}}function _l(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?_l(e,r):YT(e,r)}}function YT(e,t){let n;for(n in t)if(Al.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Oa(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+dn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+dn({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+dn({start:t.start,end:t.end})+") is still open")}function qT(e){const t=this;t.parser=n;function n(r){return zT(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function VT(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function WT(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
46
|
-
`}]}function
|
|
47
|
-
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function
|
|
45
|
+
`;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(s)}i=s===-2,r.push(a)}return r.join("")}function qT(e){const r={constructs:Zo([jT,...(e||{}).extensions||[]]),content:i(kT),defined:[],document:i(AT),flow:i(ST),lazy:{},string:i(wT),text:i(LT)};return r;function i(s){return a;function a(u){return zT(r,s,u)}}}function VT(e){for(;!cl(e););return e}const va=/[\0\t\n\r]/g;function WT(){let e=1,t="",n=!0,r;return i;function i(s,a,u){const o=[];let c,d,h,f,m;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),h=0,t="",n&&(s.charCodeAt(0)===65279&&h++,n=void 0);h<s.length;){if(va.lastIndex=h,c=va.exec(s),f=c&&c.index!==void 0?c.index:s.length,m=s.charCodeAt(f),!c){t=s.slice(h);break}if(m===10&&h===f&&r)o.push(-3),r=void 0;else switch(r&&(o.push(-5),r=void 0),h<f&&(o.push(s.slice(h,f)),e+=f-h),m){case 0:{o.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,o.push(-2);e++<d;)o.push(-1);break}case 10:{o.push(-4),e=1;break}default:r=!0,e=1}h=f+1}return u&&(r&&o.push(-5),t&&o.push(t),o.push(null)),o}}const Il={}.hasOwnProperty;function GT(e,t,n){return typeof t!="string"&&(n=t,t=void 0),QT(n)(VT(qT(n).document().write(WT()(e,t,!0))))}function QT(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Es),autolinkProtocol:K,autolinkEmail:K,atxHeading:s(ps),blockQuote:s(Ct),characterEscape:K,characterReference:K,codeFenced:s(On),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(On,a),codeText:s(Vc,a),codeTextData:K,data:K,codeFlowValue:K,definition:s(Wc),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(Gc),hardBreakEscape:s(gs),hardBreakTrailing:s(gs),htmlFlow:s(bs,a),htmlFlowData:K,htmlText:s(bs,a),htmlTextData:K,image:s(Qc),label:a,link:s(Es),listItem:s(Kc),listItemValue:f,listOrdered:s(Ts,h),listUnordered:s(Ts),paragraph:s(Xc),reference:A,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(ps),strong:s(Zc),thematicBreak:s(ed)},exit:{atxHeading:o(),atxHeadingSequence:z,autolink:o(),autolinkEmail:_t,autolinkProtocol:Je,blockQuote:o(),characterEscapeValue:N,characterReferenceMarkerHexadecimal:lt,characterReferenceMarkerNumeric:lt,characterReferenceValue:be,characterReference:$t,codeFenced:o(S),codeFencedFence:k,codeFencedFenceInfo:m,codeFencedFenceMeta:b,codeFlowValue:N,codeIndented:o(_),codeText:o(j),codeTextData:N,data:N,definition:o(),definitionDestinationString:B,definitionLabelString:L,definitionTitleString:I,emphasis:o(),hardBreakEscape:o(v),hardBreakTrailing:o(v),htmlFlow:o(V),htmlFlowData:N,htmlText:o(Y),htmlTextData:N,image:o(W),label:re,labelText:ue,lineEnding:U,link:o(F),listItem:o(),listOrdered:o(),listUnordered:o(),paragraph:o(),referenceString:ve,resourceDestinationString:x,resourceTitleString:Ne,resource:Ve,setextHeading:o(G),setextHeadingLineSequence:$,setextHeadingText:R,strong:o(),thematicBreak:o()}};wl(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(O){let H={type:"root",children:[]};const X={stack:[H],tokenStack:[],config:t,enter:u,exit:c,buffer:a,resume:d,data:n},te=[];let oe=-1;for(;++oe<O.length;)if(O[oe][1].type==="listOrdered"||O[oe][1].type==="listUnordered")if(O[oe][0]==="enter")te.push(oe);else{const Me=te.pop();oe=i(O,Me,oe)}for(oe=-1;++oe<O.length;){const Me=t[O[oe][0]];Il.call(Me,O[oe][1].type)&&Me[O[oe][1].type].call(Object.assign({sliceSerialize:O[oe][2].sliceSerialize},X),O[oe][1])}if(X.tokenStack.length>0){const Me=X.tokenStack[X.tokenStack.length-1];(Me[1]||Ma).call(X,void 0,Me[0])}for(H.position={start:et(O.length>0?O[0][1].start:{line:1,column:1,offset:0}),end:et(O.length>0?O[O.length-2][1].end:{line:1,column:1,offset:0})},oe=-1;++oe<t.transforms.length;)H=t.transforms[oe](H)||H;return H}function i(O,H,X){let te=H-1,oe=-1,Me=!1,ct,We,Yt,qt;for(;++te<=X;){const Ie=O[te];switch(Ie[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ie[0]==="enter"?oe++:oe--,qt=void 0;break}case"lineEndingBlank":{Ie[0]==="enter"&&(ct&&!qt&&!oe&&!Yt&&(Yt=te),qt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:qt=void 0}if(!oe&&Ie[0]==="enter"&&Ie[1].type==="listItemPrefix"||oe===-1&&Ie[0]==="exit"&&(Ie[1].type==="listUnordered"||Ie[1].type==="listOrdered")){if(ct){let St=te;for(We=void 0;St--;){const Ge=O[St];if(Ge[1].type==="lineEnding"||Ge[1].type==="lineEndingBlank"){if(Ge[0]==="exit")continue;We&&(O[We][1].type="lineEndingBlank",Me=!0),Ge[1].type="lineEnding",We=St}else if(!(Ge[1].type==="linePrefix"||Ge[1].type==="blockQuotePrefix"||Ge[1].type==="blockQuotePrefixWhitespace"||Ge[1].type==="blockQuoteMarker"||Ge[1].type==="listItemIndent"))break}Yt&&(!We||Yt<We)&&(ct._spread=!0),ct.end=Object.assign({},We?O[We][1].start:Ie[1].end),O.splice(We||te,0,["exit",ct,Ie[2]]),te++,X++}if(Ie[1].type==="listItemPrefix"){const St={type:"listItem",_spread:!1,start:Object.assign({},Ie[1].start),end:void 0};ct=St,O.splice(te,0,["enter",St,Ie[2]]),te++,X++,Yt=void 0,qt=!0}}}return O[H][1]._spread=Me,X}function s(O,H){return X;function X(te){u.call(this,O(te),te),H&&H.call(this,te)}}function a(){this.stack.push({type:"fragment",children:[]})}function u(O,H,X){this.stack[this.stack.length-1].children.push(O),this.stack.push(O),this.tokenStack.push([H,X||void 0]),O.position={start:et(H.start),end:void 0}}function o(O){return H;function H(X){O&&O.call(this,X),c.call(this,X)}}function c(O,H){const X=this.stack.pop(),te=this.tokenStack.pop();if(te)te[0].type!==O.type&&(H?H.call(this,O,te[0]):(te[1]||Ma).call(this,O,te[0]));else throw new Error("Cannot close `"+O.type+"` ("+hn({start:O.start,end:O.end})+"): it’s not open");X.position.end=et(O.end)}function d(){return zi(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function f(O){if(this.data.expectingFirstListItemValue){const H=this.stack[this.stack.length-2];H.start=Number.parseInt(this.sliceSerialize(O),10),this.data.expectingFirstListItemValue=void 0}}function m(){const O=this.resume(),H=this.stack[this.stack.length-1];H.lang=O}function b(){const O=this.resume(),H=this.stack[this.stack.length-1];H.meta=O}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const O=this.resume(),H=this.stack[this.stack.length-1];H.value=O.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const O=this.resume(),H=this.stack[this.stack.length-1];H.value=O.replace(/(\r?\n|\r)$/g,"")}function L(O){const H=this.resume(),X=this.stack[this.stack.length-1];X.label=H,X.identifier=He(this.sliceSerialize(O)).toLowerCase()}function I(){const O=this.resume(),H=this.stack[this.stack.length-1];H.title=O}function B(){const O=this.resume(),H=this.stack[this.stack.length-1];H.url=O}function z(O){const H=this.stack[this.stack.length-1];if(!H.depth){const X=this.sliceSerialize(O).length;H.depth=X}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function $(O){const H=this.stack[this.stack.length-1];H.depth=this.sliceSerialize(O).codePointAt(0)===61?1:2}function G(){this.data.setextHeadingSlurpLineEnding=void 0}function K(O){const X=this.stack[this.stack.length-1].children;let te=X[X.length-1];(!te||te.type!=="text")&&(te=Jc(),te.position={start:et(O.start),end:void 0},X.push(te)),this.stack.push(te)}function N(O){const H=this.stack.pop();H.value+=this.sliceSerialize(O),H.position.end=et(O.end)}function U(O){const H=this.stack[this.stack.length-1];if(this.data.atHardBreak){const X=H.children[H.children.length-1];X.position.end=et(O.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(H.type)&&(K.call(this,O),N.call(this,O))}function v(){this.data.atHardBreak=!0}function V(){const O=this.resume(),H=this.stack[this.stack.length-1];H.value=O}function Y(){const O=this.resume(),H=this.stack[this.stack.length-1];H.value=O}function j(){const O=this.resume(),H=this.stack[this.stack.length-1];H.value=O}function F(){const O=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=H,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function W(){const O=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=H,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function ue(O){const H=this.sliceSerialize(O),X=this.stack[this.stack.length-2];X.label=_1(H),X.identifier=He(H).toLowerCase()}function re(){const O=this.stack[this.stack.length-1],H=this.resume(),X=this.stack[this.stack.length-1];if(this.data.inReference=!0,X.type==="link"){const te=O.children;X.children=te}else X.alt=H}function x(){const O=this.resume(),H=this.stack[this.stack.length-1];H.url=O}function Ne(){const O=this.resume(),H=this.stack[this.stack.length-1];H.title=O}function Ve(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function ve(O){const H=this.resume(),X=this.stack[this.stack.length-1];X.label=H,X.identifier=He(this.sliceSerialize(O)).toLowerCase(),this.data.referenceType="full"}function lt(O){this.data.characterReferenceType=O.type}function be(O){const H=this.sliceSerialize(O),X=this.data.characterReferenceType;let te;X?(te=Xo(H,X==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):te=Yi(H);const oe=this.stack[this.stack.length-1];oe.value+=te}function $t(O){const H=this.stack.pop();H.position.end=et(O.end)}function Je(O){N.call(this,O);const H=this.stack[this.stack.length-1];H.url=this.sliceSerialize(O)}function _t(O){N.call(this,O);const H=this.stack[this.stack.length-1];H.url="mailto:"+this.sliceSerialize(O)}function Ct(){return{type:"blockquote",children:[]}}function On(){return{type:"code",lang:null,meta:null,value:""}}function Vc(){return{type:"inlineCode",value:""}}function Wc(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Gc(){return{type:"emphasis",children:[]}}function ps(){return{type:"heading",depth:0,children:[]}}function gs(){return{type:"break"}}function bs(){return{type:"html",value:""}}function Qc(){return{type:"image",title:null,url:"",alt:null}}function Es(){return{type:"link",title:null,url:"",children:[]}}function Ts(O){return{type:"list",ordered:O.type==="listOrdered",start:null,spread:O._spread,children:[]}}function Kc(O){return{type:"listItem",spread:O._spread,checked:null,children:[]}}function Xc(){return{type:"paragraph",children:[]}}function Zc(){return{type:"strong",children:[]}}function Jc(){return{type:"text",value:""}}function ed(){return{type:"thematicBreak"}}}function et(e){return{line:e.line,column:e.column,offset:e.offset}}function wl(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?wl(e,r):KT(e,r)}}function KT(e,t){let n;for(n in t)if(Il.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Ma(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+hn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+hn({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+hn({start:t.start,end:t.end})+") is still open")}function XT(e){const t=this;t.parser=n;function n(r){return GT(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function ZT(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function JT(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
46
|
+
`}]}function e2(e,t){const n=t.value?t.value+`
|
|
47
|
+
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function t2(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function n2(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function r2(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=zt(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let a,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=s+1,u+=1,e.footnoteCounts.set(r,u);const o={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,o);const c={type:"element",tagName:"sup",properties:{},children:[o]};return e.patch(t,c),e.applyData(t,c)}function i2(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function s2(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Ll(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function a2(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ll(e,t);const i={src:zt(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function u2(e,t){const n={src:zt(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function o2(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function l2(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ll(e,t);const i={href:zt(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function c2(e,t){const n={href:zt(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function d2(e,t,n){const r=e.all(t),i=n?h2(n):Rl(t),s={},a=[];if(typeof t.checked=="boolean"){const d=r[0];let h;d&&d.type==="element"&&d.tagName==="p"?h=d:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const d=r[u];(i||u!==0||d.type!=="element"||d.tagName!=="p")&&a.push({type:"text",value:`
|
|
48
48
|
`}),d.type==="element"&&d.tagName==="p"&&!i?a.push(...d.children):a.push(d)}const o=r[r.length-1];o&&(i||o.type!=="element"||o.tagName!=="p")&&a.push({type:"text",value:`
|
|
49
|
-
`});const c={type:"element",tagName:"li",properties:s,children:a};return e.patch(t,c),e.applyData(t,c)}function
|
|
49
|
+
`});const c={type:"element",tagName:"li",properties:s,children:a};return e.patch(t,c),e.applyData(t,c)}function h2(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Rl(n[r])}return t}function Rl(e){const t=e.spread;return t??e.children.length>1}function f2(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function m2(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function p2(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function g2(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function b2(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=Ye(t.children[1]),o=yr(t.children[t.children.length-1]);u&&o&&(a.position={start:u,end:o}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function E2(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,u=a?a.length:t.children.length;let o=-1;const c=[];for(;++o<u;){const h=t.children[o],f={},m=a?a[o]:void 0;m&&(f.align=m);let b={type:"element",tagName:s,properties:f,children:[]};h&&(b.children=e.all(h),e.patch(h,b),b=e.applyData(h,b)),c.push(b)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,d),e.applyData(t,d)}function T2(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Ba=9,Fa=32;function x2(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(Ha(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(Ha(t.slice(i),i>0,!1)),s.join("")}function Ha(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===Ba||s===Fa;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===Ba||s===Fa;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function k2(e,t){const n={type:"text",value:x2(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function y2(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const A2={blockquote:ZT,break:JT,code:e2,delete:t2,emphasis:n2,footnoteReference:r2,heading:i2,html:s2,imageReference:a2,image:u2,inlineCode:o2,linkReference:l2,link:c2,listItem:d2,list:f2,paragraph:m2,root:p2,strong:g2,table:b2,tableCell:T2,tableRow:E2,text:k2,thematicBreak:y2,toml:Fn,yaml:Fn,definition:Fn,footnoteDefinition:Fn};function Fn(){}function _2(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function C2(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function S2(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||_2,r=e.options.footnoteBackLabel||C2,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let o=-1;for(;++o<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[o]);if(!c)continue;const d=e.all(c),h=String(c.identifier).toUpperCase(),f=zt(h.toLowerCase());let m=0;const b=[],k=e.footnoteCounts.get(h);for(;k!==void 0&&++m<=k;){b.length>0&&b.push({type:"text",value:" "});let L=typeof n=="string"?n:n(o,m);typeof L=="string"&&(L={type:"text",value:L}),b.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+f+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(o,m),className:["data-footnote-backref"]},children:Array.isArray(L)?L:[L]})}const S=d[d.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const L=S.children[S.children.length-1];L&&L.type==="text"?L.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...b)}else d.push(...b);const _={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(d,!0)};e.patch(c,_),u.push(_)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...gt(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
50
50
|
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
|
|
51
|
-
`}]}}const
|
|
51
|
+
`}]}}const mi={}.hasOwnProperty,N2={};function I2(e,t){const n=t||N2,r=new Map,i=new Map,s=new Map,a={...A2,...n.handlers},u={all:c,applyData:L2,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:o,options:n,patch:w2,wrap:O2};return st(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const h=d.type==="definition"?r:i,f=String(d.identifier).toUpperCase();h.has(f)||h.set(f,d)}}),u;function o(d,h){const f=d.type,m=u.handlers[f];if(mi.call(u.handlers,f)&&m)return m(u,d,h);if(u.options.passThrough&&u.options.passThrough.includes(f)){if("children"in d){const{children:k,...S}=d,_=gt(S);return _.children=u.all(d),_}return gt(d)}return(u.options.unknownHandler||R2)(u,d,h)}function c(d){const h=[];if("children"in d){const f=d.children;let m=-1;for(;++m<f.length;){const b=u.one(f[m],d);if(b){if(m&&f[m-1].type==="break"&&(!Array.isArray(b)&&b.type==="text"&&(b.value=Ua(b.value)),!Array.isArray(b)&&b.type==="element")){const k=b.children[0];k&&k.type==="text"&&(k.value=Ua(k.value))}Array.isArray(b)?h.push(...b):h.push(b)}}}return h}}function w2(e,t){e.position&&(t.position=So(e))}function L2(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&s&&Object.assign(n.properties,gt(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function R2(e,t){const n=t.data||{},r="value"in t&&!(mi.call(n,"hProperties")||mi.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 O2(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
52
52
|
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
53
53
|
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
54
|
-
`}),n}function
|
|
55
|
-
`},i),s}function N2(e,t){return e&&"run"in e?async function(n,r){const i=Ba(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Ba(n,{file:r,...e||t})}}function Fa(e){if(e)throw e}var zr,Ha;function I2(){if(Ha)return zr;Ha=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},s=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var d=e.call(c,"constructor"),h=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!d&&!h)return!1;var f;for(f in c);return typeof f>"u"||e.call(c,f)},a=function(c,d){n&&d.name==="__proto__"?n(c,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):c[d.name]=d.newValue},u=function(c,d){if(d==="__proto__")if(e.call(c,d)){if(r)return r(c,d).value}else return;return c[d]};return zr=function o(){var c,d,h,f,m,b,A=arguments[0],S=1,_=arguments.length,L=!1;for(typeof A=="boolean"&&(L=A,A=arguments[1]||{},S=2),(A==null||typeof A!="object"&&typeof A!="function")&&(A={});S<_;++S)if(c=arguments[S],c!=null)for(d in c)h=u(A,d),f=u(c,d),A!==f&&(L&&f&&(s(f)||(m=i(f)))?(m?(m=!1,b=h&&i(h)?h:[]):b=h&&s(h)?h:{},a(A,{name:d,newValue:o(L,b,f)})):typeof f<"u"&&a(A,{name:d,newValue:f}));return A},zr}var w2=I2();const $r=Eu(w2);function mi(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function L2(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);u(null,...i);function u(o,...c){const d=e[++s];let h=-1;if(o){a(o);return}for(;++h<i.length;)(c[h]===null||c[h]===void 0)&&(c[h]=i[h]);i=c,d?R2(d,u)(...c):a(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function R2(e,t){let n;return r;function r(...a){const u=e.length>a.length;let o;u&&a.push(i);try{o=e.apply(this,a)}catch(c){const d=c;if(u&&n)throw d;return i(d)}u||(o&&o.then&&typeof o.then=="function"?o.then(s,i):o instanceof Error?i(o):s(o))}function i(a,...u){n||(n=!0,t(a,...u))}function s(a){i(null,a)}}const je={basename:O2,dirname:D2,extname:P2,join:v2,sep:"/"};function O2(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');In(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,u=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),u>-1&&(e.codePointAt(i)===t.codePointAt(u--)?u<0&&(r=i):(u=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function D2(e){if(In(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||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function P2(e){In(e);let t=e.length,n=-1,r=0,i=-1,s=0,a;for(;t--;){const u=e.codePointAt(t);if(u===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),u===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function v2(...e){let t=-1,n;for(;++t<e.length;)In(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":M2(n)}function M2(e){In(e);const t=e.codePointAt(0)===47;let n=B2(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function B2(e,t){let n="",r=0,i=-1,s=0,a=-1,u,o;for(;++a<=e.length;){if(a<e.length)u=e.codePointAt(a);else{if(u===47)break;u=47}if(u===47){if(!(i===a-1||s===1))if(i!==a-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(o=n.lastIndexOf("/"),o!==n.length-1){o<0?(n="",r=0):(n=n.slice(0,o),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,s=0}else u===46&&s>-1?s++:s=-1}return n}function In(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const F2={cwd:H2};function H2(){return"/"}function pi(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function U2(e){if(typeof e=="string")e=new URL(e);else if(!pi(e)){const t=new 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:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return j2(e)}function j2(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Yr=["history","path","basename","stem","extname","dirname"];class z2{constructor(t){let n;t?pi(t)?n={path:t}:typeof t=="string"||$2(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":F2.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Yr.length;){const s=Yr[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)Yr.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?je.basename(this.path):void 0}set basename(t){Vr(t,"basename"),qr(t,"basename"),this.path=je.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?je.dirname(this.path):void 0}set dirname(t){Ua(this.basename,"dirname"),this.path=je.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?je.extname(this.path):void 0}set extname(t){if(qr(t,"extname"),Ua(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=je.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){pi(t)&&(t=U2(t)),Vr(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?je.basename(this.path,this.extname):void 0}set stem(t){Vr(t,"stem"),qr(t,"stem"),this.path=je.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new xe(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function qr(e,t){if(e&&e.includes(je.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+je.sep+"`")}function Vr(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Ua(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function $2(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Y2=(function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),q2={}.hasOwnProperty;class Ki extends Y2{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=L2()}copy(){const t=new Ki;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data($r(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Qr("data",this.frozen),this.namespace[t]=n,this):q2.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Qr("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Mn(t),r=this.parser||this.Parser;return Wr("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Wr("process",this.parser||this.Parser),Gr("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const u=Mn(t),o=r.parse(u);r.run(o,u,function(d,h,f){if(d||!h||!f)return c(d);const m=h,b=r.stringify(m,f);G2(b)?f.value=b:f.result=b,c(d,f)});function c(d,h){d||!h?a(d):s?s(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),Wr("processSync",this.parser||this.Parser),Gr("processSync",this.compiler||this.Compiler),this.process(t,i),za("processSync","process",n),r;function i(s,a){n=!0,Fa(s),r=a}}run(t,n,r){ja(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,u){const o=Mn(n);i.run(t,o,c);function c(d,h,f){const m=h||t;d?u(d):a?a(m):r(void 0,m,f)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),za("runSync","run",r),i;function s(a,u){Fa(a),i=u,r=!0}}stringify(t,n){this.freeze();const r=Mn(n),i=this.compiler||this.Compiler;return Gr("stringify",i),ja(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Qr("use",this.frozen),t!=null)if(typeof t=="function")o(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(c){if(typeof c=="function")o(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[d,...h]=c;o(d,h)}else a(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function a(c){if(!("plugins"in c)&&!("settings"in c))throw new 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");u(c.plugins),c.settings&&(i.settings=$r(!0,i.settings,c.settings))}function u(c){let d=-1;if(c!=null)if(Array.isArray(c))for(;++d<c.length;){const h=c[d];s(h)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function o(c,d){let h=-1,f=-1;for(;++h<r.length;)if(r[h][0]===c){f=h;break}if(f===-1)r.push([c,...d]);else if(d.length>0){let[m,...b]=d;const A=r[f][1];mi(A)&&mi(m)&&(m=$r(!0,A,m)),r[f]=[c,m,...b]}}}}const V2=new Ki().freeze();function Wr(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Gr(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Qr(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ja(e){if(!mi(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function za(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Mn(e){return W2(e)?e:new z2(e)}function W2(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function G2(e){return typeof e=="string"||Q2(e)}function Q2(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}function Xi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var yt=Xi();function Nl(e){yt=e}var hn={exec:()=>null};function ie(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(i,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(Ae.caret,"$1"),n=n.replace(i,a),r},getRegex:()=>new RegExp(n,t)};return r}var K2=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Ae={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},X2=/^(?:[ \t]*(?:\n|$))+/,Z2=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,J2=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,wn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ex=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Zi=/(?:[*+-]|\d{1,9}[.)])/,Il=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,wl=ie(Il).replace(/bull/g,Zi).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),tx=ie(Il).replace(/bull/g,Zi).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ji=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,nx=/^[^\n]+/,es=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,rx=ie(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",es).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ix=ie(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Zi).getRegex(),_r="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ts=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,sx=ie("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ts).replace("tag",_r).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ll=ie(Ji).replace("hr",wn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_r).getRegex(),ax=ie(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ll).getRegex(),ns={blockquote:ax,code:Z2,def:rx,fences:J2,heading:ex,hr:wn,html:sx,lheading:wl,list:ix,newline:X2,paragraph:Ll,table:hn,text:nx},$a=ie("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",wn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_r).getRegex(),ux={...ns,lheading:tx,table:$a,paragraph:ie(Ji).replace("hr",wn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",$a).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_r).getRegex()},ox={...ns,html:ie(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ts).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:hn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ie(Ji).replace("hr",wn).replace("heading",` *#{1,6} *[^
|
|
56
|
-
]`).replace("lheading",
|
|
54
|
+
`}),n}function Ua(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function ja(e,t){const n=I2(e,t),r=n.one(e,void 0),i=S2(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
|
|
55
|
+
`},i),s}function D2(e,t){return e&&"run"in e?async function(n,r){const i=ja(n,{file:r,...t});await e.run(i,r)}:function(n,r){return ja(n,{file:r,...e||t})}}function za(e){if(e)throw e}var Yr,$a;function P2(){if($a)return Yr;$a=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},s=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var d=e.call(c,"constructor"),h=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!d&&!h)return!1;var f;for(f in c);return typeof f>"u"||e.call(c,f)},a=function(c,d){n&&d.name==="__proto__"?n(c,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):c[d.name]=d.newValue},u=function(c,d){if(d==="__proto__")if(e.call(c,d)){if(r)return r(c,d).value}else return;return c[d]};return Yr=function o(){var c,d,h,f,m,b,k=arguments[0],S=1,_=arguments.length,L=!1;for(typeof k=="boolean"&&(L=k,k=arguments[1]||{},S=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});S<_;++S)if(c=arguments[S],c!=null)for(d in c)h=u(k,d),f=u(c,d),k!==f&&(L&&f&&(s(f)||(m=i(f)))?(m?(m=!1,b=h&&i(h)?h:[]):b=h&&s(h)?h:{},a(k,{name:d,newValue:o(L,b,f)})):typeof f<"u"&&a(k,{name:d,newValue:f}));return k},Yr}var v2=P2();const qr=Au(v2);function pi(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function M2(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);u(null,...i);function u(o,...c){const d=e[++s];let h=-1;if(o){a(o);return}for(;++h<i.length;)(c[h]===null||c[h]===void 0)&&(c[h]=i[h]);i=c,d?B2(d,u)(...c):a(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function B2(e,t){let n;return r;function r(...a){const u=e.length>a.length;let o;u&&a.push(i);try{o=e.apply(this,a)}catch(c){const d=c;if(u&&n)throw d;return i(d)}u||(o&&o.then&&typeof o.then=="function"?o.then(s,i):o instanceof Error?i(o):s(o))}function i(a,...u){n||(n=!0,t(a,...u))}function s(a){i(null,a)}}const je={basename:F2,dirname:H2,extname:U2,join:j2,sep:"/"};function F2(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ln(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,u=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),u>-1&&(e.codePointAt(i)===t.codePointAt(u--)?u<0&&(r=i):(u=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function H2(e){if(Ln(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||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function U2(e){Ln(e);let t=e.length,n=-1,r=0,i=-1,s=0,a;for(;t--;){const u=e.codePointAt(t);if(u===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),u===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function j2(...e){let t=-1,n;for(;++t<e.length;)Ln(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":z2(n)}function z2(e){Ln(e);const t=e.codePointAt(0)===47;let n=$2(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function $2(e,t){let n="",r=0,i=-1,s=0,a=-1,u,o;for(;++a<=e.length;){if(a<e.length)u=e.codePointAt(a);else{if(u===47)break;u=47}if(u===47){if(!(i===a-1||s===1))if(i!==a-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(o=n.lastIndexOf("/"),o!==n.length-1){o<0?(n="",r=0):(n=n.slice(0,o),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,s=0}else u===46&&s>-1?s++:s=-1}return n}function Ln(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Y2={cwd:q2};function q2(){return"/"}function gi(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function V2(e){if(typeof e=="string")e=new URL(e);else if(!gi(e)){const t=new 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:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return W2(e)}function W2(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Vr=["history","path","basename","stem","extname","dirname"];class G2{constructor(t){let n;t?gi(t)?n={path:t}:typeof t=="string"||Q2(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Y2.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Vr.length;){const s=Vr[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)Vr.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?je.basename(this.path):void 0}set basename(t){Gr(t,"basename"),Wr(t,"basename"),this.path=je.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?je.dirname(this.path):void 0}set dirname(t){Ya(this.basename,"dirname"),this.path=je.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?je.extname(this.path):void 0}set extname(t){if(Wr(t,"extname"),Ya(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=je.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){gi(t)&&(t=V2(t)),Gr(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?je.basename(this.path,this.extname):void 0}set stem(t){Gr(t,"stem"),Wr(t,"stem"),this.path=je.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new xe(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Wr(e,t){if(e&&e.includes(je.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+je.sep+"`")}function Gr(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Ya(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Q2(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const K2=(function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),X2={}.hasOwnProperty;class Xi extends K2{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=M2()}copy(){const t=new Xi;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(qr(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Xr("data",this.frozen),this.namespace[t]=n,this):X2.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Xr("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Hn(t),r=this.parser||this.Parser;return Qr("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Qr("process",this.parser||this.Parser),Kr("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const u=Hn(t),o=r.parse(u);r.run(o,u,function(d,h,f){if(d||!h||!f)return c(d);const m=h,b=r.stringify(m,f);ex(b)?f.value=b:f.result=b,c(d,f)});function c(d,h){d||!h?a(d):s?s(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),Qr("processSync",this.parser||this.Parser),Kr("processSync",this.compiler||this.Compiler),this.process(t,i),Va("processSync","process",n),r;function i(s,a){n=!0,za(s),r=a}}run(t,n,r){qa(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,u){const o=Hn(n);i.run(t,o,c);function c(d,h,f){const m=h||t;d?u(d):a?a(m):r(void 0,m,f)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),Va("runSync","run",r),i;function s(a,u){za(a),i=u,r=!0}}stringify(t,n){this.freeze();const r=Hn(n),i=this.compiler||this.Compiler;return Kr("stringify",i),qa(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Xr("use",this.frozen),t!=null)if(typeof t=="function")o(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(c){if(typeof c=="function")o(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[d,...h]=c;o(d,h)}else a(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function a(c){if(!("plugins"in c)&&!("settings"in c))throw new 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");u(c.plugins),c.settings&&(i.settings=qr(!0,i.settings,c.settings))}function u(c){let d=-1;if(c!=null)if(Array.isArray(c))for(;++d<c.length;){const h=c[d];s(h)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function o(c,d){let h=-1,f=-1;for(;++h<r.length;)if(r[h][0]===c){f=h;break}if(f===-1)r.push([c,...d]);else if(d.length>0){let[m,...b]=d;const k=r[f][1];pi(k)&&pi(m)&&(m=qr(!0,k,m)),r[f]=[c,m,...b]}}}}const Z2=new Xi().freeze();function Qr(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Kr(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Xr(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function qa(e){if(!pi(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Va(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Hn(e){return J2(e)?e:new G2(e)}function J2(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function ex(e){return typeof e=="string"||tx(e)}function tx(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}function Zi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var At=Zi();function Ol(e){At=e}var fn={exec:()=>null};function ie(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(i,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(Ae.caret,"$1"),n=n.replace(i,a),r},getRegex:()=>new RegExp(n,t)};return r}var nx=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Ae={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},rx=/^(?:[ \t]*(?:\n|$))+/,ix=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,sx=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Rn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ax=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ji=/(?:[*+-]|\d{1,9}[.)])/,Dl=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Pl=ie(Dl).replace(/bull/g,Ji).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),ux=ie(Dl).replace(/bull/g,Ji).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),es=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ox=/^[^\n]+/,ts=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,lx=ie(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ts).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),cx=ie(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ji).getRegex(),Sr="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ns=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,dx=ie("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ns).replace("tag",Sr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),vl=ie(es).replace("hr",Rn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Sr).getRegex(),hx=ie(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",vl).getRegex(),rs={blockquote:hx,code:ix,def:lx,fences:sx,heading:ax,hr:Rn,html:dx,lheading:Pl,list:cx,newline:rx,paragraph:vl,table:fn,text:ox},Wa=ie("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Rn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Sr).getRegex(),fx={...rs,lheading:ux,table:Wa,paragraph:ie(es).replace("hr",Rn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Wa).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Sr).getRegex()},mx={...rs,html:ie(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ns).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:fn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ie(es).replace("hr",Rn).replace("heading",` *#{1,6} *[^
|
|
56
|
+
]`).replace("lheading",Pl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},px=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,gx=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ml=/^( {2,}|\\)\n(?!\s*$)/,bx=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Nr=/[\p{P}\p{S}]/u,is=/[\s\p{P}\p{S}]/u,Bl=/[^\s\p{P}\p{S}]/u,Ex=ie(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,is).getRegex(),Fl=/(?!~)[\p{P}\p{S}]/u,Tx=/(?!~)[\s\p{P}\p{S}]/u,xx=/(?:[^\s\p{P}\p{S}]|~)/u,kx=ie(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",nx?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Hl=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,yx=ie(Hl,"u").replace(/punct/g,Nr).getRegex(),Ax=ie(Hl,"u").replace(/punct/g,Fl).getRegex(),Ul="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",_x=ie(Ul,"gu").replace(/notPunctSpace/g,Bl).replace(/punctSpace/g,is).replace(/punct/g,Nr).getRegex(),Cx=ie(Ul,"gu").replace(/notPunctSpace/g,xx).replace(/punctSpace/g,Tx).replace(/punct/g,Fl).getRegex(),Sx=ie("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Bl).replace(/punctSpace/g,is).replace(/punct/g,Nr).getRegex(),Nx=ie(/\\(punct)/,"gu").replace(/punct/g,Nr).getRegex(),Ix=ie(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[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])?)+(?![-_])/).getRegex(),wx=ie(ns).replace("(?:-->|$)","-->").getRegex(),Lx=ie("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",wx).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ar=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Rx=ie(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ar).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),jl=ie(/^!?\[(label)\]\[(ref)\]/).replace("label",ar).replace("ref",ts).getRegex(),zl=ie(/^!?\[(ref)\](?:\[\])?/).replace("ref",ts).getRegex(),Ox=ie("reflink|nolink(?!\\()","g").replace("reflink",jl).replace("nolink",zl).getRegex(),Ga=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ss={_backpedal:fn,anyPunctuation:Nx,autolink:Ix,blockSkip:kx,br:Ml,code:gx,del:fn,emStrongLDelim:yx,emStrongRDelimAst:_x,emStrongRDelimUnd:Sx,escape:px,link:Rx,nolink:zl,punctuation:Ex,reflink:jl,reflinkSearch:Ox,tag:Lx,text:bx,url:fn},Dx={...ss,link:ie(/^!?\[(label)\]\((.*?)\)/).replace("label",ar).getRegex(),reflink:ie(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ar).getRegex()},bi={...ss,emStrongRDelimAst:Cx,emStrongLDelim:Ax,url:ie(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Ga).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ie(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Ga).getRegex()},Px={...bi,br:ie(Ml).replace("{2,}","*").getRegex(),text:ie(bi.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Un={normal:rs,gfm:fx,pedantic:mx},Zt={normal:ss,gfm:bi,breaks:Px,pedantic:Dx},vx={"&":"&","<":"<",">":">",'"':""","'":"'"},Qa=e=>vx[e];function Qe(e,t){if(t){if(Ae.escapeTest.test(e))return e.replace(Ae.escapeReplace,Qa)}else if(Ae.escapeTestNoEncode.test(e))return e.replace(Ae.escapeReplaceNoEncode,Qa);return e}function Ka(e){try{e=encodeURI(e).replace(Ae.percentDecode,"%")}catch{return null}return e}function Xa(e,t){let n=e.replace(Ae.findPipe,(s,a,u)=>{let o=!1,c=a;for(;--c>=0&&u[c]==="\\";)o=!o;return o?"|":" |"}),r=n.split(Ae.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(Ae.slashPipe,"|");return r}function Jt(e,t,n){let r=e.length;if(r===0)return"";let i=0;for(;i<r&&e.charAt(r-i-1)===t;)i++;return e.slice(0,r-i)}function Mx(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Za(e,t,n,r,i){let s=t.href,a=t.title||null,u=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let o={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:a,text:u,tokens:r.inlineTokens(u)};return r.state.inLink=!1,o}function Bx(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
57
57
|
`).map(s=>{let a=s.match(n.other.beginningSpace);if(a===null)return s;let[u]=a;return u.length>=i.length?s.slice(i.length):s}).join(`
|
|
58
|
-
`)}var
|
|
59
|
-
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=
|
|
60
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=
|
|
58
|
+
`)}var ur=class{options;rules;lexer;constructor(e){this.options=e||At}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Jt(n,`
|
|
59
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=Bx(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=Jt(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Jt(t[0],`
|
|
60
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=Jt(t[0],`
|
|
61
61
|
`).split(`
|
|
62
62
|
`),r="",i="",s=[];for(;n.length>0;){let a=!1,u=[],o;for(o=0;o<n.length;o++)if(this.rules.other.blockquoteStart.test(n[o]))u.push(n[o]),a=!0;else if(!a)u.push(n[o]);else break;n=n.slice(o);let c=u.join(`
|
|
63
63
|
`),d=c.replace(this.rules.other.blockquoteSetextReplace,`
|
|
@@ -65,19 +65,19 @@ $$`:`${e}$$`},CE=e=>AE(e)%2===0?e:_E(e),SE=(e,t,n)=>{if(e.substring(t+2).include
|
|
|
65
65
|
${c}`:c,i=i?`${i}
|
|
66
66
|
${d}`:d;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,s,!0),this.lexer.state.top=h,n.length===0)break;let f=s.at(-1);if(f?.type==="code")break;if(f?.type==="blockquote"){let m=f,b=m.raw+`
|
|
67
67
|
`+n.join(`
|
|
68
|
-
`),
|
|
68
|
+
`),k=this.blockquote(b);s[s.length-1]=k,r=r.substring(0,r.length-m.raw.length)+k.raw,i=i.substring(0,i.length-m.text.length)+k.text;break}else if(f?.type==="list"){let m=f,b=m.raw+`
|
|
69
69
|
`+n.join(`
|
|
70
|
-
`),
|
|
70
|
+
`),k=this.list(b);s[s.length-1]=k,r=r.substring(0,r.length-f.raw.length)+k.raw,i=i.substring(0,i.length-m.raw.length)+k.raw,n=b.substring(s.at(-1).raw.length).split(`
|
|
71
71
|
`);continue}}return{type:"blockquote",raw:r,tokens:s,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let s=this.rules.other.listItemRegex(n),a=!1;for(;e;){let o=!1,c="",d="";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;c=t[0],e=e.substring(c.length);let h=t[2].split(`
|
|
72
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,
|
|
72
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,k=>" ".repeat(3*k.length)),f=e.split(`
|
|
73
73
|
`,1)[0],m=!h.trim(),b=0;if(this.options.pedantic?(b=2,d=h.trimStart()):m?b=t[1].length+1:(b=t[2].search(this.rules.other.nonSpaceChar),b=b>4?1:b,d=h.slice(b),b+=t[1].length),m&&this.rules.other.blankLine.test(f)&&(c+=f+`
|
|
74
|
-
`,e=e.substring(f.length+1),o=!0),!o){let
|
|
75
|
-
`,1)[0],z;if(f=B,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),z=f):z=f.replace(this.rules.other.tabCharGlobal," "),_.test(f)||L.test(f)||I.test(f)||
|
|
74
|
+
`,e=e.substring(f.length+1),o=!0),!o){let k=this.rules.other.nextBulletRegex(b),S=this.rules.other.hrRegex(b),_=this.rules.other.fencesBeginRegex(b),L=this.rules.other.headingBeginRegex(b),I=this.rules.other.htmlBeginRegex(b);for(;e;){let B=e.split(`
|
|
75
|
+
`,1)[0],z;if(f=B,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),z=f):z=f.replace(this.rules.other.tabCharGlobal," "),_.test(f)||L.test(f)||I.test(f)||k.test(f)||S.test(f))break;if(z.search(this.rules.other.nonSpaceChar)>=b||!f.trim())d+=`
|
|
76
76
|
`+z.slice(b);else{if(m||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||_.test(h)||L.test(h)||S.test(h))break;d+=`
|
|
77
77
|
`+f}!m&&!f.trim()&&(m=!0),c+=B+`
|
|
78
|
-
`,e=e.substring(B.length+1),h=z.slice(b)}}i.loose||(a?i.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(a=!0)),i.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(d),loose:!1,text:d,tokens:[]}),i.raw+=c}let u=i.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let o of i.items){if(this.lexer.state.top=!1,o.tokens=this.lexer.blockTokens(o.text,[]),o.task){if(o.text=o.text.replace(this.rules.other.listReplaceTask,""),o.tokens[0]?.type==="text"||o.tokens[0]?.type==="paragraph"){o.tokens[0].raw=o.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),o.tokens[0].text=o.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}}let c=this.rules.other.listTaskCheckbox.exec(o.raw);if(c){let d={type:"checkbox",raw:c[0]+" ",checked:c[0]!=="[ ]"};o.checked=d.checked,i.loose?o.tokens[0]&&["paragraph","text"].includes(o.tokens[0].type)&&"tokens"in o.tokens[0]&&o.tokens[0].tokens?(o.tokens[0].raw=d.raw+o.tokens[0].raw,o.tokens[0].text=d.raw+o.tokens[0].text,o.tokens[0].tokens.unshift(d)):o.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):o.tokens.unshift(d)}}if(!i.loose){let c=o.tokens.filter(h=>h.type==="space"),d=c.length>0&&c.some(h=>this.rules.other.anyLine.test(h.raw));i.loose=d}}if(i.loose)for(let o of i.items){o.loose=!0;for(let c of o.tokens)c.type==="text"&&(c.type="paragraph")}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:i}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=
|
|
79
|
-
`):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let a of r)this.rules.other.tableAlignRight.test(a)?s.align.push("right"):this.rules.other.tableAlignCenter.test(a)?s.align.push("center"):this.rules.other.tableAlignLeft.test(a)?s.align.push("left"):s.align.push(null);for(let a=0;a<n.length;a++)s.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:s.align[a]});for(let a of i)s.rows.push(
|
|
80
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=
|
|
78
|
+
`,e=e.substring(B.length+1),h=z.slice(b)}}i.loose||(a?i.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(a=!0)),i.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(d),loose:!1,text:d,tokens:[]}),i.raw+=c}let u=i.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let o of i.items){if(this.lexer.state.top=!1,o.tokens=this.lexer.blockTokens(o.text,[]),o.task){if(o.text=o.text.replace(this.rules.other.listReplaceTask,""),o.tokens[0]?.type==="text"||o.tokens[0]?.type==="paragraph"){o.tokens[0].raw=o.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),o.tokens[0].text=o.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}}let c=this.rules.other.listTaskCheckbox.exec(o.raw);if(c){let d={type:"checkbox",raw:c[0]+" ",checked:c[0]!=="[ ]"};o.checked=d.checked,i.loose?o.tokens[0]&&["paragraph","text"].includes(o.tokens[0].type)&&"tokens"in o.tokens[0]&&o.tokens[0].tokens?(o.tokens[0].raw=d.raw+o.tokens[0].raw,o.tokens[0].text=d.raw+o.tokens[0].text,o.tokens[0].tokens.unshift(d)):o.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):o.tokens.unshift(d)}}if(!i.loose){let c=o.tokens.filter(h=>h.type==="space"),d=c.length>0&&c.some(h=>this.rules.other.anyLine.test(h.raw));i.loose=d}}if(i.loose)for(let o of i.items){o.loose=!0;for(let c of o.tokens)c.type==="text"&&(c.type="paragraph")}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:i}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Xa(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
79
|
+
`):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let a of r)this.rules.other.tableAlignRight.test(a)?s.align.push("right"):this.rules.other.tableAlignCenter.test(a)?s.align.push("center"):this.rules.other.tableAlignLeft.test(a)?s.align.push("left"):s.align.push(null);for(let a=0;a<n.length;a++)s.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:s.align[a]});for(let a of i)s.rows.push(Xa(a,s.header.length).map((u,o)=>({text:u,tokens:this.lexer.inline(u),header:!1,align:s.align[o]})));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
|
|
80
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=Jt(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=Mx(t[2],"()");if(s===-2)return;if(s>-1){let a=(t[0].indexOf("!")===0?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,a).trim(),t[3]=""}}let r=t[2],i="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],i=s[3])}else i=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),Za(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[r.toLowerCase()];if(!i){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return Za(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,s,a,u=i,o=0,c=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+i);(r=c.exec(t))!=null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(a=[...s].length,r[3]||r[4]){u+=a;continue}else if((r[5]||r[6])&&i%3&&!((i+a)%3)){o+=a;continue}if(u-=a,u>0)continue;a=Math.min(a,a+u+o);let d=[...r[0]][0].length,h=e.slice(0,i+r.index+d+a);if(Math.min(i,a)%2){let m=h.slice(1,-1);return{type:"em",raw:h,text:m,tokens:this.lexer.inlineTokens(m)}}let f=h.slice(2,-2);return{type:"strong",raw:h,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,r;if(t[2]==="@")n=t[0],r="mailto:"+n;else{let i;do i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(i!==t[0]);n=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},De=class Ei{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||At,this.options.tokenizer=this.options.tokenizer||new ur,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:Ae,block:Un.normal,inline:Zt.normal};this.options.pedantic?(n.block=Un.pedantic,n.inline=Zt.pedantic):this.options.gfm&&(n.block=Un.gfm,this.options.breaks?n.inline=Zt.breaks:n.inline=Zt.gfm),this.tokenizer.rules=n}static get rules(){return{block:Un,inline:Zt}}static lex(t,n){return new Ei(n).lex(t)}static lexInline(t,n){return new Ei(n).inlineTokens(t)}lex(t){t=t.replace(Ae.carriageReturn,`
|
|
81
81
|
`),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){for(this.options.pedantic&&(t=t.replace(Ae.tabCharGlobal," ").replace(Ae.spaceLine,""));t;){let i;if(this.options.extensions?.block?.some(a=>(i=a.call({lexer:this},t,n))?(t=t.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length);let a=n.at(-1);i.raw.length===1&&a!==void 0?a.raw+=`
|
|
82
82
|
`:n.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
83
83
|
`)?"":`
|
|
@@ -91,7 +91,7 @@ ${d}`:d;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
91
91
|
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i),r=s.length!==t.length,t=t.substring(i.raw.length);continue}if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length);let a=n.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
92
92
|
`)?"":`
|
|
93
93
|
`)+i.raw,a.text+=`
|
|
94
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i);continue}if(t){let a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let r=t,i=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)o.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)s=i[2]?i[2].length:0,r=r.slice(0,i.index+s)+"["+"a".repeat(i[0].length-s-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let a=!1,u="";for(;t;){a||(u=""),a=!1;let o;if(this.options.extensions?.inline?.some(d=>(o=d.call({lexer:this},t,n))?(t=t.substring(o.raw.length),n.push(o),!0):!1))continue;if(o=this.tokenizer.escape(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.tag(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.link(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(o.raw.length);let d=n.at(-1);o.type==="text"&&d?.type==="text"?(d.raw+=o.raw,d.text+=o.text):n.push(o);continue}if(o=this.tokenizer.emStrong(t,r,u)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.codespan(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.br(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.del(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.autolink(t)){t=t.substring(o.raw.length),n.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(t))){t=t.substring(o.raw.length),n.push(o);continue}let c=t;if(this.options.extensions?.startInline){let d=1/0,h=t.slice(1),f;this.options.extensions.startInline.forEach(m=>{f=m.call({lexer:this},h),typeof f=="number"&&f>=0&&(d=Math.min(d,f))}),d<1/0&&d>=0&&(c=t.substring(0,d+1))}if(o=this.tokenizer.inlineText(c)){t=t.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(u=o.raw.slice(-1)),a=!0;let d=n.at(-1);d?.type==="text"?(d.raw+=o.raw,d.text+=o.text):n.push(o);continue}if(t){let d="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return n}},
|
|
94
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i);continue}if(t){let a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let r=t,i=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)o.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)s=i[2]?i[2].length:0,r=r.slice(0,i.index+s)+"["+"a".repeat(i[0].length-s-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let a=!1,u="";for(;t;){a||(u=""),a=!1;let o;if(this.options.extensions?.inline?.some(d=>(o=d.call({lexer:this},t,n))?(t=t.substring(o.raw.length),n.push(o),!0):!1))continue;if(o=this.tokenizer.escape(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.tag(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.link(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(o.raw.length);let d=n.at(-1);o.type==="text"&&d?.type==="text"?(d.raw+=o.raw,d.text+=o.text):n.push(o);continue}if(o=this.tokenizer.emStrong(t,r,u)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.codespan(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.br(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.del(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.autolink(t)){t=t.substring(o.raw.length),n.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(t))){t=t.substring(o.raw.length),n.push(o);continue}let c=t;if(this.options.extensions?.startInline){let d=1/0,h=t.slice(1),f;this.options.extensions.startInline.forEach(m=>{f=m.call({lexer:this},h),typeof f=="number"&&f>=0&&(d=Math.min(d,f))}),d<1/0&&d>=0&&(c=t.substring(0,d+1))}if(o=this.tokenizer.inlineText(c)){t=t.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(u=o.raw.slice(-1)),a=!0;let d=n.at(-1);d?.type==="text"?(d.raw+=o.raw,d.text+=o.text):n.push(o);continue}if(t){let d="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return n}},or=class{options;parser;constructor(e){this.options=e||At}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(Ae.notSpaceStart)?.[0],i=e.replace(Ae.endingNewline,"")+`
|
|
95
95
|
`;return r?'<pre><code class="language-'+Qe(r)+'">'+(n?i:Qe(i,!0))+`</code></pre>
|
|
96
96
|
`:"<pre><code>"+(n?i:Qe(i,!0))+`</code></pre>
|
|
97
97
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
@@ -109,15 +109,15 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
109
109
|
`}tablerow({text:e}){return`<tr>
|
|
110
110
|
${e}</tr>
|
|
111
111
|
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
112
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Qe(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=
|
|
113
|
-
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+Qe(r.message+"",!0)+"</pre>";return n?Promise.resolve(i):i}if(n)return Promise.reject(r);throw r}}},Et=new Ox;function ae(e,t){return Et.parse(e,t)}ae.options=ae.setOptions=function(e){return Et.setOptions(e),ae.defaults=Et.defaults,Nl(ae.defaults),ae};ae.getDefaults=Xi;ae.defaults=yt;ae.use=function(...e){return Et.use(...e),ae.defaults=Et.defaults,Nl(ae.defaults),ae};ae.walkTokens=function(e,t){return Et.walkTokens(e,t)};ae.parseInline=Et.parseInline;ae.Parser=Be;ae.parser=Be.parse;ae.Renderer=sr;ae.TextRenderer=ss;ae.Lexer=De;ae.lexer=De.lex;ae.Tokenizer=ir;ae.Hooks=tn;ae.parse=ae;ae.options;ae.setOptions;ae.use;ae.walkTokens;ae.parseInline;Be.parse;De.lex;var Dx=300,Px="300px",vx=500;function Mx(e={}){let{immediate:t=!1,debounceDelay:n=Dx,rootMargin:r=Px,idleTimeout:i=vx}=e,[s,a]=k.useState(!1),u=k.useRef(null),o=k.useRef(null),c=k.useRef(null),d=k.useMemo(()=>m=>{let b=Date.now();return window.setTimeout(()=>{m({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-b))})},1)},[]),h=k.useMemo(()=>typeof window<"u"&&window.requestIdleCallback?(m,b)=>window.requestIdleCallback(m,b):d,[d]),f=k.useMemo(()=>typeof window<"u"&&window.cancelIdleCallback?m=>window.cancelIdleCallback(m):m=>{clearTimeout(m)},[]);return k.useEffect(()=>{if(t){a(!0);return}let m=u.current;if(!m)return;o.current&&(clearTimeout(o.current),o.current=null),c.current&&(f(c.current),c.current=null);let b=()=>{o.current&&(clearTimeout(o.current),o.current=null),c.current&&(f(c.current),c.current=null)},A=I=>{c.current=h(B=>{B.timeRemaining()>0||B.didTimeout?(a(!0),I.disconnect()):c.current=h(()=>{a(!0),I.disconnect()},{timeout:i/2})},{timeout:i})},S=I=>{b(),o.current=window.setTimeout(()=>{var B,z;let R=I.takeRecords();(R.length===0||(z=(B=R.at(-1))==null?void 0:B.isIntersecting)!=null&&z)&&A(I)},n)},_=(I,B)=>{I.isIntersecting?S(B):b()},L=new IntersectionObserver(I=>{for(let B of I)_(B,L)},{rootMargin:r,threshold:0});return L.observe(m),()=>{o.current&&clearTimeout(o.current),c.current&&f(c.current),L.disconnect()}},[t,n,r,i,f,h]),{shouldRender:s,containerRef:u}}var Fl=/\s/,Bx=/^\s+$/,Fx=new Set(["code","pre","svg","math","annotation"]),Hx=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",Ux=e=>e.some(t=>Hx(t)&&Fx.has(t.tagName)),jx=e=>{let t=[],n="",r=!1;for(let i of e){let s=Fl.test(i);s!==r&&n&&(t.push(n),n=""),n+=i,r=s}return n&&t.push(n),t},zx=e=>{let t=[],n="";for(let r of e)Fl.test(r)?n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&t.push(n),t},$x=(e,t,n,r)=>({type:"element",tagName:"span",properties:{"data-sd-animate":!0,style:`--sd-animation:sd-${t};--sd-duration:${n}ms;--sd-easing:${r}`},children:[{type:"text",value:e}]}),Yx=(e,t,n)=>{let r=t.at(-1);if(!(r&&"children"in r))return;if(Ux(t))return Kn;let i=r,s=i.children.indexOf(e);if(s===-1)return;let a=e.value;if(!a.trim())return;let u=(n.sep==="char"?zx(a):jx(a)).map(o=>Bx.test(o)?{type:"text",value:o}:$x(o,n.animation,n.duration,n.easing));return i.children.splice(s,1,...u),s+u.length};function Ti(e){var t,n,r,i;let s={animation:(t=e?.animation)!=null?t:"fadeIn",duration:(n=e?.duration)!=null?n:150,easing:(r=e?.easing)!=null?r:"ease",sep:(i=e?.sep)!=null?i:"word"};return{name:"animate",type:"animate",rehypePlugin:()=>a=>{Ii(a,"text",(u,o)=>Yx(u,o,s))}}}Ti();var as=e=>p.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:p.jsx("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),us=e=>p.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:p.jsx("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),Sr=e=>p.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:p.jsx("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),qx=e=>p.jsxs("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[p.jsx("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),Vx=e=>p.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:p.jsx("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),Wx=e=>p.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:p.jsx("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),Hl=e=>p.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:p.jsx("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),Qa=e=>p.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:p.jsx("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),Gx=e=>p.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:p.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),Qx=e=>p.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:p.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),Q=(...e)=>ud(od(e)),Dt=(e,t,n)=>{let r=typeof t=="string"?new Blob([t],{type:n}):t,i=URL.createObjectURL(r),s=document.createElement("a");s.href=i,s.download=e,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i)},Kx=k.createContext({code:""}),Ul=()=>k.useContext(Kx),Ka=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:s,...a})=>{let[u,o]=k.useState(!1),c=k.useRef(0),{code:d}=Ul(),{isAnimating:h}=k.useContext(Pe),f=s??d,m=async()=>{var A;if(typeof window>"u"||!((A=navigator?.clipboard)!=null&&A.writeText)){t?.(new Error("Clipboard API not available"));return}try{u||(await navigator.clipboard.writeText(f),o(!0),e?.(),c.current=window.setTimeout(()=>o(!1),n))}catch(S){t?.(S)}};k.useEffect(()=>()=>{window.clearTimeout(c.current)},[]);let b=u?as:us;return p.jsx("button",{className:Q("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-copy-button",disabled:h,onClick:m,title:"Copy Code",type:"button",...a,children:r??p.jsx(b,{size:14})})},Xa={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",文言:"wy"},Xx=({onDownload:e,onError:t,language:n,children:r,className:i,code:s,...a})=>{let{code:u}=Ul(),{isAnimating:o}=k.useContext(Pe),c=s??u,d=`file.${n&&n in Xa?Xa[n]:"txt"}`,h="text/plain",f=()=>{try{Dt(d,c,h),e?.()}catch(m){t?.(m)}};return p.jsx("button",{className:Q("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-download-button",disabled:o,onClick:f,title:"Download file",type:"button",...a,children:r??p.jsx(Sr,{size:14})})},Za=()=>p.jsxs("div",{className:"w-full divide-y divide-border overflow-hidden rounded-xl border border-border",children:[p.jsx("div",{className:"h-[46px] w-full bg-muted/80"}),p.jsx("div",{className:"flex w-full items-center justify-center p-4",children:p.jsx(qx,{className:"size-4 animate-spin"})})]}),Zx=/\.[^/.]+$/,Jx=({node:e,className:t,src:n,alt:r,...i})=>{let s=async()=>{if(n)try{let a=await(await fetch(n)).blob(),u=new URL(n,window.location.origin).pathname.split("/").pop()||"",o=u.split(".").pop(),c=u.includes(".")&&o!==void 0&&o.length<=4,d="";if(c)d=u;else{let h=a.type,f="png";h.includes("jpeg")||h.includes("jpg")?f="jpg":h.includes("png")?f="png":h.includes("svg")?f="svg":h.includes("gif")?f="gif":h.includes("webp")&&(f="webp"),d=`${(r||u||"image").replace(Zx,"")}.${f}`}Dt(d,a,a.type)}catch{window.open(n,"_blank")}};return n?p.jsxs("div",{className:"group relative my-4 inline-block","data-streamdown":"image-wrapper",children:[p.jsx("img",{alt:r,className:Q("max-w-full rounded-lg",t),"data-streamdown":"image",src:n,...i}),p.jsx("div",{className:"pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block"}),p.jsx("button",{className:Q("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:s,title:"Download image",type:"button",children:p.jsx(Sr,{size:14})})]}):null},fn=0,ek=()=>{fn+=1,fn===1&&(document.body.style.overflow="hidden")},tk=()=>{fn=Math.max(0,fn-1),fn===0&&(document.body.style.overflow="")},nk=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let[i,s]=k.useState(!1),a=k.useCallback(async()=>{try{await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),2e3)}catch{}},[e]),u=k.useCallback(()=>{r(),n()},[r,n]);return k.useEffect(()=>{if(t){ek();let o=c=>{c.key==="Escape"&&n()};return document.addEventListener("keydown",o),()=>{document.removeEventListener("keydown",o),tk()}}},[t,n]),t?p.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm","data-streamdown":"link-safety-modal",onClick:n,onKeyDown:o=>{o.key==="Escape"&&n()},role:"button",tabIndex:0,children:p.jsxs("div",{className:"relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg",onClick:o=>o.stopPropagation(),onKeyDown:o=>o.stopPropagation(),role:"presentation",children:[p.jsx("button",{className:"absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground",onClick:n,title:"Close",type:"button",children:p.jsx(Hl,{size:16})}),p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsxs("div",{className:"flex items-center gap-2 font-semibold text-lg",children:[p.jsx(Qa,{size:20}),p.jsx("span",{children:"Open external link?"})]}),p.jsx("p",{className:"text-muted-foreground text-sm",children:"You're about to visit an external website."})]}),p.jsx("div",{className:Q("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx("button",{className:"flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted",onClick:a,type:"button",children:i?p.jsxs(p.Fragment,{children:[p.jsx(as,{size:14}),p.jsx("span",{children:"Copied"})]}):p.jsxs(p.Fragment,{children:[p.jsx(us,{size:14}),p.jsx("span",{children:"Copy link"})]})}),p.jsxs("button",{className:"flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90",onClick:u,type:"button",children:[p.jsx(Qa,{size:14}),p.jsx("span",{children:"Open link"})]})]})]})}):null},xi=k.createContext(null),jl=()=>k.useContext(xi),J3=()=>{var e;let t=jl();return(e=t?.code)!=null?e:null},os=()=>{var e;let t=jl();return(e=t?.mermaid)!=null?e:null},rk=(e,t)=>{var n;let r=(n=void 0)!=null?n:5;return new Promise((i,s)=>{let a="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),u=new Image;u.crossOrigin="anonymous",u.onload=()=>{let o=document.createElement("canvas"),c=u.width*r,d=u.height*r;o.width=c,o.height=d;let h=o.getContext("2d");if(!h){s(new Error("Failed to create 2D canvas context for PNG export"));return}h.drawImage(u,0,0,c,d),o.toBlob(f=>{if(!f){s(new Error("Failed to create PNG blob"));return}i(f)},"image/png")},u.onerror=()=>s(new Error("Failed to load SVG image")),u.src=a})},ik=({chart:e,children:t,className:n,onDownload:r,config:i,onError:s})=>{let[a,u]=k.useState(!1),o=k.useRef(null),{isAnimating:c}=k.useContext(Pe),d=os(),h=async f=>{try{if(f==="mmd"){Dt("diagram.mmd",e,"text/plain"),u(!1),r?.(f);return}if(!d){s?.(new Error("Mermaid plugin not available"));return}let m=d.getMermaid(i),b=e.split("").reduce((_,L)=>(_<<5)-_+L.charCodeAt(0)|0,0),A=`mermaid-${Math.abs(b)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:S}=await m.render(A,e);if(!S){s?.(new Error("SVG not found. Please wait for the diagram to render."));return}if(f==="svg"){Dt("diagram.svg",S,"image/svg+xml"),u(!1),r?.(f);return}if(f==="png"){let _=await rk(S);Dt("diagram.png",_,"image/png"),r?.(f),u(!1);return}}catch(m){s?.(m)}};return k.useEffect(()=>{let f=m=>{let b=m.composedPath();o.current&&!b.includes(o.current)&&u(!1)};return document.addEventListener("mousedown",f),()=>{document.removeEventListener("mousedown",f)}},[]),p.jsxs("div",{className:"relative",ref:o,children:[p.jsx("button",{className:Q("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",n),disabled:c,onClick:()=>u(!a),title:"Download diagram",type:"button",children:t??p.jsx(Sr,{size:14})}),a?p.jsxs("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[p.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>h("svg"),title:"Download diagram as SVG",type:"button",children:"SVG"}),p.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>h("png"),title:"Download diagram as PNG",type:"button",children:"PNG"}),p.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>h("mmd"),title:"Download diagram as MMD",type:"button",children:"MMD"})]}):null]})},mn=0,sk=()=>{mn+=1,mn===1&&(document.body.style.overflow="hidden")},ak=()=>{mn=Math.max(0,mn-1),mn===0&&(document.body.style.overflow="")},uk=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...s})=>{let[a,u]=k.useState(!1),{isAnimating:o,controls:c}=k.useContext(Pe),d=(()=>{if(typeof c=="boolean")return c;let f=c.mermaid;return f===!1?!1:f===!0||f===void 0?!0:f.panZoom!==!1})(),h=()=>{u(!a)};return k.useEffect(()=>{if(a){sk();let f=m=>{m.key==="Escape"&&u(!1)};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f),ak()}}},[a]),k.useEffect(()=>{a?n?.():r&&r()},[a,n,r]),p.jsxs(p.Fragment,{children:[p.jsx("button",{className:Q("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),disabled:o,onClick:h,title:"View fullscreen",type:"button",...s,children:p.jsx(Vx,{size:14})}),a?p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm",onClick:h,onKeyDown:f=>{f.key==="Escape"&&h()},role:"button",tabIndex:0,children:[p.jsx("button",{className:"absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground",onClick:h,title:"Exit fullscreen",type:"button",children:p.jsx(Hl,{size:20})}),p.jsx("div",{className:"flex size-full items-center justify-center p-4",onClick:f=>f.stopPropagation(),onKeyDown:f=>f.stopPropagation(),role:"presentation",children:p.jsx(bc,{chart:e,className:"size-full [&_svg]:h-auto [&_svg]:w-auto",config:t,fullscreen:!0,showControls:d})})]}):null]})},zl=e=>{var t,n;let r=[],i=[],s=e.querySelectorAll("thead th");for(let u of s)r.push(((t=u.textContent)==null?void 0:t.trim())||"");let a=e.querySelectorAll("tbody tr");for(let u of a){let o=[],c=u.querySelectorAll("td");for(let d of c)o.push(((n=d.textContent)==null?void 0:n.trim())||"");i.push(o)}return{headers:r,rows:i}},$l=e=>{let{headers:t,rows:n}=e,r=u=>{let o=!1,c=!1;for(let d of u){if(d==='"'){o=!0,c=!0;break}(d===","||d===`
|
|
112
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Qe(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Ka(e);if(i===null)return r;e=i;let s='<a href="'+e+'"';return t&&(s+=' title="'+Qe(t)+'"'),s+=">"+r+"</a>",s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Ka(e);if(i===null)return Qe(n);e=i;let s=`<img src="${e}" alt="${n}"`;return t&&(s+=` title="${Qe(t)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Qe(e.text)}},as=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},Be=class Ti{options;renderer;textRenderer;constructor(t){this.options=t||At,this.options.renderer=this.options.renderer||new or,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new as}static parse(t,n){return new Ti(n).parse(t)}static parseInline(t,n){return new Ti(n).parseInline(t)}parse(t){let n="";for(let r=0;r<t.length;r++){let i=t[r];if(this.options.extensions?.renderers?.[i.type]){let a=i,u=this.options.extensions.renderers[a.type].call({parser:this},a);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(a.type)){n+=u||"";continue}}let s=i;switch(s.type){case"space":{n+=this.renderer.space(s);break}case"hr":{n+=this.renderer.hr(s);break}case"heading":{n+=this.renderer.heading(s);break}case"code":{n+=this.renderer.code(s);break}case"table":{n+=this.renderer.table(s);break}case"blockquote":{n+=this.renderer.blockquote(s);break}case"list":{n+=this.renderer.list(s);break}case"checkbox":{n+=this.renderer.checkbox(s);break}case"html":{n+=this.renderer.html(s);break}case"def":{n+=this.renderer.def(s);break}case"paragraph":{n+=this.renderer.paragraph(s);break}case"text":{n+=this.renderer.text(s);break}default:{let a='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}parseInline(t,n=this.renderer){let r="";for(let i=0;i<t.length;i++){let s=t[i];if(this.options.extensions?.renderers?.[s.type]){let u=this.options.extensions.renderers[s.type].call({parser:this},s);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){r+=u||"";continue}}let a=s;switch(a.type){case"escape":{r+=n.text(a);break}case"html":{r+=n.html(a);break}case"link":{r+=n.link(a);break}case"image":{r+=n.image(a);break}case"checkbox":{r+=n.checkbox(a);break}case"strong":{r+=n.strong(a);break}case"em":{r+=n.em(a);break}case"codespan":{r+=n.codespan(a);break}case"br":{r+=n.br(a);break}case"del":{r+=n.del(a);break}case"text":{r+=n.text(a);break}default:{let u='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}},nn=class{options;block;constructor(e){this.options=e||At}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?De.lex:De.lexInline}provideParser(){return this.block?Be.parse:Be.parseInline}},Fx=class{defaults=Zi();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Be;Renderer=or;TextRenderer=as;Lexer=De;Tokenizer=ur;Hooks=nn;constructor(...t){this.use(...t)}walkTokens(t,n){let r=[];for(let i of t)switch(r=r.concat(n.call(this,i)),i.type){case"table":{let s=i;for(let a of s.header)r=r.concat(this.walkTokens(a.tokens,n));for(let a of s.rows)for(let u of a)r=r.concat(this.walkTokens(u.tokens,n));break}case"list":{let s=i;r=r.concat(this.walkTokens(s.items,n));break}default:{let s=i;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(a=>{let u=s[a].flat(1/0);r=r.concat(this.walkTokens(u,n))}):s.tokens&&(r=r.concat(this.walkTokens(s.tokens,n)))}}return r}use(...t){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let i={...r};if(i.async=this.defaults.async||i.async||!1,r.extensions&&(r.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let a=n.renderers[s.name];a?n.renderers[s.name]=function(...u){let o=s.renderer.apply(this,u);return o===!1&&(o=a.apply(this,u)),o}:n.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=n[s.level];a?a.unshift(s.tokenizer):n[s.level]=[s.tokenizer],s.start&&(s.level==="block"?n.startBlock?n.startBlock.push(s.start):n.startBlock=[s.start]:s.level==="inline"&&(n.startInline?n.startInline.push(s.start):n.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(n.childTokens[s.name]=s.childTokens)}),i.extensions=n),r.renderer){let s=this.defaults.renderer||new or(this.defaults);for(let a in r.renderer){if(!(a in s))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let u=a,o=r.renderer[u],c=s[u];s[u]=(...d)=>{let h=o.apply(s,d);return h===!1&&(h=c.apply(s,d)),h||""}}i.renderer=s}if(r.tokenizer){let s=this.defaults.tokenizer||new ur(this.defaults);for(let a in r.tokenizer){if(!(a in s))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let u=a,o=r.tokenizer[u],c=s[u];s[u]=(...d)=>{let h=o.apply(s,d);return h===!1&&(h=c.apply(s,d)),h}}i.tokenizer=s}if(r.hooks){let s=this.defaults.hooks||new nn;for(let a in r.hooks){if(!(a in s))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let u=a,o=r.hooks[u],c=s[u];nn.passThroughHooks.has(a)?s[u]=d=>{if(this.defaults.async&&nn.passThroughHooksRespectAsync.has(a))return(async()=>{let f=await o.call(s,d);return c.call(s,f)})();let h=o.call(s,d);return c.call(s,h)}:s[u]=(...d)=>{if(this.defaults.async)return(async()=>{let f=await o.apply(s,d);return f===!1&&(f=await c.apply(s,d)),f})();let h=o.apply(s,d);return h===!1&&(h=c.apply(s,d)),h}}i.hooks=s}if(r.walkTokens){let s=this.defaults.walkTokens,a=r.walkTokens;i.walkTokens=function(u){let o=[];return o.push(a.call(this,u)),s&&(o=o.concat(s.call(this,u))),o}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return De.lex(t,n??this.defaults)}parser(t,n){return Be.parse(t,n??this.defaults)}parseMarkdown(t){return(n,r)=>{let i={...r},s={...this.defaults,...i},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&i.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=t),s.async)return(async()=>{let u=s.hooks?await s.hooks.preprocess(n):n,o=await(s.hooks?await s.hooks.provideLexer():t?De.lex:De.lexInline)(u,s),c=s.hooks?await s.hooks.processAllTokens(o):o;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let d=await(s.hooks?await s.hooks.provideParser():t?Be.parse:Be.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(d):d})().catch(a);try{s.hooks&&(n=s.hooks.preprocess(n));let u=(s.hooks?s.hooks.provideLexer():t?De.lex:De.lexInline)(n,s);s.hooks&&(u=s.hooks.processAllTokens(u)),s.walkTokens&&this.walkTokens(u,s.walkTokens);let o=(s.hooks?s.hooks.provideParser():t?Be.parse:Be.parseInline)(u,s);return s.hooks&&(o=s.hooks.postprocess(o)),o}catch(u){return a(u)}}}onError(t,n){return r=>{if(r.message+=`
|
|
113
|
+
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+Qe(r.message+"",!0)+"</pre>";return n?Promise.resolve(i):i}if(n)return Promise.reject(r);throw r}}},Tt=new Fx;function ae(e,t){return Tt.parse(e,t)}ae.options=ae.setOptions=function(e){return Tt.setOptions(e),ae.defaults=Tt.defaults,Ol(ae.defaults),ae};ae.getDefaults=Zi;ae.defaults=At;ae.use=function(...e){return Tt.use(...e),ae.defaults=Tt.defaults,Ol(ae.defaults),ae};ae.walkTokens=function(e,t){return Tt.walkTokens(e,t)};ae.parseInline=Tt.parseInline;ae.Parser=Be;ae.parser=Be.parse;ae.Renderer=or;ae.TextRenderer=as;ae.Lexer=De;ae.lexer=De.lex;ae.Tokenizer=ur;ae.Hooks=nn;ae.parse=ae;ae.options;ae.setOptions;ae.use;ae.walkTokens;ae.parseInline;Be.parse;De.lex;var Hx=300,Ux="300px",jx=500;function zx(e={}){let{immediate:t=!1,debounceDelay:n=Hx,rootMargin:r=Ux,idleTimeout:i=jx}=e,[s,a]=y.useState(!1),u=y.useRef(null),o=y.useRef(null),c=y.useRef(null),d=y.useMemo(()=>m=>{let b=Date.now();return window.setTimeout(()=>{m({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-b))})},1)},[]),h=y.useMemo(()=>typeof window<"u"&&window.requestIdleCallback?(m,b)=>window.requestIdleCallback(m,b):d,[d]),f=y.useMemo(()=>typeof window<"u"&&window.cancelIdleCallback?m=>window.cancelIdleCallback(m):m=>{clearTimeout(m)},[]);return y.useEffect(()=>{if(t){a(!0);return}let m=u.current;if(!m)return;o.current&&(clearTimeout(o.current),o.current=null),c.current&&(f(c.current),c.current=null);let b=()=>{o.current&&(clearTimeout(o.current),o.current=null),c.current&&(f(c.current),c.current=null)},k=I=>{c.current=h(B=>{B.timeRemaining()>0||B.didTimeout?(a(!0),I.disconnect()):c.current=h(()=>{a(!0),I.disconnect()},{timeout:i/2})},{timeout:i})},S=I=>{b(),o.current=window.setTimeout(()=>{var B,z;let R=I.takeRecords();(R.length===0||(z=(B=R.at(-1))==null?void 0:B.isIntersecting)!=null&&z)&&k(I)},n)},_=(I,B)=>{I.isIntersecting?S(B):b()},L=new IntersectionObserver(I=>{for(let B of I)_(B,L)},{rootMargin:r,threshold:0});return L.observe(m),()=>{o.current&&clearTimeout(o.current),c.current&&f(c.current),L.disconnect()}},[t,n,r,i,f,h]),{shouldRender:s,containerRef:u}}var $l=/\s/,$x=/^\s+$/,Yx=new Set(["code","pre","svg","math","annotation"]),qx=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",Vx=e=>e.some(t=>qx(t)&&Yx.has(t.tagName)),Wx=e=>{let t=[],n="",r=!1;for(let i of e){let s=$l.test(i);s!==r&&n&&(t.push(n),n=""),n+=i,r=s}return n&&t.push(n),t},Gx=e=>{let t=[],n="";for(let r of e)$l.test(r)?n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&t.push(n),t},Qx=(e,t,n,r)=>({type:"element",tagName:"span",properties:{"data-sd-animate":!0,style:`--sd-animation:sd-${t};--sd-duration:${n}ms;--sd-easing:${r}`},children:[{type:"text",value:e}]}),Kx=(e,t,n)=>{let r=t.at(-1);if(!(r&&"children"in r))return;if(Vx(t))return Jn;let i=r,s=i.children.indexOf(e);if(s===-1)return;let a=e.value;if(!a.trim())return;let u=(n.sep==="char"?Gx(a):Wx(a)).map(o=>$x.test(o)?{type:"text",value:o}:Qx(o,n.animation,n.duration,n.easing));return i.children.splice(s,1,...u),s+u.length};function xi(e){var t,n,r,i;let s={animation:(t=e?.animation)!=null?t:"fadeIn",duration:(n=e?.duration)!=null?n:150,easing:(r=e?.easing)!=null?r:"ease",sep:(i=e?.sep)!=null?i:"word"};return{name:"animate",type:"animate",rehypePlugin:()=>a=>{wi(a,"text",(u,o)=>Kx(u,o,s))}}}xi();var us=e=>p.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:p.jsx("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),os=e=>p.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:p.jsx("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),Ir=e=>p.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:p.jsx("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),Xx=e=>p.jsxs("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[p.jsx("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),Zx=e=>p.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:p.jsx("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),Jx=e=>p.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:p.jsx("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),Yl=e=>p.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:p.jsx("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),Ja=e=>p.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:p.jsx("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),ek=e=>p.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:p.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),tk=e=>p.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:p.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),Q=(...e)=>md(pd(e)),Pt=(e,t,n)=>{let r=typeof t=="string"?new Blob([t],{type:n}):t,i=URL.createObjectURL(r),s=document.createElement("a");s.href=i,s.download=e,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i)},nk=y.createContext({code:""}),ql=()=>y.useContext(nk),eu=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:s,...a})=>{let[u,o]=y.useState(!1),c=y.useRef(0),{code:d}=ql(),{isAnimating:h}=y.useContext(Pe),f=s??d,m=async()=>{var k;if(typeof window>"u"||!((k=navigator?.clipboard)!=null&&k.writeText)){t?.(new Error("Clipboard API not available"));return}try{u||(await navigator.clipboard.writeText(f),o(!0),e?.(),c.current=window.setTimeout(()=>o(!1),n))}catch(S){t?.(S)}};y.useEffect(()=>()=>{window.clearTimeout(c.current)},[]);let b=u?us:os;return p.jsx("button",{className:Q("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-copy-button",disabled:h,onClick:m,title:"Copy Code",type:"button",...a,children:r??p.jsx(b,{size:14})})},tu={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",文言:"wy"},rk=({onDownload:e,onError:t,language:n,children:r,className:i,code:s,...a})=>{let{code:u}=ql(),{isAnimating:o}=y.useContext(Pe),c=s??u,d=`file.${n&&n in tu?tu[n]:"txt"}`,h="text/plain",f=()=>{try{Pt(d,c,h),e?.()}catch(m){t?.(m)}};return p.jsx("button",{className:Q("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-download-button",disabled:o,onClick:f,title:"Download file",type:"button",...a,children:r??p.jsx(Ir,{size:14})})},nu=()=>p.jsxs("div",{className:"w-full divide-y divide-border overflow-hidden rounded-xl border border-border",children:[p.jsx("div",{className:"h-[46px] w-full bg-muted/80"}),p.jsx("div",{className:"flex w-full items-center justify-center p-4",children:p.jsx(Xx,{className:"size-4 animate-spin"})})]}),ik=/\.[^/.]+$/,sk=({node:e,className:t,src:n,alt:r,...i})=>{let s=async()=>{if(n)try{let a=await(await fetch(n)).blob(),u=new URL(n,window.location.origin).pathname.split("/").pop()||"",o=u.split(".").pop(),c=u.includes(".")&&o!==void 0&&o.length<=4,d="";if(c)d=u;else{let h=a.type,f="png";h.includes("jpeg")||h.includes("jpg")?f="jpg":h.includes("png")?f="png":h.includes("svg")?f="svg":h.includes("gif")?f="gif":h.includes("webp")&&(f="webp"),d=`${(r||u||"image").replace(ik,"")}.${f}`}Pt(d,a,a.type)}catch{window.open(n,"_blank")}};return n?p.jsxs("div",{className:"group relative my-4 inline-block","data-streamdown":"image-wrapper",children:[p.jsx("img",{alt:r,className:Q("max-w-full rounded-lg",t),"data-streamdown":"image",src:n,...i}),p.jsx("div",{className:"pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block"}),p.jsx("button",{className:Q("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:s,title:"Download image",type:"button",children:p.jsx(Ir,{size:14})})]}):null},mn=0,ak=()=>{mn+=1,mn===1&&(document.body.style.overflow="hidden")},uk=()=>{mn=Math.max(0,mn-1),mn===0&&(document.body.style.overflow="")},ok=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let[i,s]=y.useState(!1),a=y.useCallback(async()=>{try{await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),2e3)}catch{}},[e]),u=y.useCallback(()=>{r(),n()},[r,n]);return y.useEffect(()=>{if(t){ak();let o=c=>{c.key==="Escape"&&n()};return document.addEventListener("keydown",o),()=>{document.removeEventListener("keydown",o),uk()}}},[t,n]),t?p.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm","data-streamdown":"link-safety-modal",onClick:n,onKeyDown:o=>{o.key==="Escape"&&n()},role:"button",tabIndex:0,children:p.jsxs("div",{className:"relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg",onClick:o=>o.stopPropagation(),onKeyDown:o=>o.stopPropagation(),role:"presentation",children:[p.jsx("button",{className:"absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground",onClick:n,title:"Close",type:"button",children:p.jsx(Yl,{size:16})}),p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsxs("div",{className:"flex items-center gap-2 font-semibold text-lg",children:[p.jsx(Ja,{size:20}),p.jsx("span",{children:"Open external link?"})]}),p.jsx("p",{className:"text-muted-foreground text-sm",children:"You're about to visit an external website."})]}),p.jsx("div",{className:Q("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx("button",{className:"flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted",onClick:a,type:"button",children:i?p.jsxs(p.Fragment,{children:[p.jsx(us,{size:14}),p.jsx("span",{children:"Copied"})]}):p.jsxs(p.Fragment,{children:[p.jsx(os,{size:14}),p.jsx("span",{children:"Copy link"})]})}),p.jsxs("button",{className:"flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90",onClick:u,type:"button",children:[p.jsx(Ja,{size:14}),p.jsx("span",{children:"Open link"})]})]})]})}):null},ki=y.createContext(null),Vl=()=>y.useContext(ki),ay=()=>{var e;let t=Vl();return(e=t?.code)!=null?e:null},ls=()=>{var e;let t=Vl();return(e=t?.mermaid)!=null?e:null},lk=(e,t)=>{var n;let r=(n=void 0)!=null?n:5;return new Promise((i,s)=>{let a="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),u=new Image;u.crossOrigin="anonymous",u.onload=()=>{let o=document.createElement("canvas"),c=u.width*r,d=u.height*r;o.width=c,o.height=d;let h=o.getContext("2d");if(!h){s(new Error("Failed to create 2D canvas context for PNG export"));return}h.drawImage(u,0,0,c,d),o.toBlob(f=>{if(!f){s(new Error("Failed to create PNG blob"));return}i(f)},"image/png")},u.onerror=()=>s(new Error("Failed to load SVG image")),u.src=a})},ck=({chart:e,children:t,className:n,onDownload:r,config:i,onError:s})=>{let[a,u]=y.useState(!1),o=y.useRef(null),{isAnimating:c}=y.useContext(Pe),d=ls(),h=async f=>{try{if(f==="mmd"){Pt("diagram.mmd",e,"text/plain"),u(!1),r?.(f);return}if(!d){s?.(new Error("Mermaid plugin not available"));return}let m=d.getMermaid(i),b=e.split("").reduce((_,L)=>(_<<5)-_+L.charCodeAt(0)|0,0),k=`mermaid-${Math.abs(b)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:S}=await m.render(k,e);if(!S){s?.(new Error("SVG not found. Please wait for the diagram to render."));return}if(f==="svg"){Pt("diagram.svg",S,"image/svg+xml"),u(!1),r?.(f);return}if(f==="png"){let _=await lk(S);Pt("diagram.png",_,"image/png"),r?.(f),u(!1);return}}catch(m){s?.(m)}};return y.useEffect(()=>{let f=m=>{let b=m.composedPath();o.current&&!b.includes(o.current)&&u(!1)};return document.addEventListener("mousedown",f),()=>{document.removeEventListener("mousedown",f)}},[]),p.jsxs("div",{className:"relative",ref:o,children:[p.jsx("button",{className:Q("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",n),disabled:c,onClick:()=>u(!a),title:"Download diagram",type:"button",children:t??p.jsx(Ir,{size:14})}),a?p.jsxs("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[p.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>h("svg"),title:"Download diagram as SVG",type:"button",children:"SVG"}),p.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>h("png"),title:"Download diagram as PNG",type:"button",children:"PNG"}),p.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>h("mmd"),title:"Download diagram as MMD",type:"button",children:"MMD"})]}):null]})},pn=0,dk=()=>{pn+=1,pn===1&&(document.body.style.overflow="hidden")},hk=()=>{pn=Math.max(0,pn-1),pn===0&&(document.body.style.overflow="")},fk=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...s})=>{let[a,u]=y.useState(!1),{isAnimating:o,controls:c}=y.useContext(Pe),d=(()=>{if(typeof c=="boolean")return c;let f=c.mermaid;return f===!1?!1:f===!0||f===void 0?!0:f.panZoom!==!1})(),h=()=>{u(!a)};return y.useEffect(()=>{if(a){dk();let f=m=>{m.key==="Escape"&&u(!1)};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f),hk()}}},[a]),y.useEffect(()=>{a?n?.():r&&r()},[a,n,r]),p.jsxs(p.Fragment,{children:[p.jsx("button",{className:Q("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),disabled:o,onClick:h,title:"View fullscreen",type:"button",...s,children:p.jsx(Zx,{size:14})}),a?p.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm",onClick:h,onKeyDown:f=>{f.key==="Escape"&&h()},role:"button",tabIndex:0,children:[p.jsx("button",{className:"absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground",onClick:h,title:"Exit fullscreen",type:"button",children:p.jsx(Yl,{size:20})}),p.jsx("div",{className:"flex size-full items-center justify-center p-4",onClick:f=>f.stopPropagation(),onKeyDown:f=>f.stopPropagation(),role:"presentation",children:p.jsx(yc,{chart:e,className:"size-full [&_svg]:h-auto [&_svg]:w-auto",config:t,fullscreen:!0,showControls:d})})]}):null]})},Wl=e=>{var t,n;let r=[],i=[],s=e.querySelectorAll("thead th");for(let u of s)r.push(((t=u.textContent)==null?void 0:t.trim())||"");let a=e.querySelectorAll("tbody tr");for(let u of a){let o=[],c=u.querySelectorAll("td");for(let d of c)o.push(((n=d.textContent)==null?void 0:n.trim())||"");i.push(o)}return{headers:r,rows:i}},Gl=e=>{let{headers:t,rows:n}=e,r=u=>{let o=!1,c=!1;for(let d of u){if(d==='"'){o=!0,c=!0;break}(d===","||d===`
|
|
114
114
|
`)&&(o=!0)}return o?c?`"${u.replace(/"/g,'""')}"`:`"${u}"`:u},i=t.length>0?n.length+1:n.length,s=new Array(i),a=0;t.length>0&&(s[a]=t.map(r).join(","),a+=1);for(let u of n)s[a]=u.map(r).join(","),a+=1;return s.join(`
|
|
115
|
-
`)},
|
|
115
|
+
`)},mk=e=>{let{headers:t,rows:n}=e,r=u=>{let o=!1;for(let d of u)if(d===" "||d===`
|
|
116
116
|
`||d==="\r"){o=!0;break}if(!o)return u;let c=[];for(let d of u)d===" "?c.push("\\t"):d===`
|
|
117
117
|
`?c.push("\\n"):d==="\r"?c.push("\\r"):c.push(d);return c.join("")},i=t.length>0?n.length+1:n.length,s=new Array(i),a=0;t.length>0&&(s[a]=t.map(r).join(" "),a+=1);for(let u of n)s[a]=u.map(r).join(" "),a+=1;return s.join(`
|
|
118
|
-
`)},
|
|
119
|
-
`)},ck=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let[s,a]=k.useState(!1),[u,o]=k.useState(!1),c=k.useRef(null),d=k.useRef(0),{isAnimating:h}=k.useContext(Pe),f=async b=>{var A,S;if(typeof window>"u"||!((A=navigator?.clipboard)!=null&&A.write)){r?.(new Error("Clipboard API not available"));return}try{let _=(S=c.current)==null?void 0:S.closest('[data-streamdown="table-wrapper"]'),L=_?.querySelector("table");if(!L){r?.(new Error("Table not found"));return}let I=zl(L),B=b==="csv"?$l(I):ok(I),z=new ClipboardItem({"text/plain":new Blob([B],{type:"text/plain"}),"text/html":new Blob([L.outerHTML],{type:"text/html"})});await navigator.clipboard.write([z]),o(!0),a(!1),n?.(b),d.current=window.setTimeout(()=>o(!1),i)}catch(_){r?.(_)}};k.useEffect(()=>{let b=A=>{let S=A.composedPath();c.current&&!S.includes(c.current)&&a(!1)};return document.addEventListener("mousedown",b),()=>{document.removeEventListener("mousedown",b),window.clearTimeout(d.current)}},[]);let m=u?as:us;return p.jsxs("div",{className:"relative",ref:c,children:[p.jsx("button",{className:Q("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:h,onClick:()=>a(!s),title:"Copy table",type:"button",children:e??p.jsx(m,{size:14})}),s?p.jsxs("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[p.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>f("csv"),title:"Copy table as CSV",type:"button",children:"CSV"}),p.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>f("tsv"),title:"Copy table as TSV",type:"button",children:"TSV"})]}):null]})},dk=({children:e,className:t,onDownload:n,onError:r})=>{let[i,s]=k.useState(!1),a=k.useRef(null),{isAnimating:u}=k.useContext(Pe),o=c=>{var d;try{let h=(d=a.current)==null?void 0:d.closest('[data-streamdown="table-wrapper"]'),f=h?.querySelector("table");if(!f){r?.(new Error("Table not found"));return}let m=zl(f),b=c==="csv"?$l(m):lk(m);Dt(`table.${c==="csv"?"csv":"md"}`,b,c==="csv"?"text/csv":"text/markdown"),s(!1),n?.(c)}catch(h){r?.(h)}};return k.useEffect(()=>{let c=d=>{let h=d.composedPath();a.current&&!h.includes(a.current)&&s(!1)};return document.addEventListener("mousedown",c),()=>{document.removeEventListener("mousedown",c)}},[]),p.jsxs("div",{className:"relative",ref:a,children:[p.jsx("button",{className:Q("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:u,onClick:()=>s(!i),title:"Download table",type:"button",children:e??p.jsx(Sr,{size:14})}),i?p.jsxs("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[p.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>o("csv"),title:"Download table as CSV",type:"button",children:"CSV"}),p.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>o("markdown"),title:"Download table as Markdown",type:"button",children:"Markdown"})]}):null]})},hk=({children:e,className:t,showControls:n,...r})=>p.jsxs("div",{className:"my-4 flex flex-col space-y-2","data-streamdown":"table-wrapper",children:[n?p.jsxs("div",{className:"flex items-center justify-end gap-1",children:[p.jsx(ck,{}),p.jsx(dk,{})]}):null,p.jsx("div",{className:"overflow-x-auto overscroll-y-auto",children:p.jsx("table",{className:Q("w-full border-collapse border border-border",t),"data-streamdown":"table",...r,children:e})})]}),fk=k.lazy(()=>Ni(()=>import("./code-block-OCS4YCEC-BSdICyOa.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(e=>({default:e.CodeBlock}))),mk=k.lazy(()=>Ni(()=>Promise.resolve().then(()=>Y3),void 0).then(e=>({default:e.Mermaid}))),pk=/language-([^\s]+)/;function Nr(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,s=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&i?.line===s?.line&&i?.column===s?.column}function he(e,t){return e.className===t.className&&Nr(e.node,t.node)}var ki=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,Fn=(e,t)=>{if(typeof e=="boolean")return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},ls=k.memo(({children:e,className:t,node:n,...r})=>p.jsx("ol",{className:Q("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e}),(e,t)=>he(e,t));ls.displayName="MarkdownOl";var Yl=k.memo(({children:e,className:t,node:n,...r})=>p.jsx("li",{className:Q("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e}),(e,t)=>e.className===t.className&&Nr(e.node,t.node));Yl.displayName="MarkdownLi";var ql=k.memo(({children:e,className:t,node:n,...r})=>p.jsx("ul",{className:Q("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e}),(e,t)=>he(e,t));ql.displayName="MarkdownUl";var Vl=k.memo(({className:e,node:t,...n})=>p.jsx("hr",{className:Q("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n}),(e,t)=>he(e,t));Vl.displayName="MarkdownHr";var Wl=k.memo(({children:e,className:t,node:n,...r})=>p.jsx("span",{className:Q("font-semibold",t),"data-streamdown":"strong",...r,children:e}),(e,t)=>he(e,t));Wl.displayName="MarkdownStrong";var gk=({children:e,className:t,href:n,node:r,...i})=>{let{linkSafety:s}=k.useContext(Pe),[a,u]=k.useState(!1),o=n==="streamdown:incomplete-link",c=k.useCallback(async m=>{if(!(!(s!=null&&s.enabled&&n)||o)){if(m.preventDefault(),s.onLinkCheck&&await s.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}u(!0)}},[s,n,o]),d=k.useCallback(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),h=k.useCallback(()=>{u(!1)},[]),f={url:n??"",isOpen:a,onClose:h,onConfirm:d};return s!=null&&s.enabled&&n?p.jsxs(p.Fragment,{children:[p.jsx("button",{className:Q("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":o,"data-streamdown":"link",onClick:c,type:"button",children:e}),s.renderModal?s.renderModal(f):p.jsx(nk,{...f})]}):p.jsx("a",{className:Q("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":o,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...i,children:e})},Gl=k.memo(gk,(e,t)=>he(e,t)&&e.href===t.href);Gl.displayName="MarkdownA";var Ql=k.memo(({children:e,className:t,node:n,...r})=>p.jsx("h1",{className:Q("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e}),(e,t)=>he(e,t));Ql.displayName="MarkdownH1";var Kl=k.memo(({children:e,className:t,node:n,...r})=>p.jsx("h2",{className:Q("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e}),(e,t)=>he(e,t));Kl.displayName="MarkdownH2";var Xl=k.memo(({children:e,className:t,node:n,...r})=>p.jsx("h3",{className:Q("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e}),(e,t)=>he(e,t));Xl.displayName="MarkdownH3";var Zl=k.memo(({children:e,className:t,node:n,...r})=>p.jsx("h4",{className:Q("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e}),(e,t)=>he(e,t));Zl.displayName="MarkdownH4";var Jl=k.memo(({children:e,className:t,node:n,...r})=>p.jsx("h5",{className:Q("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e}),(e,t)=>he(e,t));Jl.displayName="MarkdownH5";var ec=k.memo(({children:e,className:t,node:n,...r})=>p.jsx("h6",{className:Q("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e}),(e,t)=>he(e,t));ec.displayName="MarkdownH6";var tc=k.memo(({children:e,className:t,node:n,...r})=>{let{controls:i}=k.useContext(Pe),s=ki(i,"table");return p.jsx(hk,{className:t,showControls:s,...r,children:e})},(e,t)=>he(e,t));tc.displayName="MarkdownTable";var nc=k.memo(({children:e,className:t,node:n,...r})=>p.jsx("thead",{className:Q("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e}),(e,t)=>he(e,t));nc.displayName="MarkdownThead";var rc=k.memo(({children:e,className:t,node:n,...r})=>p.jsx("tbody",{className:Q("divide-y divide-border bg-muted/40",t),"data-streamdown":"table-body",...r,children:e}),(e,t)=>he(e,t));rc.displayName="MarkdownTbody";var ic=k.memo(({children:e,className:t,node:n,...r})=>p.jsx("tr",{className:Q("border-border border-b",t),"data-streamdown":"table-row",...r,children:e}),(e,t)=>he(e,t));ic.displayName="MarkdownTr";var sc=k.memo(({children:e,className:t,node:n,...r})=>p.jsx("th",{className:Q("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...r,children:e}),(e,t)=>he(e,t));sc.displayName="MarkdownTh";var ac=k.memo(({children:e,className:t,node:n,...r})=>p.jsx("td",{className:Q("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e}),(e,t)=>he(e,t));ac.displayName="MarkdownTd";var uc=k.memo(({children:e,className:t,node:n,...r})=>p.jsx("blockquote",{className:Q("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...r,children:e}),(e,t)=>he(e,t));uc.displayName="MarkdownBlockquote";var oc=k.memo(({children:e,className:t,node:n,...r})=>p.jsx("sup",{className:Q("text-sm",t),"data-streamdown":"superscript",...r,children:e}),(e,t)=>he(e,t));oc.displayName="MarkdownSup";var lc=k.memo(({children:e,className:t,node:n,...r})=>p.jsx("sub",{className:Q("text-sm",t),"data-streamdown":"subscript",...r,children:e}),(e,t)=>he(e,t));lc.displayName="MarkdownSub";var cc=k.memo(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let i=a=>{var u,o;if(!k.isValidElement(a))return!1;let c=Array.isArray(a.props.children)?a.props.children:[a.props.children],d=!1,h=!1;for(let f of c)if(f){if(typeof f=="string")f.trim()!==""&&(d=!0);else if(k.isValidElement(f))if(((u=f.props)==null?void 0:u["data-footnote-backref"])!==void 0)h=!0;else{let m=Array.isArray(f.props.children)?f.props.children:[f.props.children];for(let b of m){if(typeof b=="string"&&b.trim()!==""){d=!0;break}if(k.isValidElement(b)&&((o=b.props)==null?void 0:o["data-footnote-backref"])===void 0){d=!0;break}}}}return h&&!d},s=Array.isArray(e)?e.map(a=>{if(!k.isValidElement(a))return a;if(a.type===ls){let u=(Array.isArray(a.props.children)?a.props.children:[a.props.children]).filter(o=>!i(o));return u.length===0?null:{...a,props:{...a.props,children:u}}}return a}):e;return(Array.isArray(s)?s.some(a=>a!==null):s!==null)?p.jsx("section",{className:t,...r,children:s}):null}return p.jsx("section",{className:t,...r,children:e})},(e,t)=>he(e,t));cc.displayName="MarkdownSection";var bk=({node:e,className:t,children:n,...r})=>{var i;let s=!("data-block"in r),{mermaid:a,controls:u}=k.useContext(Pe),o=os();if(s)return p.jsx("code",{className:Q("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...r,children:n});let c=t?.match(pk),d=(i=c?.at(1))!=null?i:"",h="";if(k.isValidElement(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?h=n.props.children:typeof n=="string"&&(h=n),d==="mermaid"&&o){let m=ki(u,"mermaid"),b=Fn(u,"download"),A=Fn(u,"copy"),S=Fn(u,"fullscreen"),_=Fn(u,"panZoom"),L=m&&(b||A||S);return p.jsx(k.Suspense,{fallback:p.jsx(Za,{}),children:p.jsxs("div",{className:Q("group relative my-4 h-auto rounded-xl border p-4",t),"data-streamdown":"mermaid-block",children:[L?p.jsxs("div",{className:"flex items-center justify-end gap-2",children:[b?p.jsx(ik,{chart:h,config:a?.config}):null,A?p.jsx(Ka,{code:h}):null,S?p.jsx(uk,{chart:h,config:a?.config}):null]}):null,p.jsx(mk,{chart:h,config:a?.config,showControls:_})]})})}let f=ki(u,"code");return p.jsx(k.Suspense,{fallback:p.jsx(Za,{}),children:p.jsx(fk,{className:Q("overflow-x-auto border-border border-t",t),code:h,language:d,children:f?p.jsxs(p.Fragment,{children:[p.jsx(Xx,{code:h,language:d}),p.jsx(Ka,{})]}):null})})},dc=k.memo(bk,(e,t)=>e.className===t.className&&Nr(e.node,t.node));dc.displayName="MarkdownCode";var hc=k.memo(Jx,(e,t)=>e.className===t.className&&Nr(e.node,t.node));hc.displayName="MarkdownImg";var fc=k.memo(({children:e,className:t,node:n,...r})=>{let i=(Array.isArray(e)?e:[e]).filter(s=>s!=null&&s!=="");if(i.length===1&&k.isValidElement(i[0])){let s=i[0].props.node,a=s?.tagName;if(a==="img")return p.jsx(p.Fragment,{children:e});if(a==="code"&&"data-block"in i[0].props)return p.jsx(p.Fragment,{children:e})}return p.jsx("p",{className:t,...r,children:e})},(e,t)=>he(e,t));fc.displayName="MarkdownParagraph";var Ek={ol:ls,li:Yl,ul:ql,hr:Vl,strong:Wl,a:Gl,h1:Ql,h2:Kl,h3:Xl,h4:Zl,h5:Jl,h6:ec,table:tc,thead:nc,tbody:rc,tr:ic,th:sc,td:ac,blockquote:uc,code:dc,img:hc,pre:({children:e})=>k.isValidElement(e)?k.cloneElement(e,{"data-block":"true"}):e,sup:oc,sub:lc,p:fc,section:cc},Tk=()=>e=>{st(e,"html",(t,n,r)=>{!r||typeof n!="number"||(r.children[n]={type:"text",value:t.value})})},Ja=[],eu={allowDangerousHtml:!0},Hn=new WeakMap,xk=class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let d="default";return this.keyCache.set(e,d),d}let s=d=>{if(!d||d.length===0)return"";let h="";for(let f=0;f<d.length;f+=1){let m=d[f];if(f>0&&(h+=","),Array.isArray(m)){let[b,A]=m;if(typeof b=="function"){let S=Hn.get(b);S||(S=b.name,Hn.set(b,S)),h+=S}else h+=String(b);h+=":",h+=JSON.stringify(A)}else if(typeof m=="function"){let b=Hn.get(m);b||(b=m.name,Hn.set(m,b)),h+=b}else h+=String(m)}return h},a=s(n),u=s(r),o=i?JSON.stringify(i):"",c=`${u}::${a}::${o}`;return this.keyCache.set(e,c),c}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let r=this.cache.keys().next().value;r&&this.cache.delete(r)}this.cache.set(n,t)}clear(){this.cache.clear()}},tu=new xk,mc=e=>{let t=kk(e),n=e.children||"";return Ik(t.runSync(t.parse(n),n),e)},kk=e=>{let t=tu.get(e);if(t)return t;let n=Ak(e);return tu.set(e,n),n},yk=e=>e.some(t=>Array.isArray(t)?t[0]===oi:t===oi),Ak=e=>{let t=e.rehypePlugins||Ja,n=e.remarkPlugins||Ja,r=yk(t)?n:[...n,Tk],i=e.remarkRehypeOptions?{...eu,...e.remarkRehypeOptions}:eu;return V2().use(qT).use(r).use(N2,i).use(t)},_k=e=>e,Ck=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:"text",value:r}},Sk=(e,t)=>{var n;for(let r in jr)if(Object.hasOwn(jr,r)&&Object.hasOwn(e.properties,r)){let i=e.properties[r],s=jr[r];(s===null||s.includes(e.tagName))&&(e.properties[r]=(n=t(String(i||""),r,e))!=null?n:void 0)}},Nk=(e,t,n,r,i,s)=>{let a=!1;return r?a=!r.includes(e.tagName):i&&(a=i.includes(e.tagName)),!a&&s&&typeof t=="number"&&(a=!s(e,t,n)),a},Ik=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:s,unwrapDisallowed:a,urlTransform:u}=t;if(n||r||i||s||u){let o=u||_k;st(e,(c,d,h)=>{if(c.type==="raw"&&h&&typeof d=="number")return Ck(h,d,s,c.value),d;if(c.type==="element"&&(Sk(c,o),Nk(c,d,h,r,i,n)&&h&&typeof d=="number"))return a&&c.children?h.children.splice(d,1,...c.children):h.children.splice(d,1),d})}return JE(e,{Fragment:p.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:p.jsx,jsxs:p.jsxs,passKeys:!0,passNode:!0})},wk=/\[\^[\w-]{1,200}\](?!:)/,Lk=/\[\^[\w-]{1,200}\]:/,Rk=/<\/(\w+)>/,Ok=/<(\w+)[\s>]/,Dk=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Pk=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]==="$"&&e[n+1]==="$"&&(t+=1,n+=1);return t},vk=e=>{let t=wk.test(e),n=Lk.test(e);if(t||n)return[e];let r=De.lex(e,{gfm:!0}),i=[],s=[],a=!1;for(let u of r){let o=u.raw,c=i.length;if(s.length>0){if(i[c-1]+=o,u.type==="html"){let d=o.match(Rk);if(d){let h=d[1];s.at(-1)===h&&s.pop()}}continue}if(u.type==="html"&&u.block){let d=o.match(Ok);if(d){let h=d[1];o.includes(`</${h}>`)||Dk.has(h.toLowerCase())||s.push(h)}}if(c>0&&!a){let d=i[c-1];if(Pk(d)%2===1){i[c-1]=d+o;continue}}i.push(o),u.type!=="space"&&(a=u.type==="code")}return i},nu,ru,qn={...ln,protocols:{...ln.protocols,href:[...(ru=(nu=ln.protocols)==null?void 0:nu.href)!=null?ru:[],"tel"]}},yi={raw:oi,sanitize:[wo,qn],harden:[hh,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},Mk={gfm:[wb,{}]},iu=Object.values(yi),Bk=Object.values(Mk),Fk={block:" ▋",circle:" ●"},Hk={shikiTheme:["github-light","github-dark"],controls:!0,isAnimating:!1,mode:"streaming",mermaid:void 0,linkSafety:{enabled:!0}},Pe=k.createContext(Hk),pc=k.memo(({content:e,shouldParseIncompleteMarkdown:t,index:n,...r})=>p.jsx(mc,{...r,children:e}),(e,t)=>{if(e.content!==t.content||e.index!==t.index)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(i=>{var s,a;return((s=e.components)==null?void 0:s[i])!==((a=t.components)==null?void 0:a[i])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});pc.displayName="Block";var Uk=["github-light","github-dark"],gc=k.memo(({children:e,mode:t="streaming",parseIncompleteMarkdown:n=!0,components:r,rehypePlugins:i=iu,remarkPlugins:s=Bk,className:a,shikiTheme:u=Uk,mermaid:o,controls:c=!0,isAnimating:d=!1,animated:h,BlockComponent:f=pc,parseMarkdownIntoBlocksFn:m=vk,caret:b,plugins:A,remend:S,linkSafety:_={enabled:!0},allowedTags:L,...I})=>{let B=k.useId(),[z,R]=k.useTransition(),$=k.useMemo(()=>typeof e!="string"?"":t==="streaming"&&n?BE(e,S):e,[e,t,n,S]),G=k.useMemo(()=>m($),[$,m]),[K,N]=k.useState(G);k.useEffect(()=>{t==="streaming"?R(()=>{N(G)}):N(G)},[G,t]);let U=t==="streaming"?K:G,v=k.useMemo(()=>U.map((re,x)=>`${B}-${x}`),[U.length,B]),V=k.useMemo(()=>h?h===!0?Ti():Ti(h):null,[h]),Y=k.useMemo(()=>{var re,x;return{shikiTheme:(x=(re=A?.code)==null?void 0:re.getThemes())!=null?x:u,controls:c,isAnimating:d,mode:t,mermaid:o,linkSafety:_}},[u,c,d,t,o,_,A?.code]),j=k.useMemo(()=>({...Ek,...r}),[r]),F=k.useMemo(()=>{let re=[];return A!=null&&A.cjk&&(re=[...re,...A.cjk.remarkPluginsBefore]),re=[...re,...s],A!=null&&A.cjk&&(re=[...re,...A.cjk.remarkPluginsAfter]),A!=null&&A.math&&(re=[...re,A.math.remarkPlugin]),re},[s,A?.math,A?.cjk]),W=k.useMemo(()=>{var re;let x=i;if(L&&Object.keys(L).length>0&&i===iu){let Ne={...qn,tagNames:[...(re=qn.tagNames)!=null?re:[],...Object.keys(L)],attributes:{...qn.attributes,...L}};x=[yi.raw,[wo,Ne],yi.harden]}return A!=null&&A.math&&(x=[...x,A.math.rehypePlugin]),V&&d&&(x=[...x,V.rehypePlugin]),x},[i,A?.math,V,d,L]),ue=k.useMemo(()=>b&&d?{"--streamdown-caret":`"${Fk[b]}"`}:void 0,[b,d]);return t==="static"?p.jsx(xi.Provider,{value:A??null,children:p.jsx(Pe.Provider,{value:Y,children:p.jsx("div",{className:Q("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",a),children:p.jsx(mc,{components:j,rehypePlugins:W,remarkPlugins:F,...I,children:e})})})}):p.jsx(xi.Provider,{value:A??null,children:p.jsx(Pe.Provider,{value:Y,children:p.jsxs("div",{className:Q("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",b?"*:last:after:inline *:last:after:align-baseline *:last:after:content-[var(--streamdown-caret)]":null,a),style:ue,children:[U.length===0&&b&&d&&p.jsx("span",{}),U.map((re,x)=>p.jsx(f,{components:j,content:re,index:x,rehypePlugins:W,remarkPlugins:F,shouldParseIncompleteMarkdown:n,...I},v[x]))]})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety);gc.displayName="Streamdown";var jk=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:s=!0,initialZoom:a=1,fullscreen:u=!1})=>{let o=k.useRef(null),c=k.useRef(null),[d,h]=k.useState(a),[f,m]=k.useState({x:0,y:0}),[b,A]=k.useState(!1),[S,_]=k.useState({x:0,y:0}),[L,I]=k.useState({x:0,y:0}),B=k.useCallback(v=>{h(V=>Math.max(n,Math.min(r,V+v)))},[n,r]),z=k.useCallback(()=>{B(i)},[B,i]),R=k.useCallback(()=>{B(-i)},[B,i]),$=k.useCallback(()=>{h(a),m({x:0,y:0})},[a]),G=k.useCallback(v=>{v.preventDefault();let V=v.deltaY>0?-i:i;B(V)},[B,i]),K=k.useCallback(v=>{if(v.button!==0||v.isPrimary===!1)return;A(!0),_({x:v.clientX,y:v.clientY}),I(f);let V=v.currentTarget;V instanceof HTMLElement&&V.setPointerCapture(v.pointerId)},[f]),N=k.useCallback(v=>{if(!b)return;v.preventDefault();let V=v.clientX-S.x,Y=v.clientY-S.y;m({x:L.x+V,y:L.y+Y})},[b,S,L]),U=k.useCallback(v=>{A(!1);let V=v.currentTarget;V instanceof HTMLElement&&V.releasePointerCapture(v.pointerId)},[]);return k.useEffect(()=>{let v=o.current;if(v)return v.addEventListener("wheel",G,{passive:!1}),()=>{v.removeEventListener("wheel",G)}},[G]),k.useEffect(()=>{let v=c.current;if(v&&b)return document.body.style.userSelect="none",v.addEventListener("pointermove",N,{passive:!1}),v.addEventListener("pointerup",U),v.addEventListener("pointercancel",U),()=>{document.body.style.userSelect="",v.removeEventListener("pointermove",N),v.removeEventListener("pointerup",U),v.removeEventListener("pointercancel",U)}},[b,N,U]),p.jsxs("div",{className:Q("relative flex flex-col",u?"h-full w-full":"min-h-28 w-full",t),ref:o,style:{cursor:b?"grabbing":"grab"},children:[s?p.jsxs("div",{className:Q("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/90 p-1 shadow-sm backdrop-blur-sm",u?"bottom-4 left-4":"bottom-2 left-2"),children:[p.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:d>=r,onClick:z,title:"Zoom in",type:"button",children:p.jsx(Gx,{size:16})}),p.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:d<=n,onClick:R,title:"Zoom out",type:"button",children:p.jsx(Qx,{size:16})}),p.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",onClick:$,title:"Reset zoom and pan",type:"button",children:p.jsx(Wx,{size:16})})]}):null,p.jsx("div",{className:Q("flex-1 origin-center transition-transform duration-150 ease-out",u?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:K,ref:c,role:"application",style:{transform:`translate(${f.x}px, ${f.y}px) scale(${d})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},bc=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let[s,a]=k.useState(null),[u,o]=k.useState(!1),[c,d]=k.useState(""),[h,f]=k.useState(""),[m,b]=k.useState(0),{mermaid:A}=k.useContext(Pe),S=os(),_=A?.errorComponent,{shouldRender:L,containerRef:I}=Mx({immediate:r});if(k.useEffect(()=>{if(L){if(!S){a("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{a(null),o(!0);let z=S.getMermaid(n),R=e.split("").reduce((K,N)=>(K<<5)-K+N.charCodeAt(0)|0,0),$=`mermaid-${Math.abs(R)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:G}=await z.render($,e);d(G),f(G)}catch(z){if(!(h||c)){let R=z instanceof Error?z.message:"Failed to render Mermaid chart";a(R)}}finally{o(!1)}})()}},[e,n,m,L,S]),!(L||c||h))return p.jsx("div",{className:Q("my-4 min-h-[200px]",t),ref:I});if(u&&!c&&!h)return p.jsx("div",{className:Q("my-4 flex justify-center p-4",t),ref:I,children:p.jsxs("div",{className:"flex items-center space-x-2 text-muted-foreground",children:[p.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-current border-b-2"}),p.jsx("span",{className:"text-sm",children:"Loading diagram..."})]})});if(s&&!c&&!h){let z=()=>b(R=>R+1);return _?p.jsx("div",{ref:I,children:p.jsx(_,{chart:e,error:s,retry:z})}):p.jsxs("div",{className:Q("rounded-lg border border-red-200 bg-red-50 p-4",t),ref:I,children:[p.jsxs("p",{className:"font-mono text-red-700 text-sm",children:["Mermaid Error: ",s]}),p.jsxs("details",{className:"mt-2",children:[p.jsx("summary",{className:"cursor-pointer text-red-600 text-xs",children:"Show Code"}),p.jsx("pre",{className:"mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs",children:e})]})]})}let B=c||h;return p.jsx("div",{className:Q("size-full",t),"data-streamdown":"mermaid",ref:I,children:p.jsx(jk,{className:Q(r?"size-full overflow-hidden":"my-4 overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:p.jsx("div",{"aria-label":"Mermaid chart",className:Q("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:B},role:"img"})})})};const Ec=/^[a-zA-Z]:[\\/]/,zk=/[/\\](attachments|conversations)[/\\]/,$k=/^\/(Users|home|tmp|private|var|opt|mnt|Volumes)(\/|$)/;function su(e){return e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")}function Yk(e){const t=e.match(/^(.*)#L([1-9]\d*)(?:C([1-9]\d*))?$/i);if(t)return{path:t[1],line:Number(t[2]),column:t[3]?Number(t[3]):void 0};const n=e.match(/^(.*?):(\d+)(?::(\d+))?$/);if(n&&n[1]){const r=Number(n[2]),i=n[3]?Number(n[3]):void 0;if(r>0&&(!n[3]||i&&i>0))return{path:n[1],line:r,column:i}}return{path:e}}function qk(e,t){if(!t)return null;const n=su(e),r=su(t).replace(/\/$/,"");return n===r?null:n.startsWith(`${r}/`)?n.slice(r.length+1):n.startsWith("./")?n.slice(2):!n.startsWith("/")&&!Ec.test(e)&&!n.startsWith("../")?n:null}function Vk(e){return`${xn()}/attachments/by-path?path=${encodeURIComponent(e)}`}function Tc(e,t){if(/^https?:\/\//i.test(e))return{type:"external",url:e};if(/^(mailto|tel):/i.test(e))return{type:"external",url:e};if(e.startsWith("/api/")||e.startsWith("#"))return{type:"internal",url:e};const n=Yk(e),r=qk(n.path,t);return r?{type:"workspace-file",path:r,line:n.line,column:n.column}:zk.test(e)?{type:"attachment",path:e,url:Vk(e)}:$k.test(e)||Ec.test(e)?{type:"unknown-local",path:e}:{type:"internal",url:e}}function Wk(e,t){const n=new URLSearchParams({workingDir:e,path:t});return`${xn()}/files/image?${n.toString()}`}function Gk(e){const t=new URLSearchParams({path:e});return`${xn()}/files/image?${t.toString()}`}const xc="/__agent-tower/message-intent/codex-inline-vis",kc="/__agent-tower/message-intent/agent-download",Qk=/^[ \t]{0,3}::codex-inline-vis\{file="([^"\r\n]+)"\}[ \t]*$/,yc=/^[a-z0-9][a-z0-9-]*\.html$/,Kk=/^[ \t]{0,3}(`{3,}|~{3,})/;function Xk(e,t){const n=t[0]==="`"?"`":"~";return new RegExp(`^[ \\t]{0,3}${n}{${t.length},}[ \\t]*$`).test(e)}function Zk(e){let t=null;return e.split(/\r?\n/).map(n=>{if(t)return Xk(n,t)&&(t=null),n;const r=n.match(Kk);if(r)return t=r[1],n;const i=n.match(Qk);if(i&&yc.test(i[1])){const u=`${xc}?file=${encodeURIComponent(i[1])}`;return`[${i[1]}](${u})`}const s=Id(n);if(!s)return n;const a=`${kc}?file=${encodeURIComponent(s)}`;return`[${s}](${a})`}).join(`
|
|
120
|
-
`)}function Jk(e){try{const t=new URL(e,"http://agent-tower.local"),n=t.searchParams.get("file");if(!n)return null;if(t.pathname===xc&&yc.test(n))return{type:"codex-inline-visualization",file:n};if(t.pathname===kc){const r=Au(n);return r?{type:"agent-download",file:r}:null}return null}catch{return null}}function ey(e,t){return`${xn()}/sessions/${encodeURIComponent(e)}/visualizations/${encodeURIComponent(t)}`}function e3(e,t){const n=new URLSearchParams({path:t});return`${xn()}/sessions/${encodeURIComponent(e)}/artifacts/download?${n.toString()}`}const Ac=new Set(["localhost","127.0.0.1","::1","[::1]","0.0.0.0"]);function t3(e){return/^\d+$/.test(e)?`http://127.0.0.1:${e}`:/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(e)?e:`http://${e}`}function Ai(e){try{return new URL(t3(e.trim()))}catch{return null}}function au(e){return Ac.has(e.hostname.toLowerCase())?"loopback":e.hostname.toLowerCase()}function uu(e){return e.port?e.port:e.protocol==="https:"?"443":"80"}function n3(e,t){return e.protocol===t.protocol&&au(e)===au(t)&&uu(e)===uu(t)}function _c(e){return!e||e==="/"?"":e.endsWith("/")?e.slice(0,-1):e}function r3(e,t){return t?e===t||e.startsWith(`${t}/`):!0}function Un(e,t){return t?{kind:"target",target:t.origin,path:`${t.pathname}${t.search}${t.hash}`}:{kind:"target",target:e,path:null}}function ou(e,t){try{const i=new URL(e),s=i.searchParams.get("__agent_tower_preview_token"),a=new URL(t.startsWith("/")?t:`/${t}`,"http://preview.local");return i.pathname=a.pathname,i.search=a.search,i.hash=a.hash,s&&i.searchParams.set("__agent_tower_preview_token",s),i.toString()}catch{}const n=e.endsWith("/")?e:`${e}/`,r=t.startsWith("/")?t.slice(1):t;return`${n}${r}`}function ty(e,t,n){const r=e.trim();if(!r)return null;if(r.startsWith("/"))return n?{kind:"proxy",url:ou(n,r)}:null;const i=Ai(r);if(!i)return Un(r,null);if(!t||!n)return Un(r,i);const s=Ai(t);if(!s||!n3(i,s))return Un(r,i);const a=_c(s.pathname);if(!r3(i.pathname,a))return Un(r,i);const u=i.pathname.slice(a.length)||"/";return{kind:"proxy",url:ou(n,`${u}${i.search}${i.hash}`)}}function ny(e,t,n,r){if(!e||!t)return null;try{const i=new URL(e),s=new URL(t,r),a=new URL(n,r),u=s.pathname==="/"?"":s.pathname.endsWith("/")?s.pathname.slice(0,-1):s.pathname;if(a.origin!==s.origin||u&&a.pathname!==u&&!a.pathname.startsWith(`${u}/`))return a.toString();const o=a.pathname.slice(u.length)||"/",c=_c(i.pathname);return i.pathname=`${c}${o}`.replace(/\/{2,}/g,"/")||"/",i.search=a.search,i.hash=a.hash,i.toString()}catch{return null}}function i3(e){const t=Ai(e);return!!(t&&Ac.has(t.hostname.toLowerCase()))}const Cc=({src:e,alt:t,className:n,node:r,...i})=>p.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"inline-block",children:p.jsx("img",{src:e,alt:t,...i,className:dr("max-w-[300px] max-h-[200px] object-contain rounded-lg border border-border cursor-pointer hover:opacity-90 active:opacity-90 transition-opacity",n)})}),s3=({href:e="",children:t,node:n,onClick:r,className:i,...s})=>{const{t:a}=Xe(),{workingDir:u,onOpenWorkspaceFile:o,onOpenPreviewUrl:c,onOpenVisualization:d,downloadSessionId:h}=s,f=Jk(e),m=Tc(e,u),b={...s};delete b.workingDir,delete b.onOpenWorkspaceFile,delete b.onOpenPreviewUrl,delete b.onOpenVisualization,delete b.downloadSessionId;const A=xs(i),S=xs("inline-flex max-w-full items-center gap-1.5 align-middle font-medium");if(f?.type==="codex-inline-visualization")return d?p.jsxs("button",{type:"button",onClick:()=>d(f.file),title:a("Open visualization"),className:S,children:[p.jsx(_d,{className:"size-4 shrink-0","aria-hidden":!0}),p.jsx("span",{className:"truncate",children:f.file})]}):p.jsx("code",{title:f.file,children:f.file});if(f?.type==="agent-download")return h?p.jsxs("a",{href:e3(h,f.file),download:f.file.split("/").at(-1),title:a("Download file"),className:S,children:[p.jsx(ld,{className:"size-4 shrink-0","aria-hidden":!0}),p.jsx("span",{className:"truncate",children:f.file.split("/").at(-1)})]}):p.jsx("code",{title:f.file,children:f.file});if(c&&i3(e)){const L=I=>{r?.(I),!I.defaultPrevented&&(I.preventDefault(),c(e))};return p.jsx("a",{href:e,onClick:L,className:A,...b,children:t})}if(m.type==="workspace-file"&&o){const L=I=>{r?.(I),!I.defaultPrevented&&(I.preventDefault(),o(m.path,m.line,m.column))};return p.jsx("a",{href:e,onClick:L,className:A,...b,children:t})}if(m.type==="unknown-local"||m.type==="workspace-file"){const L=m.path;return p.jsx("code",{title:L,children:t})}const _=m.url;return p.jsx("a",{href:_,onClick:r,className:A,...b,children:t})},a3=({children:e,className:t,node:n,...r})=>p.jsx("li",{className:dr("py-0 pl-0 [&>p]:inline",t),...r,children:e}),u3={img:Cc,li:a3};function o3({workingDir:e,onOpenWorkspaceFile:t,onOpenPreviewUrl:n,onOpenVisualization:r,downloadSessionId:i}){return{...u3,a:s=>p.jsx(s3,{...s,workingDir:e,onOpenWorkspaceFile:t,onOpenPreviewUrl:n,onOpenVisualization:r,downloadSessionId:i}),img:s=>{const a=Tc(s.src??"",e),u=a.type==="workspace-file"&&e?Wk(e,a.path):a.type==="attachment"?a.url:a.type==="unknown-local"?Gk(a.path):s.src;return p.jsx(Cc,{...s,src:u})}}}const l3={mermaid:{download:!0,copy:!0,fullscreen:!0,panZoom:!0}},c3=/(^|\n)(```|~~~)[^\S\r\n]*mermaid(?:[\s\r\n]|$)/i;let _i=null;function d3(e){return c3.test(e)}function h3(){return _i??=Ni(async()=>{const{mermaid:e}=await import("./index-C-M0QDqc.js").then(t=>t.bm);return{mermaid:e}},__vite__mapDeps([13,1,2])).then(({mermaid:e})=>({mermaid:e})),_i}function f3(e){const t=d3(e),[n,r]=k.useState();return k.useEffect(()=>{if(!t){r(void 0);return}let i=!0;return h3().then(s=>{i&&r(s)}).catch(()=>{_i=null,i&&r(void 0)}),()=>{i=!1}},[t]),t?n:void 0}function Sc(e){if(e.tool?.status)return e.tool.status;if(e.title?.endsWith("✓"))return"success";if(e.title?.endsWith("✗"))return"failed";if(e.title?.includes("待审批"))return"pending_approval"}function m3(e){return Sc(e)==="success"}function p3(e){const t=Sc(e);return t==="failed"||t==="timed_out"}function Ir(e){return e.title==="Thinking"||e.content.startsWith("Thinking:")}function g3(e){return e.type===se.Tool&&!!e.children?.length}function b3(e){return e.type!==se.Cursor&&!e.children?.length&&e.content.trim()===""}function cs(e){return!!e.tokenUsage||b3(e)}function E3(e){const t=e.tool?.status;return t==="pending_approval"||t==="denied"}function T3(e){return e.type===se.Cursor||e.type===se.User||e.type===se.Assistant||e.type===se.Error||e.type===se.Warning?!0:e.type===se.Info&&e.tokenUsage?!1:E3(e)}function lu(e){return Ir(e)?!0:g3(e)||e.type!==se.Tool&&e.type!==se.Action?!1:!T3(e)}function ds(e){return!Ir(e)&&(e.type===se.Tool||e.type===se.Action)}function Vn(e){const t=e.filter(i=>!cs(i)),n=[];let r=0;for(;r<t.length;){const i=t[r];if(lu(i)){const s=[i];let a=r+1;for(;a<t.length;){const u=t[a];if(lu(u))s.push(u),a++;else break}s.some(ds)?n.push({kind:"execution-group",logs:s,key:s[0].id}):s.forEach(u=>n.push({kind:"single",log:u,key:u.id})),r=a}else n.push({kind:"single",log:i,key:i.id}),r++}return n}function x3(e){const t=[];let n,r=[];const i=()=>{!n&&r.length===0||t.push({key:n?`turn-${n.id}`:`turn-${r[0]?.id??t.length}`,user:n,agentLogs:r})};for(const s of e)s.type===se.User?(i(),n=s,r=[]):r.push(s);return i(),t}function k3(e){let t=-1;for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(r.content.trim()){if(r.type===se.Assistant)return n;t===-1&&r.type===se.Error&&(t=n)}}return t}function y3(e,t){if(!Number.isFinite(e)||!Number.isFinite(t))return null;const n=Math.max(0,t-e),r=n===0?0:Math.max(1,Math.round(n/1e3)),i=Math.floor(r/3600),s=Math.floor(r%3600/60),a=r%60;return i>0?`${i}h${s>0?` ${s}m`:""}`:s>0?`${s}m${a>0?` ${a}s`:""}`:`${a}s`}function A3(e){const t=e.agentLogs.reduce((i,s)=>Number.isFinite(s.cursorActivity?.processingStartedAt)?s.cursorActivity?.processingStartedAt:i,void 0),n=e.user?.timestamp??t??e.agentLogs.find(i=>Number.isFinite(i.timestamp))?.timestamp,r=e.agentLogs.reduce((i,s)=>Number.isFinite(s.timestamp)?i===void 0?s.timestamp:Math.max(i,s.timestamp):i,void 0);return{startedAt:n,latestLogAt:r}}function _3(e,t,n,r){const i=t&&n===!0,s=A3(e),a=i?null:t?r??s.latestLogAt??null:s.latestLogAt??null,u={start:s.startedAt,end:a};if(i)return{key:e.key,user:e.user??null,running:!0,duration:u,showSummary:!0,summaryCollapsible:!1,inlineItems:Vn(e.agentLogs),processedItems:[],finalItems:[]};if(e.agentLogs.length===0)return{key:e.key,user:e.user??null,running:!1,duration:u,showSummary:!1,summaryCollapsible:!1,inlineItems:[],processedItems:[],finalItems:[]};const o=k3(e.agentLogs),c=o>=0?e.agentLogs.slice(0,o):e.agentLogs,d=o>=0?e.agentLogs.slice(o):[],h=c.some(f=>!cs(f));return{key:e.key,user:e.user??null,running:!1,duration:u,showSummary:!0,summaryCollapsible:h,inlineItems:[],processedItems:h?Vn(c):[],finalItems:Vn(d)}}function Xr(e){return`item:${e.key}`}function C3(e,t){const n=[];for(const r of e){if(r.user&&n.push({kind:"user",key:`user:${r.user.id}`,log:r.user}),r.showSummary&&n.push({kind:"summary",key:`summary:${r.key}`,turnKey:r.key,duration:r.duration,collapsible:r.summaryCollapsible}),r.running){for(const i of r.inlineItems)n.push({kind:"item",key:Xr(i),item:i,processed:!1});continue}if(t.has(r.key))for(const i of r.processedItems)n.push({kind:"item",key:Xr(i),item:i,processed:!0});for(const i of r.finalItems)n.push({kind:"item",key:Xr(i),item:i,processed:!1})}return n}function S3(e){if(!e)return 40;switch(e.kind){case"user":return 72;case"summary":return 44;default:return 32}}function N3(e){let t=e?.parentElement??null;for(;t;){const n=window.getComputedStyle(t).overflowY;if(n==="auto"||n==="scroll")return t;t=t.parentElement}return null}const ar=k.memo(({content:e,className:t,workingDir:n,onOpenWorkspaceFile:r,onOpenPreviewUrl:i,onOpenVisualization:s,downloadSessionId:a})=>{const u=k.useMemo(()=>s||a?Zk(e):e,[e,a,s]),o=f3(u),c=k.useMemo(()=>o3({workingDir:n,onOpenWorkspaceFile:r,onOpenPreviewUrl:i,onOpenVisualization:s,downloadSessionId:a}),[a,i,s,r,n]);return p.jsx(gc,{className:dr("session-log-message-markdown",t),components:c,plugins:o,controls:o?l3:void 0,children:u})});ar.displayName="MarkdownMessage";function I3({id:e}){const{data:t}=gu({queryKey:["message-delivery",e],queryFn:()=>Pt.get(`/message-deliveries/${encodeURIComponent(e)}`),staleTime:1/0});return t?p.jsx(Su,{delivery:t}):null}const Nc=k.createContext(new Map),hs=k.memo(({content:e,deliveryId:t,compact:n,workingDir:r,onOpenWorkspaceFile:i,onOpenPreviewUrl:s})=>{const a=k.useContext(Nc).get(t??"");return p.jsx("div",{className:n?"flex justify-end mb-4 mt-2":"flex justify-end mb-8 mt-4",children:p.jsxs("div",{className:"flex max-w-[85%] min-w-0 flex-col items-end",children:[p.jsxs("div",{className:`relative bg-foreground/[0.08] text-foreground rounded-2xl rounded-tr-sm max-w-full min-w-0 leading-relaxed ${n?"px-3.5 py-2.5 text-[13px]":"px-5 py-3.5 text-sm"}`,children:[p.jsx(ar,{content:e,workingDir:r,onOpenWorkspaceFile:i,onOpenPreviewUrl:s}),a&&p.jsx(Vd,{delivery:a})]}),t&&p.jsx("div",{className:"mt-1 max-w-full px-0.5","data-message-feedback":!0,children:a?p.jsx(Su,{delivery:a}):p.jsx(I3,{id:t})})]})})});hs.displayName="UserMessage";const fs=k.memo(({content:e,isOpenDefault:t=!0})=>{const[n,r]=k.useState(t),i=k.useRef(null),[s,a]=k.useState(0);k.useEffect(()=>{i.current&&a(i.current.scrollHeight)},[e,n]);const u=k.useMemo(()=>{const c=e.replace(/^Thinking:\s*/i,"").trim().split(`
|
|
121
|
-
`)[0]||"";return c.length>80?c.slice(0,80)+"…":c},[e]);return p.jsxs("div",{className:"my-1.5",children:[p.jsxs("button",{onClick:()=>r(!n),className:"group flex items-center gap-1.5 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors select-none w-full text-left",children:[p.jsx("span",{className:"shrink-0 w-3.5 h-3.5 flex items-center justify-center transition-transform duration-200",style:{transform:n?"rotate(90deg)":"rotate(0deg)"},children:p.jsx(
|
|
122
|
-
`)[0]||"").slice(0,t)}function
|
|
123
|
-
`)[0]||"",d=c!==e?c:"";return p.jsxs("div",{className:"my-2",children:[p.jsxs("button",{onClick:()=>i(!r),className:"group flex items-center gap-1.5 py-1 text-xs w-full text-left transition-colors",children:[p.jsx("span",{className:`shrink-0 w-3.5 h-3.5 flex items-center justify-center ${o}`,children:u?p.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:p.jsx("path",{d:"M2 2l6 6M8 2l-6 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}):a?p.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:p.jsx("path",{d:"M2 5.5l2 2 4-4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}):p.jsx("span",{className:"w-1 h-1 rounded-full bg-muted-foreground/40"})}),p.jsx("span",{className:"font-medium text-muted-foreground shrink-0",children:e.replace(/\s*[✓✗]$/,"")}),d&&p.jsx("span",{className:"truncate text-muted-foreground font-mono",children:d}),t&&p.jsx("span",{className:"ml-auto shrink-0 opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground/70",children:r?p.jsx(yu,{size:10}):p.jsx(kn,{size:10})})]}),r&&t&&p.jsx("div",{className:"ml-5 mt-0.5 mb-1.5 rounded-md bg-muted/50 border border-border/60 overflow-x-auto",children:p.jsx("code",{className:"block p-2.5 text-xs font-mono text-muted-foreground leading-relaxed whitespace-pre-wrap break-all",children:t})})]})});Ci.displayName="ToolBlock";const Lc=k.memo(({count:e})=>{const[t,n]=k.useState(()=>({current:e,previous:null}));return t.current!==e&&n({current:e,previous:t.current}),p.jsxs("span",{className:"agent-tool-count inline-flex items-center justify-center px-1.5 rounded-full bg-muted text-muted-foreground text-[10px] font-medium leading-none tabular-nums",children:[p.jsxs("span",{className:"agent-tool-count__window",style:{width:`${String(e).length}ch`},"aria-hidden":"true",children:[t.previous!==null&&p.jsx("span",{className:"agent-tool-count__value agent-tool-count__value--out whitespace-nowrap min-w-max",onAnimationEnd:()=>n(r=>r.previous===null?r:{...r,previous:null}),children:t.previous},`out-${t.previous}`),p.jsx("span",{className:dr("agent-tool-count__value agent-tool-count__value--in whitespace-nowrap min-w-max",t.previous!==null&&"agent-tool-count__value--rolling"),children:t.current},`in-${t.current}`)]}),p.jsx("span",{className:"sr-only",children:e})]})});Lc.displayName="ToolCountBadge";const Si=k.memo(({logs:e,onBeforeToggle:t})=>{const{t:n}=Xe(),[r,i]=k.useState(!1),s=e.filter(ds),a=R3(e),u=s.length;return p.jsxs("div",{className:"my-2",children:[p.jsxs("button",{type:"button",onClick:()=>{t?.(),i(!r)},"aria-expanded":r,className:"group flex items-center gap-1.5 py-1 text-xs w-full text-left transition-colors",children:[p.jsx("span",{className:"shrink-0 w-3.5 h-3.5 flex items-center justify-center transition-transform duration-200",style:{transform:r?"rotate(90deg)":"rotate(0deg)"},children:p.jsx(kn,{size:11,strokeWidth:2,className:"text-muted-foreground/70"})}),p.jsx("span",{className:"font-medium text-muted-foreground shrink-0",children:n("工具调用")}),p.jsx("span",{className:"shrink-0 inline-flex items-center gap-1",children:p.jsx(Lc,{count:u})}),!r&&p.jsxs("span",{className:"truncate text-muted-foreground font-mono",children:[a.slice(-3).join(", "),a.length>3?" …":""]})]}),r&&p.jsx("div",{className:"ml-5 mt-0.5 mb-1.5",children:e.map(o=>Ir(o)?p.jsx(fs,{content:o.content,isOpenDefault:!1},o.id):p.jsx(Rc,{log:o,title:wc(o),onBeforeToggle:t},o.id))})]})});Si.displayName="ExecutionDetailsGroup";const Rc=k.memo(({log:e,title:t,onBeforeToggle:n})=>{const[r,i]=k.useState(!1),s=!!e.content.trim()&&e.content.trim()!==t.trim(),a=m3(e),u=p3(e)||e.type===se.Error;return p.jsxs("div",{children:[p.jsxs("button",{type:"button",onClick:()=>{s&&(n?.(),i(!r))},"aria-expanded":s?r:void 0,className:`group flex items-center gap-1.5 py-0.5 text-xs w-full text-left ${s?"cursor-pointer":"cursor-default"}`,children:[p.jsx("span",{className:"shrink-0 w-3.5 h-3.5 flex items-center justify-center",children:u?p.jsx("svg",{width:"8",height:"8",viewBox:"0 0 10 10",fill:"none",className:"text-destructive",children:p.jsx("path",{d:"M2 2l6 6M8 2l-6 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}):a?p.jsx("svg",{width:"8",height:"8",viewBox:"0 0 10 10",fill:"none",className:"text-success",children:p.jsx("path",{d:"M2 5.5l2 2 4-4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}):p.jsx("span",{className:"w-1 h-1 rounded-full bg-muted-foreground/40"})}),p.jsx("span",{className:"truncate text-muted-foreground font-mono",children:t}),s&&p.jsx("span",{className:"ml-auto shrink-0 opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground/70",children:r?p.jsx(yu,{size:10}):p.jsx(kn,{size:10})})]}),r&&s&&p.jsx("div",{className:"ml-5 mt-0.5 mb-1 rounded-md bg-muted/50 border border-border/60 overflow-x-auto",children:p.jsx("code",{className:"block p-2.5 text-xs font-mono text-muted-foreground leading-relaxed whitespace-pre-wrap break-all",children:e.content})})]})});Rc.displayName="ToolGroupItem";const Oc=k.memo(({content:e,compact:t})=>p.jsx("div",{className:`text-foreground whitespace-pre-wrap min-w-0 ${t?"text-[13px] leading-5":"text-sm leading-6"}`,children:e}));Oc.displayName="AgentText";const Dc=k.createContext(null),Pc=k.memo(({log:e,compact:t,workingDir:n,onOpenWorkspaceFile:r,onOpenPreviewUrl:i,onOpenVisualization:s,downloadSessionId:a})=>{const u=k.useContext(Dc),o=u?Od(u.sessionId,e,u.overlays):void 0,c=o?.state==="SUCCESS"&&o.translatedText!==null,d=c?o.translatedText:e.content,h={workingDir:n,onOpenWorkspaceFile:r,onOpenPreviewUrl:i,onOpenVisualization:s,downloadSessionId:a};return p.jsxs("div",{className:`relative text-foreground min-w-0 ${o&&o.state!=="NOT_REQUIRED"?"pr-8":""} ${t?"text-[13px] leading-5":"text-sm leading-6"}`,children:[p.jsx(jd,{claim:u?.claimReveal,version:c?`${o.sourceId}:${o.sourceRevision}`:null,children:p.jsx(ar,{className:"space-y-2",content:d,...h})}),o&&o.state!=="NOT_REQUIRED"&&p.jsx("div",{className:"absolute bottom-0 right-0",children:p.jsxs(Cu,{original:e.content,children:[p.jsx(ar,{content:e.content,...h}),p.jsx(Yd,{overlay:o,enabled:u?.enabled??!1})]},`${o.sourceId}:${o.sourceRevision}`)})]})});Pc.displayName="AssistantMessage";const vc=k.memo(({content:e})=>p.jsx(Tu,{tone:"danger",className:"my-2",children:p.jsx("pre",{className:"text-xs leading-relaxed whitespace-pre-wrap break-all min-w-0",children:e})}));vc.displayName="ErrorMessage";const Mc=k.memo(({content:e})=>p.jsx(Tu,{tone:"warning",className:"my-2",children:p.jsx("pre",{className:"text-xs leading-relaxed whitespace-pre-wrap break-all min-w-0",children:e})}));Mc.displayName="WarningMessage";function cu(e,t){const n=Math.max(0,Math.floor(e/1e3));if(n<60)return t("{count} 秒",{count:n});const r=Math.floor(n/60),i=n%60;if(r<60)return t("{minutes} 分 {seconds} 秒",{minutes:r,seconds:i});const s=Math.floor(r/60),a=r%60;return t("{hours} 小时 {minutes} 分",{hours:s,minutes:a})}const Bc=k.memo(({activity:e})=>{const{t}=Xe(),n=k.useRef(Date.now()),[r,i]=k.useState(()=>Date.now()),s=e?.processingStartedAt??n.current;k.useEffect(()=>{const c=window.setInterval(()=>i(Date.now()),1e3);return()=>window.clearInterval(c)},[]);const a=cu(r-s,t),u=e?.lastOutputAt==null?null:cu(r-e.lastOutputAt,t),o=t("正在思考");return p.jsx(md,{align:"start",content:p.jsxs("div",{className:"flex min-w-max flex-col gap-0.5",children:[p.jsx("span",{children:t("已处理 {duration}",{duration:a})}),p.jsx("span",{className:"text-inverse-muted",children:u?t("最后一次输出于 {duration}前",{duration:u}):t("等待首次输出")})]}),children:p.jsx("span",{tabIndex:0,"aria-label":o,className:"inline-flex cursor-help select-none py-1 text-sm font-normal outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:p.jsx("span",{className:"agent-thinking-shimmer","aria-hidden":"true",children:Array.from(o).map((c,d)=>p.jsx("span",{className:"agent-thinking-char",style:{animationDelay:`${d*45}ms`},children:c},`${c}-${d}`))})})})});Bc.displayName="ThinkingIndicator";const Fc=k.memo(({turnKey:e,duration:t,collapsible:n,isOpen:r,onToggle:i,onBeforeToggle:s})=>{const{t:a}=Xe(),u=t?a("已处理 {duration}",{duration:t}):a("已处理"),o=p.jsxs(p.Fragment,{children:[p.jsx("span",{children:u}),n&&p.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center transition-transform duration-200 motion-reduce:transition-none",style:{transform:r?"rotate(90deg)":"rotate(0deg)"},children:p.jsx(kn,{size:14,strokeWidth:2})})]});return n?p.jsx("div",{className:"mb-3 mt-1",children:p.jsx("button",{type:"button","data-at-group-header":e,"aria-expanded":r,onClick:()=>{s?.(),i(e)},className:"group flex w-full items-center gap-1.5 border-b border-border/60 py-2 text-left text-sm leading-6 text-muted-foreground transition-colors hover:text-foreground/80",children:o})}):p.jsx("div",{className:"mb-3 mt-1",children:p.jsx("div",{role:"status",className:"flex w-full items-center gap-1.5 border-b border-border/60 py-2 text-sm leading-6 text-muted-foreground",children:o})})});Fc.displayName="ProcessedGroupSummary";function O3(e,t,n,r,i,s,a,u){if(e.kind==="execution-group")return p.jsx(Si,{logs:e.logs,onBeforeToggle:u});const o=e.log;if(o.type===se.Tool&&o.children?.length)return p.jsx(Si,{logs:o.children,onBeforeToggle:u});if(cs(o))return null;if(o.title==="Thinking"||o.content.startsWith("Thinking:"))return p.jsx(fs,{content:o.content,isOpenDefault:!0});switch(o.type){case se.User:return p.jsx(hs,{content:o.content,deliveryId:o.deliveryId,compact:t,workingDir:n,onOpenWorkspaceFile:r,onOpenPreviewUrl:i});case se.Tool:return p.jsx(Ci,{type:o.type,title:o.title||"Tool",content:o.content});case se.Action:return p.jsx(Ci,{type:o.type,title:"Action",content:o.content});case se.Assistant:return p.jsx(Pc,{log:o,compact:t,workingDir:n,onOpenWorkspaceFile:r,onOpenPreviewUrl:i,onOpenVisualization:s,downloadSessionId:a});case se.Info:return o.tokenUsage?null:p.jsx(Oc,{content:o.content,compact:t});case se.Error:return p.jsx(vc,{content:o.content});case se.Warning:return p.jsx(Mc,{content:o.content});case se.Cursor:return p.jsx(Bc,{activity:o.cursorActivity});default:return null}}const D3=8,P3=k.forwardRef(function(t,n){const r=vd(t.sessionId,t.logs),i=ku(),s=Bd(t.sessionId,t.logs.filter(m=>m.textBlock).map(m=>({id:JSON.stringify([m.textBlock.turnId,m.textBlock.blockId]),revision:m.textBlock.sourceRevision,streaming:m.textBlock.state==="OPEN"})),r.overlays.map(m=>({id:JSON.stringify([m.turnId,m.blockId]),version:`${m.sourceId}:${m.sourceRevision}`,state:m.state})),t.logs.some(m=>m.type!==se.Cursor)),a=k.useMemo(()=>({sessionId:t.sessionId,overlays:r.overlays,claimReveal:s,enabled:!i.isError&&i.data?.enabled===!0}),[t.sessionId,i.data?.enabled,i.isError,r.overlays,s]),u=ys(t.sessionId),o=ys(t.sessionId,"sent"),c=k.useMemo(()=>new Map([...u.data?.pages.flatMap(m=>m.items)??[],...o.data?.pages.flatMap(m=>m.items)??[]].sort((m,b)=>m.revision-b.revision).map(m=>[m.id,m])),[u.data,o.data]),d=k.useMemo(()=>[...c.values()].map(m=>m.clientSubmissionId),[c]),h=fd(t.sessionId,d),f=k.useMemo(()=>wd(t.logs,[...c.values()]),[t.logs,c]);return p.jsx(Dc.Provider,{value:a,children:p.jsxs(Nc.Provider,{value:c,children:[p.jsx(Hc,{...t,logs:f,ref:n}),h.filter(m=>![...c.values()].some(b=>b.clientSubmissionId===m.id)).map(m=>p.jsx(Ld,{item:m},m.id)),u.hasNextPage&&p.jsx("button",{type:"button",className:"text-xs underline",onClick:()=>{u.fetchNextPage()},children:"Load more"})]})})}),ry=k.forwardRef(function(t,n){return t.sessionId?p.jsx(P3,{...t,sessionId:t.sessionId,ref:n},t.sessionId):p.jsx(Hc,{...t,ref:n})}),Hc=k.forwardRef(function({logs:t,isOutputActive:n,lastExitAt:r,onUserToggleDetails:i,scrollElementRef:s,workingDir:a,onOpenWorkspaceFile:u,onOpenPreviewUrl:o,onOpenVisualization:c,downloadSessionId:d},h){const[f,m]=k.useState(null),[b,A]=k.useState(!1),[S,_]=k.useState(0),[L,I]=k.useState(()=>new Set),[B,z]=k.useState(()=>Date.now());k.useEffect(()=>{if(!n)return;const F=()=>z(Date.now()),W=window.setTimeout(F,0),ue=window.setInterval(F,1e3);return()=>{window.clearTimeout(W),window.clearInterval(ue)}},[n]);const R=k.useCallback(F=>{if(!F)return;const W=s?.current??N3(F);m(ue=>ue===W?ue:W),_(W?.clientHeight??0),A(!0)},[s]);k.useEffect(()=>{if(!f)return;const F=()=>_(f.clientHeight);if(F(),typeof ResizeObserver>"u")return;const W=new ResizeObserver(F);return W.observe(f),()=>W.disconnect()},[f]);const $=k.useCallback(F=>{I(W=>{const ue=new Set(W);return ue.has(F)?ue.delete(F):ue.add(F),ue})},[]),G=k.useMemo(()=>{if(n===void 0)return null;const F=x3(t),W=F.length-1;return F.map((ue,re)=>_3(ue,re===W,n,r))},[t,n,r]),K=k.useMemo(()=>n===void 0?Vn(t):null,[n,t]),N=k.useMemo(()=>K?K.map(F=>({kind:"item",key:`legacy:${F.key}`,item:F,processed:!1})):C3(G??[],L),[L,K,G]),U=ih({count:N.length,getScrollElement:()=>f,estimateSize:F=>S3(N[F]),getItemKey:F=>N[F]?.key??F,overscan:D3,measureElement:F=>F.getBoundingClientRect().height});U.shouldAdjustScrollPositionOnItemSizeChange=sh;const v=f!==null&&S>0;k.useImperativeHandle(h,()=>({scrollToBottom:(F="instant")=>{const W=s?.current;if(!W||(v&&N.length>0&&U.scrollToIndex(N.length-1,{align:"end"}),W.scrollTo({top:W.scrollHeight,behavior:F}),F!=="instant"))return;let ue=0;const re=()=>{const x=s?.current;x&&(x.scrollHeight-x.scrollTop-x.clientHeight<=1||(x.scrollTop=x.scrollHeight,++ue<5&&requestAnimationFrame(re)))};requestAnimationFrame(re)}}),[v,N.length,s,U]);const V=k.useCallback(F=>{const W=F.end===null?B:F.end;return y3(F.start,W)},[B]),Y=k.useCallback(F=>{switch(F.kind){case"user":return p.jsx(hs,{content:F.log.content,deliveryId:F.log.deliveryId,workingDir:a,onOpenWorkspaceFile:u,onOpenPreviewUrl:o});case"summary":return p.jsx(Fc,{turnKey:F.turnKey,duration:V(F.duration),collapsible:F.collapsible,isOpen:L.has(F.turnKey),onToggle:$,onBeforeToggle:i});case"item":return O3(F.item,!1,a,u,o,c,d,i);default:return null}},[d,V,L,o,c,u,i,$,a]),j=U.getVirtualItems();return b?p.jsx("div",{ref:R,className:"w-full mx-auto pb-4 min-w-0",style:{overflowWrap:"anywhere"},children:v?p.jsx("div",{style:{height:U.getTotalSize(),width:"100%",position:"relative"},children:j.map(F=>{const W=N[F.index];return W?p.jsx("div",{"data-index":F.index,"data-at-row":W.key,...W.kind==="item"&&W.processed?{"data-processed-content":""}:{},ref:U.measureElement,style:{position:"absolute",top:F.start,left:0,width:"100%"},children:Y(W)},W.key):null})},"virtualized"):p.jsx("div",{children:N.map(F=>p.jsx("div",{"data-at-row":F.key,...F.kind==="item"&&F.processed?{"data-processed-content":""}:{},children:Y(F)},F.key))},"static")}):p.jsx("div",{ref:R,className:"w-full mx-auto pb-4 min-w-0",style:{overflowWrap:"anywhere"}})}),v3=/^(0|[1-9]\d*)$/,M3=2147483647;function B3(e,t){if(!Array.isArray(t))return Fe("patch sequence must be an array");let n=e;for(const r of t){const i=F3(n,r);if(!i.ok)return i;n=i.conversation}return{ok:!0,conversation:n}}function F3(e,t){if(!or(t))return Fe("operation is not an object");const n=j3(t.path);return n?t.op==="add"?H3(e,n,t):t.op==="replace"?U3(e,n,t):$e(t):$e(t)}function H3(e,t,n){if(n.value===void 0)return Fe("operation value is required");if(lr(n.value))return Fe("operation value cannot contain undefined");if(t.length===1&&t[0]==="sessionId")return Rt({...e,sessionId:n.value});if(t[0]!=="entries"||t.length!==2)return $e(n);const r=Uc(t[1]);if(r===void 0)return $e(n);if(!Array.isArray(e.entries))return Fe("entries is not an array");if(r>e.entries.length)return $e(n);const i=e.entries.slice();return i.splice(r,0,n.value),Rt(ur(e,i))}function U3(e,t,n){if(n.value===void 0)return Fe("operation value is required");if(lr(n.value))return Fe("operation value cannot contain undefined");if(t.length===1&&t[0]==="entries"){const d=n.value,h=Array.isArray(d)?d.slice():d;return Rt(ur(e,h))}if(t[0]!=="entries")return $e(n);const r=Uc(t[1]);if(r===void 0)return $e(n);if(!Array.isArray(e.entries))return Fe("entries is not an array");const i=t.length===2,s=t.length===3&&t[2]==="content",a=t.length===4&&t[2]==="metadata"&&t[3]==="status";if(!i&&!s&&!a)return $e(n);if(i){if(r>=e.entries.length)return $e(n);const d=e.entries.slice();return d[r]=n.value,Rt(ur(e,d))}const u=e.entries[r];if(!or(u))return Fe("entry does not exist");if(s)return u.content===void 0?Fe("entry content does not exist"):Rt(du(e,r,{...u,content:n.value}));const o=u.metadata;if(!or(o)||o.status===void 0)return Fe("entry metadata status does not exist");const c={...o,status:n.value};return Rt(du(e,r,{...u,metadata:c}))}function du(e,t,n){const r=e.entries.slice();return r[t]=n,ur(e,r)}function ur(e,t){return{...e,entries:t}}function j3(e){if(!(typeof e!="string"||!e.startsWith("/")))return e.slice(1).split("/")}function Uc(e){if(!v3.test(e))return;const t=Number(e);if(Number.isSafeInteger(t))return t<=M3?t:void 0}function or(e){return typeof e=="object"&&e!==null}function lr(e){return e===void 0?!0:Array.isArray(e)?e.some(lr):or(e)?Object.keys(e).some(t=>lr(e[t])):!1}function Rt(e){return{ok:!0,conversation:e}}function Fe(e){return{ok:!1,kind:"failed",reason:e}}function $e(e){return console.warn("[sessionLogStore] unsupported conversation patch op/path",{op:e.op,path:e.path}),{ok:!1,kind:"unsupported",reason:`unsupported op/path: ${String(e.op)} ${String(e.path)}`}}const iy={entries:[],isTruncated:!1},z3=50,hu=500;function fu(e){return typeof e?.seq=="number"?e.seq:0}function mu(e){return e?.entries.at(-1)?.id}function pu(e){const t=e?.entries.at(-1);if(t)return JSON.stringify(t)}function sy(e){return{...e,entries:Array.isArray(e.entries)?e.entries:[],isTruncated:!1}}function ay(e,t){if(!e||e.isTruncated)return!0;const n=fu(e),r=fu(t);if(r>n)return!0;if(r<n)return!1;if(t.entries.length>e.entries.length)return!0;if(t.entries.length<e.entries.length)return!1;const i=mu(e),s=mu(t);if(s&&i&&s!==i)return!0;const a=pu(e),u=pu(t);return!!(u&&a&&u!==a)}function $3(e,t){for(;t.length>z3;){const n=t[0];t=t.slice(1);const{[n]:r,...i}=e;e=i}return{conversations:e,accessOrder:t}}const uy=cd((e,t)=>({conversations:{},accessOrder:[],setConversation:(n,r)=>{e(i=>{const s=i.accessOrder.filter(u=>u!==n);s.push(n);const a={...i.conversations,[n]:{...r,isTruncated:r.isTruncated??!1}};return $3(a,s)})},applyPatch:(n,r,i)=>{const s=t().conversations[n];if(!s)return!1;if(typeof i=="number"&&typeof s.seq=="number"&&i<=s.seq)return!0;const a=B3(s,r);if(!a.ok)return a.kind==="failed"&&console.error("[sessionLogStore] applyPatch failed:",a.reason),!1;const u={...a.conversation,seq:typeof i=="number"?i:s.seq,isTruncated:s.isTruncated??!1};return e(o=>({conversations:{...o.conversations,[n]:u}})),!0},touchAccess:n=>{e(r=>{const i=r.accessOrder.indexOf(n);if(i===-1||i===r.accessOrder.length-1)return r;const s=[...r.accessOrder];return s.splice(i,1),s.push(n),{accessOrder:s}})},truncateSession:n=>{e(r=>{const i=r.conversations[n];return!i||i.entries.length<=hu?r:{conversations:{...r.conversations,[n]:{...i,entries:i.entries.slice(-hu),isTruncated:!0}}}})},removeSession:n=>{e(r=>{const{[n]:i,...s}=r.conversations;return{conversations:s,accessOrder:r.accessOrder.filter(a=>a!==n)}})},getConversation:n=>t().conversations[n],clear:()=>{e({conversations:{},accessOrder:[]})}})),Y3=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:bc},Symbol.toStringTag,{value:"Module"}));export{iy as E,Kx as I,Pe as L,Vd as M,Ld as O,gc as Q,jd as T,J3 as Z,ry as a,uy as b,B3 as c,jn as d,ay as e,ys as f,Q as g,Su as h,Bd as i,Cu as j,qd as k,f3 as l,o3 as m,sy as n,l3 as o,Zk as p,ty as q,Fd as r,u3 as s,ou as t,yd as u,ey as v,ny as w};
|
|
118
|
+
`)},Zr=e=>{let t=!1;for(let r of e)if(r==="\\"||r==="|"){t=!0;break}if(!t)return e;let n=[];for(let r of e)r==="\\"?n.push("\\\\"):r==="|"?n.push("\\|"):n.push(r);return n.join("")},pk=e=>{let{headers:t,rows:n}=e;if(t.length===0)return"";let r=new Array(n.length+2),i=0,s=t.map(u=>Zr(u));r[i]=`| ${s.join(" | ")} |`,i+=1;let a=new Array(t.length);for(let u=0;u<t.length;u+=1)a[u]="---";r[i]=`| ${a.join(" | ")} |`,i+=1;for(let u of n)if(u.length<t.length){let o=new Array(t.length);for(let c=0;c<t.length;c+=1)o[c]=c<u.length?Zr(u[c]):"";r[i]=`| ${o.join(" | ")} |`,i+=1}else{let o=u.map(c=>Zr(c));r[i]=`| ${o.join(" | ")} |`,i+=1}return r.join(`
|
|
119
|
+
`)},gk=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let[s,a]=y.useState(!1),[u,o]=y.useState(!1),c=y.useRef(null),d=y.useRef(0),{isAnimating:h}=y.useContext(Pe),f=async b=>{var k,S;if(typeof window>"u"||!((k=navigator?.clipboard)!=null&&k.write)){r?.(new Error("Clipboard API not available"));return}try{let _=(S=c.current)==null?void 0:S.closest('[data-streamdown="table-wrapper"]'),L=_?.querySelector("table");if(!L){r?.(new Error("Table not found"));return}let I=Wl(L),B=b==="csv"?Gl(I):mk(I),z=new ClipboardItem({"text/plain":new Blob([B],{type:"text/plain"}),"text/html":new Blob([L.outerHTML],{type:"text/html"})});await navigator.clipboard.write([z]),o(!0),a(!1),n?.(b),d.current=window.setTimeout(()=>o(!1),i)}catch(_){r?.(_)}};y.useEffect(()=>{let b=k=>{let S=k.composedPath();c.current&&!S.includes(c.current)&&a(!1)};return document.addEventListener("mousedown",b),()=>{document.removeEventListener("mousedown",b),window.clearTimeout(d.current)}},[]);let m=u?us:os;return p.jsxs("div",{className:"relative",ref:c,children:[p.jsx("button",{className:Q("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:h,onClick:()=>a(!s),title:"Copy table",type:"button",children:e??p.jsx(m,{size:14})}),s?p.jsxs("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[p.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>f("csv"),title:"Copy table as CSV",type:"button",children:"CSV"}),p.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>f("tsv"),title:"Copy table as TSV",type:"button",children:"TSV"})]}):null]})},bk=({children:e,className:t,onDownload:n,onError:r})=>{let[i,s]=y.useState(!1),a=y.useRef(null),{isAnimating:u}=y.useContext(Pe),o=c=>{var d;try{let h=(d=a.current)==null?void 0:d.closest('[data-streamdown="table-wrapper"]'),f=h?.querySelector("table");if(!f){r?.(new Error("Table not found"));return}let m=Wl(f),b=c==="csv"?Gl(m):pk(m);Pt(`table.${c==="csv"?"csv":"md"}`,b,c==="csv"?"text/csv":"text/markdown"),s(!1),n?.(c)}catch(h){r?.(h)}};return y.useEffect(()=>{let c=d=>{let h=d.composedPath();a.current&&!h.includes(a.current)&&s(!1)};return document.addEventListener("mousedown",c),()=>{document.removeEventListener("mousedown",c)}},[]),p.jsxs("div",{className:"relative",ref:a,children:[p.jsx("button",{className:Q("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:u,onClick:()=>s(!i),title:"Download table",type:"button",children:e??p.jsx(Ir,{size:14})}),i?p.jsxs("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[p.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>o("csv"),title:"Download table as CSV",type:"button",children:"CSV"}),p.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>o("markdown"),title:"Download table as Markdown",type:"button",children:"Markdown"})]}):null]})},Ek=({children:e,className:t,showControls:n,...r})=>p.jsxs("div",{className:"my-4 flex flex-col space-y-2","data-streamdown":"table-wrapper",children:[n?p.jsxs("div",{className:"flex items-center justify-end gap-1",children:[p.jsx(gk,{}),p.jsx(bk,{})]}):null,p.jsx("div",{className:"overflow-x-auto overscroll-y-auto",children:p.jsx("table",{className:Q("w-full border-collapse border border-border",t),"data-streamdown":"table",...r,children:e})})]}),Tk=y.lazy(()=>Ii(()=>import("./code-block-OCS4YCEC-B2hHBO_G.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(e=>({default:e.CodeBlock}))),xk=y.lazy(()=>Ii(()=>Promise.resolve().then(()=>X3),void 0).then(e=>({default:e.Mermaid}))),kk=/language-([^\s]+)/;function wr(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,s=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&i?.line===s?.line&&i?.column===s?.column}function he(e,t){return e.className===t.className&&wr(e.node,t.node)}var yi=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,jn=(e,t)=>{if(typeof e=="boolean")return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},cs=y.memo(({children:e,className:t,node:n,...r})=>p.jsx("ol",{className:Q("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e}),(e,t)=>he(e,t));cs.displayName="MarkdownOl";var Ql=y.memo(({children:e,className:t,node:n,...r})=>p.jsx("li",{className:Q("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e}),(e,t)=>e.className===t.className&&wr(e.node,t.node));Ql.displayName="MarkdownLi";var Kl=y.memo(({children:e,className:t,node:n,...r})=>p.jsx("ul",{className:Q("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e}),(e,t)=>he(e,t));Kl.displayName="MarkdownUl";var Xl=y.memo(({className:e,node:t,...n})=>p.jsx("hr",{className:Q("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n}),(e,t)=>he(e,t));Xl.displayName="MarkdownHr";var Zl=y.memo(({children:e,className:t,node:n,...r})=>p.jsx("span",{className:Q("font-semibold",t),"data-streamdown":"strong",...r,children:e}),(e,t)=>he(e,t));Zl.displayName="MarkdownStrong";var yk=({children:e,className:t,href:n,node:r,...i})=>{let{linkSafety:s}=y.useContext(Pe),[a,u]=y.useState(!1),o=n==="streamdown:incomplete-link",c=y.useCallback(async m=>{if(!(!(s!=null&&s.enabled&&n)||o)){if(m.preventDefault(),s.onLinkCheck&&await s.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}u(!0)}},[s,n,o]),d=y.useCallback(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),h=y.useCallback(()=>{u(!1)},[]),f={url:n??"",isOpen:a,onClose:h,onConfirm:d};return s!=null&&s.enabled&&n?p.jsxs(p.Fragment,{children:[p.jsx("button",{className:Q("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":o,"data-streamdown":"link",onClick:c,type:"button",children:e}),s.renderModal?s.renderModal(f):p.jsx(ok,{...f})]}):p.jsx("a",{className:Q("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":o,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...i,children:e})},Jl=y.memo(yk,(e,t)=>he(e,t)&&e.href===t.href);Jl.displayName="MarkdownA";var ec=y.memo(({children:e,className:t,node:n,...r})=>p.jsx("h1",{className:Q("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e}),(e,t)=>he(e,t));ec.displayName="MarkdownH1";var tc=y.memo(({children:e,className:t,node:n,...r})=>p.jsx("h2",{className:Q("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e}),(e,t)=>he(e,t));tc.displayName="MarkdownH2";var nc=y.memo(({children:e,className:t,node:n,...r})=>p.jsx("h3",{className:Q("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e}),(e,t)=>he(e,t));nc.displayName="MarkdownH3";var rc=y.memo(({children:e,className:t,node:n,...r})=>p.jsx("h4",{className:Q("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e}),(e,t)=>he(e,t));rc.displayName="MarkdownH4";var ic=y.memo(({children:e,className:t,node:n,...r})=>p.jsx("h5",{className:Q("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e}),(e,t)=>he(e,t));ic.displayName="MarkdownH5";var sc=y.memo(({children:e,className:t,node:n,...r})=>p.jsx("h6",{className:Q("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e}),(e,t)=>he(e,t));sc.displayName="MarkdownH6";var ac=y.memo(({children:e,className:t,node:n,...r})=>{let{controls:i}=y.useContext(Pe),s=yi(i,"table");return p.jsx(Ek,{className:t,showControls:s,...r,children:e})},(e,t)=>he(e,t));ac.displayName="MarkdownTable";var uc=y.memo(({children:e,className:t,node:n,...r})=>p.jsx("thead",{className:Q("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e}),(e,t)=>he(e,t));uc.displayName="MarkdownThead";var oc=y.memo(({children:e,className:t,node:n,...r})=>p.jsx("tbody",{className:Q("divide-y divide-border bg-muted/40",t),"data-streamdown":"table-body",...r,children:e}),(e,t)=>he(e,t));oc.displayName="MarkdownTbody";var lc=y.memo(({children:e,className:t,node:n,...r})=>p.jsx("tr",{className:Q("border-border border-b",t),"data-streamdown":"table-row",...r,children:e}),(e,t)=>he(e,t));lc.displayName="MarkdownTr";var cc=y.memo(({children:e,className:t,node:n,...r})=>p.jsx("th",{className:Q("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...r,children:e}),(e,t)=>he(e,t));cc.displayName="MarkdownTh";var dc=y.memo(({children:e,className:t,node:n,...r})=>p.jsx("td",{className:Q("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e}),(e,t)=>he(e,t));dc.displayName="MarkdownTd";var hc=y.memo(({children:e,className:t,node:n,...r})=>p.jsx("blockquote",{className:Q("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...r,children:e}),(e,t)=>he(e,t));hc.displayName="MarkdownBlockquote";var fc=y.memo(({children:e,className:t,node:n,...r})=>p.jsx("sup",{className:Q("text-sm",t),"data-streamdown":"superscript",...r,children:e}),(e,t)=>he(e,t));fc.displayName="MarkdownSup";var mc=y.memo(({children:e,className:t,node:n,...r})=>p.jsx("sub",{className:Q("text-sm",t),"data-streamdown":"subscript",...r,children:e}),(e,t)=>he(e,t));mc.displayName="MarkdownSub";var pc=y.memo(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let i=a=>{var u,o;if(!y.isValidElement(a))return!1;let c=Array.isArray(a.props.children)?a.props.children:[a.props.children],d=!1,h=!1;for(let f of c)if(f){if(typeof f=="string")f.trim()!==""&&(d=!0);else if(y.isValidElement(f))if(((u=f.props)==null?void 0:u["data-footnote-backref"])!==void 0)h=!0;else{let m=Array.isArray(f.props.children)?f.props.children:[f.props.children];for(let b of m){if(typeof b=="string"&&b.trim()!==""){d=!0;break}if(y.isValidElement(b)&&((o=b.props)==null?void 0:o["data-footnote-backref"])===void 0){d=!0;break}}}}return h&&!d},s=Array.isArray(e)?e.map(a=>{if(!y.isValidElement(a))return a;if(a.type===cs){let u=(Array.isArray(a.props.children)?a.props.children:[a.props.children]).filter(o=>!i(o));return u.length===0?null:{...a,props:{...a.props,children:u}}}return a}):e;return(Array.isArray(s)?s.some(a=>a!==null):s!==null)?p.jsx("section",{className:t,...r,children:s}):null}return p.jsx("section",{className:t,...r,children:e})},(e,t)=>he(e,t));pc.displayName="MarkdownSection";var Ak=({node:e,className:t,children:n,...r})=>{var i;let s=!("data-block"in r),{mermaid:a,controls:u}=y.useContext(Pe),o=ls();if(s)return p.jsx("code",{className:Q("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...r,children:n});let c=t?.match(kk),d=(i=c?.at(1))!=null?i:"",h="";if(y.isValidElement(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?h=n.props.children:typeof n=="string"&&(h=n),d==="mermaid"&&o){let m=yi(u,"mermaid"),b=jn(u,"download"),k=jn(u,"copy"),S=jn(u,"fullscreen"),_=jn(u,"panZoom"),L=m&&(b||k||S);return p.jsx(y.Suspense,{fallback:p.jsx(nu,{}),children:p.jsxs("div",{className:Q("group relative my-4 h-auto rounded-xl border p-4",t),"data-streamdown":"mermaid-block",children:[L?p.jsxs("div",{className:"flex items-center justify-end gap-2",children:[b?p.jsx(ck,{chart:h,config:a?.config}):null,k?p.jsx(eu,{code:h}):null,S?p.jsx(fk,{chart:h,config:a?.config}):null]}):null,p.jsx(xk,{chart:h,config:a?.config,showControls:_})]})})}let f=yi(u,"code");return p.jsx(y.Suspense,{fallback:p.jsx(nu,{}),children:p.jsx(Tk,{className:Q("overflow-x-auto border-border border-t",t),code:h,language:d,children:f?p.jsxs(p.Fragment,{children:[p.jsx(rk,{code:h,language:d}),p.jsx(eu,{})]}):null})})},gc=y.memo(Ak,(e,t)=>e.className===t.className&&wr(e.node,t.node));gc.displayName="MarkdownCode";var bc=y.memo(sk,(e,t)=>e.className===t.className&&wr(e.node,t.node));bc.displayName="MarkdownImg";var Ec=y.memo(({children:e,className:t,node:n,...r})=>{let i=(Array.isArray(e)?e:[e]).filter(s=>s!=null&&s!=="");if(i.length===1&&y.isValidElement(i[0])){let s=i[0].props.node,a=s?.tagName;if(a==="img")return p.jsx(p.Fragment,{children:e});if(a==="code"&&"data-block"in i[0].props)return p.jsx(p.Fragment,{children:e})}return p.jsx("p",{className:t,...r,children:e})},(e,t)=>he(e,t));Ec.displayName="MarkdownParagraph";var _k={ol:cs,li:Ql,ul:Kl,hr:Xl,strong:Zl,a:Jl,h1:ec,h2:tc,h3:nc,h4:rc,h5:ic,h6:sc,table:ac,thead:uc,tbody:oc,tr:lc,th:cc,td:dc,blockquote:hc,code:gc,img:bc,pre:({children:e})=>y.isValidElement(e)?y.cloneElement(e,{"data-block":"true"}):e,sup:fc,sub:mc,p:Ec,section:pc},Ck=()=>e=>{st(e,"html",(t,n,r)=>{!r||typeof n!="number"||(r.children[n]={type:"text",value:t.value})})},ru=[],iu={allowDangerousHtml:!0},zn=new WeakMap,Sk=class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let d="default";return this.keyCache.set(e,d),d}let s=d=>{if(!d||d.length===0)return"";let h="";for(let f=0;f<d.length;f+=1){let m=d[f];if(f>0&&(h+=","),Array.isArray(m)){let[b,k]=m;if(typeof b=="function"){let S=zn.get(b);S||(S=b.name,zn.set(b,S)),h+=S}else h+=String(b);h+=":",h+=JSON.stringify(k)}else if(typeof m=="function"){let b=zn.get(m);b||(b=m.name,zn.set(m,b)),h+=b}else h+=String(m)}return h},a=s(n),u=s(r),o=i?JSON.stringify(i):"",c=`${u}::${a}::${o}`;return this.keyCache.set(e,c),c}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let r=this.cache.keys().next().value;r&&this.cache.delete(r)}this.cache.set(n,t)}clear(){this.cache.clear()}},su=new Sk,Tc=e=>{let t=Nk(e),n=e.children||"";return Pk(t.runSync(t.parse(n),n),e)},Nk=e=>{let t=su.get(e);if(t)return t;let n=wk(e);return su.set(e,n),n},Ik=e=>e.some(t=>Array.isArray(t)?t[0]===li:t===li),wk=e=>{let t=e.rehypePlugins||ru,n=e.remarkPlugins||ru,r=Ik(t)?n:[...n,Ck],i=e.remarkRehypeOptions?{...iu,...e.remarkRehypeOptions}:iu;return Z2().use(XT).use(r).use(D2,i).use(t)},Lk=e=>e,Rk=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:"text",value:r}},Ok=(e,t)=>{var n;for(let r in $r)if(Object.hasOwn($r,r)&&Object.hasOwn(e.properties,r)){let i=e.properties[r],s=$r[r];(s===null||s.includes(e.tagName))&&(e.properties[r]=(n=t(String(i||""),r,e))!=null?n:void 0)}},Dk=(e,t,n,r,i,s)=>{let a=!1;return r?a=!r.includes(e.tagName):i&&(a=i.includes(e.tagName)),!a&&s&&typeof t=="number"&&(a=!s(e,t,n)),a},Pk=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:s,unwrapDisallowed:a,urlTransform:u}=t;if(n||r||i||s||u){let o=u||Lk;st(e,(c,d,h)=>{if(c.type==="raw"&&h&&typeof d=="number")return Rk(h,d,s,c.value),d;if(c.type==="element"&&(Ok(c,o),Dk(c,d,h,r,i,n)&&h&&typeof d=="number"))return a&&c.children?h.children.splice(d,1,...c.children):h.children.splice(d,1),d})}return sT(e,{Fragment:p.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:p.jsx,jsxs:p.jsxs,passKeys:!0,passNode:!0})},vk=/\[\^[\w-]{1,200}\](?!:)/,Mk=/\[\^[\w-]{1,200}\]:/,Bk=/<\/(\w+)>/,Fk=/<(\w+)[\s>]/,Hk=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Uk=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]==="$"&&e[n+1]==="$"&&(t+=1,n+=1);return t},jk=e=>{let t=vk.test(e),n=Mk.test(e);if(t||n)return[e];let r=De.lex(e,{gfm:!0}),i=[],s=[],a=!1;for(let u of r){let o=u.raw,c=i.length;if(s.length>0){if(i[c-1]+=o,u.type==="html"){let d=o.match(Bk);if(d){let h=d[1];s.at(-1)===h&&s.pop()}}continue}if(u.type==="html"&&u.block){let d=o.match(Fk);if(d){let h=d[1];o.includes(`</${h}>`)||Hk.has(h.toLowerCase())||s.push(h)}}if(c>0&&!a){let d=i[c-1];if(Uk(d)%2===1){i[c-1]=d+o;continue}}i.push(o),u.type!=="space"&&(a=u.type==="code")}return i},au,uu,Gn={...cn,protocols:{...cn.protocols,href:[...(uu=(au=cn.protocols)==null?void 0:au.href)!=null?uu:[],"tel"]}},Ai={raw:li,sanitize:[Po,Gn],harden:[Eh,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},zk={gfm:[vb,{}]},ou=Object.values(Ai),$k=Object.values(zk),Yk={block:" ▋",circle:" ●"},qk={shikiTheme:["github-light","github-dark"],controls:!0,isAnimating:!1,mode:"streaming",mermaid:void 0,linkSafety:{enabled:!0}},Pe=y.createContext(qk),xc=y.memo(({content:e,shouldParseIncompleteMarkdown:t,index:n,...r})=>p.jsx(Tc,{...r,children:e}),(e,t)=>{if(e.content!==t.content||e.index!==t.index)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(i=>{var s,a;return((s=e.components)==null?void 0:s[i])!==((a=t.components)==null?void 0:a[i])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});xc.displayName="Block";var Vk=["github-light","github-dark"],kc=y.memo(({children:e,mode:t="streaming",parseIncompleteMarkdown:n=!0,components:r,rehypePlugins:i=ou,remarkPlugins:s=$k,className:a,shikiTheme:u=Vk,mermaid:o,controls:c=!0,isAnimating:d=!1,animated:h,BlockComponent:f=xc,parseMarkdownIntoBlocksFn:m=jk,caret:b,plugins:k,remend:S,linkSafety:_={enabled:!0},allowedTags:L,...I})=>{let B=y.useId(),[z,R]=y.useTransition(),$=y.useMemo(()=>typeof e!="string"?"":t==="streaming"&&n?$E(e,S):e,[e,t,n,S]),G=y.useMemo(()=>m($),[$,m]),[K,N]=y.useState(G);y.useEffect(()=>{t==="streaming"?R(()=>{N(G)}):N(G)},[G,t]);let U=t==="streaming"?K:G,v=y.useMemo(()=>U.map((re,x)=>`${B}-${x}`),[U.length,B]),V=y.useMemo(()=>h?h===!0?xi():xi(h):null,[h]),Y=y.useMemo(()=>{var re,x;return{shikiTheme:(x=(re=k?.code)==null?void 0:re.getThemes())!=null?x:u,controls:c,isAnimating:d,mode:t,mermaid:o,linkSafety:_}},[u,c,d,t,o,_,k?.code]),j=y.useMemo(()=>({..._k,...r}),[r]),F=y.useMemo(()=>{let re=[];return k!=null&&k.cjk&&(re=[...re,...k.cjk.remarkPluginsBefore]),re=[...re,...s],k!=null&&k.cjk&&(re=[...re,...k.cjk.remarkPluginsAfter]),k!=null&&k.math&&(re=[...re,k.math.remarkPlugin]),re},[s,k?.math,k?.cjk]),W=y.useMemo(()=>{var re;let x=i;if(L&&Object.keys(L).length>0&&i===ou){let Ne={...Gn,tagNames:[...(re=Gn.tagNames)!=null?re:[],...Object.keys(L)],attributes:{...Gn.attributes,...L}};x=[Ai.raw,[Po,Ne],Ai.harden]}return k!=null&&k.math&&(x=[...x,k.math.rehypePlugin]),V&&d&&(x=[...x,V.rehypePlugin]),x},[i,k?.math,V,d,L]),ue=y.useMemo(()=>b&&d?{"--streamdown-caret":`"${Yk[b]}"`}:void 0,[b,d]);return t==="static"?p.jsx(ki.Provider,{value:k??null,children:p.jsx(Pe.Provider,{value:Y,children:p.jsx("div",{className:Q("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",a),children:p.jsx(Tc,{components:j,rehypePlugins:W,remarkPlugins:F,...I,children:e})})})}):p.jsx(ki.Provider,{value:k??null,children:p.jsx(Pe.Provider,{value:Y,children:p.jsxs("div",{className:Q("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",b?"*:last:after:inline *:last:after:align-baseline *:last:after:content-[var(--streamdown-caret)]":null,a),style:ue,children:[U.length===0&&b&&d&&p.jsx("span",{}),U.map((re,x)=>p.jsx(f,{components:j,content:re,index:x,rehypePlugins:W,remarkPlugins:F,shouldParseIncompleteMarkdown:n,...I},v[x]))]})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety);kc.displayName="Streamdown";var Wk=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:s=!0,initialZoom:a=1,fullscreen:u=!1})=>{let o=y.useRef(null),c=y.useRef(null),[d,h]=y.useState(a),[f,m]=y.useState({x:0,y:0}),[b,k]=y.useState(!1),[S,_]=y.useState({x:0,y:0}),[L,I]=y.useState({x:0,y:0}),B=y.useCallback(v=>{h(V=>Math.max(n,Math.min(r,V+v)))},[n,r]),z=y.useCallback(()=>{B(i)},[B,i]),R=y.useCallback(()=>{B(-i)},[B,i]),$=y.useCallback(()=>{h(a),m({x:0,y:0})},[a]),G=y.useCallback(v=>{v.preventDefault();let V=v.deltaY>0?-i:i;B(V)},[B,i]),K=y.useCallback(v=>{if(v.button!==0||v.isPrimary===!1)return;k(!0),_({x:v.clientX,y:v.clientY}),I(f);let V=v.currentTarget;V instanceof HTMLElement&&V.setPointerCapture(v.pointerId)},[f]),N=y.useCallback(v=>{if(!b)return;v.preventDefault();let V=v.clientX-S.x,Y=v.clientY-S.y;m({x:L.x+V,y:L.y+Y})},[b,S,L]),U=y.useCallback(v=>{k(!1);let V=v.currentTarget;V instanceof HTMLElement&&V.releasePointerCapture(v.pointerId)},[]);return y.useEffect(()=>{let v=o.current;if(v)return v.addEventListener("wheel",G,{passive:!1}),()=>{v.removeEventListener("wheel",G)}},[G]),y.useEffect(()=>{let v=c.current;if(v&&b)return document.body.style.userSelect="none",v.addEventListener("pointermove",N,{passive:!1}),v.addEventListener("pointerup",U),v.addEventListener("pointercancel",U),()=>{document.body.style.userSelect="",v.removeEventListener("pointermove",N),v.removeEventListener("pointerup",U),v.removeEventListener("pointercancel",U)}},[b,N,U]),p.jsxs("div",{className:Q("relative flex flex-col",u?"h-full w-full":"min-h-28 w-full",t),ref:o,style:{cursor:b?"grabbing":"grab"},children:[s?p.jsxs("div",{className:Q("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/90 p-1 shadow-sm backdrop-blur-sm",u?"bottom-4 left-4":"bottom-2 left-2"),children:[p.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:d>=r,onClick:z,title:"Zoom in",type:"button",children:p.jsx(ek,{size:16})}),p.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:d<=n,onClick:R,title:"Zoom out",type:"button",children:p.jsx(tk,{size:16})}),p.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",onClick:$,title:"Reset zoom and pan",type:"button",children:p.jsx(Jx,{size:16})})]}):null,p.jsx("div",{className:Q("flex-1 origin-center transition-transform duration-150 ease-out",u?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:K,ref:c,role:"application",style:{transform:`translate(${f.x}px, ${f.y}px) scale(${d})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},yc=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let[s,a]=y.useState(null),[u,o]=y.useState(!1),[c,d]=y.useState(""),[h,f]=y.useState(""),[m,b]=y.useState(0),{mermaid:k}=y.useContext(Pe),S=ls(),_=k?.errorComponent,{shouldRender:L,containerRef:I}=zx({immediate:r});if(y.useEffect(()=>{if(L){if(!S){a("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{a(null),o(!0);let z=S.getMermaid(n),R=e.split("").reduce((K,N)=>(K<<5)-K+N.charCodeAt(0)|0,0),$=`mermaid-${Math.abs(R)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:G}=await z.render($,e);d(G),f(G)}catch(z){if(!(h||c)){let R=z instanceof Error?z.message:"Failed to render Mermaid chart";a(R)}}finally{o(!1)}})()}},[e,n,m,L,S]),!(L||c||h))return p.jsx("div",{className:Q("my-4 min-h-[200px]",t),ref:I});if(u&&!c&&!h)return p.jsx("div",{className:Q("my-4 flex justify-center p-4",t),ref:I,children:p.jsxs("div",{className:"flex items-center space-x-2 text-muted-foreground",children:[p.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-current border-b-2"}),p.jsx("span",{className:"text-sm",children:"Loading diagram..."})]})});if(s&&!c&&!h){let z=()=>b(R=>R+1);return _?p.jsx("div",{ref:I,children:p.jsx(_,{chart:e,error:s,retry:z})}):p.jsxs("div",{className:Q("rounded-lg border border-red-200 bg-red-50 p-4",t),ref:I,children:[p.jsxs("p",{className:"font-mono text-red-700 text-sm",children:["Mermaid Error: ",s]}),p.jsxs("details",{className:"mt-2",children:[p.jsx("summary",{className:"cursor-pointer text-red-600 text-xs",children:"Show Code"}),p.jsx("pre",{className:"mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs",children:e})]})]})}let B=c||h;return p.jsx("div",{className:Q("size-full",t),"data-streamdown":"mermaid",ref:I,children:p.jsx(Wk,{className:Q(r?"size-full overflow-hidden":"my-4 overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:p.jsx("div",{"aria-label":"Mermaid chart",className:Q("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:B},role:"img"})})})};function Gk({content:e,children:t,className:n,side:r="top",align:i="center"}){return p.jsx(Sd,{content:e,side:r,align:i,children:p.jsx("div",{className:kn("relative inline-block [&>:disabled]:pointer-events-none",n),children:t})})}const Ac=/^[a-zA-Z]:[\\/]/,Qk=/[/\\](attachments|conversations)[/\\]/,Kk=/^\/(Users|home|tmp|private|var|opt|mnt|Volumes)(\/|$)/;function lu(e){return e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")}function Xk(e){const t=e.match(/^(.*)#L([1-9]\d*)(?:C([1-9]\d*))?$/i);if(t)return{path:t[1],line:Number(t[2]),column:t[3]?Number(t[3]):void 0};const n=e.match(/^(.*?):(\d+)(?::(\d+))?$/);if(n&&n[1]){const r=Number(n[2]),i=n[3]?Number(n[3]):void 0;if(r>0&&(!n[3]||i&&i>0))return{path:n[1],line:r,column:i}}return{path:e}}function Zk(e,t){if(!t)return null;const n=lu(e),r=lu(t).replace(/\/$/,"");return n===r?null:n.startsWith(`${r}/`)?n.slice(r.length+1):n.startsWith("./")?n.slice(2):!n.startsWith("/")&&!Ac.test(e)&&!n.startsWith("../")?n:null}function Jk(e){return`${yn()}/attachments/by-path?path=${encodeURIComponent(e)}`}function _c(e,t){if(/^https?:\/\//i.test(e))return{type:"external",url:e};if(/^(mailto|tel):/i.test(e))return{type:"external",url:e};if(e.startsWith("/api/")||e.startsWith("#"))return{type:"internal",url:e};const n=Xk(e),r=Zk(n.path,t);return r?{type:"workspace-file",path:r,line:n.line,column:n.column}:Qk.test(e)?{type:"attachment",path:e,url:Jk(e)}:Kk.test(e)||Ac.test(e)?{type:"unknown-local",path:e}:{type:"internal",url:e}}function e3(e,t){const n=new URLSearchParams({workingDir:e,path:t});return`${yn()}/files/image?${n.toString()}`}function t3(e){const t=new URLSearchParams({path:e});return`${yn()}/files/image?${t.toString()}`}const Cc="/__agent-tower/message-intent/codex-inline-vis",Sc="/__agent-tower/message-intent/agent-download",n3=/^[ \t]{0,3}::codex-inline-vis\{file="([^"\r\n]+)"\}[ \t]*$/,Nc=/^[a-z0-9][a-z0-9-]*\.html$/,r3=/^[ \t]{0,3}(`{3,}|~{3,})/;function i3(e,t){const n=t[0]==="`"?"`":"~";return new RegExp(`^[ \\t]{0,3}${n}{${t.length},}[ \\t]*$`).test(e)}function s3(e){let t=null;return e.split(/\r?\n/).map(n=>{if(t)return i3(n,t)&&(t=null),n;const r=n.match(r3);if(r)return t=r[1],n;const i=n.match(n3);if(i&&Nc.test(i[1])){const u=`${Cc}?file=${encodeURIComponent(i[1])}`;return`[${i[1]}](${u})`}const s=Pd(n);if(!s)return n;const a=`${Sc}?file=${encodeURIComponent(s)}`;return`[${s}](${a})`}).join(`
|
|
120
|
+
`)}function a3(e){try{const t=new URL(e,"http://agent-tower.local"),n=t.searchParams.get("file");if(!n)return null;if(t.pathname===Cc&&Nc.test(n))return{type:"codex-inline-visualization",file:n};if(t.pathname===Sc){const r=Iu(n);return r?{type:"agent-download",file:r}:null}return null}catch{return null}}function uy(e,t){return`${yn()}/sessions/${encodeURIComponent(e)}/visualizations/${encodeURIComponent(t)}`}function u3(e,t){const n=new URLSearchParams({path:t});return`${yn()}/sessions/${encodeURIComponent(e)}/artifacts/download?${n.toString()}`}const Ic=new Set(["localhost","127.0.0.1","::1","[::1]","0.0.0.0"]);function o3(e){return/^\d+$/.test(e)?`http://127.0.0.1:${e}`:/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(e)?e:`http://${e}`}function _i(e){try{return new URL(o3(e.trim()))}catch{return null}}function cu(e){return Ic.has(e.hostname.toLowerCase())?"loopback":e.hostname.toLowerCase()}function du(e){return e.port?e.port:e.protocol==="https:"?"443":"80"}function l3(e,t){return e.protocol===t.protocol&&cu(e)===cu(t)&&du(e)===du(t)}function wc(e){return!e||e==="/"?"":e.endsWith("/")?e.slice(0,-1):e}function c3(e,t){return t?e===t||e.startsWith(`${t}/`):!0}function $n(e,t){return t?{kind:"target",target:t.origin,path:`${t.pathname}${t.search}${t.hash}`}:{kind:"target",target:e,path:null}}function hu(e,t){try{const i=new URL(e),s=i.searchParams.get("__agent_tower_preview_token"),a=new URL(t.startsWith("/")?t:`/${t}`,"http://preview.local");return i.pathname=a.pathname,i.search=a.search,i.hash=a.hash,s&&i.searchParams.set("__agent_tower_preview_token",s),i.toString()}catch{}const n=e.endsWith("/")?e:`${e}/`,r=t.startsWith("/")?t.slice(1):t;return`${n}${r}`}function oy(e,t,n){const r=e.trim();if(!r)return null;if(r.startsWith("/"))return n?{kind:"proxy",url:hu(n,r)}:null;const i=_i(r);if(!i)return $n(r,null);if(!t||!n)return $n(r,i);const s=_i(t);if(!s||!l3(i,s))return $n(r,i);const a=wc(s.pathname);if(!c3(i.pathname,a))return $n(r,i);const u=i.pathname.slice(a.length)||"/";return{kind:"proxy",url:hu(n,`${u}${i.search}${i.hash}`)}}function ly(e,t,n,r){if(!e||!t)return null;try{const i=new URL(e),s=new URL(t,r),a=new URL(n,r),u=s.pathname==="/"?"":s.pathname.endsWith("/")?s.pathname.slice(0,-1):s.pathname;if(a.origin!==s.origin||u&&a.pathname!==u&&!a.pathname.startsWith(`${u}/`))return a.toString();const o=a.pathname.slice(u.length)||"/",c=wc(i.pathname);return i.pathname=`${c}${o}`.replace(/\/{2,}/g,"/")||"/",i.search=a.search,i.hash=a.hash,i.toString()}catch{return null}}function d3(e){const t=_i(e);return!!(t&&Ic.has(t.hostname.toLowerCase()))}const Lc=({src:e,alt:t,className:n,node:r,...i})=>p.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"inline-block",children:p.jsx("img",{src:e,alt:t,...i,className:kn("max-w-[300px] max-h-[200px] object-contain rounded-lg border border-border cursor-pointer hover:opacity-90 active:opacity-90 transition-opacity",n)})}),h3=({href:e="",children:t,node:n,onClick:r,className:i,...s})=>{const{t:a}=Xe(),{workingDir:u,onOpenWorkspaceFile:o,onOpenPreviewUrl:c,onOpenVisualization:d,downloadSessionId:h}=s,f=a3(e),m=_c(e,u),b={...s};delete b.workingDir,delete b.onOpenWorkspaceFile,delete b.onOpenPreviewUrl,delete b.onOpenVisualization,delete b.downloadSessionId;const k=ys(i),S=ys("inline-flex max-w-full items-center gap-1.5 align-middle font-medium");if(f?.type==="codex-inline-visualization")return d?p.jsxs("button",{type:"button",onClick:()=>d(f.file),title:a("Open visualization"),className:S,children:[p.jsx(Ld,{className:"size-4 shrink-0","aria-hidden":!0}),p.jsx("span",{className:"truncate",children:f.file})]}):p.jsx("code",{title:f.file,children:f.file});if(f?.type==="agent-download")return h?p.jsxs("a",{href:u3(h,f.file),download:f.file.split("/").at(-1),title:a("Download file"),className:S,children:[p.jsx(gd,{className:"size-4 shrink-0","aria-hidden":!0}),p.jsx("span",{className:"truncate",children:f.file.split("/").at(-1)})]}):p.jsx("code",{title:f.file,children:f.file});if(c&&d3(e)){const L=I=>{r?.(I),!I.defaultPrevented&&(I.preventDefault(),c(e))};return p.jsx("a",{href:e,onClick:L,className:k,...b,children:t})}if(m.type==="workspace-file"&&o){const L=I=>{r?.(I),!I.defaultPrevented&&(I.preventDefault(),o(m.path,m.line,m.column))};return p.jsx("a",{href:e,onClick:L,className:k,...b,children:t})}if(m.type==="unknown-local"||m.type==="workspace-file"){const L=m.path;return p.jsx("code",{title:L,children:t})}const _=m.url;return p.jsx("a",{href:_,onClick:r,className:k,...b,children:t})},f3=({children:e,className:t,node:n,...r})=>p.jsx("li",{className:kn("py-0 pl-0 [&>p]:inline",t),...r,children:e}),m3={img:Lc,li:f3};function p3({workingDir:e,onOpenWorkspaceFile:t,onOpenPreviewUrl:n,onOpenVisualization:r,downloadSessionId:i}){return{...m3,a:s=>p.jsx(h3,{...s,workingDir:e,onOpenWorkspaceFile:t,onOpenPreviewUrl:n,onOpenVisualization:r,downloadSessionId:i}),img:s=>{const a=_c(s.src??"",e),u=a.type==="workspace-file"&&e?e3(e,a.path):a.type==="attachment"?a.url:a.type==="unknown-local"?t3(a.path):s.src;return p.jsx(Lc,{...s,src:u})}}}const g3={mermaid:{download:!0,copy:!0,fullscreen:!0,panZoom:!0}},b3=/(^|\n)(```|~~~)[^\S\r\n]*mermaid(?:[\s\r\n]|$)/i;let Ci=null;function E3(e){return b3.test(e)}function T3(){return Ci??=Ii(async()=>{const{mermaid:e}=await import("./index-CrKx8Yaz.js").then(t=>t.bm);return{mermaid:e}},__vite__mapDeps([13,1,2])).then(({mermaid:e})=>({mermaid:e})),Ci}function x3(e){const t=E3(e),[n,r]=y.useState();return y.useEffect(()=>{if(!t){r(void 0);return}let i=!0;return T3().then(s=>{i&&r(s)}).catch(()=>{Ci=null,i&&r(void 0)}),()=>{i=!1}},[t]),t?n:void 0}function Rc(e){if(e.tool?.status)return e.tool.status;if(e.title?.endsWith("✓"))return"success";if(e.title?.endsWith("✗"))return"failed";if(e.title?.includes("待审批"))return"pending_approval"}function k3(e){return Rc(e)==="success"}function y3(e){const t=Rc(e);return t==="failed"||t==="timed_out"}function Lr(e){return e.title==="Thinking"||e.content.startsWith("Thinking:")}function A3(e){return e.type===se.Tool&&!!e.children?.length}function _3(e){return e.type!==se.Cursor&&!e.children?.length&&e.content.trim()===""}function ds(e){return!!e.tokenUsage||_3(e)}function C3(e){const t=e.tool?.status;return t==="pending_approval"||t==="denied"}function S3(e){return e.type===se.Cursor||e.type===se.User||e.type===se.Assistant||e.type===se.Error||e.type===se.Warning?!0:e.type===se.Info&&e.tokenUsage?!1:C3(e)}function fu(e){return Lr(e)?!0:A3(e)||e.type!==se.Tool&&e.type!==se.Action?!1:!S3(e)}function hs(e){return!Lr(e)&&(e.type===se.Tool||e.type===se.Action)}function Qn(e){const t=e.filter(i=>!ds(i)),n=[];let r=0;for(;r<t.length;){const i=t[r];if(fu(i)){const s=[i];let a=r+1;for(;a<t.length;){const u=t[a];if(fu(u))s.push(u),a++;else break}s.some(hs)?n.push({kind:"execution-group",logs:s,key:s[0].id}):s.forEach(u=>n.push({kind:"single",log:u,key:u.id})),r=a}else n.push({kind:"single",log:i,key:i.id}),r++}return n}function N3(e){const t=[];let n,r=[];const i=()=>{!n&&r.length===0||t.push({key:n?`turn-${n.id}`:`turn-${r[0]?.id??t.length}`,user:n,agentLogs:r})};for(const s of e)s.type===se.User?(i(),n=s,r=[]):r.push(s);return i(),t}function I3(e){let t=-1;for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(r.content.trim()){if(r.type===se.Assistant)return n;t===-1&&r.type===se.Error&&(t=n)}}return t}function w3(e,t){if(!Number.isFinite(e)||!Number.isFinite(t))return null;const n=Math.max(0,t-e),r=n===0?0:Math.max(1,Math.round(n/1e3)),i=Math.floor(r/3600),s=Math.floor(r%3600/60),a=r%60;return i>0?`${i}h${s>0?` ${s}m`:""}`:s>0?`${s}m${a>0?` ${a}s`:""}`:`${a}s`}function L3(e){const t=e.agentLogs.reduce((i,s)=>Number.isFinite(s.cursorActivity?.processingStartedAt)?s.cursorActivity?.processingStartedAt:i,void 0),n=e.user?.timestamp??t??e.agentLogs.find(i=>Number.isFinite(i.timestamp))?.timestamp,r=e.agentLogs.reduce((i,s)=>Number.isFinite(s.timestamp)?i===void 0?s.timestamp:Math.max(i,s.timestamp):i,void 0);return{startedAt:n,latestLogAt:r}}function R3(e,t,n,r){const i=t&&n===!0,s=L3(e),a=i?null:t?r??s.latestLogAt??null:s.latestLogAt??null,u={start:s.startedAt,end:a};if(i)return{key:e.key,user:e.user??null,running:!0,duration:u,showSummary:!0,summaryCollapsible:!1,inlineItems:Qn(e.agentLogs),processedItems:[],finalItems:[]};if(e.agentLogs.length===0)return{key:e.key,user:e.user??null,running:!1,duration:u,showSummary:!1,summaryCollapsible:!1,inlineItems:[],processedItems:[],finalItems:[]};const o=I3(e.agentLogs),c=o>=0?e.agentLogs.slice(0,o):e.agentLogs,d=o>=0?e.agentLogs.slice(o):[],h=c.some(f=>!ds(f));return{key:e.key,user:e.user??null,running:!1,duration:u,showSummary:!0,summaryCollapsible:h,inlineItems:[],processedItems:h?Qn(c):[],finalItems:Qn(d)}}function Jr(e){return`item:${e.key}`}function O3(e,t){const n=[];for(const r of e){if(r.user&&n.push({kind:"user",key:`user:${r.user.id}`,log:r.user}),r.showSummary&&n.push({kind:"summary",key:`summary:${r.key}`,turnKey:r.key,duration:r.duration,collapsible:r.summaryCollapsible}),r.running){for(const i of r.inlineItems)n.push({kind:"item",key:Jr(i),item:i,processed:!1});continue}if(t.has(r.key))for(const i of r.processedItems)n.push({kind:"item",key:Jr(i),item:i,processed:!0});for(const i of r.finalItems)n.push({kind:"item",key:Jr(i),item:i,processed:!1})}return n}function D3(e){if(!e)return 40;switch(e.kind){case"user":return 72;case"summary":return 44;default:return 32}}function P3(e){let t=e?.parentElement??null;for(;t;){const n=window.getComputedStyle(t).overflowY;if(n==="auto"||n==="scroll")return t;t=t.parentElement}return null}const lr=y.memo(({content:e,className:t,workingDir:n,onOpenWorkspaceFile:r,onOpenPreviewUrl:i,onOpenVisualization:s,downloadSessionId:a})=>{const u=y.useMemo(()=>s||a?s3(e):e,[e,a,s]),o=x3(u),c=y.useMemo(()=>p3({workingDir:n,onOpenWorkspaceFile:r,onOpenPreviewUrl:i,onOpenVisualization:s,downloadSessionId:a}),[a,i,s,r,n]);return p.jsx(kc,{className:kn("session-log-message-markdown",t),components:c,plugins:o,controls:o?g3:void 0,children:u})});lr.displayName="MarkdownMessage";function v3({id:e}){const{data:t}=xu({queryKey:["message-delivery",e],queryFn:()=>vt.get(`/message-deliveries/${encodeURIComponent(e)}`),staleTime:1/0});return t?p.jsx(Ru,{delivery:t}):null}const Oc=y.createContext(new Map),fs=y.memo(({content:e,deliveryId:t,compact:n,workingDir:r,onOpenWorkspaceFile:i,onOpenPreviewUrl:s})=>{const a=y.useContext(Oc).get(t??"");return p.jsx("div",{className:n?"flex justify-end mb-4 mt-2":"flex justify-end mb-8 mt-4",children:p.jsxs("div",{className:"flex max-w-[85%] min-w-0 flex-col items-end",children:[p.jsxs("div",{className:`relative bg-foreground/[0.08] text-foreground rounded-2xl rounded-tr-sm max-w-full min-w-0 leading-relaxed ${n?"px-3.5 py-2.5 text-[13px]":"px-5 py-3.5 text-sm"}`,children:[p.jsx(lr,{content:e,workingDir:r,onOpenWorkspaceFile:i,onOpenPreviewUrl:s}),a&&p.jsx(Zd,{delivery:a})]}),t&&p.jsx("div",{className:"mt-1 max-w-full px-0.5","data-message-feedback":!0,children:a?p.jsx(Ru,{delivery:a}):p.jsx(v3,{id:t})})]})})});fs.displayName="UserMessage";const ms=y.memo(({content:e,isOpenDefault:t=!0})=>{const[n,r]=y.useState(t),i=y.useRef(null),[s,a]=y.useState(0);y.useEffect(()=>{i.current&&a(i.current.scrollHeight)},[e,n]);const u=y.useMemo(()=>{const c=e.replace(/^Thinking:\s*/i,"").trim().split(`
|
|
121
|
+
`)[0]||"";return c.length>80?c.slice(0,80)+"…":c},[e]);return p.jsxs("div",{className:"my-1.5",children:[p.jsxs("button",{onClick:()=>r(!n),className:"group flex items-center gap-1.5 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors select-none w-full text-left",children:[p.jsx("span",{className:"shrink-0 w-3.5 h-3.5 flex items-center justify-center transition-transform duration-200",style:{transform:n?"rotate(90deg)":"rotate(0deg)"},children:p.jsx(An,{size:11,strokeWidth:2})}),p.jsx("span",{className:"font-medium",children:"Thinking"}),!n&&u&&p.jsx("span",{className:"truncate text-muted-foreground ml-1 font-normal",children:u})]}),p.jsx("div",{className:"overflow-hidden relative",style:{maxHeight:n?s+16:0},children:p.jsx("div",{ref:i,className:"pl-5 pt-1 pb-2 before:absolute before:left-[7px] before:top-1 before:bottom-2 before:w-px before:bg-border/60",children:p.jsx("div",{className:"text-xs text-muted-foreground leading-relaxed whitespace-pre-wrap min-w-0",children:e.replace(/^Thinking:\s*/i,"").trim()})})})]})});ms.displayName="ThinkingBlock";function Dc(e,t=140){return(e.split(`
|
|
122
|
+
`)[0]||"").slice(0,t)}function Pc(e){const t=e.title?.replace(/\s*[✓✗]$/,"").replace(/\s*\(待审批\)$/,"");return e.tool?.kind?e.tool.name||t||"Tool":Dc(e.content,140)||e.tool?.name||t||"Tool"}const M3=new Set(["bash","shell","read","write","edit","glob","grep"]);function B3(e){const t=Pc(e),n=e.tool?.name?.trim().toLowerCase();if(!n||!M3.has(n))return t;const r=e.content.match(/(?:^|\n)Input\n([\s\S]*?)(?:\n\nContent\n|$)/i)?.[1]?.trim();if(r)try{const i=JSON.parse(r);if(typeof i.command=="string"){const s=i.command.split(/\s*(?:&&|\|\||;)\s*/)[0]?.trim();if(s)return s.length>72?`${s.slice(0,72)}…`:s}if(typeof i.file_path=="string")return i.file_path.split("/").pop()||i.file_path;if(typeof i.pattern=="string")return i.pattern}catch{}return t}function F3(e){const t=e.flatMap(n=>{if(Lr(n)){const r=Dc(n.content.replace(/^Thinking:\s*/i,"").trim(),72);return r?[r]:[]}return hs(n)?[B3(n)]:[]});return t.filter((n,r)=>r===0||n!==t[r-1])}const Si=y.memo(({title:e,content:t,type:n})=>{const[r,i]=y.useState(!1);if(n===se.Action)return p.jsxs("div",{className:"flex items-center gap-1.5 py-0.5 text-xs text-muted-foreground",children:[p.jsx("span",{className:"shrink-0 w-1 h-1 rounded-full bg-muted-foreground/40"}),p.jsx("span",{children:t})]});const a=e.endsWith("✓"),u=e.endsWith("✗"),o=u?"text-destructive":a?"text-success":"text-muted-foreground/70",c=t?.split(`
|
|
123
|
+
`)[0]||"",d=c!==e?c:"";return p.jsxs("div",{className:"my-2",children:[p.jsxs("button",{onClick:()=>i(!r),className:"group flex items-center gap-1.5 py-1 text-xs w-full text-left transition-colors",children:[p.jsx("span",{className:`shrink-0 w-3.5 h-3.5 flex items-center justify-center ${o}`,children:u?p.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:p.jsx("path",{d:"M2 2l6 6M8 2l-6 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}):a?p.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:p.jsx("path",{d:"M2 5.5l2 2 4-4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}):p.jsx("span",{className:"w-1 h-1 rounded-full bg-muted-foreground/40"})}),p.jsx("span",{className:"font-medium text-muted-foreground shrink-0",children:e.replace(/\s*[✓✗]$/,"")}),d&&p.jsx("span",{className:"truncate text-muted-foreground font-mono",children:d}),t&&p.jsx("span",{className:"ml-auto shrink-0 opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground/70",children:r?p.jsx(Nu,{size:10}):p.jsx(An,{size:10})})]}),r&&t&&p.jsx("div",{className:"ml-5 mt-0.5 mb-1.5 rounded-md bg-muted/50 border border-border/60 overflow-x-auto",children:p.jsx("code",{className:"block p-2.5 text-xs font-mono text-muted-foreground leading-relaxed whitespace-pre-wrap break-all",children:t})})]})});Si.displayName="ToolBlock";const vc=y.memo(({count:e})=>{const[t,n]=y.useState(()=>({current:e,previous:null}));return t.current!==e&&n({current:e,previous:t.current}),p.jsxs("span",{className:"agent-tool-count inline-flex items-center justify-center px-1.5 rounded-full bg-muted text-muted-foreground text-[10px] font-medium leading-none tabular-nums",children:[p.jsxs("span",{className:"agent-tool-count__window",style:{width:`${String(e).length}ch`},"aria-hidden":"true",children:[t.previous!==null&&p.jsx("span",{className:"agent-tool-count__value agent-tool-count__value--out whitespace-nowrap min-w-max",onAnimationEnd:()=>n(r=>r.previous===null?r:{...r,previous:null}),children:t.previous},`out-${t.previous}`),p.jsx("span",{className:kn("agent-tool-count__value agent-tool-count__value--in whitespace-nowrap min-w-max",t.previous!==null&&"agent-tool-count__value--rolling"),children:t.current},`in-${t.current}`)]}),p.jsx("span",{className:"sr-only",children:e})]})});vc.displayName="ToolCountBadge";const Ni=y.memo(({logs:e,onBeforeToggle:t})=>{const{t:n}=Xe(),[r,i]=y.useState(!1),s=e.filter(hs),a=F3(e),u=s.length;return p.jsxs("div",{className:"my-2",children:[p.jsxs("button",{type:"button",onClick:()=>{t?.(),i(!r)},"aria-expanded":r,className:"group flex items-center gap-1.5 py-1 text-xs w-full text-left transition-colors",children:[p.jsx("span",{className:"shrink-0 w-3.5 h-3.5 flex items-center justify-center transition-transform duration-200",style:{transform:r?"rotate(90deg)":"rotate(0deg)"},children:p.jsx(An,{size:11,strokeWidth:2,className:"text-muted-foreground/70"})}),p.jsx("span",{className:"font-medium text-muted-foreground shrink-0",children:n("工具调用")}),p.jsx("span",{className:"shrink-0 inline-flex items-center gap-1",children:p.jsx(vc,{count:u})}),!r&&p.jsxs("span",{className:"truncate text-muted-foreground font-mono",children:[a.slice(-3).join(", "),a.length>3?" …":""]})]}),r&&p.jsx("div",{className:"ml-5 mt-0.5 mb-1.5",children:e.map(o=>Lr(o)?p.jsx(ms,{content:o.content,isOpenDefault:!1},o.id):p.jsx(Mc,{log:o,title:Pc(o),onBeforeToggle:t},o.id))})]})});Ni.displayName="ExecutionDetailsGroup";const Mc=y.memo(({log:e,title:t,onBeforeToggle:n})=>{const[r,i]=y.useState(!1),s=!!e.content.trim()&&e.content.trim()!==t.trim(),a=k3(e),u=y3(e)||e.type===se.Error;return p.jsxs("div",{children:[p.jsxs("button",{type:"button",onClick:()=>{s&&(n?.(),i(!r))},"aria-expanded":s?r:void 0,className:`group flex items-center gap-1.5 py-0.5 text-xs w-full text-left ${s?"cursor-pointer":"cursor-default"}`,children:[p.jsx("span",{className:"shrink-0 w-3.5 h-3.5 flex items-center justify-center",children:u?p.jsx("svg",{width:"8",height:"8",viewBox:"0 0 10 10",fill:"none",className:"text-destructive",children:p.jsx("path",{d:"M2 2l6 6M8 2l-6 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}):a?p.jsx("svg",{width:"8",height:"8",viewBox:"0 0 10 10",fill:"none",className:"text-success",children:p.jsx("path",{d:"M2 5.5l2 2 4-4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}):p.jsx("span",{className:"w-1 h-1 rounded-full bg-muted-foreground/40"})}),p.jsx("span",{className:"truncate text-muted-foreground font-mono",children:t}),s&&p.jsx("span",{className:"ml-auto shrink-0 opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground/70",children:r?p.jsx(Nu,{size:10}):p.jsx(An,{size:10})})]}),r&&s&&p.jsx("div",{className:"ml-5 mt-0.5 mb-1 rounded-md bg-muted/50 border border-border/60 overflow-x-auto",children:p.jsx("code",{className:"block p-2.5 text-xs font-mono text-muted-foreground leading-relaxed whitespace-pre-wrap break-all",children:e.content})})]})});Mc.displayName="ToolGroupItem";const Bc=y.memo(({content:e,compact:t})=>p.jsx("div",{className:`text-foreground whitespace-pre-wrap min-w-0 ${t?"text-[13px] leading-5":"text-sm leading-6"}`,children:e}));Bc.displayName="AgentText";const Fc=y.createContext(null),Hc=y.memo(({log:e,compact:t,workingDir:n,onOpenWorkspaceFile:r,onOpenPreviewUrl:i,onOpenVisualization:s,downloadSessionId:a})=>{const u=y.useContext(Fc),o=u?Hd(u.sessionId,e,u.overlays):void 0,c=o?.overlays.filter(f=>f.state!=="NOT_REQUIRED")??[],d=o?.content??e.content,h={workingDir:n,onOpenWorkspaceFile:r,onOpenPreviewUrl:i,onOpenVisualization:s,downloadSessionId:a};return p.jsxs("div",{className:`relative text-foreground min-w-0 ${c.length?"pr-8":""} ${t?"text-[13px] leading-5":"text-sm leading-6"}`,children:[p.jsx(Gd,{claim:u?.claimReveal,version:o?.version??null,children:p.jsx(lr,{className:"space-y-2",content:d,...h})}),c.length>0&&p.jsx("div",{className:"absolute bottom-0 right-0",children:p.jsxs(Lu,{original:e.content,children:[p.jsx(lr,{content:e.content,...h}),c.map(f=>p.jsx(Kd,{overlay:f,enabled:u?.enabled??!1},f.sourceId))]},`${e.id}:${e.textBlock?.sourceRevision}`)})]})});Hc.displayName="AssistantMessage";const Uc=y.memo(({content:e})=>p.jsx(_u,{tone:"danger",className:"my-2",children:p.jsx("pre",{className:"text-xs leading-relaxed whitespace-pre-wrap break-all min-w-0",children:e})}));Uc.displayName="ErrorMessage";const jc=y.memo(({content:e})=>p.jsx(_u,{tone:"warning",className:"my-2",children:p.jsx("pre",{className:"text-xs leading-relaxed whitespace-pre-wrap break-all min-w-0",children:e})}));jc.displayName="WarningMessage";function mu(e,t){const n=Math.max(0,Math.floor(e/1e3));if(n<60)return t("{count} 秒",{count:n});const r=Math.floor(n/60),i=n%60;if(r<60)return t("{minutes} 分 {seconds} 秒",{minutes:r,seconds:i});const s=Math.floor(r/60),a=r%60;return t("{hours} 小时 {minutes} 分",{hours:s,minutes:a})}const zc=y.memo(({activity:e})=>{const{t}=Xe(),[n]=y.useState(()=>Date.now()),[r,i]=y.useState(n),s=e?.processingStartedAt??n;y.useEffect(()=>{const c=window.setInterval(()=>i(Date.now()),1e3);return()=>window.clearInterval(c)},[]);const a=mu(r-s,t),u=e?.lastOutputAt==null?null:mu(r-e.lastOutputAt,t),o=t("正在思考");return p.jsx(Gk,{align:"start",content:p.jsxs("div",{className:"flex min-w-max flex-col gap-0.5",children:[p.jsx("span",{children:t("已处理 {duration}",{duration:a})}),p.jsx("span",{className:"text-inverse-muted",children:u?t("最后一次输出于 {duration}前",{duration:u}):t("等待首次输出")})]}),children:p.jsx("span",{tabIndex:0,"aria-label":o,className:"inline-flex cursor-help select-none py-1 text-sm font-normal outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:p.jsx("span",{className:"agent-thinking-shimmer","aria-hidden":"true",children:Array.from(o).map((c,d)=>p.jsx("span",{className:"agent-thinking-char",style:{animationDelay:`${d*45}ms`},children:c},`${c}-${d}`))})})})});zc.displayName="ThinkingIndicator";const $c=y.memo(({turnKey:e,duration:t,collapsible:n,isOpen:r,onToggle:i,onBeforeToggle:s})=>{const{t:a}=Xe(),u=t?a("已处理 {duration}",{duration:t}):a("已处理"),o=p.jsxs(p.Fragment,{children:[p.jsx("span",{children:u}),n&&p.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center transition-transform duration-200 motion-reduce:transition-none",style:{transform:r?"rotate(90deg)":"rotate(0deg)"},children:p.jsx(An,{size:14,strokeWidth:2})})]});return n?p.jsx("div",{className:"mb-3 mt-1",children:p.jsx("button",{type:"button","data-at-group-header":e,"aria-expanded":r,onClick:()=>{s?.(),i(e)},className:"group flex w-full items-center gap-1.5 border-b border-border/60 py-2 text-left text-sm leading-6 text-muted-foreground transition-colors hover:text-foreground/80",children:o})}):p.jsx("div",{className:"mb-3 mt-1",children:p.jsx("div",{role:"status",className:"flex w-full items-center gap-1.5 border-b border-border/60 py-2 text-sm leading-6 text-muted-foreground",children:o})})});$c.displayName="ProcessedGroupSummary";function H3(e,t,n,r,i,s,a,u){if(e.kind==="execution-group")return p.jsx(Ni,{logs:e.logs,onBeforeToggle:u});const o=e.log;if(o.type===se.Tool&&o.children?.length)return p.jsx(Ni,{logs:o.children,onBeforeToggle:u});if(ds(o))return null;if(o.title==="Thinking"||o.content.startsWith("Thinking:"))return p.jsx(ms,{content:o.content,isOpenDefault:!0});switch(o.type){case se.User:return p.jsx(fs,{content:o.content,deliveryId:o.deliveryId,compact:t,workingDir:n,onOpenWorkspaceFile:r,onOpenPreviewUrl:i});case se.Tool:return p.jsx(Si,{type:o.type,title:o.title||"Tool",content:o.content});case se.Action:return p.jsx(Si,{type:o.type,title:"Action",content:o.content});case se.Assistant:return p.jsx(Hc,{log:o,compact:t,workingDir:n,onOpenWorkspaceFile:r,onOpenPreviewUrl:i,onOpenVisualization:s,downloadSessionId:a});case se.Info:return o.tokenUsage?null:p.jsx(Bc,{content:o.content,compact:t});case se.Error:return p.jsx(Uc,{content:o.content});case se.Warning:return p.jsx(jc,{content:o.content});case se.Cursor:return p.jsx(zc,{activity:o.cursorActivity});default:return null}}const U3=8,j3=y.forwardRef(function(t,n){const r=zd(t.sessionId,t.logs),i=Su(),s=y.useMemo(()=>t.logs.flatMap(k=>k.textBlock?ku(k.content,k.textBlock).map(S=>({id:JSON.stringify([S.turnId,S.blockId]),revision:S.sourceRevision,streaming:k.textBlock.state==="OPEN"})):[]),[t.logs]),a=y.useMemo(()=>Fd(r.overlays),[r.overlays]),u=Yd(t.sessionId,s,r.overlays.map(k=>({id:JSON.stringify([k.turnId,k.blockId]),version:`${k.sourceId}:${k.sourceRevision}`,state:k.state})),t.logs.some(k=>k.type!==se.Cursor)),o=y.useMemo(()=>({sessionId:t.sessionId,overlays:a,claimReveal:u,enabled:!i.isError&&i.data?.enabled===!0}),[t.sessionId,i.data?.enabled,i.isError,a,u]),c=Cs(t.sessionId),d=Cs(t.sessionId,"sent"),h=y.useMemo(()=>new Map([...c.data?.pages.flatMap(k=>k.items)??[],...d.data?.pages.flatMap(k=>k.items)??[]].sort((k,S)=>k.revision-S.revision).map(k=>[k.id,k])),[c.data,d.data]),f=y.useMemo(()=>[...h.values()].map(k=>k.clientSubmissionId),[h]),m=xd(t.sessionId,f),b=y.useMemo(()=>vd(t.logs,[...h.values()]),[t.logs,h]);return p.jsx(Fc.Provider,{value:o,children:p.jsxs(Oc.Provider,{value:h,children:[p.jsx(Yc,{...t,logs:b,ref:n}),m.filter(k=>![...h.values()].some(S=>S.clientSubmissionId===k.id)).map(k=>p.jsx(Md,{item:k},k.id)),c.hasNextPage&&p.jsx("button",{type:"button",className:"text-xs underline",onClick:()=>{c.fetchNextPage()},children:"Load more"})]})})}),cy=y.forwardRef(function(t,n){return t.sessionId?p.jsx(j3,{...t,sessionId:t.sessionId,ref:n},t.sessionId):p.jsx(Yc,{...t,ref:n})}),Yc=y.forwardRef(function({logs:t,isOutputActive:n,lastExitAt:r,onUserToggleDetails:i,scrollElementRef:s,workingDir:a,onOpenWorkspaceFile:u,onOpenPreviewUrl:o,onOpenVisualization:c,downloadSessionId:d},h){const[f,m]=y.useState(null),[b,k]=y.useState(!1),[S,_]=y.useState(0),[L,I]=y.useState(()=>new Set),[B,z]=y.useState(()=>Date.now());y.useEffect(()=>{if(!n)return;const F=()=>z(Date.now()),W=window.setTimeout(F,0),ue=window.setInterval(F,1e3);return()=>{window.clearTimeout(W),window.clearInterval(ue)}},[n]);const R=y.useCallback(F=>{if(!F)return;const W=s?.current??P3(F);m(ue=>ue===W?ue:W),_(W?.clientHeight??0),k(!0)},[s]);y.useEffect(()=>{if(!f)return;const F=()=>_(f.clientHeight);if(F(),typeof ResizeObserver>"u")return;const W=new ResizeObserver(F);return W.observe(f),()=>W.disconnect()},[f]);const $=y.useCallback(F=>{I(W=>{const ue=new Set(W);return ue.has(F)?ue.delete(F):ue.add(F),ue})},[]),G=y.useMemo(()=>{if(n===void 0)return null;const F=N3(t),W=F.length-1;return F.map((ue,re)=>R3(ue,re===W,n,r))},[t,n,r]),K=y.useMemo(()=>n===void 0?Qn(t):null,[n,t]),N=y.useMemo(()=>K?K.map(F=>({kind:"item",key:`legacy:${F.key}`,item:F,processed:!1})):O3(G??[],L),[L,K,G]),U=ch({count:N.length,getScrollElement:()=>f,estimateSize:F=>D3(N[F]),getItemKey:F=>N[F]?.key??F,overscan:U3,measureElement:F=>F.getBoundingClientRect().height});U.shouldAdjustScrollPositionOnItemSizeChange=dh;const v=f!==null&&S>0;y.useImperativeHandle(h,()=>({scrollToBottom:(F="instant")=>{const W=s?.current;if(!W||(v&&N.length>0&&U.scrollToIndex(N.length-1,{align:"end"}),W.scrollTo({top:W.scrollHeight,behavior:F}),F!=="instant"))return;let ue=0;const re=()=>{const x=s?.current;x&&(x.scrollHeight-x.scrollTop-x.clientHeight<=1||(x.scrollTop=x.scrollHeight,++ue<5&&requestAnimationFrame(re)))};requestAnimationFrame(re)}}),[v,N.length,s,U]);const V=y.useCallback(F=>{const W=F.end===null?B:F.end;return w3(F.start,W)},[B]),Y=y.useCallback(F=>{switch(F.kind){case"user":return p.jsx(fs,{content:F.log.content,deliveryId:F.log.deliveryId,workingDir:a,onOpenWorkspaceFile:u,onOpenPreviewUrl:o});case"summary":return p.jsx($c,{turnKey:F.turnKey,duration:V(F.duration),collapsible:F.collapsible,isOpen:L.has(F.turnKey),onToggle:$,onBeforeToggle:i});case"item":return H3(F.item,!1,a,u,o,c,d,i);default:return null}},[d,V,L,o,c,u,i,$,a]),j=U.getVirtualItems();return b?p.jsx("div",{ref:R,className:"w-full mx-auto pb-4 min-w-0",style:{overflowWrap:"anywhere"},children:v?p.jsx("div",{style:{height:U.getTotalSize(),width:"100%",position:"relative"},children:j.map(F=>{const W=N[F.index];return W?p.jsx("div",{"data-index":F.index,"data-at-row":W.key,...W.kind==="item"&&W.processed?{"data-processed-content":""}:{},ref:U.measureElement,style:{position:"absolute",top:F.start,left:0,width:"100%"},children:Y(W)},W.key):null})},"virtualized"):p.jsx("div",{children:N.map(F=>p.jsx("div",{"data-at-row":F.key,...F.kind==="item"&&F.processed?{"data-processed-content":""}:{},children:Y(F)},F.key))},"static")}):p.jsx("div",{ref:R,className:"w-full mx-auto pb-4 min-w-0",style:{overflowWrap:"anywhere"}})}),z3=/^(0|[1-9]\d*)$/,$3=2147483647;function Y3(e,t){if(!Array.isArray(t))return Fe("patch sequence must be an array");let n=e;for(const r of t){const i=q3(n,r);if(!i.ok)return i;n=i.conversation}return{ok:!0,conversation:n}}function q3(e,t){if(!dr(t))return Fe("operation is not an object");const n=G3(t.path);return n?t.op==="add"?V3(e,n,t):t.op==="replace"?W3(e,n,t):$e(t):$e(t)}function V3(e,t,n){if(n.value===void 0)return Fe("operation value is required");if(hr(n.value))return Fe("operation value cannot contain undefined");if(t.length===1&&t[0]==="sessionId")return Ot({...e,sessionId:n.value});if(t[0]!=="entries"||t.length!==2)return $e(n);const r=qc(t[1]);if(r===void 0)return $e(n);if(!Array.isArray(e.entries))return Fe("entries is not an array");if(r>e.entries.length)return $e(n);const i=e.entries.slice();return i.splice(r,0,n.value),Ot(cr(e,i))}function W3(e,t,n){if(n.value===void 0)return Fe("operation value is required");if(hr(n.value))return Fe("operation value cannot contain undefined");if(t.length===1&&t[0]==="entries"){const d=n.value,h=Array.isArray(d)?d.slice():d;return Ot(cr(e,h))}if(t[0]!=="entries")return $e(n);const r=qc(t[1]);if(r===void 0)return $e(n);if(!Array.isArray(e.entries))return Fe("entries is not an array");const i=t.length===2,s=t.length===3&&t[2]==="content",a=t.length===4&&t[2]==="metadata"&&t[3]==="status";if(!i&&!s&&!a)return $e(n);if(i){if(r>=e.entries.length)return $e(n);const d=e.entries.slice();return d[r]=n.value,Ot(cr(e,d))}const u=e.entries[r];if(!dr(u))return Fe("entry does not exist");if(s)return u.content===void 0?Fe("entry content does not exist"):Ot(pu(e,r,{...u,content:n.value}));const o=u.metadata;if(!dr(o)||o.status===void 0)return Fe("entry metadata status does not exist");const c={...o,status:n.value};return Ot(pu(e,r,{...u,metadata:c}))}function pu(e,t,n){const r=e.entries.slice();return r[t]=n,cr(e,r)}function cr(e,t){return{...e,entries:t}}function G3(e){if(!(typeof e!="string"||!e.startsWith("/")))return e.slice(1).split("/")}function qc(e){if(!z3.test(e))return;const t=Number(e);if(Number.isSafeInteger(t))return t<=$3?t:void 0}function dr(e){return typeof e=="object"&&e!==null}function hr(e){return e===void 0?!0:Array.isArray(e)?e.some(hr):dr(e)?Object.keys(e).some(t=>hr(e[t])):!1}function Ot(e){return{ok:!0,conversation:e}}function Fe(e){return{ok:!1,kind:"failed",reason:e}}function $e(e){return console.warn("[sessionLogStore] unsupported conversation patch op/path",{op:e.op,path:e.path}),{ok:!1,kind:"unsupported",reason:`unsupported op/path: ${String(e.op)} ${String(e.path)}`}}const dy={entries:[],isTruncated:!1},Q3=50,gu=500;function bu(e){return typeof e?.seq=="number"?e.seq:0}function Eu(e){return e?.entries.at(-1)?.id}function Tu(e){const t=e?.entries.at(-1);if(t)return JSON.stringify(t)}function hy(e){return{...e,entries:Array.isArray(e.entries)?e.entries:[],isTruncated:!1}}function fy(e,t){if(!e||e.isTruncated)return!0;const n=bu(e),r=bu(t);if(r>n)return!0;if(r<n)return!1;if(t.entries.length>e.entries.length)return!0;if(t.entries.length<e.entries.length)return!1;const i=Eu(e),s=Eu(t);if(s&&i&&s!==i)return!0;const a=Tu(e),u=Tu(t);return!!(u&&a&&u!==a)}function K3(e,t){for(;t.length>Q3;){const n=t[0];t=t.slice(1);const{[n]:r,...i}=e;e=i}return{conversations:e,accessOrder:t}}const my=bd((e,t)=>({conversations:{},accessOrder:[],setConversation:(n,r)=>{e(i=>{const s=i.accessOrder.filter(u=>u!==n);s.push(n);const a={...i.conversations,[n]:{...r,isTruncated:r.isTruncated??!1}};return K3(a,s)})},applyPatch:(n,r,i)=>{const s=t().conversations[n];if(!s)return!1;if(typeof i=="number"&&typeof s.seq=="number"&&i<=s.seq)return!0;const a=Y3(s,r);if(!a.ok)return a.kind==="failed"&&console.error("[sessionLogStore] applyPatch failed:",a.reason),!1;const u={...a.conversation,seq:typeof i=="number"?i:s.seq,isTruncated:s.isTruncated??!1};return e(o=>({conversations:{...o.conversations,[n]:u}})),!0},touchAccess:n=>{e(r=>{const i=r.accessOrder.indexOf(n);if(i===-1||i===r.accessOrder.length-1)return r;const s=[...r.accessOrder];return s.splice(i,1),s.push(n),{accessOrder:s}})},truncateSession:n=>{e(r=>{const i=r.conversations[n];return!i||i.entries.length<=gu?r:{conversations:{...r.conversations,[n]:{...i,entries:i.entries.slice(-gu),isTruncated:!0}}}})},removeSession:n=>{e(r=>{const{[n]:i,...s}=r.conversations;return{conversations:s,accessOrder:r.accessOrder.filter(a=>a!==n)}})},getConversation:n=>t().conversations[n],clear:()=>{e({conversations:{},accessOrder:[]})}})),X3=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:yc},Symbol.toStringTag,{value:"Module"}));export{dy as E,nk as I,Pe as L,Zd as M,Md as O,kc as Q,Gk as T,ay as Z,cy as a,my as b,Y3 as c,Yn as d,fy as e,Cs as f,Q as g,Ru as h,ch as i,dh as j,Yd as k,Gd as l,Lu as m,hy as n,Xd as o,s3 as p,x3 as q,qd as r,m3 as s,p3 as t,Id as u,g3 as v,oy as w,hu as x,uy as y,ly as z};
|