lookatstudy-mobile 0.25.0 → 0.26.0
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/package.json +1 -1
- package/web/assets/{CanvasStage-CoofMkz2.js → CanvasStage-sR8T2IFn.js} +1 -1
- package/web/assets/{CommandPalette-CdwG7gxb.js → CommandPalette-xoHRtFTt.js} +1 -1
- package/web/assets/{CourseSearchPanel-5HfObta6.js → CourseSearchPanel-Blz5uOZo.js} +2 -2
- package/web/assets/{ExamView-ERfD2XYG.js → ExamView-DcD9-XhK.js} +1 -1
- package/web/assets/{ReviewPanel-KoEHhgh6.js → ReviewPanel-DPX_Gbvn.js} +1 -1
- package/web/assets/{SettingsView-Bp35Wqa-.js → SettingsView-DpSiGIUo.js} +3 -3
- package/web/assets/Tableau10-CvOaoHrI.js +1 -0
- package/web/assets/{VoicePanel-ByLmSH6U.js → VoicePanel-BFuMIduE.js} +1 -1
- package/web/assets/abnfDiagram-N423BO3Z-BRYm-LZF.js +1 -0
- package/web/assets/abnfDiagram-VCTEODGH-ODA7YWAP-B--kWzEh.js +1 -0
- package/web/assets/arc-DIdxrd7q.js +1 -0
- package/web/assets/architectureDiagram-5GKGNRK7-C4PU3XN7-DzOQ5fo_.js +36 -0
- package/web/assets/architectureDiagram-T3A2C74G-BhljJtMX.js +36 -0
- package/web/assets/{arrow-right-BycjrUFf.js → arrow-right-DtCWRkvj.js} +1 -1
- package/web/assets/{blockDiagram-NRAW4CY4-UMJ6PMQQ-SIAU2g89.js → blockDiagram-NRAW4CY4-UMJ6PMQQ-D3KXfJhJ.js} +2 -2
- package/web/assets/{blockDiagram-VBNYF7ZC-DHTnIGVD.js → blockDiagram-VBNYF7ZC-Dr7ZTeLw.js} +3 -3
- package/web/assets/{c4Diagram-5PPSVZJV-CZabrc9d.js → c4Diagram-5PPSVZJV-CPi9fgO4.js} +2 -2
- package/web/assets/{c4Diagram-UCG6FXSJ-75X3U2P3-3jemwAfq.js → c4Diagram-UCG6FXSJ-75X3U2P3-Bj0Dw0IT.js} +2 -2
- package/web/assets/channel-aqWuF1WT.js +1 -0
- package/web/assets/{chunk-2GRJ4B5K-B_JQfuWi.js → chunk-2GRJ4B5K-DeZ82qe7.js} +1 -1
- package/web/assets/{chunk-2Q5K7J3B-BrEHxvJs.js → chunk-2Q5K7J3B-B1WwbyzY.js} +1 -1
- package/web/assets/{chunk-5RXB4S5H-DZzYYxU5.js → chunk-5RXB4S5H-BX9ZzOwO.js} +1 -1
- package/web/assets/{chunk-5VM5RSS4-BHAK5GmL.js → chunk-5VM5RSS4-9-QvfnU2.js} +1 -1
- package/web/assets/{chunk-6Q2QTUOP-8we8GYlR.js → chunk-6Q2QTUOP-Dkt-zdDg.js} +1 -1
- package/web/assets/{chunk-7XDTSPCN-Dv5w1-4R.js → chunk-7XDTSPCN-DOxJ22Ws.js} +1 -1
- package/web/assets/{chunk-CTNIYPP6-Bz1XpNQR.js → chunk-CTNIYPP6-2D6eMEGx.js} +1 -1
- package/web/assets/{chunk-CXNFBKHE-9-huZ6cz.js → chunk-CXNFBKHE-BETxgCVr.js} +1 -1
- package/web/assets/{chunk-GF5L2VYU-CcDtyPoT.js → chunk-GF5L2VYU-JBwf_TWs.js} +1 -1
- package/web/assets/{chunk-ISA7TJRJ-DRuVfhcv.js → chunk-ISA7TJRJ-DGTMMKAm.js} +1 -1
- package/web/assets/{chunk-JWPE2WC7-BpAzG5a2.js → chunk-JWPE2WC7-B_A1as9r.js} +1 -1
- package/web/assets/{chunk-KBJHAD2P-Bhoc3gMB.js → chunk-KBJHAD2P-bmR9qwSi.js} +1 -1
- package/web/assets/{chunk-LV3HUYFY-F8phyCwz.js → chunk-LV3HUYFY-D8UFu3pb.js} +1 -1
- package/web/assets/{chunk-M3IUQBOH-CQgNEW7k.js → chunk-M3IUQBOH-r4ZZKIWR.js} +1 -1
- package/web/assets/{chunk-NDIOYS4C-TbmzspUp.js → chunk-NDIOYS4C-BuC155ii.js} +1 -1
- package/web/assets/{chunk-RE4WF27V-Corls46M.js → chunk-RE4WF27V-DJoYieaa.js} +1 -1
- package/web/assets/{chunk-RYQCIY6F-XjvAMB4v.js → chunk-RYQCIY6F-DNF6lO1-.js} +1 -1
- package/web/assets/{chunk-VII2H2IX-eKcEa4Y7.js → chunk-VII2H2IX-DBudi9Y-.js} +1 -1
- package/web/assets/{chunk-X5GNSKZ3-CicX0Ldl.js → chunk-X5GNSKZ3-Dzcgoim8.js} +1 -1
- package/web/assets/{chunk-XCWWM2C3-QlsNpse-.js → chunk-XCWWM2C3-3YSDgOL-.js} +1 -1
- package/web/assets/{chunk-XXDRQBXY-DvsPhfrL.js → chunk-XXDRQBXY-B5LLJm9i.js} +1 -1
- package/web/assets/classDiagram-DTDB5LWJ-LWRDKZ5K-DhFaZ76j.js +1 -0
- package/web/assets/classDiagram-JCYQIIEL-CNvSQ-RA.js +1 -0
- package/web/assets/classDiagram-v2-JRS7N3AN-2BZHGRP2-DhFaZ76j.js +1 -0
- package/web/assets/classDiagram-v2-OCEON4UE-CNvSQ-RA.js +1 -0
- package/web/assets/{core-DeLhdWdV.js → core-Cf-iwesp.js} +4 -4
- package/web/assets/cose-bilkent-JH36ORCC-DweZYTE6.js +1 -0
- package/web/assets/cose-bilkent-JH36ORCC-OB24KH3T-D3S0f4LW.js +1 -0
- package/web/assets/{cynefin-OW5HDTMX-GVF3BKWE-DTq1cJ6e.js → cynefin-OW5HDTMX-GVF3BKWE-DrtBkvjj.js} +1 -1
- package/web/assets/{cynefin-VYW2F7L2-BbPwBhzs.js → cynefin-VYW2F7L2-lYm8p8qp.js} +1 -1
- package/web/assets/cynefinDiagram-5FMLGOSQ-H3WIRU3N-CGurIKbY.js +62 -0
- package/web/assets/cynefinDiagram-MW4NZA55-EMZxCSzT.js +62 -0
- package/web/assets/{dagre-3AP2YEHR-DCERTXHT-DoiauN_q.js → dagre-3AP2YEHR-DCERTXHT-B3xLLC4U.js} +2 -2
- package/web/assets/{dagre-VZM6K2ZE-DEEN76Ty.js → dagre-VZM6K2ZE-lqYJ3WXC.js} +2 -2
- package/web/assets/{diagram-7IWD3JNH-CmERk2Sw.js → diagram-7IWD3JNH-DXSSf7q4.js} +2 -2
- package/web/assets/{diagram-B4RE2ZJO-CouO-Wd1.js → diagram-B4RE2ZJO-ak7sOZ19.js} +2 -2
- package/web/assets/diagram-LBJQPF4R-XmQxOAH-.js +24 -0
- package/web/assets/diagram-Q27KOJAE-D-yQEvjN.js +24 -0
- package/web/assets/{diagram-S7CK7UJ4-MULGZGEL-DC2_UGAu.js → diagram-S7CK7UJ4-MULGZGEL-D5WNGIG9.js} +2 -2
- package/web/assets/diagram-UB23O5K3-CRgze-MQ.js +41 -0
- package/web/assets/diagram-UQ7AKVKN-YQBY353J-CSvMx1Fm.js +41 -0
- package/web/assets/{diagram-VSXAHHWV-WLNH2ELY-DscZdreE.js → diagram-VSXAHHWV-WLNH2ELY-DMVZ0M5s.js} +2 -2
- package/web/assets/diagram-VX7I27RA-XW6YQV5G-NONTq7mV.js +24 -0
- package/web/assets/diagram-Z3DM3KII-HG7RF65D-D0VfGCJh.js +24 -0
- package/web/assets/ebnfDiagram-BXEA7PRR-D0k0RumW.js +1 -0
- package/web/assets/ebnfDiagram-PWID7BFC-OKY4VHYD-By7cMb-m.js +1 -0
- package/web/assets/{elk.bundled-BeLoT87a.js → elk.bundled-DCJrDGbL.js} +1 -1
- package/web/assets/{erDiagram-JOGREHBK-DqRalBaD.js → erDiagram-JOGREHBK-DxDlKHXu.js} +4 -4
- package/web/assets/{erDiagram-SSCWMZ5O-PIPKOIK7-Bx0VSyYd.js → erDiagram-SSCWMZ5O-PIPKOIK7-DwWrIKUB.js} +2 -2
- package/web/assets/{flowDiagram-A5DVABFB-2Z4AVO5R-Dcj5shOP.js → flowDiagram-A5DVABFB-2Z4AVO5R-eqJKcw9W.js} +1 -1
- package/web/assets/{flowDiagram-UKHOOZJN-DcJh3CAY.js → flowDiagram-UKHOOZJN-CC84JD3t.js} +1 -1
- package/web/assets/{ganttDiagram-EL5Y4UJY-JZNG7GOG-saLQ8O68.js → ganttDiagram-EL5Y4UJY-JZNG7GOG-CWOtJ46k.js} +6 -6
- package/web/assets/{ganttDiagram-PKOTCBZU-Bxa4tvM9.js → ganttDiagram-PKOTCBZU-Bw78KC7C.js} +3 -3
- package/web/assets/gitGraphDiagram-DS77QQ5N-CywKDUgv.js +106 -0
- package/web/assets/gitGraphDiagram-WWUBYQGX-DMWMLL3G-DIUZBjRH.js +106 -0
- package/web/assets/{index-BdqyfaDB.js → index-BLO7CDRf.js} +2 -2
- package/web/assets/{index-CSi5z7Wi.js → index-BNNZmZ7L.js} +2 -2
- package/web/assets/{index-B1IsZZhV.js → index-CAFnQS2L.js} +1 -1
- package/web/assets/index-Coa1vpTG.css +1 -0
- package/web/assets/{index-C9AodbWN.js → index-WF4B6heO.js} +6 -6
- package/web/assets/infoDiagram-6WML65LV-DFCB1zK_.js +2 -0
- package/web/assets/infoDiagram-RXCK75RN-HANS5KVC-CR0XCzL1.js +2 -0
- package/web/assets/{ishikawaDiagram-5VMMS53U-7GCIT7WU-zUhIfN7X.js → ishikawaDiagram-5VMMS53U-7GCIT7WU-BQmMapB0.js} +4 -4
- package/web/assets/{ishikawaDiagram-WSZJBQD7-CcGOfpiN.js → ishikawaDiagram-WSZJBQD7-CDVYsb8F.js} +6 -6
- package/web/assets/{journeyDiagram-EYS64GPL-OAPELBT7-DdEImGKZ.js → journeyDiagram-EYS64GPL-OAPELBT7-Bv57BEbI.js} +2 -2
- package/web/assets/{journeyDiagram-NVQOT4AX-dnKtNQmd.js → journeyDiagram-NVQOT4AX-BUhHhw49.js} +2 -2
- package/web/assets/{kanban-definition-27J2QSJJ-1VmzX5ov.js → kanban-definition-27J2QSJJ-DJWi_jsV.js} +2 -2
- package/web/assets/{kanban-definition-3QL26DDD-I7RKWQQY-yUam0q6I.js → kanban-definition-3QL26DDD-I7RKWQQY-DeQuTmff.js} +2 -2
- package/web/assets/{katex-N6JRN4PM-UengXRpx.js → katex-N6JRN4PM-CsmS8bAu.js} +1 -1
- package/web/assets/{linear-BHfMepXe.js → linear-DQOfHiUP.js} +1 -1
- package/web/assets/main-Bkgg11ZB.js +462 -0
- package/web/assets/mermaid-layout-elk.core-DDX9gcIM.js +2 -0
- package/web/assets/{mermaid.core-C8XkKX-p.js → mermaid.core-D0rh4nEj.js} +13 -13
- package/web/assets/{mindmap-definition-FAOFIHXS-DE1Nhp70.js → mindmap-definition-FAOFIHXS-nqKMiE2n.js} +2 -2
- package/web/assets/{mindmap-definition-FBJOCRG2-KIYZG64Y-CoiIugZw.js → mindmap-definition-FBJOCRG2-KIYZG64Y-CgkstHv4.js} +2 -2
- package/web/assets/pegDiagram-VL7TDLO6-Cy8v2veR.js +1 -0
- package/web/assets/pegDiagram-XKGWAZYB-OIP57N6J-DHOcOx86.js +1 -0
- package/web/assets/{pet-Cn-mywQK.js → pet-DaccG5xt.js} +1 -1
- package/web/assets/pie-5VdQHRMI.js +1 -0
- package/web/assets/{pieDiagram-7S7Q4E2Y-Dpp9yMtX.js → pieDiagram-7S7Q4E2Y-D2e6HI5F.js} +2 -2
- package/web/assets/{pieDiagram-E7YTZNPT-2UOTW327-HT3hNPRF.js → pieDiagram-E7YTZNPT-2UOTW327-9oqFgJEQ.js} +3 -3
- package/web/assets/{quadrantDiagram-AXDQQJYC-SN3ASJJK-D0OmQ8Os.js → quadrantDiagram-AXDQQJYC-SN3ASJJK-aRI00491.js} +2 -2
- package/web/assets/{quadrantDiagram-CIZ2JOQS-Dtn9o9jB.js → quadrantDiagram-CIZ2JOQS-BxVU5r4V.js} +2 -2
- package/web/assets/railroadDiagram-AXF67PYL-CxcdKdyz.js +1 -0
- package/web/assets/railroadDiagram-O6MQD6OU-34742W6X-82y7OitY.js +1 -0
- package/web/assets/{render-O7CIS3YK-DOEKPsaG.js → render-O7CIS3YK-0coM2jiE.js} +15 -15
- package/web/assets/{requirementDiagram-EFPCY7ZU-NGAFFSMB-DaLi0KnA.js → requirementDiagram-EFPCY7ZU-NGAFFSMB-CiCBt9Q_.js} +2 -2
- package/web/assets/{requirementDiagram-LRYGKXZP-D41o3BVo.js → requirementDiagram-LRYGKXZP-a-jqBbh4.js} +4 -4
- package/web/assets/{rotate-ccw-DteADTW0.js → rotate-ccw-DPfbZXyQ.js} +1 -1
- package/web/assets/sankeyDiagram-P5KCCOFB-3D3M4XPB-vVOpmIBk.js +40 -0
- package/web/assets/{sankeyDiagram-W5VNT64P-DCJLL02G.js → sankeyDiagram-W5VNT64P-CXBDBsJf.js} +2 -2
- package/web/assets/{sequenceDiagram-SI44F4Z6-DDF1-pEV.js → sequenceDiagram-SI44F4Z6-BEzEovun.js} +2 -2
- package/web/assets/{sequenceDiagram-WJ2MYXX4-Q2IOPB4R-C0uFHNXl.js → sequenceDiagram-WJ2MYXX4-Q2IOPB4R-BAt30Hjd.js} +2 -2
- package/web/assets/sizeCapture-X5ZJPWSS-CqVF9LHS.js +1 -0
- package/web/assets/sizeCapture-X5ZJPWSS-PSGVOMYM-DPuPQlRM.js +1 -0
- package/web/assets/stateDiagram-HBIQ2CUA-4M2S6MAN-DnF-bmgm.js +1 -0
- package/web/assets/stateDiagram-OKZ733FA-CKebmBa5.js +1 -0
- package/web/assets/stateDiagram-v2-4QOOHH4V-LBBLA2WV-BLTGkUFQ.js +1 -0
- package/web/assets/stateDiagram-v2-UEYNNEHI-BLjk4IRo.js +1 -0
- package/web/assets/swimlanes-SLNWSIFB-M10HmJH-.js +2 -0
- package/web/assets/swimlanes-XN3QIQJK-N6N2CCQ6-DzcOR4_D.js +1 -0
- package/web/assets/swimlanesDiagram-ULZ7WXOC-DCxkAVHU.js +8 -0
- package/web/assets/swimlanesDiagram-VK2B7HYN-E6N4H5SY-JLTPHNIv.js +8 -0
- package/web/assets/time-BgujFIZT.js +1 -0
- package/web/assets/{timeline-definition-24CTP7MA-KN7RSRVM-BAL2KmSH.js → timeline-definition-24CTP7MA-KN7RSRVM-CMhLQnxM.js} +2 -2
- package/web/assets/{timeline-definition-Z64GVDOM-DhMcMmWO.js → timeline-definition-Z64GVDOM-LcGdwXI-.js} +2 -2
- package/web/assets/transform-B5_amWNh.js +1 -0
- package/web/assets/{vennDiagram-4TSXK5OY-AKJ7LXAN-DoV4t3On.js → vennDiagram-4TSXK5OY-AKJ7LXAN-CKicd48A.js} +2 -2
- package/web/assets/{vennDiagram-T6HMQDX7-B03nsbGF.js → vennDiagram-T6HMQDX7-D7hxv4W7.js} +2 -2
- package/web/assets/{wardleyDiagram-T6FBY63Y-DARNHaGy.js → wardleyDiagram-T6FBY63Y-DnTzvRkP.js} +2 -2
- package/web/assets/{wardleyDiagram-VM6X3IG4-3B6A3BN5-DHq9TCO-.js → wardleyDiagram-VM6X3IG4-3B6A3BN5-CBmbko0H.js} +2 -2
- package/web/assets/{xychartDiagram-ELKLHX3M-DKxGAC7w.js → xychartDiagram-ELKLHX3M-B1fLmbSX.js} +3 -3
- package/web/assets/{xychartDiagram-S5SC5T6Z-OBDNV6WG-CC3o2SJP.js → xychartDiagram-S5SC5T6Z-OBDNV6WG-D1kFCVEP.js} +3 -3
- package/web/index.html +3 -3
- package/web/pet.html +3 -3
- package/web/assets/MindmapView-lDgBnVx4.js +0 -4
- package/web/assets/Tableau10-Cz3F1amA.js +0 -1
- package/web/assets/abnfDiagram-N423BO3Z-S2marhoF.js +0 -1
- package/web/assets/abnfDiagram-VCTEODGH-ODA7YWAP-WordT_-z.js +0 -1
- package/web/assets/arc-Bb-hQPAI.js +0 -1
- package/web/assets/architectureDiagram-5GKGNRK7-C4PU3XN7-DcxruSyK.js +0 -36
- package/web/assets/architectureDiagram-T3A2C74G-CAd9lB-N.js +0 -36
- package/web/assets/channel-BxqXcoo4.js +0 -1
- package/web/assets/classDiagram-DTDB5LWJ-LWRDKZ5K-8fJj9TeK.js +0 -1
- package/web/assets/classDiagram-JCYQIIEL-t9YAUl_T.js +0 -1
- package/web/assets/classDiagram-v2-JRS7N3AN-2BZHGRP2-8fJj9TeK.js +0 -1
- package/web/assets/classDiagram-v2-OCEON4UE-t9YAUl_T.js +0 -1
- package/web/assets/colors-Cc3OSVma.js +0 -1
- package/web/assets/cose-bilkent-JH36ORCC-DIFJ6b9c.js +0 -1
- package/web/assets/cose-bilkent-JH36ORCC-OB24KH3T-DHjZCs9M.js +0 -1
- package/web/assets/cynefinDiagram-5FMLGOSQ-H3WIRU3N-BiE-QvNG.js +0 -62
- package/web/assets/cynefinDiagram-MW4NZA55-qWVfE36_.js +0 -62
- package/web/assets/diagram-LBJQPF4R-ekSYdcY3.js +0 -24
- package/web/assets/diagram-Q27KOJAE-rmq99VIY.js +0 -24
- package/web/assets/diagram-UB23O5K3-cRMwChr5.js +0 -41
- package/web/assets/diagram-UQ7AKVKN-YQBY353J-B_cP2siw.js +0 -41
- package/web/assets/diagram-VX7I27RA-XW6YQV5G-QmTZZJb_.js +0 -24
- package/web/assets/diagram-Z3DM3KII-HG7RF65D-CddUWndD.js +0 -24
- package/web/assets/ebnfDiagram-BXEA7PRR-D7JcKXAh.js +0 -1
- package/web/assets/ebnfDiagram-PWID7BFC-OKY4VHYD-Cgn1ltl3.js +0 -1
- package/web/assets/gitGraphDiagram-DS77QQ5N-DZAjnUW8.js +0 -106
- package/web/assets/gitGraphDiagram-WWUBYQGX-DMWMLL3G-R1OmDfud.js +0 -106
- package/web/assets/index-B0Bl6acU.js +0 -416
- package/web/assets/index-CU6ublfJ.js +0 -1
- package/web/assets/index-DjoBjasB.css +0 -1
- package/web/assets/index-H1bePBGl.js +0 -3
- package/web/assets/infoDiagram-6WML65LV-xdjUpxRM.js +0 -2
- package/web/assets/infoDiagram-RXCK75RN-HANS5KVC-COpDG9QY.js +0 -2
- package/web/assets/main-D8bIdqDS.js +0 -462
- package/web/assets/mermaid-layout-elk.core-ILWdiYQr.js +0 -2
- package/web/assets/min-tv6RD-6E.js +0 -1
- package/web/assets/pegDiagram-VL7TDLO6-BZ1pVU8U.js +0 -1
- package/web/assets/pegDiagram-XKGWAZYB-OIP57N6J-CpmYeaRo.js +0 -1
- package/web/assets/pie-xhYaZtwS.js +0 -1
- package/web/assets/railroadDiagram-AXF67PYL-DV1LuCn7.js +0 -1
- package/web/assets/railroadDiagram-O6MQD6OU-34742W6X-0XliLClI.js +0 -1
- package/web/assets/sankeyDiagram-P5KCCOFB-3D3M4XPB-Do9G_qdd.js +0 -40
- package/web/assets/sizeCapture-X5ZJPWSS-DUIyZu15.js +0 -1
- package/web/assets/sizeCapture-X5ZJPWSS-PSGVOMYM-BTefTAjo.js +0 -1
- package/web/assets/stateDiagram-HBIQ2CUA-4M2S6MAN-B1_DadNv.js +0 -1
- package/web/assets/stateDiagram-OKZ733FA-C7MRNHyo.js +0 -1
- package/web/assets/stateDiagram-v2-4QOOHH4V-LBBLA2WV-Z0S8c0oV.js +0 -1
- package/web/assets/stateDiagram-v2-UEYNNEHI-DegrtgqZ.js +0 -1
- package/web/assets/step-SI6FXFD6.js +0 -1
- package/web/assets/swimlanes-SLNWSIFB-Dk_wl7fg.js +0 -2
- package/web/assets/swimlanes-XN3QIQJK-N6N2CCQ6-BDifrhHh.js +0 -1
- package/web/assets/swimlanesDiagram-ULZ7WXOC-DVzSyGRE.js +0 -8
- package/web/assets/swimlanesDiagram-VK2B7HYN-E6N4H5SY-D4KZH-zv.js +0 -8
- package/web/assets/time-CLfYygnx.js +0 -1
- package/web/assets/transform-CzGDKG_M.js +0 -1
|
@@ -1,462 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CourseSearchPanel-5HfObta6.js","./index-CSi5z7Wi.js","./index-DjoBjasB.css","./index-BdqyfaDB.js","./index-B1IsZZhV.js","./cpp-DddhVWhK.js","./c-BIGW1oBm.js","./ruby-B6QtyW_S.js","./html-pp8916En.js","./javascript-wDzz0qaB.js","./css-CLj8gQPS.js","./xml-sdJ4AIDG.js","./java-CylS5w8V.js","./sql-CRqJ_cUM.js","./graphql-ChdNCCLP.js","./typescript-BPQ3VLAy.js","./jsx-g9-lgVsj.js","./tsx-COt5Ahok.js","./shellscript-Yzrsuije.js","./lua-BaeVxFsk.js","./yaml-Buea-lGh.js","./php-Csjmro_R.js","./json-Cp-IABpG.js","./scss-D5BDwBP9.js","./latex-B2nUCzCX.js","./r-Cf5RLm7j.js","./vue-CHlpWS_5.js","./core-DeLhdWdV.js","./MindmapView-lDgBnVx4.js","./CanvasStage-CoofMkz2.js","./index-C9AodbWN.js","./arrow-right-BycjrUFf.js","./rotate-ccw-DteADTW0.js","./ReviewPanel-KoEHhgh6.js","./VoicePanel-ByLmSH6U.js","./SettingsView-Bp35Wqa-.js","./ExamView-ERfD2XYG.js","./CommandPalette-CdwG7gxb.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var $g=Object.defineProperty;var Wg=(e,t,n)=>t in e?$g(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var oa=(e,t,n)=>Wg(e,typeof t!="symbol"?t+"":t,n);import{r as w,l as Yg,j as x,a as Al,g as mu,u as pu,m as Cl,c as Zi,n as Gg,o as po,p as Kg,q as Xg,t as Dt,v as Qg,V as Zg,w as Jg,F as _l,x as Il,y as e1,z as rh,A as t1,B as Nl,D as Rl,E as n1,G as r1,H as i1,s as s1,k as ua,I as a1,J as Ll,K as go,M as o1,L as u1,N as Ml,O as la,P as l1,Q as c1,R as ca,d as Zt,S as Pl,T as d1,U as Dl,W as f1,X as h1,Y as m1,Z as p1,_ as g1,$ as da,a0 as Ol,a1 as In,a2 as x1,a3 as b1,a4 as y1,a5 as E1,a6 as T1,a7 as v1,a8 as k1,a9 as gu}from"./index-CSi5z7Wi.js";const w1="modulepreload",S1=function(e,t){return new URL(e,t).href},Fl={},ve=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let a=function(c){return Promise.all(c.map(f=>Promise.resolve(f).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};const o=document.getElementsByTagName("link"),u=document.querySelector("meta[property=csp-nonce]"),l=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));s=a(n.map(c=>{if(c=S1(c,r),c in Fl)return;Fl[c]=!0;const f=c.endsWith(".css"),h=f?'[rel="stylesheet"]':"";if(!!r)for(let p=o.length-1;p>=0;p--){const g=o[p];if(g.href===c&&(!f||g.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${h}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":w1,f||(m.as="script"),m.crossOrigin="",m.href=c,l&&m.setAttribute("nonce",l),document.head.appendChild(m),f)return new Promise((p,g)=>{m.addEventListener("load",p),m.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return s.then(a=>{for(const o of a||[])o.status==="rejected"&&i(o.reason);return t().catch(i)})};/**
|
|
3
|
-
* @license lucide-react v0.468.0 - ISC
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the ISC license.
|
|
6
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/const A1=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ih=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
8
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9
|
-
*
|
|
10
|
-
* This source code is licensed under the ISC license.
|
|
11
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
12
|
-
*/var C1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
13
|
-
* @license lucide-react v0.468.0 - ISC
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the ISC license.
|
|
16
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/const _1=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...o},u)=>w.createElement("svg",{ref:u,...C1,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ih("lucide",s),...o},[...a.map(([l,c])=>w.createElement(l,c)),...Array.isArray(i)?i:[i]]));/**
|
|
18
|
-
* @license lucide-react v0.468.0 - ISC
|
|
19
|
-
*
|
|
20
|
-
* This source code is licensed under the ISC license.
|
|
21
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
22
|
-
*/const pe=(e,t)=>{const n=w.forwardRef(({className:r,...s},i)=>w.createElement(_1,{ref:i,iconNode:t,className:ih(`lucide-${A1(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
|
|
23
|
-
* @license lucide-react v0.468.0 - ISC
|
|
24
|
-
*
|
|
25
|
-
* This source code is licensed under the ISC license.
|
|
26
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/const I1=pe("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
|
|
28
|
-
* @license lucide-react v0.468.0 - ISC
|
|
29
|
-
*
|
|
30
|
-
* This source code is licensed under the ISC license.
|
|
31
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
32
|
-
*/const N1=pe("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
33
|
-
* @license lucide-react v0.468.0 - ISC
|
|
34
|
-
*
|
|
35
|
-
* This source code is licensed under the ISC license.
|
|
36
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
37
|
-
*/const R1=pe("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/**
|
|
38
|
-
* @license lucide-react v0.468.0 - ISC
|
|
39
|
-
*
|
|
40
|
-
* This source code is licensed under the ISC license.
|
|
41
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/const kn=pe("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
|
|
43
|
-
* @license lucide-react v0.468.0 - ISC
|
|
44
|
-
*
|
|
45
|
-
* This source code is licensed under the ISC license.
|
|
46
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
47
|
-
*/const L1=pe("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/**
|
|
48
|
-
* @license lucide-react v0.468.0 - ISC
|
|
49
|
-
*
|
|
50
|
-
* This source code is licensed under the ISC license.
|
|
51
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
52
|
-
*/const sh=pe("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
|
|
53
|
-
* @license lucide-react v0.468.0 - ISC
|
|
54
|
-
*
|
|
55
|
-
* This source code is licensed under the ISC license.
|
|
56
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
57
|
-
*/const vn=pe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
58
|
-
* @license lucide-react v0.468.0 - ISC
|
|
59
|
-
*
|
|
60
|
-
* This source code is licensed under the ISC license.
|
|
61
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
62
|
-
*/const xu=pe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
63
|
-
* @license lucide-react v0.468.0 - ISC
|
|
64
|
-
*
|
|
65
|
-
* This source code is licensed under the ISC license.
|
|
66
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
67
|
-
*/const M1=pe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
68
|
-
* @license lucide-react v0.468.0 - ISC
|
|
69
|
-
*
|
|
70
|
-
* This source code is licensed under the ISC license.
|
|
71
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
72
|
-
*/const ah=pe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
73
|
-
* @license lucide-react v0.468.0 - ISC
|
|
74
|
-
*
|
|
75
|
-
* This source code is licensed under the ISC license.
|
|
76
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
-
*/const P1=pe("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
78
|
-
* @license lucide-react v0.468.0 - ISC
|
|
79
|
-
*
|
|
80
|
-
* This source code is licensed under the ISC license.
|
|
81
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
-
*/const bu=pe("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
83
|
-
* @license lucide-react v0.468.0 - ISC
|
|
84
|
-
*
|
|
85
|
-
* This source code is licensed under the ISC license.
|
|
86
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
87
|
-
*/const D1=pe("CircleSlash",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]]);/**
|
|
88
|
-
* @license lucide-react v0.468.0 - ISC
|
|
89
|
-
*
|
|
90
|
-
* This source code is licensed under the ISC license.
|
|
91
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
-
*/const oh=pe("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
93
|
-
* @license lucide-react v0.468.0 - ISC
|
|
94
|
-
*
|
|
95
|
-
* This source code is licensed under the ISC license.
|
|
96
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
-
*/const O1=pe("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
|
|
98
|
-
* @license lucide-react v0.468.0 - ISC
|
|
99
|
-
*
|
|
100
|
-
* This source code is licensed under the ISC license.
|
|
101
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
-
*/const uh=pe("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
103
|
-
* @license lucide-react v0.468.0 - ISC
|
|
104
|
-
*
|
|
105
|
-
* This source code is licensed under the ISC license.
|
|
106
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
-
*/const F1=pe("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
108
|
-
* @license lucide-react v0.468.0 - ISC
|
|
109
|
-
*
|
|
110
|
-
* This source code is licensed under the ISC license.
|
|
111
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
-
*/const B1=pe("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]);/**
|
|
113
|
-
* @license lucide-react v0.468.0 - ISC
|
|
114
|
-
*
|
|
115
|
-
* This source code is licensed under the ISC license.
|
|
116
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
-
*/const j1=pe("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
118
|
-
* @license lucide-react v0.468.0 - ISC
|
|
119
|
-
*
|
|
120
|
-
* This source code is licensed under the ISC license.
|
|
121
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
-
*/const Ds=pe("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
123
|
-
* @license lucide-react v0.468.0 - ISC
|
|
124
|
-
*
|
|
125
|
-
* This source code is licensed under the ISC license.
|
|
126
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
-
*/const lh=pe("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/**
|
|
128
|
-
* @license lucide-react v0.468.0 - ISC
|
|
129
|
-
*
|
|
130
|
-
* This source code is licensed under the ISC license.
|
|
131
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
-
*/const H1=pe("FolderDown",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m15 13-3 3-3-3",key:"6j2sf0"}]]);/**
|
|
133
|
-
* @license lucide-react v0.468.0 - ISC
|
|
134
|
-
*
|
|
135
|
-
* This source code is licensed under the ISC license.
|
|
136
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
-
*/const U1=pe("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
138
|
-
* @license lucide-react v0.468.0 - ISC
|
|
139
|
-
*
|
|
140
|
-
* This source code is licensed under the ISC license.
|
|
141
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
-
*/const z1=pe("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
|
143
|
-
* @license lucide-react v0.468.0 - ISC
|
|
144
|
-
*
|
|
145
|
-
* This source code is licensed under the ISC license.
|
|
146
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
-
*/const V1=pe("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);/**
|
|
148
|
-
* @license lucide-react v0.468.0 - ISC
|
|
149
|
-
*
|
|
150
|
-
* This source code is licensed under the ISC license.
|
|
151
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
-
*/const q1=pe("Hammer",[["path",{d:"m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9",key:"eefl8a"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"b7pghm"}]]);/**
|
|
153
|
-
* @license lucide-react v0.468.0 - ISC
|
|
154
|
-
*
|
|
155
|
-
* This source code is licensed under the ISC license.
|
|
156
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
-
*/const $1=pe("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
|
|
158
|
-
* @license lucide-react v0.468.0 - ISC
|
|
159
|
-
*
|
|
160
|
-
* This source code is licensed under the ISC license.
|
|
161
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
-
*/const W1=pe("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
163
|
-
* @license lucide-react v0.468.0 - ISC
|
|
164
|
-
*
|
|
165
|
-
* This source code is licensed under the ISC license.
|
|
166
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
-
*/const Y1=pe("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);/**
|
|
168
|
-
* @license lucide-react v0.468.0 - ISC
|
|
169
|
-
*
|
|
170
|
-
* This source code is licensed under the ISC license.
|
|
171
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
-
*/const G1=pe("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
|
|
173
|
-
* @license lucide-react v0.468.0 - ISC
|
|
174
|
-
*
|
|
175
|
-
* This source code is licensed under the ISC license.
|
|
176
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
-
*/const K1=pe("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
|
|
178
|
-
* @license lucide-react v0.468.0 - ISC
|
|
179
|
-
*
|
|
180
|
-
* This source code is licensed under the ISC license.
|
|
181
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
-
*/const ch=pe("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
|
|
183
|
-
* @license lucide-react v0.468.0 - ISC
|
|
184
|
-
*
|
|
185
|
-
* This source code is licensed under the ISC license.
|
|
186
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
-
*/const dh=pe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
188
|
-
* @license lucide-react v0.468.0 - ISC
|
|
189
|
-
*
|
|
190
|
-
* This source code is licensed under the ISC license.
|
|
191
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
-
*/const fh=pe("Map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);/**
|
|
193
|
-
* @license lucide-react v0.468.0 - ISC
|
|
194
|
-
*
|
|
195
|
-
* This source code is licensed under the ISC license.
|
|
196
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
-
*/const hh=pe("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
|
|
198
|
-
* @license lucide-react v0.468.0 - ISC
|
|
199
|
-
*
|
|
200
|
-
* This source code is licensed under the ISC license.
|
|
201
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
-
*/const X1=pe("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
|
|
203
|
-
* @license lucide-react v0.468.0 - ISC
|
|
204
|
-
*
|
|
205
|
-
* This source code is licensed under the ISC license.
|
|
206
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
-
*/const Ji=pe("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/**
|
|
208
|
-
* @license lucide-react v0.468.0 - ISC
|
|
209
|
-
*
|
|
210
|
-
* This source code is licensed under the ISC license.
|
|
211
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
-
*/const Q1=pe("NotebookPen",[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]]);/**
|
|
213
|
-
* @license lucide-react v0.468.0 - ISC
|
|
214
|
-
*
|
|
215
|
-
* This source code is licensed under the ISC license.
|
|
216
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
217
|
-
*/const Bl=pe("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/**
|
|
218
|
-
* @license lucide-react v0.468.0 - ISC
|
|
219
|
-
*
|
|
220
|
-
* This source code is licensed under the ISC license.
|
|
221
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
222
|
-
*/const Z1=pe("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
|
|
223
|
-
* @license lucide-react v0.468.0 - ISC
|
|
224
|
-
*
|
|
225
|
-
* This source code is licensed under the ISC license.
|
|
226
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
227
|
-
*/const J1=pe("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
|
|
228
|
-
* @license lucide-react v0.468.0 - ISC
|
|
229
|
-
*
|
|
230
|
-
* This source code is licensed under the ISC license.
|
|
231
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
232
|
-
*/const ex=pe("Paperclip",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]]);/**
|
|
233
|
-
* @license lucide-react v0.468.0 - ISC
|
|
234
|
-
*
|
|
235
|
-
* This source code is licensed under the ISC license.
|
|
236
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
237
|
-
*/const tx=pe("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
|
|
238
|
-
* @license lucide-react v0.468.0 - ISC
|
|
239
|
-
*
|
|
240
|
-
* This source code is licensed under the ISC license.
|
|
241
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
242
|
-
*/const ai=pe("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
243
|
-
* @license lucide-react v0.468.0 - ISC
|
|
244
|
-
*
|
|
245
|
-
* This source code is licensed under the ISC license.
|
|
246
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
247
|
-
*/const jl=pe("Pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);/**
|
|
248
|
-
* @license lucide-react v0.468.0 - ISC
|
|
249
|
-
*
|
|
250
|
-
* This source code is licensed under the ISC license.
|
|
251
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
252
|
-
*/const mh=pe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
253
|
-
* @license lucide-react v0.468.0 - ISC
|
|
254
|
-
*
|
|
255
|
-
* This source code is licensed under the ISC license.
|
|
256
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
257
|
-
*/const fa=pe("Presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]);/**
|
|
258
|
-
* @license lucide-react v0.468.0 - ISC
|
|
259
|
-
*
|
|
260
|
-
* This source code is licensed under the ISC license.
|
|
261
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
262
|
-
*/const nx=pe("Puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);/**
|
|
263
|
-
* @license lucide-react v0.468.0 - ISC
|
|
264
|
-
*
|
|
265
|
-
* This source code is licensed under the ISC license.
|
|
266
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
267
|
-
*/const rx=pe("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/**
|
|
268
|
-
* @license lucide-react v0.468.0 - ISC
|
|
269
|
-
*
|
|
270
|
-
* This source code is licensed under the ISC license.
|
|
271
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
272
|
-
*/const ix=pe("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/**
|
|
273
|
-
* @license lucide-react v0.468.0 - ISC
|
|
274
|
-
*
|
|
275
|
-
* This source code is licensed under the ISC license.
|
|
276
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
277
|
-
*/const sx=pe("ScanText",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 8h8",key:"1jbsf9"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h6",key:"1vyc9m"}]]);/**
|
|
278
|
-
* @license lucide-react v0.468.0 - ISC
|
|
279
|
-
*
|
|
280
|
-
* This source code is licensed under the ISC license.
|
|
281
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
282
|
-
*/const ax=pe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
283
|
-
* @license lucide-react v0.468.0 - ISC
|
|
284
|
-
*
|
|
285
|
-
* This source code is licensed under the ISC license.
|
|
286
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
287
|
-
*/const ox=pe("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
|
|
288
|
-
* @license lucide-react v0.468.0 - ISC
|
|
289
|
-
*
|
|
290
|
-
* This source code is licensed under the ISC license.
|
|
291
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
292
|
-
*/const ms=pe("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
293
|
-
* @license lucide-react v0.468.0 - ISC
|
|
294
|
-
*
|
|
295
|
-
* This source code is licensed under the ISC license.
|
|
296
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
297
|
-
*/const ph=pe("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
|
|
298
|
-
* @license lucide-react v0.468.0 - ISC
|
|
299
|
-
*
|
|
300
|
-
* This source code is licensed under the ISC license.
|
|
301
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
302
|
-
*/const ux=pe("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
|
|
303
|
-
* @license lucide-react v0.468.0 - ISC
|
|
304
|
-
*
|
|
305
|
-
* This source code is licensed under the ISC license.
|
|
306
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
307
|
-
*/const lx=pe("Shuffle",[["path",{d:"m18 14 4 4-4 4",key:"10pe0f"}],["path",{d:"m18 2 4 4-4 4",key:"pucp1d"}],["path",{d:"M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22",key:"1ailkh"}],["path",{d:"M2 6h1.972a4 4 0 0 1 3.6 2.2",key:"km57vx"}],["path",{d:"M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45",key:"os18l9"}]]);/**
|
|
308
|
-
* @license lucide-react v0.468.0 - ISC
|
|
309
|
-
*
|
|
310
|
-
* This source code is licensed under the ISC license.
|
|
311
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
312
|
-
*/const Hl=pe("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
|
|
313
|
-
* @license lucide-react v0.468.0 - ISC
|
|
314
|
-
*
|
|
315
|
-
* This source code is licensed under the ISC license.
|
|
316
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
317
|
-
*/const cx=pe("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
|
|
318
|
-
* @license lucide-react v0.468.0 - ISC
|
|
319
|
-
*
|
|
320
|
-
* This source code is licensed under the ISC license.
|
|
321
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
322
|
-
*/const yu=pe("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
323
|
-
* @license lucide-react v0.468.0 - ISC
|
|
324
|
-
*
|
|
325
|
-
* This source code is licensed under the ISC license.
|
|
326
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
327
|
-
*/const dx=pe("Table2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]]);/**
|
|
328
|
-
* @license lucide-react v0.468.0 - ISC
|
|
329
|
-
*
|
|
330
|
-
* This source code is licensed under the ISC license.
|
|
331
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
332
|
-
*/const fx=pe("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
|
|
333
|
-
* @license lucide-react v0.468.0 - ISC
|
|
334
|
-
*
|
|
335
|
-
* This source code is licensed under the ISC license.
|
|
336
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
337
|
-
*/const gh=pe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
338
|
-
* @license lucide-react v0.468.0 - ISC
|
|
339
|
-
*
|
|
340
|
-
* This source code is licensed under the ISC license.
|
|
341
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
342
|
-
*/const xo=pe("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);/**
|
|
343
|
-
* @license lucide-react v0.468.0 - ISC
|
|
344
|
-
*
|
|
345
|
-
* This source code is licensed under the ISC license.
|
|
346
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
347
|
-
*/const Eu=pe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
348
|
-
* @license lucide-react v0.468.0 - ISC
|
|
349
|
-
*
|
|
350
|
-
* This source code is licensed under the ISC license.
|
|
351
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
352
|
-
*/const hx=pe("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/**
|
|
353
|
-
* @license lucide-react v0.468.0 - ISC
|
|
354
|
-
*
|
|
355
|
-
* This source code is licensed under the ISC license.
|
|
356
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
357
|
-
*/const xh=pe("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
|
|
358
|
-
* @license lucide-react v0.468.0 - ISC
|
|
359
|
-
*
|
|
360
|
-
* This source code is licensed under the ISC license.
|
|
361
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
362
|
-
*/const bh=pe("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
|
|
363
|
-
* @license lucide-react v0.468.0 - ISC
|
|
364
|
-
*
|
|
365
|
-
* This source code is licensed under the ISC license.
|
|
366
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
367
|
-
*/const hr=pe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
368
|
-
* @license lucide-react v0.468.0 - ISC
|
|
369
|
-
*
|
|
370
|
-
* This source code is licensed under the ISC license.
|
|
371
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
372
|
-
*/const bo=pe("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),ce=new Proxy({},{get(e,t){if(typeof window>"u"||!window.api)throw new Error(`window.api 未注入(尝试访问 ${t})。请检查 preload 是否正确加载。`);const n=window.api[t];if(typeof n!="function")throw new Error(`window.api.${t} 不是函数`);return n}}),un=typeof navigator<"u"&&navigator.userAgent.includes("Electron"),mx=/[\u2E80-\u9FFF\uF900-\uFAFF\u3000-\u303F\uFF00-\uFFEF]/g;function yh(e){if(!e)return 0;const t=(e.match(mx)??[]).length,n=e.length-t;return Math.ceil(t*11/10+n/4)}function px(e,t){return!t||t<=0?null:e<=0?0:Math.min(100,Math.round(e/t*100))}function gx(e,t){const n=e.reduce((r,s)=>r+s,0);return n<=0||t<=0?e.map(()=>0):e.map(r=>t*r/n)}function er(e){return e<1e3?String(Math.round(e)):e<1e4?`${(e/1e3).toFixed(1)}k`:`${Math.round(e/1e3)}k`}const xx=.5,K4=.9,X4=.85;var Eh=Yg();const Th="lookatstudy-lang";let ps=typeof localStorage>"u"?"zh-CN":localStorage.getItem(Th)||"zh-CN";const yo=new Set;function vh(e){return yo.add(e),()=>{yo.delete(e)}}const Ul={"zh-CN":{"action.close":"关闭","action.delete":"删除","action.undo":"撤销","action.confirm":"确认","action.cancel":"取消","header.toggleLeft":"切换左栏 (Ctrl+B)","header.toggleRight":"切换右栏","header.font.smaller":"缩小字号","header.font.larger":"放大字号","header.settings":"设置 (Ctrl+S)","header.xp":"XP","header.theme.dark":"切换到亮色","header.theme.light":"切换到暗色","map.tab.map":"课程地图","map.tab.import":"导入课程","map.course.none":"未选择课程","map.review.label":"复习","map.search.label":"搜索","map.search.placeholder":"搜索章节、课时或内容…","map.search.close":"关闭","map.search.clear":"清空","map.search.noResults":"没有匹配的结果","map.search.contentGroup":"内容匹配","chat.action.startLearning":"开始学习「{title}」","chat.action.startLearningPrompt":`我想开始学「{title}」。但我现在没什么劲——别直接讲概念,也别出计分题考我。请这样开场:
|
|
373
|
-
1. 先用一两句散文抛个钩子(反直觉的、或跟我日常有关的,让我产生好奇);
|
|
374
|
-
2. 然后调用 pose_guess 工具,给我一个二选一的小猜测(就是玩,不是考试);
|
|
375
|
-
3. 我会点选项猜,你【下一回合】再揭晓,顺带把这课最核心的一点讲清楚。
|
|
376
|
-
铁律:起手不要讲座、不要用 generate_quiz 出计分题、不要计分。把我勾住是唯一目标。`,"starter.go-deeper.label":"深入这点","starter.go-deeper.hint":"把刚揭晓的概念讲深一层","starter.go-deeper.message":"帮我深入讲讲「{title}」刚才那个核心点——展开它的结构、细节和容易忽略的边界。","starter.give-example.label":"举个例子","starter.give-example.hint":"用真实例子帮你看懂","starter.give-example.message":"给我一个「{title}」的实际例子或用法,让我更具体地理解。","starter.quiz-me.label":"考考我","starter.quiz-me.hint":"出题检验(答对涨掌握度)","starter.quiz-me.message":"出一道关于「{title}」的应用题考考我,看我是否真懂了——我答完请判断对错。","starter.confused.label":"我没太懂","starter.confused.hint":"告诉 AI 你卡在哪(会记下)","starter.confused.message":"关于「{title}」,我有地方不太懂,帮我理一理——先问我是哪里不清楚。","map.world.study":"学习","map.world.practice":"实操","pane.switcher":"视图切换","pane.map":"课程","pane.chat":"导师","pane.notes":"黑板","map.streaming.notice":"AI 正在后台回答,可随意切换节点","map.generating":"正在生成课程路径…","map.empty.cta.title":"开始你的第一门课","map.empty.cta.desc":"导入一个 GitHub 学习仓库,自动生成选关路径","map.empty.cta.btn":"点这里导入 →","map.empty.practice":"这个课程暂无实操练习内容","node.locked.chapterHint":"(完成本章所有课时后解锁)","node.due.hint":"(待复习)","import.empty":"还没有课程。用下方导入第一个吧。","import.cta":"导入新课程","import.tab.url":"URL","import.tab.md":"MD","import.tab.folder":"文件夹","import.url.placeholder":"GitHub 仓库 / 网页文章 / arXiv 论文 链接","import.url.desc":"粘贴任意链接自动识别:GitHub 仓库 / arXiv 论文 / 网页文章 / B站·YouTube 视频(转写成课;B站多分P 不带 ?p= 导整季;更多站点需自装 yt-dlp)。","import.btn.url":"导入","import.btn.url.busy":"导入中…","import.placeholder.name":"课程名称(可选)","import.placeholder.md":"粘贴任意长文本或 Markdown…(没有小标题会自动分段)","import.btn.md":"导入为课程","import.btn.md.busy":"生成中…","import.folder.desc":"递归扫描 .txt/.md/.html/.pdf,适合已下载的课程资料包。","import.btn.folder":"选择文件夹","import.tab.epub":"电子书","import.epub.desc":"EPUB 电子书按章节拆课(章节边界来自书的目录与书脊顺序)。","import.btn.epub":"选择 EPUB 文件导入","import.tab.audio":"音频","import.audio.desc":"播客/讲座音频或本地视频(mp4)本地转写成课(音频 wav/mp3/m4a/flac,视频 mp4/m4v/mov,可多选=多集)。首次使用自动下载 Whisper 模型(约 1GB)。","import.btn.audio":"选择音频文件导入","import.tab.pack":"课程包","import.btn.pack":"选择课程包文件导入","import.pack.desc":"课程包是别人分享的导入方案快照(零 AI 调用,秒过分类和结构设计)。GitHub 仓库内容一致时直接复用;有更新会自动丢弃消失文件对应的课。","import.export":"导出","import.folder.pathPlaceholder":"服务器侧文件夹路径(如 /storage/emulated/0/Download/我的课程)","import.folder.pathRequired":"请填写服务器侧文件夹路径","import.pack.export":"导出课程包(分享给别人零 AI 导入)","import.pack.exported":"课程包已导出:{path}","import.error.resume":"从断点重试(跳过已完成的 AI 步骤)","import.success.reused":"复用已有方案,零 AI 调用","import.btn.folder.busy":"处理中…","import.delete":"删除","import.delete.confirm":"所有进度和练习都会清除,无法撤销。","import.delete.current":"删除当前课程","course.empty.title":"选择一门课程开始学习","course.empty.desc":"从左侧「导入课程」面板选择一门已导入的课程,或导入新课程。","import.success.md":"生成成功","import.success.folder":"导入成功","import.error.network":`
|
|
377
|
-
|
|
378
|
-
网络受限或私有仓库请改用「Markdown」方式。`,"import.progress.elapsed":"已 {s}s","import.progress.title":"正在导入课程…","import.progress.starting":"正在启动…","import.progress.note":"导入在后台进行,可继续浏览其他课程","import.progress.cancel":"取消导入","import.cancelled":"已取消导入","toast.threadCreateFailed":"创建失败了,再试一次","toast.threadCreated":"新对话","toast.threadRenamed":"已重命名","toast.threadArchived":"已归档","toast.threadDeleted":"已删除","toast.threadDefault":"新会话","toast.restored":"已恢复","toast.noteSaved":"已加到笔记","toast.noteDeleted":"已删除笔记","toast.artifactSaved":"已记到笔记本","artifact.type.concept_map":"概念图","artifact.type.quiz":"练习题","artifact.type.compare_table":"对比表","artifact.type.diagram":"流程图","artifact.type.code_walkthrough":"代码讲解","artifact.type.unknown":"产物","command.placeholder":"输入指令或问题…(↑↓ 选择,Enter 确认)","command.empty.node":"没有匹配的命令","command.empty.nonode":"先在左侧选一个节点,才能用这些命令","command.footer.hint":"AI 导师会根据指令生成对应内容","command.footer.keys":"↵ 确认 · esc 关闭","command.group.node":"基于当前节点","command.group.mode":"学习模式","command.group.nav":"导航","command.explain_simple":"用大白话解释这一节","command.quiz_3":"出 3 道练习题考考我","command.concept_map":"画个概念图理清结构","command.compare_prev":"和上一节做对比表","command.socratic":"切到苏格拉底模式(提问引导)","command.exam_mode":"切到考试冲刺模式","review.title":"复习","review.nudge":"📅 今天有 {n} 个待复习,点左侧地图的「复习」入口巩固一下","review.loading":"正在检查哪些课该复习了…","review.empty.title":"还没有复习项","review.empty.desc":"完成一些练习后,这里会出现间隔复习提醒","review.due.count":"个待复习","review.start":"开始复习","review.shuffle":"混合练习(随机交错)","review.interleave":"交错复习","review.reviewLesson":"复习该课","review.selectSection":"选择章节","review.dueIn":"待复习","review.noDueInSection":"该章节暂无待复习内容","review.srsHint":"复习提醒","review.myProgress":"我的课程进度","review.overdueQuickHint":"逾期项,点击直接复习","review.quadrant.overdue":"逾期","review.quadrant.short":"短期","review.quadrant.long":"长期","review.quadrant.inactive":"待激活","review.quadrant.more":"更多","review.tip":"复习采用 SM-2 间隔重复算法。逾期项优先复习;长期记忆项间隔更长。单次复习封顶 {n} 题,避免积压压垮节奏。","review.selfrated":"✓ 已记录,掌握度已更新","review.selfrate.title":"复习完了吗?给自己打分","review.selfrate.again":"忘了","review.selfrate.again.hint":"明天重练","review.selfrate.remembered":"记得","review.selfrate.remembered.hint":"推迟几天","review.selfrate.mastered":"很熟","review.selfrate.mastered.hint":"很久后再看","lang.original":"原文","error.checkReadyFailed":"无法检查就绪状态","notebook.tab.explain":"讲解","notebook.tab.notes":"笔记","notebook.tab.board":"黑板","notebook.board.empty":"对话里产生概念图、流程图、对比表、代码讲解时,这里会实时展示最新的一幅大图,方便边看边问。","notebook.zone.understand":"理解","notebook.zone.note":"记录","notebook.zone.practice":"练习","notebook.empty.explain.title":"选一节课开始","notebook.empty.explain.desc":"在左侧地图选一个课时,这里会显示讲解内容","notebook.empty.notes.title":"还没有笔记","notebook.empty.notes.desc":"选中讲解文字画线,或让 AI 生成概念图/对比表,会出现在这里","settings.group.ai":"主模型","settings.group.speech":"语音模型","settings.group.vision":"看图模型","settings.group.appearance":"外观与语言","settings.group.about":"关于","settings.row.version":"版本","settings.version.hint":"点版本号可查看该版的更新内容。","settings.row.provider":"服务商","settings.row.theme":"主题","settings.row.interface_lang":"界面语言","settings.row.import_lang":"导入偏好","settings.custom.form_title":"添加自定义 Provider","settings.footer.hint":"主模型区的改动需保存后生效,其余即时生效","settings.footer.save":"保存 AI 配置","header.energy":"今日能量","header.level.title":"等级(累计经验值的持久成长线,不随每日能量清零)","settings.title":"设置","view.tree":"技能树","view.dashboard":"仪表盘","view.import":"导入课程","mode.chat":"💬 对话","mode.exercise":"📝 练习","mode.settings":"⚙️ 设置","chat.starter.hint":"💡 从下面选一个开始,或者直接输入你的问题","chat.no_key.title":"还没有配置 AI 模型","chat.no_key.desc":"配置后即可开始 AI 导师对话和练习","chat.no_key.btn":"去配置模型","chat.input.placeholder":"问 AI 导师…(Enter 发送)","chat.input.no_node":"先在左侧选一个 lesson…","chat.send":"发送","chat.stop":"停止","chat.clear":"清空对话历史","chat.selection.quote":"提问这段","chat.soul.label":"风格:","chat.no_key.short":"未配置 AI 模型","chat.no_key.cta":"去配置 →","chat.attach.add":"添加图片或文件(可粘贴 / 拖拽)","chat.attach.remove":"移除 {name}","chat.attach.tooMany":"一条消息最多 {n} 个附件","chat.attach.tooLargeImage":"图片超过 5MB:{name}","chat.attach.tooLargeText":"文本文件超过 256KB:{name}","chat.attach.unsupported":"暂不支持该类型:{name}(支持图片与常见文本 / 代码文件)","chat.attach.visionUnsupported":"当前模型不支持看图,请用右侧模型切换器选一个带眼睛图标的模型,或在设置 → AI 看图里配置视觉模型覆盖","chat.attach.bridgeChip":"主模型是纯文本:图片将先由 {model} 转译成文字再交给它","chat.attach.preview":"查看 {name}","chat.attach.textChip":"文本附件,内容已随消息发给 AI","chat.attach.imageOnlyText":"请看这张图片。","context.label":"上下文","context.aria":"上下文已用 {p}","context.approx":"约","context.system":"系统提示","context.node":"课文","context.learner":"学习者状态","context.history":"对话历史","context.draft":"草稿","context.unknownWindow":"模型窗口未知","model.picker.label":"模型","model.picker.manage":"管理模型与密钥…","model.picker.vision":"支持看图","model.picker.noneConfigured":"还没有配置任何 provider 密钥","effort.label":"思考强度","effort.auto.label":"自动","effort.auto.desc":"模型默认行为,不干预","effort.fast.label":"快速","effort.fast.desc":"尽量关思考,答得快、省 token","effort.deep.label":"深度","effort.deep.desc":"尽量开思考,难题多想几步","effort.unsupported":"当前 provider 暂不支持思考强度切换","soul.direct":"精讲","soul.guide":"引导","soul.practice":"实战","soul.direct.desc":"精讲派 · 新手/想搞懂时用。先讲清楚再确认,给完整范例,不让你猜","soul.guide.desc":"引导派 · 有点基础、想自己推时用。不直接给答案,用引导性问题帮你推导","soul.practice.desc":"实战派 · 想动手时用。围绕真实世界的乱问题,在做中把概念织成网","settings.provider":"AI 服务商(Provider)","settings.model":"模型(Model)","settings.apikey":"API Key","settings.test":"测试连接","settings.testing":"测试中…","settings.save":"保存设置","settings.saved":"✅ 已保存","settings.daily_goal":"每日学习目标(XP)","settings.custom.add":"+ 添加自定义 Provider","settings.language":"语言(Language)","settings.add_custom":"自定义","settings.custom.label_ph":"名称","settings.custom.baseurl_ph":"Base URL(如 https://api.example.com/v1)","settings.custom.model_ph":"模型 ID","settings.custom.new":"新建自定义","settings.custom.form_title_vision":"配置看图模型(自定义 provider)","settings.custom.model_ph_vision":"如 glm-4.6v / gpt-4o","settings.custom.form_title_tts":"配置朗读 provider(OpenAI 兼容 /audio/speech 端点)","settings.custom.model_ph_tts":"如 tts-1 / FunAudioLLM/CosyVoice2-0.5B","settings.custom.form_title_asr":"配置听写 provider(OpenAI 兼容 /audio/transcriptions 端点)","settings.custom.model_ph_asr":"如 whisper-large-v3-turbo","settings.custom.apikey_ph":"API Key(可选)","settings.custom.save":"保存","settings.custom.windowLabel":"上下文窗口(tokens)","settings.custom.windowPh":"如 128000 或 128k(留空 = 未知)","settings.custom.windowHint":"当前模型的最大上下文,可在模型官方文档查到。填了输入框旁的上下文表才会显示占比。","settings.custom.vision":"支持看图(多模态)","settings.custom.visionHint":"勾选后系统将图片直接发给主模型;不勾选则走视觉转译桥(需在 AI 看图区配视觉模型)或跳过图片。","settings.delete_custom":"删除此自定义 Provider","settings.delete_custom_confirm":"删除自定义 Provider「{name}」?无法撤销。","settings.key.overwrite_ph":"覆盖…","settings.key.paste_ph":"粘贴 key","settings.key.get":"获取 →","settings.refresh":"刷新","settings.discovering":"刷新中…","settings.discover_failed":"刷新失败(可能网络受限)","settings.daily_goal.hint":"XP / 天(每答对一题 +10 XP)","settings.theme.auto":"跟随系统","settings.theme.light":"浅色","settings.theme.dark":"深色","settings.theme.following":"当前跟随系统:{mode}","settings.lang_pref.desc":"导入课程时自动按此偏好选择翻译。仓库原文语言与偏好一致时直接用原文;无对应翻译时也用原文。","settings.img_download":"图片下载","settings.img_download.desc":"导入课程时自动下载 md/notebook 里引用的图片(默认开启)","settings.multimodal.toggle":"AI 看图(聊天时)","settings.multimodal.toggle.desc":"开启后,聊天时 AI 能看到当前课关联的图片并讲解;问图/图表/架构图时生效(需 vision 模型)。导入时下载图片由上面的「图片下载」控制。","settings.group.memory":"学习者记忆","settings.memory.toggle":"让 AI 记住我","settings.memory.toggle.desc":"开启后,AI 会跨会话记住你的学习方式(偏好/卡点/反复混淆),越教越懂你。你拿皇冠(通关一节)时自动总结;也可手动触发。所有记忆只存本地。","settings.group.companion":"伴学伙伴","settings.companion.toggle":"伴学伙伴","settings.companion.toggle.desc":"伴学伙伴常驻课程地图、笔记本与对话栏:高光时刻一起庆祝,朗读课文时对口型,你的每次键击它都跟着拍手。五款形象随时换,只在本地运行。","settings.companion.sfx":"宠物音效","settings.companion.sfx.desc":"戳他/被拍/落地时的短促啾哔声(合成音,低音量)","settings.companion.pet":"桌宠模式","settings.companion.pet.desc":"伴学伙伴在应用外常驻桌面:透明置顶、慢慢巡游,点他仍可互动。开启后应用内的伙伴会休息,避免双影。","settings.companion.form":"形象","companion.name":"小焰","companion.form.ember.name":"小焰","companion.form.ember.desc":"赤焰守护机——热情的原点,能量核随今日 XP 充能","companion.form.frost.name":"霜绒","companion.form.frost.desc":"冰晶守望机——冷静沉稳,六瓣冰晶核逐瓣点亮","companion.form.moss.name":"苔芽","companion.form.moss.desc":"自然精灵机——温软陪伴,胸口种子随进度发芽张叶","companion.form.astro.name":"星尘","companion.form.astro.desc":"星空观测机——夜空屏面,能量核是随 XP 变圆的月相","companion.form.ink.name":"墨墨","companion.form.ink.desc":"砚上学者机——书房静气,墨池水位就是今日进度","companion.greet.1":"我在呢,继续!","companion.greet.2":"这节快拿下了!","companion.greet.3":"要我再讲一遍吗?","companion.greet.4":"深呼吸,再来一次。","settings.multimodal.current_model":"当前主模型:{model}","settings.multimodal.not_selected":"(未选)","settings.multimodal.hint_custom":"自定义 provider — 视觉能力未知。如不支持看图,在下方覆盖一个 vision 模型。","settings.multimodal.hint_preset":"如当前模型不支持 vision,可在下方配置专门的 vision 模型。常见:GLM-4V / GPT-4o / Claude 3.5 / Gemini。","settings.multimodal.override_title":"Vision 模型覆盖(可选 — 留空则复用主模型)","settings.multimodal.override_bridge_hint":"主模型不支持看图时,聊天中上传的图片会先由该模型转译成文字描述,再交给主模型解读(图像转译桥)。","settings.multimodal.legacy_preset":"旧配置(预设 {label})仍生效;可停止覆盖或改用自定义。","settings.multimodal.replace_custom":"更换","settings.multimodal.stop_override":"停止覆盖","settings.multimodal.vision_capable":"vision","settings.multimodal.test_override":"测试模型","settings.mathvision.toggle":"PDF 公式视觉转写(实验)","settings.mathvision.desc":"导入 PDF 时检测公式密集页,整页渲染成图交给上面的看图模型转成 LaTeX。需先配好看图模型,按页消耗额度;未开启或失败时按普通文本层导入。","settings.saved_text":"已保存","settings.key.configured":"已配置","settings.custom.test_label":"(测试)","settings.proto.openai":"OpenAI 兼容","chat.empty.overview":"这是这一课的概览","chat.empty.summary.title":"本课摘要","chat.empty.summary.none":"暂无摘要,点开始学习让 AI 帮你了解这一课","chat.empty.start":"开始学习","chat.empty.greeting":"👋 准备好了吗?这一课我们慢慢来。","chat.empty.keyless.title":"内容已在右侧,先读一读","chat.empty.keyless.desc":"配置好 AI 模型,就能和我对练、做练习、追踪掌握度。","chat.empty.keyless.btn":"去配置 AI 模型","chat.empty.no_node.title":"从左侧地图选一个节点","chat.empty.no_node.desc":"点击圆球节点开始学习。绿色=可学,金色=已掌握,紫色=章节考试","chat.scroll.bottom":"回到底部","chat.speech.speak":"朗读这条消息","chat.speech.stop":"停止朗读","chat.speech.progress":"{n}/{total} 句","chat.speech.model_missing":"语音模型还没下载。到 设置 → 语音能力 下载后即可朗读。","chat.speech.engine_unavailable":"语音引擎未就位。桌面版开箱可用;Termux 端重跑一行安装命令即可补装(约 12MB)。","chat.speech.dictation":"语音输入","chat.speech.hold_to_talk":"按住说话","chat.speech.release_to_stop":"松开,结束录音","chat.speech.recording_hint":"正在录音,松开结束","chat.speech.rerecord":"取消重录","chat.speech.retry":"重试","chat.speech.back_to_keyboard":"切回键盘输入","chat.speech.keyboard":"键盘","chat.speech.custom_provider_missing":"自定义语音 provider 不存在或已删除,到 设置 → 语音模型 重新配置。","chat.speech.no_speech":"没听到声音,请检查麦克风后重试。","chat.speech.transcribing":"转录中…","chat.speech.asr_failed":"转录失败,请重试。","chat.speech.groq_key_missing":"Groq 密钥未配置。到 设置 → 模型服务 配置 Groq,或改用本地引擎。","chat.speech.azure_stt_key_missing":"旧 Azure 听写配置缺少密钥。请在 设置 → 语音模型 改用自定义听写端点。","chat.speech.azure_stt_region_missing":"旧 Azure 听写配置缺少区域。请在 设置 → 语音模型 改用自定义听写端点。","chat.speech.asr_model_missing":"听写模型还没下载。到 设置 → 语音模型 下载 Whisper(本地离线),或改用自定义听写端点。","chat.speech.asr_start_fail":"麦克风启动失败,请检查系统权限。","chat.speech.asr_insecure_context":"浏览器只允许在安全上下文(https 或 127.0.0.1)使用麦克风。请用手机引导器打开本页,或给 serve 配置 --tls-cert/--tls-key 后改走 https 访问。","chat.speech.read_aloud_node":"朗读本课","chat.speech.azure_key_missing":"Azure 朗读缺少密钥。到 设置 → 语音能力 填写后使用。","chat.speech.azure_region_missing":"Azure 朗读缺少区域。到 设置 → 语音能力 填写后使用。","chat.speech.edge_failed":"在线朗读失败,且本地模型未就绪无法降级。稍后重试或改用本地引擎。","chat.speech.edge_disclosed":"朗读将文本发送至微软在线服务(Edge 免费通道)。想完全离线:设置 → 语音能力 → 本地离线。","settings.speech.tts_engine":"朗读引擎","settings.speech.engine.edge":"Edge 在线","settings.speech.engine.azure":"Azure","settings.speech.engine.local":"本地离线","settings.speech.engine.custom":"自定义","settings.speech.engine.system":"系统引擎","settings.speech.engine.system_note":"音色来自本机浏览器/系统的语音引擎,质量随设备而定(国产手机的厂商/讯飞引擎通常更自然)。本地播放、不联网;朗读时逐句高亮照常,伴学嘴型不可用。","settings.speech.engine.system_unavailable":"当前环境(WebView)不支持系统朗读","settings.speech.voice_auto":"自动(优先中文音色)","settings.speech.model.turbo_short":"Whisper Turbo(约 1GB)","settings.speech.model.small_short":"Whisper Small(约 360MB)","settings.speech.tts_title":"朗读","settings.speech.asr_title":"听写","settings.speech.custom_voice_ph":"如 alloy(留空用端点默认)","settings.speech.legacy":"旧配置,仍生效","settings.speech.key_saved":"密钥已存","settings.speech.confirm_del_custom":"删除后该档不可用,确认?","settings.speech.downloading":"下载中…","settings.speech.asr_engine.custom_note":"OpenAI 兼容转写端点;Groq 用户填 https://api.groq.com/openai/v1 + whisper-large-v3-turbo。","settings.speech.engine.edge_note":"微软 Edge 朗读通道:免费、无需密钥、音色为产品级;文本经在线服务合成。","settings.speech.voice":"音色","settings.speech.speed":"语速","settings.speech.asr_engine":"听写引擎","settings.speech.asr_engine.local":"本地离线","settings.speech.asr_engine.local_note":"Whisper 离线转写(自带标点,中文质量好);下载模型后完全离线,Turbo 约 1GB / Small 约 360MB。","settings.speech.asr_auto_stop":"静音后自动停止录音","settings.speech.asr_ux_note":"点输入框旁的麦克风进入语音模式:按住说话,松开后可修改识别文字再发送。","settings.speech.model.asr_turbo":"听写引擎 Whisper Turbo(约 1GB,推荐桌面)","settings.speech.model.asr_small":"听写引擎 Whisper Small(约 360MB,轻量)","settings.speech.license_mit":"MIT · 本地推理","settings.speech.model.tts":"朗读引擎(Kokoro,约 430MB)","settings.speech.state.absent":"未下载","settings.speech.state.ready":"已就绪","settings.speech.state.error":"出错","settings.speech.download":"下载","settings.speech.delete":"删除","settings.speech.license":"Apache-2.0 · 本地推理","chat.friction.trigger":"我卡住了","chat.friction.hint":"选一个最接近的感受(可选写一句原因),AI 会记住并据此调整讲解。","chat.friction.confused":"糊涂","chat.friction.blocked":"卡住","chat.friction.frustrated":"受挫","chat.friction.desc_placeholder":"具体卡在哪了?(可选)","chat.friction.cancel":"取消","chat.friction.submit":"记下","chat.friction.saved":"已记下,AI 会据此调整这一课的讲法","chat.mastered.toast":"👑 太棒了!你掌握了这一课","chat.note.add":"加笔记","chat.note.add.title":"把这段对话存到记录区","chat.reasoning.label":"思考过程","chat.reasoning.chars":"{n} 字","chat.proposal.title":"AI 提议","chat.proposal.fallback":"提议({tool})","chat.proposal.apply":"应用","chat.proposal.reject":"拒绝","chat.proposal.mastered.title":"AI 建议你已掌握这节课","chat.proposal.mastered.hint":"采纳后本课解锁皇冠、进入复习排期。","chat.proposal.confirm":"确认掌握","chat.proposal.later":"再练练","chat.proposal.applied":"已采纳 · 本课已掌握","chat.proposal.rejected":"已忽略,继续学习","chat.copy":"复制","chat.copied":"已复制","chat.tool.get_node_info":"读取节点信息","chat.tool.record_answer":"记录答题观测","chat.tool.mark_mastered":"标记掌握","chat.tool.show_concept_map":"生成概念图","chat.tool.generate_quiz":"出练习题","chat.tool.compare_table":"生成对比表","chat.tool.draw_diagram":"画流程图","chat.tool.show_code_walkthrough":"代码讲解","thread.empty.no_node":"未选节点","thread.empty.hint":"输入问题开始","thread.actions.label":"操作","thread.new.label":"新建会话","thread.streamingBadge":"AI 正在输出","thread.menu.rename":"重命名","thread.menu.archive":"归档","thread.delete.confirm":"删除会话「{name}」?消息也会一并删除。","notebook.empty.select_node":"从左侧地图选一个节点开始学习,讲解会显示在这里","notebook.empty.no_notes_message":"这一节还没有笔记。选中讲解文字「加笔记」,或问 AI「画个概念图」「出 3 道题」「做个对比表」","notebook.node_type.section":"章节","notebook.node_type.concept":"概念","notebook.node_type.lesson":"课时","notebook.content.loading":"正在加载这一节的讲解…","notebook.content.load_failed":"内容加载失败。","notebook.content.retry":"重试","notebook.content.render_failed":"这段内容渲染失败(可能翻译格式有问题)。","notebook.content.truncated":"…(截断)","notebook.content.retry_render":"重试渲染","notebook.content.empty":"这一节还没有讲解内容。问 AI 导师:「给我讲讲这一节」","notebook.mindmap.toggle":"思维导图视图","notebook.images.heading":"插图({n})","notebook.quote.template":"关于这段内容「{text}」,我不太懂,请帮我解释:","notebook.quote.ask":"提问","notebook.quote.add_note":"加笔记","notebook.quote.save_note.title":"把选中文字存到记录区,带溯源跳转","notebook.quote.hint":"选中讲解文字点「加笔记」;AI 生成的概念图/对比表/练习卡会自动进「笔记」标签","notebook.source.label":"来源","notebook.source.jump_content":"跳到讲解原位","notebook.source.jump_chat":"跳到对话原位","notebook.zone.understand.subtitle":"AI 帮你梳理的知识结构","notebook.zone.understand.empty_hint":"问 AI「画个概念图」「做个对比表」梳理这一节","notebook.zone.note.subtitle":"你的画线,点击可跳回原位","notebook.zone.note.empty_hint":"选中讲解或对话的文字,点「加笔记」存到这里","notebook.zone.practice.subtitle_empty":"做题检验掌握,可重做","notebook.zone.practice.subtitle_stats":"{n} 题 · 上次答对 {c} · 答错 {w}","notebook.zone.practice.empty_hint":"问 AI「出 3 道题考考我」,题目会自动进这里","notebook.note.comment.ph_new":"写下你对这段画线的注释…","notebook.note.comment.ph_edit":"编辑注释…(清空保存即可删除)","notebook.action.save":"保存","notebook.action.cancel":"取消","notebook.note.edit_comment":"编辑注释","notebook.note.add_comment":"加注释","notebook.note.pinned":"已置顶","notebook.note.pin":"置顶","notebook.note.unpin":"取消置顶","notebook.note.delete":"删除","notebook.quiz.last_correct":"上次答对","notebook.quiz.last_wrong":"上次答错","notebook.artifact.broken":"产物数据损坏","notebook.asset.loading":"加载中…","exam.loading":"正在生成章节考试题…","exam.errorTitle":"考试加载失败","exam.errorEmpty":"题目生成失败,请稍后重试","exam.reload":"重新加载","exam.question.label":"第 {n} 题","exam.next":"下一题","exam.submit":"提交考试","exam.accuracy":"正确率 {n}%","exam.stars.congrats":"恭喜,获得 {n} 星!","exam.stars.thisAndBest":"本次 {n} 星 · 历史最佳 {m} 星","exam.stars.failed":"未达 60%,再接再厉","exam.review.title":"逐题回顾","exam.review.questionFallback":"(题目 {n})","exam.review.yourAnswer":"你的答案:","exam.review.correctAnswer":"正确:","exam.review.unanswered":"(未答)","exam.retry":"重新考试(题目已缓存)","exam.generating.title":"正在生成章节考试题…","exam.generating.stage":"AI 正在按本章知识点逐批出题","exam.generating.kcProgress":"已覆盖 {done} / {total} 个知识点","exam.generating.preparing":"准备中…","exam.generating.canLeave":"可以离开本页,生成会在后台继续;完成后会通知你。","exam.failed.retry":"重新生成","exam.ready.title":"考试已生成","exam.ready.meta":"{q} 题 · 覆盖 {kc} 个知识点 · 预计 {min} 分钟","exam.ready.toast":"「{title}」的考试题已生成,随时可以开考","exam.start":"开始考试","exam.retryExam":"重新考试","exam.regenerate":"重新出题","exam.regenerate.confirmMsg":"重新出题会丢弃当前题库,并让 AI 按本章知识点重新出一批(历史成绩保留)。","exam.submitting":"正在判分…","exam.q.progress":"第 {i} / {n} 题","exam.q.next":"下一题","exam.q.submit":"提交考试","exam.terminated.banner":"本场考试因中途离开被终止,未答的题按答错计分。","exam.result.score":"{correct} / {total} 题正确","exam.result.accuracy":"正确率 {pct}%","exam.result.best":"历史最好:{stars} 星","exam.result.attempts":"已考 {n} 次","exam.result.kcBreakdown":"按知识点","exam.result.weakKc":"薄弱 · 建议复习","exam.result.correctLabel":"答对","exam.result.unanswered":"未答","exam.result.yourAnswer":"你的答案:","exam.result.correctAnswer":"正确答案:","exam.result.review":"逐题回顾","exam.leave.title":"离开将终止考试","exam.leave.message":"未答的题将按答错计分,本场成绩会被记录。确定要离开吗?","exam.leave.confirm":"终止并离开","exam.leave.cancel":"继续考试","error.renderFailed":"这部分内容渲染失败(可能格式有问题)。","error.retry":"重试","artifact.unknownHeader":"产物(未识别类型)","artifact.zoomOut":"缩小","artifact.zoomReset":"重置缩放","artifact.zoomIn":"放大","artifact.canvas.fit":"适屏","artifact.viewer.open":"放大查看","artifact.viewer.hint":"双指缩放 · 单指拖动 · Ctrl+滚轮","artifact.conceptmap.stats":"{nodes} 个概念 · {edges} 个关系 · Ctrl+滚轮缩放 · 拖动平移","artifact.codewalk.sectionLabel":"逐段讲解(点击定位代码)","artifact.codewalk.lineSingle":"第 {n} 行","artifact.codewalk.lineRange":"第 {a}-{b} 行","artifact.diagram.flowchart":"流程图","artifact.diagram.sequence":"时序图","artifact.diagram.state":"状态图","artifact.mermaid.openLive":"在 mermaid.live 打开(可编辑)","artifact.mermaid.rendering":"渲染图中…","artifact.mermaid.renderFailed":"渲染失败,显示源码(可复制到 mermaid.live 查看)","artifact.mermaid.repairing":"图有语法问题,正在自动修复…","artifact.mermaid.errorPrefix":"错误: {msg}","artifact.mermaid.hint":"Ctrl+滚轮缩放 · 拖动平移查看","quiz.questionProgress":"第 {cur}/{total} 题","quiz.answeredCorrect":"已答对 {n}","quiz.correct":"答对了","quiz.wrong":"答错了","quiz.finish":"完成练习","quiz.scoreSummary":"{correct}/{total} 答对","quiz.hook.label":"📊 答题完成:{{correct}}/{{total}}","quiz.hook.finish":"完成答题","quiz.hook.sent":"成绩单已交给导师,等待分析…","quiz.hook.message":`我刚做完了答题卡{{title}},成绩 {{correct}}/{{total}}。下面是逐题情况:
|
|
379
|
-
请根据我的表现决定下一步:答错的题讲清为什么错和正确思路;全对的话判断我是否可以进入下一部分。不要重新出同一组题,也不要只说一句做得好。`,"quiz.hook.lineOk":"✅ 第{{n}}题「{{prompt}}」:答对","quiz.hook.lineWrong":"❌ 第{{n}}题「{{prompt}}」:我选了「{{chosen}}」,正确答案是「{{answer}}」","quiz.allCorrectHint":"全部答对,掌握度已提议更新","quiz.tryAgainHint":"再练一组巩固一下","quiz.action.nextPrompt":"接下来可以:","quiz.action.explainWrong":"讲讲我答错的","quiz.action.retry":"再来一组","quiz.action.goDeeper":"深入讲讲原理","quiz.action.markMastered":"确认我掌握了","quiz.action.nextTopic":"下一个知识点","guess.header":"来猜一个","guess.pickedPrefix":"我猜:","guess.waitReveal":"已猜,等 AI 揭晓 ⋯","import.deleted":"已删除:{title}","exercise.title":"📝 练习","exercise.generate":"出一道练习","exercise.submit":"提交答案","exercise.next":"下一题 →","exercise.correct":"✅ 答对了!","exercise.wrong":"❌ 答错了","exercise.types.mcq":"选择题","exercise.types.fill_blank":"填空题","exercise.types.true_false":"判断题","dashboard.title":"学习仪表盘","dashboard.stat.streak":"连续天数","dashboard.stat.due":"今日待复习","dashboard.stat.mastery":"整体掌握度","dashboard.review":"去复习","dashboard.cleared":"已清空","dashboard.export.md":"📄 导出报告","dashboard.export.json":"导出 JSON","dashboard.section_mastery":"按章节掌握度","dashboard.mini.sections":"章节掌握度","dashboard.mini.struggle":"你的薄弱点(点开重学)","import.title":"导入课程","import.url":"GitHub URL","import.markdown":"粘贴 Markdown","import.btn":"导入","import.md_btn":"生成课程","streak.days":"天","streak.title":"连续学习 {n} 天 · 最长 {m} 天","streak.freeze.title":"剩余冻结 {n} 个:漏签一天可自动保住连击"},en:{"action.close":"Close","action.delete":"Delete","action.undo":"Undo","action.confirm":"Confirm","action.cancel":"Cancel","header.toggleLeft":"Toggle left pane (Ctrl+B)","header.toggleRight":"Toggle right pane","header.font.smaller":"Decrease font size","header.font.larger":"Increase font size","header.settings":"Settings (Ctrl+S)","header.xp":"XP","header.theme.dark":"Switch to light","header.theme.light":"Switch to dark","map.tab.map":"Course Map","map.tab.import":"Import","map.course.none":"No course selected","map.review.label":"Review","map.search.label":"Search","map.search.placeholder":"Search chapters, lessons or content…","map.search.close":"Close","map.search.clear":"Clear","map.search.noResults":"No results","map.search.contentGroup":"Content matches","chat.action.startLearning":"Start learning “{title}”","chat.action.startLearningPrompt":`I want to start learning “{title}”, but I'm low on energy right now — don't lecture me with concepts and don't quiz me with scored questions. Open like this instead:
|
|
380
|
-
1. First hook me with a sentence or two of prose (counter-intuitive, or tied to daily life — make me curious);
|
|
381
|
-
2. Then call the pose_guess tool with a small two-option guess (just for fun, not a test);
|
|
382
|
-
3. I'll pick an option and guess; in your NEXT turn, reveal the answer and teach the one core idea of this lesson.
|
|
383
|
-
Iron rules: no lecture to start, no generate_quiz scored questions, no scoring. Hooking me is the only goal.`,"starter.go-deeper.label":"Go deeper","starter.go-deeper.hint":"Unpack the concept one level down","starter.go-deeper.message":"Go deeper on “{title}” — expand the structure, the details, and the easy-to-miss edge cases of the core point we just uncovered.","starter.give-example.label":"Give an example","starter.give-example.hint":"Make it concrete with a real example","starter.give-example.message":"Give me a concrete example or use case for “{title}” so I can understand it more tangibly.","starter.quiz-me.label":"Quiz me","starter.quiz-me.hint":"Retrieve and apply (correct answers raise mastery)","starter.quiz-me.message":"Quiz me with one applied question about “{title}” to check whether I really get it — judge my answer when I respond.","starter.confused.label":"I'm lost","starter.confused.hint":"Tell the AI where you're stuck (it takes notes)","starter.confused.message":"I'm fuzzy on part of “{title}” — help me untangle it, and start by asking which part isn't clear.","map.world.study":"Learn","map.world.practice":"Practice","pane.switcher":"Switch view","pane.map":"Course","pane.chat":"Tutor","pane.notes":"Blackboard","map.streaming.notice":"AI is responding in the background. Feel free to switch nodes.","map.generating":"Generating course path…","map.empty.cta.title":"Start your first course","map.empty.cta.desc":"Import a GitHub learning repo to auto-generate a skill path","map.empty.cta.btn":"Click to import →","map.empty.practice":"No practice content for this course","node.locked.chapterHint":"(unlocks after completing all lessons in this chapter)","node.due.hint":"(due for review)","import.empty":"No courses yet. Import your first one below.","import.cta":"Import New Course","import.tab.url":"URL","import.tab.md":"MD","import.tab.folder":"Folder","import.url.placeholder":"GitHub repo / web article / arXiv paper link","import.url.desc":"Paste any link — GitHub repo / arXiv paper / web article / Bilibili·YouTube video (transcribed into a course; multi-part Bilibili videos import the whole season without ?p=; more sites need yt-dlp installed).","import.btn.url":"Import","import.btn.url.busy":"Importing…","import.placeholder.name":"Course name (optional)","import.placeholder.md":"Paste any long text or Markdown… (auto-split when there are no headings)","import.btn.md":"Import as Course","import.btn.md.busy":"Generating…","import.folder.desc":"Recursively scans .txt/.md/.html/.pdf. For downloaded course material packs.","import.btn.folder":"Select Folder","import.tab.epub":"eBook","import.epub.desc":"EPUB books become one lesson per chapter (chapter order from the book's spine & TOC).","import.btn.epub":"Pick an EPUB file","import.tab.audio":"Audio","import.audio.desc":"Audio (wav/mp3/m4a/flac) or local video (mp4/m4v/mov) transcribed locally into a course; multi-select = multiple episodes. Whisper model (~1 GB) downloads automatically on first use.","import.btn.audio":"Pick audio files","import.tab.pack":"Pack","import.btn.pack":"Pick a course pack file","import.pack.desc":"A course pack is a shared import-plan snapshot — zero AI calls, classification and structure design are instant. Reused as-is when the GitHub repo matches; if the repo moved on, lessons pointing at removed files are dropped automatically.","import.export":"Export","import.folder.pathPlaceholder":"Server-side folder path (e.g. /storage/emulated/0/Download/my-course)","import.folder.pathRequired":"Enter the server-side folder path first","import.pack.export":"Export course pack (share for zero-AI import)","import.pack.exported":"Course pack exported: {path}","import.error.resume":"Retry from checkpoint (skips finished AI steps)","import.success.reused":"reused saved plan, zero AI calls","import.btn.folder.busy":"Processing…","import.delete":"Delete","import.delete.confirm":"All progress and exercises will be erased. This cannot be undone.","import.delete.current":"Delete current course","course.empty.title":"Pick a course to start learning","course.empty.desc":"Choose an imported course from the Import panel on the left, or import a new one.","import.success.md":"Generated","import.success.folder":"Imported","import.error.network":`
|
|
384
|
-
|
|
385
|
-
For restricted networks or private repos, use the Markdown method.`,"import.progress.elapsed":"{s}s elapsed","import.progress.title":"Importing course…","import.progress.starting":"Starting…","import.progress.note":"Import runs in the background — keep browsing other courses","import.progress.cancel":"Cancel import","import.cancelled":"Import cancelled","toast.threadCreateFailed":"Couldn't create — try again","toast.threadCreated":"New chat","toast.threadRenamed":"Renamed","toast.threadArchived":"Archived","toast.threadDeleted":"Deleted","toast.threadDefault":"New thread","toast.restored":"Restored","toast.noteSaved":"Added to notes","toast.noteDeleted":"Note deleted","toast.artifactSaved":"Saved to notebook","artifact.type.concept_map":"Concept Map","artifact.type.quiz":"Quiz","artifact.type.compare_table":"Comparison Table","artifact.type.diagram":"Diagram","artifact.type.code_walkthrough":"Code Walkthrough","artifact.type.unknown":"Artifact","command.placeholder":"Type a command or question… (↑↓ to select, Enter to confirm)","command.empty.node":"No matching commands","command.empty.nonode":"Select a node on the left first","command.footer.hint":"The AI tutor generates content based on your command","command.footer.keys":"↵ confirm · esc to close","command.group.node":"Current Node","command.group.mode":"Study Mode","command.group.nav":"Navigation","command.explain_simple":"Explain this section in plain words","command.quiz_3":"Give me 3 practice questions","command.concept_map":"Draw a concept map","command.compare_prev":"Compare with the previous section","command.socratic":"Switch to Socratic mode (guided questions)","command.exam_mode":"Switch to Exam prep mode","review.title":"Review","review.nudge":"📅 {n} review(s) due today — tap the Review entry in the map to consolidate","review.loading":"Checking what to review…","review.empty.title":"No reviews yet","review.empty.desc":"Complete some exercises and spaced-repetition reminders will appear here","review.due.count":"due","review.start":"Start Review","review.shuffle":"Shuffle (interleaved)","review.interleave":"Interleaved Review","review.reviewLesson":"Review","review.selectSection":"Select a section","review.dueIn":"due","review.noDueInSection":"No reviews in this section","review.srsHint":"Review Reminders","review.myProgress":"My Progress","review.overdueQuickHint":"Overdue items — click to review","review.quadrant.overdue":"Overdue","review.quadrant.short":"Short-term","review.quadrant.long":"Long-term","review.quadrant.inactive":"Inactive","review.quadrant.more":"more","review.tip":"Review uses the SM-2 spaced repetition algorithm. Overdue items first; long-term memory items have longer intervals. Capped at {n} items per session to avoid backlog overwhelm.","review.selfrated":"✓ Recorded. Mastery updated.","review.selfrate.title":"Done reviewing? Rate yourself","review.selfrate.again":"Forgot","review.selfrate.again.hint":"Review tomorrow","review.selfrate.remembered":"Recalled","review.selfrate.remembered.hint":"In a few days","review.selfrate.mastered":"Easy","review.selfrate.mastered.hint":"Much later","lang.original":"Original","error.checkReadyFailed":"Could not check readiness","notebook.tab.explain":"Explain","notebook.tab.notes":"Notes","notebook.tab.board":"Blackboard","notebook.board.empty":"When the tutor produces a concept map, diagram, comparison table, or code walkthrough in chat, the latest one is rendered here in full size.","notebook.zone.understand":"Understand","notebook.zone.note":"Notes","notebook.zone.practice":"Practice","notebook.empty.explain.title":"Pick a lesson to start","notebook.empty.explain.desc":"Select a lesson in the map on the left; its explanation shows here.","notebook.empty.notes.title":"No notes yet","notebook.empty.notes.desc":"Highlight text in the explanation, or have the AI generate a concept map / comparison table — it shows up here.","settings.group.ai":"Main Model","settings.group.speech":"Speech Models","settings.group.vision":"Vision Model","settings.group.appearance":"Appearance & Language","settings.group.about":"About","settings.row.version":"Version","settings.version.hint":"Click the version to see what changed in this release.","settings.row.provider":"Provider","settings.row.theme":"Theme","settings.row.interface_lang":"Interface language","settings.row.import_lang":"Import preference","settings.custom.form_title":"Add custom provider","settings.footer.hint":"Main model changes need Save; everything else is instant.","settings.footer.save":"Save AI config","header.energy":"Today's energy","header.level.title":"Level (cumulative XP growth line — doesn't reset with daily energy)","settings.title":"Settings","view.tree":"Skill Tree","view.dashboard":"Dashboard","view.import":"Import Course","mode.chat":"💬 Chat","mode.exercise":"📝 Practice","mode.settings":"⚙️ Settings","chat.starter.hint":"💡 Pick one to start, or type your question","chat.no_key.title":"No AI model configured","chat.no_key.desc":"Configure a model to start AI tutoring and practice","chat.no_key.btn":"Configure Model","chat.input.placeholder":"Ask your AI tutor… (Enter to send)","chat.input.no_node":"Select a lesson on the left…","chat.send":"Send","chat.stop":"Stop","chat.clear":"Clear chat history","chat.selection.quote":"Ask about this","chat.soul.label":"Style:","chat.no_key.short":"AI model not configured","chat.no_key.cta":"Configure →","chat.attach.add":"Add image or file (paste / drag also works)","chat.attach.remove":"Remove {name}","chat.attach.tooMany":"Up to {n} attachments per message","chat.attach.tooLargeImage":"Image over 5MB: {name}","chat.attach.tooLargeText":"Text file over 256KB: {name}","chat.attach.unsupported":"Unsupported type: {name} (images and common text / code files)","chat.attach.visionUnsupported":"Current model can't see images — pick one with the eye icon in the model switcher, or set a vision model override in Settings → AI vision","chat.attach.bridgeChip":"Main model is text-only: images will be transcribed to text by {model} first","chat.attach.preview":"View {name}","chat.attach.textChip":"Text attachment, content sent with the message","chat.attach.imageOnlyText":"Please look at this image.","context.label":"Context","context.aria":"{p} of context used","context.approx":"~","context.system":"System prompt","context.node":"Lesson","context.learner":"Learner state","context.history":"History","context.draft":"Draft","context.unknownWindow":"model window unknown","model.picker.label":"Model","model.picker.manage":"Manage models & keys…","model.picker.vision":"Vision capable","model.picker.noneConfigured":"No provider key configured yet","effort.label":"Thinking effort","effort.auto.label":"Auto","effort.auto.desc":"Model default, no override","effort.fast.label":"Fast","effort.fast.desc":"Thinking off when possible — quicker, fewer tokens","effort.deep.label":"Deep","effort.deep.desc":"Thinking on when possible — extra steps for hard problems","effort.unsupported":"Current provider doesn't support effort switching","soul.direct":"Direct","soul.guide":"Guide","soul.practice":"Practice","soul.direct.desc":"Direct · for beginners or low energy. Explains clearly then checks, gives full worked examples — never makes you guess","soul.guide.desc":"Guide · when you have some footing and want to reason it out. No direct answers — guiding questions help you derive it","soul.practice.desc":"Practice · for hands-on learners. Each concept lands on a messy real-world problem; learn by doing and connect the dots","settings.provider":"AI Provider","settings.model":"Model","settings.apikey":"API Key","settings.test":"Test Connection","settings.testing":"Testing…","settings.save":"Save Settings","settings.saved":"✅ Saved","settings.daily_goal":"Daily Goal (XP)","settings.custom.add":"+ Add Custom Provider","settings.language":"Language","settings.add_custom":"Custom","settings.custom.label_ph":"Name","settings.custom.baseurl_ph":"Base URL (e.g. https://api.example.com/v1)","settings.custom.model_ph":"Model ID","settings.custom.new":"New custom","settings.custom.form_title_vision":"Configure vision model (custom provider)","settings.custom.model_ph_vision":"e.g. glm-4.6v / gpt-4o","settings.custom.form_title_tts":"Configure TTS provider (OpenAI-compatible /audio/speech)","settings.custom.model_ph_tts":"e.g. tts-1 / FunAudioLLM/CosyVoice2-0.5B","settings.custom.form_title_asr":"Configure dictation provider (OpenAI-compatible /audio/transcriptions)","settings.custom.model_ph_asr":"e.g. whisper-large-v3-turbo","settings.custom.apikey_ph":"API Key (optional)","settings.custom.save":"Save","settings.custom.windowLabel":"Context window (tokens)","settings.custom.windowPh":"e.g. 128000 or 128k (empty = unknown)","settings.custom.windowHint":"Max context of the current model, found in its official docs. The composer context meter only shows a percentage when this is set.","settings.custom.vision":"Supports vision (multimodal)","settings.custom.visionHint":"When checked, images are sent directly to the main model. Unchecked uses the vision bridge (configure a vision model in AI Vision section) or skips images.","settings.delete_custom":"Delete this custom provider","settings.delete_custom_confirm":'Delete custom provider "{name}"? This cannot be undone.',"settings.key.overwrite_ph":"Overwrite…","settings.key.paste_ph":"Paste key","settings.key.get":"Get key →","settings.refresh":"Refresh","settings.discovering":"Refreshing…","settings.discover_failed":"Refresh failed (network may be restricted)","settings.daily_goal.hint":"XP / day (+10 XP per correct answer)","settings.theme.auto":"System","settings.theme.light":"Light","settings.theme.dark":"Dark","settings.theme.following":"Following system: {mode}","settings.lang_pref.desc":"When importing a course, auto-pick the translation matching this preference. If the repo's source language already matches, the original is used; if no translation exists, the original is used as well.","settings.img_download":"Image download","settings.img_download.desc":"Auto-download images referenced in markdown/notebooks during import (on by default)","settings.multimodal.toggle":"AI vision (in chat)","settings.multimodal.toggle.desc":"When on, the AI can see and explain this lesson's images during chat — used for diagrams/charts/architecture (needs a vision model).","settings.group.memory":"Learner memory","settings.memory.toggle":"Let the AI remember me","settings.memory.toggle.desc":"When on, the AI remembers how you learn across sessions (preferences / stuck points / recurring confusions) and adapts over time. Auto-summarized when you earn a crown (clear a node); also manually triggerable. All memory stays local.","settings.group.companion":"Learning companion","settings.companion.toggle":"Learning companion","settings.companion.toggle.desc":"Your companion lives in the course map, notebook and chat: celebrates wins, lip-syncs read-alouds, and taps along with every keystroke. Five forms to switch between. Fully local.","settings.companion.sfx":"Pet sounds","settings.companion.sfx.desc":"Short chirps when poked/hit/landing (synthesized, low volume)","settings.companion.pet":"Desktop pet mode","settings.companion.pet.desc":"Keep the companion on your desktop outside the app: transparent, always on top, wandering slowly — still poke-able. The in-app buddy takes a rest so you never see double.","settings.companion.form":"Form","companion.name":"Ember","companion.form.ember.name":"Ember","companion.form.ember.desc":"Blazing guardian — the passionate original; core charges with today's XP","companion.form.frost.name":"Frost","companion.form.frost.desc":"Crystal watcher — calm and steady; the hex core lights petal by petal","companion.form.moss.name":"Moss","companion.form.moss.desc":"Nature spirit — gentle company; the seed sprouts as you progress","companion.form.astro.name":"Astro","companion.form.astro.desc":"Stargazer — night-sky visor; the core moon waxes with today's XP","companion.form.ink.name":"Ink","companion.form.ink.desc":"Inkstone scholar — quiet study vibes; the ink pool rises with your progress","companion.greet.1":"I'm here — keep going!","companion.greet.2":"Almost got this one!","companion.greet.3":"Want me to explain again?","companion.greet.4":"Breathe. One more try.","settings.multimodal.current_model":"Current main model: {model}","settings.multimodal.not_selected":"(none)","settings.multimodal.hint_custom":"Custom provider — vision capability unknown. If it can't see images, override a vision model below.","settings.multimodal.hint_preset":"If the current model lacks vision, configure a dedicated vision model below. Common: GLM-4V / GPT-4o / Claude 3.5 / Gemini.","settings.multimodal.override_title":"Vision model override (optional — leave blank to reuse main model)","settings.multimodal.override_bridge_hint":"When the main model is text-only, images uploaded in chat are transcribed to text by this model before reaching the main model (image bridge).","settings.multimodal.legacy_preset":"Legacy config (preset {label}) still active; stop the override or switch to custom.","settings.multimodal.replace_custom":"Replace","settings.multimodal.stop_override":"Stop override","settings.multimodal.vision_capable":"vision","settings.multimodal.test_override":"Test model","settings.mathvision.toggle":"PDF math vision transcription (experimental)","settings.mathvision.desc":"When importing PDFs, math-dense pages are rendered to images and transcribed to LaTeX by the vision model configured above. Requires a vision model and spends quota per page; falls back to the plain text layer when off or on failure.","settings.saved_text":"Saved","settings.key.configured":"Configured","settings.custom.test_label":"(test)","settings.proto.openai":"OpenAI-compatible","chat.empty.overview":"Overview of this lesson","chat.empty.summary.title":"Lesson Summary","chat.empty.summary.none":"No summary yet — click Start to let the AI walk you through this lesson.","chat.empty.start":"Start Learning","chat.empty.greeting":"👋 Ready? Let's take this one step at a time.","chat.empty.keyless.title":"The lesson is on the right — give it a read","chat.empty.keyless.desc":"Configure an AI model to practice with me, do exercises, and track mastery.","chat.empty.keyless.btn":"Configure AI model","chat.empty.no_node.title":"Pick a node from the map on the left","chat.empty.no_node.desc":"Click a node to start learning. Green = available, Gold = mastered, Purple = chapter exam","chat.scroll.bottom":"Scroll to bottom","chat.speech.speak":"Read aloud","chat.speech.stop":"Stop reading","chat.speech.progress":"{n}/{total}","chat.speech.model_missing":"Speech model not downloaded yet. Get it in Settings → Speech.","chat.speech.engine_unavailable":"Speech engine not installed. Desktop has it built in; on Termux rerun the one-line install command to restore it (~12MB).","chat.speech.dictation":"Voice input","chat.speech.hold_to_talk":"Hold to talk","chat.speech.release_to_stop":"Release to finish","chat.speech.recording_hint":"Recording — release to finish","chat.speech.rerecord":"Discard & retry","chat.speech.retry":"Retry","chat.speech.back_to_keyboard":"Back to keyboard input","chat.speech.keyboard":"Keyboard","chat.speech.custom_provider_missing":"Custom speech provider missing or deleted. Reconfigure it in Settings → Speech Models.","chat.speech.no_speech":"No speech detected. Check your microphone and retry.","chat.speech.transcribing":"Transcribing…","chat.speech.asr_failed":"Transcription failed. Please retry.","chat.speech.groq_key_missing":"Groq key not configured. Set it in Settings → Model providers, or switch to the local engine.","chat.speech.azure_stt_key_missing":"Legacy Azure dictation key missing. Switch to a custom endpoint in Settings → Speech Models.","chat.speech.azure_stt_region_missing":"Legacy Azure dictation region missing. Switch to a custom endpoint in Settings → Speech Models.","chat.speech.asr_model_missing":"Dictation model not downloaded. Get Whisper in Settings → Speech Models (local offline), or use a custom endpoint.","chat.speech.asr_start_fail":"Microphone failed to start. Check system permissions.","chat.speech.asr_insecure_context":"Browsers only allow the microphone on secure contexts (https or 127.0.0.1). Open this page via the phone launcher, or enable serve TLS (--tls-cert/--tls-key) and access over https.","chat.speech.read_aloud_node":"Read this lesson","chat.speech.azure_key_missing":"Azure TTS key missing. Fill it in Settings → Speech.","chat.speech.azure_region_missing":"Azure TTS region missing. Fill it in Settings → Speech.","chat.speech.edge_failed":"Online synthesis failed and no local fallback model is ready. Retry later or switch to the local engine.","chat.speech.edge_disclosed":"Read-aloud sends text to Microsoft's online service (free Edge channel). For fully offline: Settings → Speech → Local.","settings.speech.tts_engine":"TTS engine","settings.speech.engine.edge":"Edge online","settings.speech.engine.azure":"Azure","settings.speech.engine.local":"Local offline","settings.speech.engine.custom":"Custom","settings.speech.engine.system":"System","settings.speech.engine.system_note":"Voices come from this device's browser/system speech engine; quality varies by device (vendor engines on Chinese Android phones are often more natural). Plays locally with no network; sentence highlighting still works while reading, companion mouth animation is unavailable.","settings.speech.engine.system_unavailable":"System speech is unavailable in this WebView","settings.speech.voice_auto":"Auto (prefer Chinese)","settings.speech.model.turbo_short":"Whisper Turbo (~1GB)","settings.speech.model.small_short":"Whisper Small (~360MB)","settings.speech.tts_title":"Read aloud","settings.speech.asr_title":"Dictation","settings.speech.custom_voice_ph":"e.g. alloy (empty = endpoint default)","settings.speech.legacy":"legacy, still active","settings.speech.key_saved":"key saved","settings.speech.confirm_del_custom":"Delete this provider? The tier becomes unusable.","settings.speech.downloading":"Downloading…","settings.speech.asr_engine.custom_note":"OpenAI-compatible transcription endpoint; for Groq use https://api.groq.com/openai/v1 + whisper-large-v3-turbo.","settings.speech.engine.edge_note":"Microsoft Edge read-aloud channel: free, no key, product-grade voices; text is synthesized online.","settings.speech.voice":"Voice","settings.speech.speed":"Speed","settings.speech.asr_engine":"Dictation engine","settings.speech.asr_engine.local":"Local offline","settings.speech.asr_engine.local_note":"Whisper offline transcription (native punctuation, strong Chinese); fully offline once the model is downloaded — Turbo ~1GB / Small ~360MB.","settings.speech.asr_auto_stop":"Auto-stop recording after silence","settings.speech.asr_ux_note":"Click the mic beside the input box to enter voice mode: hold to talk, then edit the recognized text before sending.","settings.speech.model.asr_turbo":"Dictation engine Whisper Turbo (~1GB, recommended on desktop)","settings.speech.model.asr_small":"Dictation engine Whisper Small (~360MB, lightweight)","settings.speech.license_mit":"MIT · local inference","settings.speech.model.tts":"Read-aloud engine (Kokoro, ~430MB)","settings.speech.state.absent":"Not downloaded","settings.speech.state.ready":"Ready","settings.speech.state.error":"Error","settings.speech.download":"Download","settings.speech.delete":"Delete","settings.speech.license":"Apache-2.0 · local inference","chat.friction.trigger":"I'm stuck","chat.friction.hint":"Pick what fits (optional one-liner). The AI will remember and adapt how it teaches this.","chat.friction.confused":"Confused","chat.friction.blocked":"Blocked","chat.friction.frustrated":"Frustrated","chat.friction.desc_placeholder":"Where exactly? (optional)","chat.friction.cancel":"Cancel","chat.friction.submit":"Log it","chat.friction.saved":"Logged — the AI will adapt how it teaches this lesson","chat.mastered.toast":"👑 You mastered this lesson!","chat.note.add":"Add note","chat.note.add.title":"Save this message to your notes","chat.reasoning.label":"Reasoning","chat.reasoning.chars":"{n} chars","chat.proposal.title":"AI Proposal","chat.proposal.fallback":"Proposal ({tool})","chat.proposal.apply":"Apply","chat.proposal.reject":"Reject","chat.proposal.mastered.title":"AI suggests you've mastered this lesson","chat.proposal.mastered.hint":"Accept to unlock the crown and schedule reviews.","chat.proposal.confirm":"Confirm mastery","chat.proposal.later":"Keep practicing","chat.proposal.applied":"Accepted · lesson mastered","chat.proposal.rejected":"Dismissed, keep learning","chat.copy":"Copy","chat.copied":"Copied","chat.tool.get_node_info":"Read node info","chat.tool.record_answer":"Record answer","chat.tool.mark_mastered":"Mark mastered","chat.tool.show_concept_map":"Generate concept map","chat.tool.generate_quiz":"Generate quiz","chat.tool.compare_table":"Generate comparison table","chat.tool.draw_diagram":"Draw diagram","chat.tool.show_code_walkthrough":"Code walkthrough","thread.empty.no_node":"No node selected","thread.empty.hint":"Type to start","thread.actions.label":"Actions","thread.new.label":"New thread","thread.streamingBadge":"AI is responding","thread.menu.rename":"Rename","thread.menu.archive":"Archive","thread.delete.confirm":'Delete thread "{name}"? Messages will also be deleted.',"notebook.empty.select_node":"Pick a node from the map on the left — its explanation shows here.","notebook.empty.no_notes_message":'No notes for this lesson yet. Select explanation text to "Add note", or ask the AI to "draw a concept map", "generate 3 questions", or "make a comparison table".',"notebook.node_type.section":"Chapter","notebook.node_type.concept":"Concept","notebook.node_type.lesson":"Lesson","notebook.content.loading":"Loading this lesson…","notebook.content.load_failed":"Failed to load content. ","notebook.content.retry":"Retry","notebook.content.render_failed":"This content failed to render (possibly malformed translation).","notebook.content.truncated":"…(truncated)","notebook.content.retry_render":"Retry render","notebook.content.empty":'No explanation for this lesson yet. Ask the AI tutor: "Walk me through this lesson."',"notebook.mindmap.toggle":"Mind map view","notebook.images.heading":"Images ({n})","notebook.quote.template":"About this passage 「{text}」, I don't quite get it. Please explain:","notebook.quote.ask":"Ask","notebook.quote.add_note":"Add note","notebook.quote.save_note.title":"Save the selected text to your notes (with source jump)","notebook.quote.hint":"Select any text in the explanation to add a note; AI-generated concept maps, comparison tables, and quiz cards land in the Notes tab automatically.","notebook.source.label":"Source","notebook.source.jump_content":"Jump to explanation","notebook.source.jump_chat":"Jump to chat message","notebook.zone.understand.subtitle":"Knowledge structure the AI lays out for you","notebook.zone.understand.empty_hint":'Ask the AI to "draw a concept map" or "make a comparison table" to structure this lesson',"notebook.zone.note.subtitle":"Your highlights — click to jump back to source","notebook.zone.note.empty_hint":'Select text in the explanation or chat, then "Add note" to save here',"notebook.zone.practice.subtitle_empty":"Test your grasp; redoable","notebook.zone.practice.subtitle_stats":"{n} questions · last correct {c} · wrong {w}","notebook.zone.practice.empty_hint":'Ask the AI "give me 3 questions" — they land here',"notebook.note.comment.ph_new":"Write a note about this highlight…","notebook.note.comment.ph_edit":"Edit note… (clear + save to delete)","notebook.action.save":"Save","notebook.action.cancel":"Cancel","notebook.note.edit_comment":"Edit note","notebook.note.add_comment":"Add note","notebook.note.pinned":"Pinned","notebook.note.pin":"Pin","notebook.note.unpin":"Unpin","notebook.note.delete":"Delete","notebook.quiz.last_correct":"Last correct","notebook.quiz.last_wrong":"Last wrong","notebook.artifact.broken":"Broken artifact data","notebook.asset.loading":"Loading…","exam.loading":"Generating exam questions…","exam.errorTitle":"Exam failed to load","exam.errorEmpty":"Failed to generate questions. Please try again later.","exam.reload":"Reload","exam.question.label":"Question {n}","exam.next":"Next","exam.submit":"Submit Exam","exam.accuracy":"Accuracy {n}%","exam.stars.congrats":"Congratulations! {n} stars earned!","exam.stars.thisAndBest":"This run: {n} stars · Best: {m} stars","exam.stars.failed":"Below 60%. Keep practicing!","exam.review.title":"Question Review","exam.review.questionFallback":"(Question {n})","exam.review.yourAnswer":"Your answer:","exam.review.correctAnswer":"Correct:","exam.review.unanswered":"(no answer)","exam.retry":"Retake exam (questions cached)","exam.generating.title":"Generating chapter exam…","exam.generating.stage":"AI is writing questions knowledge point by knowledge point","exam.generating.kcProgress":"{done} / {total} knowledge points covered","exam.generating.preparing":"Preparing…","exam.generating.canLeave":"You can leave this page — generation continues in the background and you'll be notified.","exam.failed.retry":"Regenerate","exam.ready.title":"Exam ready","exam.ready.meta":"{q} questions · {kc} knowledge points · ~{min} min","exam.ready.toast":'Exam questions for "{title}" are ready',"exam.start":"Start exam","exam.retryExam":"Retake exam","exam.regenerate":"New questions","exam.regenerate.confirmMsg":"Regenerating discards the current questions and has the AI write a fresh set for this chapter (past scores are kept).","exam.submitting":"Grading…","exam.q.progress":"Question {i} / {n}","exam.q.next":"Next","exam.q.submit":"Submit exam","exam.terminated.banner":"This attempt was terminated by leaving mid-exam. Unanswered questions were counted as wrong.","exam.result.score":"{correct} / {total} correct","exam.result.accuracy":"Accuracy {pct}%","exam.result.best":"Best: {stars} stars","exam.result.attempts":"{n} attempts","exam.result.kcBreakdown":"By knowledge point","exam.result.weakKc":"Weak · review suggested","exam.result.correctLabel":"Correct","exam.result.unanswered":"No answer","exam.result.yourAnswer":"Your answer:","exam.result.correctAnswer":"Correct answer:","exam.result.review":"Question review","exam.leave.title":"Leaving will end the exam","exam.leave.message":"Unanswered questions will be counted as wrong and this attempt will be recorded. Leave anyway?","exam.leave.confirm":"End and leave","exam.leave.cancel":"Keep going","error.renderFailed":"This content failed to render (possibly malformed).","error.retry":"Retry","artifact.unknownHeader":"Artifact (unknown type)","artifact.zoomOut":"Zoom out","artifact.zoomReset":"Reset zoom","artifact.zoomIn":"Zoom in","artifact.canvas.fit":"Fit","artifact.viewer.open":"Open large view","artifact.viewer.hint":"Pinch to zoom · drag to pan · Ctrl+scroll","artifact.conceptmap.stats":"{nodes} concepts · {edges} relations · Ctrl+scroll to zoom · drag to pan","artifact.codewalk.sectionLabel":"Step-by-step notes (click to jump to code)","artifact.codewalk.lineSingle":"Line {n}","artifact.codewalk.lineRange":"Lines {a}-{b}","artifact.diagram.flowchart":"Flowchart","artifact.diagram.sequence":"Sequence","artifact.diagram.state":"State","artifact.mermaid.openLive":"Open in mermaid.live (editable)","artifact.mermaid.rendering":"Rendering diagram…","artifact.mermaid.renderFailed":"Render failed. Showing source (copy to mermaid.live to view).","artifact.mermaid.repairing":"The diagram has a syntax error, auto-repairing…","artifact.mermaid.errorPrefix":"Error: {msg}","artifact.mermaid.hint":"Ctrl+scroll to zoom · drag to pan","quiz.questionProgress":"Q {cur}/{total}","quiz.answeredCorrect":"{n} correct","quiz.correct":"Correct","quiz.wrong":"Wrong","quiz.finish":"Finish","quiz.scoreSummary":"{correct}/{total} correct","quiz.hook.label":"📊 Quiz done: {{correct}}/{{total}}","quiz.hook.finish":"Finish quiz","quiz.hook.sent":"Results sent to your tutor, awaiting analysis…","quiz.hook.message":`I just finished the quiz{{title}}, scoring {{correct}}/{{total}}. Per-question breakdown below:
|
|
386
|
-
Based on my performance, decide what comes next: explain why I got questions wrong and the right reasoning, or judge whether I can move on. Do not re-issue the same set of questions, and do not just say well done.`,"quiz.hook.lineOk":"✅ Q{{n}}: {{prompt}} — correct","quiz.hook.lineWrong":"❌ Q{{n}}: {{prompt}} — I chose {{chosen}}, correct answer is {{answer}}","quiz.allCorrectHint":"All correct! Mastery update proposed.","quiz.tryAgainHint":"Practice another set to consolidate.","quiz.action.nextPrompt":"What's next:","quiz.action.explainWrong":"Explain what I got wrong","quiz.action.retry":"Another set","quiz.action.goDeeper":"Go deeper","quiz.action.markMastered":"Confirm I've mastered it","quiz.action.nextTopic":"Next topic","guess.header":"Take a guess","guess.pickedPrefix":"I guess: ","guess.waitReveal":"Guessed — waiting for the reveal…","import.deleted":"Deleted: {title}","exercise.title":"📝 Practice","exercise.generate":"Generate a question","exercise.submit":"Submit Answer","exercise.next":"Next →","exercise.correct":"✅ Correct!","exercise.wrong":"❌ Wrong","exercise.types.mcq":"Multiple Choice","exercise.types.fill_blank":"Fill in the Blank","exercise.types.true_false":"True or False","dashboard.title":"Learning Dashboard","dashboard.stat.streak":"Streak","dashboard.stat.due":"Due Today","dashboard.stat.mastery":"Overall Mastery","dashboard.review":"Review","dashboard.cleared":"Cleared","dashboard.export.md":"📄 Export Report","dashboard.export.json":"Export JSON","dashboard.section_mastery":"Mastery by Section","dashboard.mini.sections":"Mastery by section","dashboard.mini.struggle":"Your struggle spots (tap to relearn)","import.title":"Import Course","import.url":"GitHub URL","import.markdown":"Paste Markdown","import.btn":"Import","import.md_btn":"Generate Course","streak.days":"days","streak.title":"{n}-day streak · longest {m} days","streak.freeze.title":"{n} freeze left: saves your streak on a missed day"}};function gs(){return ps}function Q4(e){e!==ps&&(ps=e,typeof localStorage<"u"&&localStorage.setItem(Th,e),yo.forEach(t=>t()))}function Tu(e,t=ps,n){var s,i;let r=((s=Ul[t])==null?void 0:s[e])??((i=Ul["zh-CN"])==null?void 0:i[e])??e;if(n)for(const[a,o]of Object.entries(n))r=r.replaceAll(`{${a}}`,String(o));return r}function We(){const e=w.useSyncExternalStore(vh,gs,gs);return w.useCallback((t,n)=>Tu(t,e,n),[e])}function kh(){return w.useSyncExternalStore(vh,gs,gs)}const bx=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].map(e=>`${e}:not([hidden])`).join(",");function zl(e){return Array.from(e.querySelectorAll(bx)).filter(t=>t.offsetParent!==null||t===document.activeElement)}function Os(e,t){w.useEffect(()=>{if(!t)return;const n=e.current;if(!n)return;const r=document.activeElement,i=zl(n)[0]??n,a=window.setTimeout(()=>i.focus(),0),o=u=>{if(u.key!=="Tab")return;const l=zl(n);if(l.length===0){u.preventDefault(),n.focus();return}const c=l[0],f=l[l.length-1];u.shiftKey?(document.activeElement===c||!n.contains(document.activeElement))&&(u.preventDefault(),f.focus()):document.activeElement===f&&(u.preventDefault(),c.focus())};return n.addEventListener("keydown",o),()=>{if(window.clearTimeout(a),n.removeEventListener("keydown",o),r&&document.body.contains(r))try{r.focus()}catch{}}},[e,t])}const Pi=220;function wh({anchorRect:e,message:t,onConfirm:n,onCancel:r,confirmLabel:s,cancelLabel:i,danger:a=!1,testid:o="confirm-card"}){const u=We(),l=w.useRef(null);Os(l,!0);const c=s??u("action.confirm"),f=i??u("action.cancel");w.useEffect(()=>{const y=T=>{l.current&&!l.current.contains(T.target)&&r()},v=T=>{T.key==="Escape"&&r(),T.key==="Enter"&&(T.preventDefault(),n())};return document.addEventListener("mousedown",y),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",y),document.removeEventListener("keydown",v)}},[r,n]);const h=window.innerWidth,d=window.innerHeight,m=e.right-Pi,p=Math.max(8,Math.min(m,h-Pi-8)),g=e.bottom+4+Pi>d?Math.max(8,e.top-4-Pi):e.bottom+4;return Eh.createPortal(x.jsxs("div",{ref:l,className:`confirm-card fixed z-[60] w-[220px] bg-surface-0 rounded-xl shadow-elevated border p-3 ${a?"border-warning/50":"border-[var(--border)]"}`,style:{left:p,top:g},role:"alertdialog","aria-modal":"false","data-testid":o,onClick:y=>y.stopPropagation(),children:[x.jsx("p",{className:"text-body text-ink-muted leading-relaxed mb-3",children:t}),x.jsxs("div",{className:"flex gap-2 justify-end",children:[x.jsx("button",{onClick:r,"data-testid":`${o}-cancel`,className:"px-2.5 py-1 rounded-md text-label font-bold text-ink-muted hover:text-ink-strong hover:bg-surface-3 transition-colors",children:f}),x.jsx("button",{onClick:n,"data-testid":`${o}-confirm`,className:"btn-3d-brand px-2.5 py-1 text-label",style:a?{background:"var(--warning)",boxShadow:"0 3px 0 0 var(--warning-dark)"}:void 0,children:c})]})]}),document.body)}const yx=268,vu=28,Ex=20,Sh=vu*2+Ex,Tx=Sh+8,vx=104,kx=18,ha=vu+6,wx=26,Sx=22;function Eo(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t^=t>>>16,t=Math.imul(t,2246822507),t^=t>>>13,t=Math.imul(t,3266489909),t^=t>>>16,t>>>0}function Ax(e,t=yx,n=""){const r=[],s=t/2,i=t/2-kx-vu;for(let u=0;u<e;u++){const l=ha+u*vx,f=Eo(`${n}:${u}`)/4294967295*2-1,h=s+f*i,m=Eo(`${n}:${u}:y`)/4294967295*2-1,p=l+m*wx;r.push({x:h,y:p,index:u})}if(r.length>0){r[0].y<ha&&(r[0].y=ha);for(let u=1;u<r.length;u++){const l=r[u-1].y+Tx;r[u].y<l&&(r[u].y=l)}}const a=[];for(let u=0;u<r.length-1;u++)a.push({from:r[u],to:r[u+1],index:u});const o=r.length===0?40:r[r.length-1].y+Sh/2+10;return{nodes:r,segments:a,height:o}}function Cx(e){const{from:t,to:n}=e,r=(t.y+n.y)/2+Sx;return`M ${t.x} ${t.y} C ${t.x} ${r}, ${n.x} ${r}, ${n.x} ${n.y}`}var es={exports:{}};/*!
|
|
387
|
-
* matter-js 0.19.0 by @liabru
|
|
388
|
-
* http://brm.io/matter-js/
|
|
389
|
-
* License MIT
|
|
390
|
-
*
|
|
391
|
-
* The MIT License (MIT)
|
|
392
|
-
*
|
|
393
|
-
* Copyright (c) Liam Brummitt and contributors.
|
|
394
|
-
*
|
|
395
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
396
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
397
|
-
* in the Software without restriction, including without limitation the rights
|
|
398
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
399
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
400
|
-
* furnished to do so, subject to the following conditions:
|
|
401
|
-
*
|
|
402
|
-
* The above copyright notice and this permission notice shall be included in
|
|
403
|
-
* all copies or substantial portions of the Software.
|
|
404
|
-
*
|
|
405
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
406
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
407
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
408
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
409
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
410
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
411
|
-
* THE SOFTWARE.
|
|
412
|
-
*/var _x=es.exports,Vl;function Ix(){return Vl||(Vl=1,(function(e,t){(function(r,s){e.exports=s()})(_x,function(){return(function(n){var r={};function s(i){if(r[i])return r[i].exports;var a=r[i]={i,l:!1,exports:{}};return n[i].call(a.exports,a,a.exports,s),a.l=!0,a.exports}return s.m=n,s.c=r,s.d=function(i,a,o){s.o(i,a)||Object.defineProperty(i,a,{enumerable:!0,get:o})},s.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},s.t=function(i,a){if(a&1&&(i=s(i)),a&8||a&4&&typeof i=="object"&&i&&i.__esModule)return i;var o=Object.create(null);if(s.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:i}),a&2&&typeof i!="string")for(var u in i)s.d(o,u,(function(l){return i[l]}).bind(null,u));return o},s.n=function(i){var a=i&&i.__esModule?function(){return i.default}:function(){return i};return s.d(a,"a",a),a},s.o=function(i,a){return Object.prototype.hasOwnProperty.call(i,a)},s.p="",s(s.s=20)})([(function(n,r){var s={};n.exports=s,(function(){s._baseDelta=1e3/60,s._nextId=0,s._seed=0,s._nowStartTime=+new Date,s._warnedOnce={},s._decomp=null,s.extend=function(a,o){var u,l;typeof o=="boolean"?(u=2,l=o):(u=1,l=!0);for(var c=u;c<arguments.length;c++){var f=arguments[c];if(f)for(var h in f)l&&f[h]&&f[h].constructor===Object&&(!a[h]||a[h].constructor===Object)?(a[h]=a[h]||{},s.extend(a[h],l,f[h])):a[h]=f[h]}return a},s.clone=function(a,o){return s.extend({},o,a)},s.keys=function(a){if(Object.keys)return Object.keys(a);var o=[];for(var u in a)o.push(u);return o},s.values=function(a){var o=[];if(Object.keys){for(var u=Object.keys(a),l=0;l<u.length;l++)o.push(a[u[l]]);return o}for(var c in a)o.push(a[c]);return o},s.get=function(a,o,u,l){o=o.split(".").slice(u,l);for(var c=0;c<o.length;c+=1)a=a[o[c]];return a},s.set=function(a,o,u,l,c){var f=o.split(".").slice(l,c);return s.get(a,o,0,-1)[f[f.length-1]]=u,u},s.shuffle=function(a){for(var o=a.length-1;o>0;o--){var u=Math.floor(s.random()*(o+1)),l=a[o];a[o]=a[u],a[u]=l}return a},s.choose=function(a){return a[Math.floor(s.random()*a.length)]},s.isElement=function(a){return typeof HTMLElement<"u"?a instanceof HTMLElement:!!(a&&a.nodeType&&a.nodeName)},s.isArray=function(a){return Object.prototype.toString.call(a)==="[object Array]"},s.isFunction=function(a){return typeof a=="function"},s.isPlainObject=function(a){return typeof a=="object"&&a.constructor===Object},s.isString=function(a){return toString.call(a)==="[object String]"},s.clamp=function(a,o,u){return a<o?o:a>u?u:a},s.sign=function(a){return a<0?-1:1},s.now=function(){if(typeof window<"u"&&window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return Date.now?Date.now():new Date-s._nowStartTime},s.random=function(a,o){return a=typeof a<"u"?a:0,o=typeof o<"u"?o:1,a+i()*(o-a)};var i=function(){return s._seed=(s._seed*9301+49297)%233280,s._seed/233280};s.colorToNumber=function(a){return a=a.replace("#",""),a.length==3&&(a=a.charAt(0)+a.charAt(0)+a.charAt(1)+a.charAt(1)+a.charAt(2)+a.charAt(2)),parseInt(a,16)},s.logLevel=1,s.log=function(){console&&s.logLevel>0&&s.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},s.info=function(){console&&s.logLevel>0&&s.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},s.warn=function(){console&&s.logLevel>0&&s.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},s.warnOnce=function(){var a=Array.prototype.slice.call(arguments).join(" ");s._warnedOnce[a]||(s.warn(a),s._warnedOnce[a]=!0)},s.deprecated=function(a,o,u){a[o]=s.chain(function(){s.warnOnce("🔅 deprecated 🔅",u)},a[o])},s.nextId=function(){return s._nextId++},s.indexOf=function(a,o){if(a.indexOf)return a.indexOf(o);for(var u=0;u<a.length;u++)if(a[u]===o)return u;return-1},s.map=function(a,o){if(a.map)return a.map(o);for(var u=[],l=0;l<a.length;l+=1)u.push(o(a[l]));return u},s.topologicalSort=function(a){var o=[],u=[],l=[];for(var c in a)!u[c]&&!l[c]&&s._topologicalSort(c,u,l,a,o);return o},s._topologicalSort=function(a,o,u,l,c){var f=l[a]||[];u[a]=!0;for(var h=0;h<f.length;h+=1){var d=f[h];u[d]||o[d]||s._topologicalSort(d,o,u,l,c)}u[a]=!1,o[a]=!0,c.push(a)},s.chain=function(){for(var a=[],o=0;o<arguments.length;o+=1){var u=arguments[o];u._chained?a.push.apply(a,u._chained):a.push(u)}var l=function(){for(var c,f=new Array(arguments.length),h=0,d=arguments.length;h<d;h++)f[h]=arguments[h];for(h=0;h<a.length;h+=1){var m=a[h].apply(c,f);typeof m<"u"&&(c=m)}return c};return l._chained=a,l},s.chainPathBefore=function(a,o,u){return s.set(a,o,s.chain(u,s.get(a,o)))},s.chainPathAfter=function(a,o,u){return s.set(a,o,s.chain(s.get(a,o),u))},s.setDecomp=function(a){s._decomp=a},s.getDecomp=function(){var a=s._decomp;try{!a&&typeof window<"u"&&(a=window.decomp),!a&&typeof Al<"u"&&(a=Al.decomp)}catch{a=null}return a}})()}),(function(n,r){var s={};n.exports=s,(function(){s.create=function(i){var a={min:{x:0,y:0},max:{x:0,y:0}};return i&&s.update(a,i),a},s.update=function(i,a,o){i.min.x=1/0,i.max.x=-1/0,i.min.y=1/0,i.max.y=-1/0;for(var u=0;u<a.length;u++){var l=a[u];l.x>i.max.x&&(i.max.x=l.x),l.x<i.min.x&&(i.min.x=l.x),l.y>i.max.y&&(i.max.y=l.y),l.y<i.min.y&&(i.min.y=l.y)}o&&(o.x>0?i.max.x+=o.x:i.min.x+=o.x,o.y>0?i.max.y+=o.y:i.min.y+=o.y)},s.contains=function(i,a){return a.x>=i.min.x&&a.x<=i.max.x&&a.y>=i.min.y&&a.y<=i.max.y},s.overlaps=function(i,a){return i.min.x<=a.max.x&&i.max.x>=a.min.x&&i.max.y>=a.min.y&&i.min.y<=a.max.y},s.translate=function(i,a){i.min.x+=a.x,i.max.x+=a.x,i.min.y+=a.y,i.max.y+=a.y},s.shift=function(i,a){var o=i.max.x-i.min.x,u=i.max.y-i.min.y;i.min.x=a.x,i.max.x=a.x+o,i.min.y=a.y,i.max.y=a.y+u}})()}),(function(n,r){var s={};n.exports=s,(function(){s.create=function(i,a){return{x:i||0,y:a||0}},s.clone=function(i){return{x:i.x,y:i.y}},s.magnitude=function(i){return Math.sqrt(i.x*i.x+i.y*i.y)},s.magnitudeSquared=function(i){return i.x*i.x+i.y*i.y},s.rotate=function(i,a,o){var u=Math.cos(a),l=Math.sin(a);o||(o={});var c=i.x*u-i.y*l;return o.y=i.x*l+i.y*u,o.x=c,o},s.rotateAbout=function(i,a,o,u){var l=Math.cos(a),c=Math.sin(a);u||(u={});var f=o.x+((i.x-o.x)*l-(i.y-o.y)*c);return u.y=o.y+((i.x-o.x)*c+(i.y-o.y)*l),u.x=f,u},s.normalise=function(i){var a=s.magnitude(i);return a===0?{x:0,y:0}:{x:i.x/a,y:i.y/a}},s.dot=function(i,a){return i.x*a.x+i.y*a.y},s.cross=function(i,a){return i.x*a.y-i.y*a.x},s.cross3=function(i,a,o){return(a.x-i.x)*(o.y-i.y)-(a.y-i.y)*(o.x-i.x)},s.add=function(i,a,o){return o||(o={}),o.x=i.x+a.x,o.y=i.y+a.y,o},s.sub=function(i,a,o){return o||(o={}),o.x=i.x-a.x,o.y=i.y-a.y,o},s.mult=function(i,a){return{x:i.x*a,y:i.y*a}},s.div=function(i,a){return{x:i.x/a,y:i.y/a}},s.perp=function(i,a){return a=a===!0?-1:1,{x:a*-i.y,y:a*i.x}},s.neg=function(i){return{x:-i.x,y:-i.y}},s.angle=function(i,a){return Math.atan2(a.y-i.y,a.x-i.x)},s._temp=[s.create(),s.create(),s.create(),s.create(),s.create(),s.create()]})()}),(function(n,r,s){var i={};n.exports=i;var a=s(2),o=s(0);(function(){i.create=function(u,l){for(var c=[],f=0;f<u.length;f++){var h=u[f],d={x:h.x,y:h.y,index:f,body:l,isInternal:!1};c.push(d)}return c},i.fromPath=function(u,l){var c=/L?\s*([-\d.e]+)[\s,]*([-\d.e]+)*/ig,f=[];return u.replace(c,function(h,d,m){f.push({x:parseFloat(d),y:parseFloat(m)})}),i.create(f,l)},i.centre=function(u){for(var l=i.area(u,!0),c={x:0,y:0},f,h,d,m=0;m<u.length;m++)d=(m+1)%u.length,f=a.cross(u[m],u[d]),h=a.mult(a.add(u[m],u[d]),f),c=a.add(c,h);return a.div(c,6*l)},i.mean=function(u){for(var l={x:0,y:0},c=0;c<u.length;c++)l.x+=u[c].x,l.y+=u[c].y;return a.div(l,u.length)},i.area=function(u,l){for(var c=0,f=u.length-1,h=0;h<u.length;h++)c+=(u[f].x-u[h].x)*(u[f].y+u[h].y),f=h;return l?c/2:Math.abs(c)/2},i.inertia=function(u,l){for(var c=0,f=0,h=u,d,m,p=0;p<h.length;p++)m=(p+1)%h.length,d=Math.abs(a.cross(h[m],h[p])),c+=d*(a.dot(h[m],h[m])+a.dot(h[m],h[p])+a.dot(h[p],h[p])),f+=d;return l/6*(c/f)},i.translate=function(u,l,c){c=typeof c<"u"?c:1;var f=u.length,h=l.x*c,d=l.y*c,m;for(m=0;m<f;m++)u[m].x+=h,u[m].y+=d;return u},i.rotate=function(u,l,c){if(l!==0){var f=Math.cos(l),h=Math.sin(l),d=c.x,m=c.y,p=u.length,g,y,v,T;for(T=0;T<p;T++)g=u[T],y=g.x-d,v=g.y-m,g.x=d+(y*f-v*h),g.y=m+(y*h+v*f);return u}},i.contains=function(u,l){for(var c=l.x,f=l.y,h=u.length,d=u[h-1],m,p=0;p<h;p++){if(m=u[p],(c-d.x)*(m.y-d.y)+(f-d.y)*(d.x-m.x)>0)return!1;d=m}return!0},i.scale=function(u,l,c,f){if(l===1&&c===1)return u;f=f||i.centre(u);for(var h,d,m=0;m<u.length;m++)h=u[m],d=a.sub(h,f),u[m].x=f.x+d.x*l,u[m].y=f.y+d.y*c;return u},i.chamfer=function(u,l,c,f,h){typeof l=="number"?l=[l]:l=l||[8],c=typeof c<"u"?c:-1,f=f||2,h=h||14;for(var d=[],m=0;m<u.length;m++){var p=u[m-1>=0?m-1:u.length-1],g=u[m],y=u[(m+1)%u.length],v=l[m<l.length?m:l.length-1];if(v===0){d.push(g);continue}var T=a.normalise({x:g.y-p.y,y:p.x-g.x}),C=a.normalise({x:y.y-g.y,y:g.x-y.x}),E=Math.sqrt(2*Math.pow(v,2)),k=a.mult(o.clone(T),v),_=a.normalise(a.mult(a.add(T,C),.5)),A=a.sub(g,a.mult(_,E)),I=c;c===-1&&(I=Math.pow(v,.32)*1.75),I=o.clamp(I,f,h),I%2===1&&(I+=1);for(var S=Math.acos(a.dot(T,C)),L=S/I,N=0;N<I;N++)d.push(a.add(a.rotate(k,L*N),A))}return d},i.clockwiseSort=function(u){var l=i.mean(u);return u.sort(function(c,f){return a.angle(l,c)-a.angle(l,f)}),u},i.isConvex=function(u){var l=0,c=u.length,f,h,d,m;if(c<3)return null;for(f=0;f<c;f++)if(h=(f+1)%c,d=(f+2)%c,m=(u[h].x-u[f].x)*(u[d].y-u[h].y),m-=(u[h].y-u[f].y)*(u[d].x-u[h].x),m<0?l|=1:m>0&&(l|=2),l===3)return!1;return l!==0?!0:null},i.hull=function(u){var l=[],c=[],f,h;for(u=u.slice(0),u.sort(function(d,m){var p=d.x-m.x;return p!==0?p:d.y-m.y}),h=0;h<u.length;h+=1){for(f=u[h];c.length>=2&&a.cross3(c[c.length-2],c[c.length-1],f)<=0;)c.pop();c.push(f)}for(h=u.length-1;h>=0;h-=1){for(f=u[h];l.length>=2&&a.cross3(l[l.length-2],l[l.length-1],f)<=0;)l.pop();l.push(f)}return l.pop(),c.pop(),l.concat(c)}})()}),(function(n,r,s){var i={};n.exports=i;var a=s(3),o=s(2),u=s(7),l=s(0),c=s(1),f=s(11);(function(){i._timeCorrection=!0,i._inertiaScale=4,i._nextCollidingGroupId=1,i._nextNonCollidingGroupId=-1,i._nextCategory=1,i._baseDelta=1e3/60,i.create=function(d){var m={id:l.nextId(),type:"body",label:"Body",parts:[],plugin:{},angle:0,vertices:a.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"),position:{x:0,y:0},force:{x:0,y:0},torque:0,positionImpulse:{x:0,y:0},constraintImpulse:{x:0,y:0,angle:0},totalContacts:0,speed:0,angularSpeed:0,velocity:{x:0,y:0},angularVelocity:0,isSensor:!1,isStatic:!1,isSleeping:!1,motion:0,sleepThreshold:60,density:.001,restitution:0,friction:.1,frictionStatic:.5,frictionAir:.01,collisionFilter:{category:1,mask:4294967295,group:0},slop:.05,timeScale:1,render:{visible:!0,opacity:1,strokeStyle:null,fillStyle:null,lineWidth:null,sprite:{xScale:1,yScale:1,xOffset:0,yOffset:0}},events:null,bounds:null,chamfer:null,circleRadius:0,positionPrev:null,anglePrev:0,parent:null,axes:null,area:0,mass:0,inertia:0,deltaTime:16.666666666666668,_original:null},p=l.extend(m,d);return h(p,d),p},i.nextGroup=function(d){return d?i._nextNonCollidingGroupId--:i._nextCollidingGroupId++},i.nextCategory=function(){return i._nextCategory=i._nextCategory<<1,i._nextCategory};var h=function(d,m){m=m||{},i.set(d,{bounds:d.bounds||c.create(d.vertices),positionPrev:d.positionPrev||o.clone(d.position),anglePrev:d.anglePrev||d.angle,vertices:d.vertices,parts:d.parts||[d],isStatic:d.isStatic,isSleeping:d.isSleeping,parent:d.parent||d}),a.rotate(d.vertices,d.angle,d.position),f.rotate(d.axes,d.angle),c.update(d.bounds,d.vertices,d.velocity),i.set(d,{axes:m.axes||d.axes,area:m.area||d.area,mass:m.mass||d.mass,inertia:m.inertia||d.inertia});var p=d.isStatic?"#14151f":l.choose(["#f19648","#f5d259","#f55a3c","#063e7b","#ececd1"]),g=d.isStatic?"#555":"#ccc",y=d.isStatic&&d.render.fillStyle===null?1:0;d.render.fillStyle=d.render.fillStyle||p,d.render.strokeStyle=d.render.strokeStyle||g,d.render.lineWidth=d.render.lineWidth||y,d.render.sprite.xOffset+=-(d.bounds.min.x-d.position.x)/(d.bounds.max.x-d.bounds.min.x),d.render.sprite.yOffset+=-(d.bounds.min.y-d.position.y)/(d.bounds.max.y-d.bounds.min.y)};i.set=function(d,m,p){var g;typeof m=="string"&&(g=m,m={},m[g]=p);for(g in m)if(Object.prototype.hasOwnProperty.call(m,g))switch(p=m[g],g){case"isStatic":i.setStatic(d,p);break;case"isSleeping":u.set(d,p);break;case"mass":i.setMass(d,p);break;case"density":i.setDensity(d,p);break;case"inertia":i.setInertia(d,p);break;case"vertices":i.setVertices(d,p);break;case"position":i.setPosition(d,p);break;case"angle":i.setAngle(d,p);break;case"velocity":i.setVelocity(d,p);break;case"angularVelocity":i.setAngularVelocity(d,p);break;case"speed":i.setSpeed(d,p);break;case"angularSpeed":i.setAngularSpeed(d,p);break;case"parts":i.setParts(d,p);break;case"centre":i.setCentre(d,p);break;default:d[g]=p}},i.setStatic=function(d,m){for(var p=0;p<d.parts.length;p++){var g=d.parts[p];g.isStatic=m,m?(g._original={restitution:g.restitution,friction:g.friction,mass:g.mass,inertia:g.inertia,density:g.density,inverseMass:g.inverseMass,inverseInertia:g.inverseInertia},g.restitution=0,g.friction=1,g.mass=g.inertia=g.density=1/0,g.inverseMass=g.inverseInertia=0,g.positionPrev.x=g.position.x,g.positionPrev.y=g.position.y,g.anglePrev=g.angle,g.angularVelocity=0,g.speed=0,g.angularSpeed=0,g.motion=0):g._original&&(g.restitution=g._original.restitution,g.friction=g._original.friction,g.mass=g._original.mass,g.inertia=g._original.inertia,g.density=g._original.density,g.inverseMass=g._original.inverseMass,g.inverseInertia=g._original.inverseInertia,g._original=null)}},i.setMass=function(d,m){var p=d.inertia/(d.mass/6);d.inertia=p*(m/6),d.inverseInertia=1/d.inertia,d.mass=m,d.inverseMass=1/d.mass,d.density=d.mass/d.area},i.setDensity=function(d,m){i.setMass(d,m*d.area),d.density=m},i.setInertia=function(d,m){d.inertia=m,d.inverseInertia=1/d.inertia},i.setVertices=function(d,m){m[0].body===d?d.vertices=m:d.vertices=a.create(m,d),d.axes=f.fromVertices(d.vertices),d.area=a.area(d.vertices),i.setMass(d,d.density*d.area);var p=a.centre(d.vertices);a.translate(d.vertices,p,-1),i.setInertia(d,i._inertiaScale*a.inertia(d.vertices,d.mass)),a.translate(d.vertices,d.position),c.update(d.bounds,d.vertices,d.velocity)},i.setParts=function(d,m,p){var g;for(m=m.slice(0),d.parts.length=0,d.parts.push(d),d.parent=d,g=0;g<m.length;g++){var y=m[g];y!==d&&(y.parent=d,d.parts.push(y))}if(d.parts.length!==1){if(p=typeof p<"u"?p:!0,p){var v=[];for(g=0;g<m.length;g++)v=v.concat(m[g].vertices);a.clockwiseSort(v);var T=a.hull(v),C=a.centre(T);i.setVertices(d,T),a.translate(d.vertices,C)}var E=i._totalProperties(d);d.area=E.area,d.parent=d,d.position.x=E.centre.x,d.position.y=E.centre.y,d.positionPrev.x=E.centre.x,d.positionPrev.y=E.centre.y,i.setMass(d,E.mass),i.setInertia(d,E.inertia),i.setPosition(d,E.centre)}},i.setCentre=function(d,m,p){p?(d.positionPrev.x+=m.x,d.positionPrev.y+=m.y,d.position.x+=m.x,d.position.y+=m.y):(d.positionPrev.x=m.x-(d.position.x-d.positionPrev.x),d.positionPrev.y=m.y-(d.position.y-d.positionPrev.y),d.position.x=m.x,d.position.y=m.y)},i.setPosition=function(d,m,p){var g=o.sub(m,d.position);p?(d.positionPrev.x=d.position.x,d.positionPrev.y=d.position.y,d.velocity.x=g.x,d.velocity.y=g.y,d.speed=o.magnitude(g)):(d.positionPrev.x+=g.x,d.positionPrev.y+=g.y);for(var y=0;y<d.parts.length;y++){var v=d.parts[y];v.position.x+=g.x,v.position.y+=g.y,a.translate(v.vertices,g),c.update(v.bounds,v.vertices,d.velocity)}},i.setAngle=function(d,m,p){var g=m-d.angle;p?(d.anglePrev=d.angle,d.angularVelocity=g,d.angularSpeed=Math.abs(g)):d.anglePrev+=g;for(var y=0;y<d.parts.length;y++){var v=d.parts[y];v.angle+=g,a.rotate(v.vertices,g,d.position),f.rotate(v.axes,g),c.update(v.bounds,v.vertices,d.velocity),y>0&&o.rotateAbout(v.position,g,d.position,v.position)}},i.setVelocity=function(d,m){var p=d.deltaTime/i._baseDelta;d.positionPrev.x=d.position.x-m.x*p,d.positionPrev.y=d.position.y-m.y*p,d.velocity.x=(d.position.x-d.positionPrev.x)/p,d.velocity.y=(d.position.y-d.positionPrev.y)/p,d.speed=o.magnitude(d.velocity)},i.getVelocity=function(d){var m=i._baseDelta/d.deltaTime;return{x:(d.position.x-d.positionPrev.x)*m,y:(d.position.y-d.positionPrev.y)*m}},i.getSpeed=function(d){return o.magnitude(i.getVelocity(d))},i.setSpeed=function(d,m){i.setVelocity(d,o.mult(o.normalise(i.getVelocity(d)),m))},i.setAngularVelocity=function(d,m){var p=d.deltaTime/i._baseDelta;d.anglePrev=d.angle-m*p,d.angularVelocity=(d.angle-d.anglePrev)/p,d.angularSpeed=Math.abs(d.angularVelocity)},i.getAngularVelocity=function(d){return(d.angle-d.anglePrev)*i._baseDelta/d.deltaTime},i.getAngularSpeed=function(d){return Math.abs(i.getAngularVelocity(d))},i.setAngularSpeed=function(d,m){i.setAngularVelocity(d,l.sign(i.getAngularVelocity(d))*m)},i.translate=function(d,m,p){i.setPosition(d,o.add(d.position,m),p)},i.rotate=function(d,m,p,g){if(!p)i.setAngle(d,d.angle+m,g);else{var y=Math.cos(m),v=Math.sin(m),T=d.position.x-p.x,C=d.position.y-p.y;i.setPosition(d,{x:p.x+(T*y-C*v),y:p.y+(T*v+C*y)},g),i.setAngle(d,d.angle+m,g)}},i.scale=function(d,m,p,g){var y=0,v=0;g=g||d.position;for(var T=0;T<d.parts.length;T++){var C=d.parts[T];a.scale(C.vertices,m,p,g),C.axes=f.fromVertices(C.vertices),C.area=a.area(C.vertices),i.setMass(C,d.density*C.area),a.translate(C.vertices,{x:-C.position.x,y:-C.position.y}),i.setInertia(C,i._inertiaScale*a.inertia(C.vertices,C.mass)),a.translate(C.vertices,{x:C.position.x,y:C.position.y}),T>0&&(y+=C.area,v+=C.inertia),C.position.x=g.x+(C.position.x-g.x)*m,C.position.y=g.y+(C.position.y-g.y)*p,c.update(C.bounds,C.vertices,d.velocity)}d.parts.length>1&&(d.area=y,d.isStatic||(i.setMass(d,d.density*y),i.setInertia(d,v))),d.circleRadius&&(m===p?d.circleRadius*=m:d.circleRadius=null)},i.update=function(d,m){m=(typeof m<"u"?m:1e3/60)*d.timeScale;var p=m*m,g=i._timeCorrection?m/(d.deltaTime||m):1,y=1-d.frictionAir*(m/l._baseDelta),v=(d.position.x-d.positionPrev.x)*g,T=(d.position.y-d.positionPrev.y)*g;d.velocity.x=v*y+d.force.x/d.mass*p,d.velocity.y=T*y+d.force.y/d.mass*p,d.positionPrev.x=d.position.x,d.positionPrev.y=d.position.y,d.position.x+=d.velocity.x,d.position.y+=d.velocity.y,d.deltaTime=m,d.angularVelocity=(d.angle-d.anglePrev)*y*g+d.torque/d.inertia*p,d.anglePrev=d.angle,d.angle+=d.angularVelocity;for(var C=0;C<d.parts.length;C++){var E=d.parts[C];a.translate(E.vertices,d.velocity),C>0&&(E.position.x+=d.velocity.x,E.position.y+=d.velocity.y),d.angularVelocity!==0&&(a.rotate(E.vertices,d.angularVelocity,d.position),f.rotate(E.axes,d.angularVelocity),C>0&&o.rotateAbout(E.position,d.angularVelocity,d.position,E.position)),c.update(E.bounds,E.vertices,d.velocity)}},i.updateVelocities=function(d){var m=i._baseDelta/d.deltaTime,p=d.velocity;p.x=(d.position.x-d.positionPrev.x)*m,p.y=(d.position.y-d.positionPrev.y)*m,d.speed=Math.sqrt(p.x*p.x+p.y*p.y),d.angularVelocity=(d.angle-d.anglePrev)*m,d.angularSpeed=Math.abs(d.angularVelocity)},i.applyForce=function(d,m,p){var g={x:m.x-d.position.x,y:m.y-d.position.y};d.force.x+=p.x,d.force.y+=p.y,d.torque+=g.x*p.y-g.y*p.x},i._totalProperties=function(d){for(var m={mass:0,area:0,inertia:0,centre:{x:0,y:0}},p=d.parts.length===1?0:1;p<d.parts.length;p++){var g=d.parts[p],y=g.mass!==1/0?g.mass:1;m.mass+=y,m.area+=g.area,m.inertia+=g.inertia,m.centre=o.add(m.centre,o.mult(g.position,y))}return m.centre=o.div(m.centre,m.mass),m}})()}),(function(n,r,s){var i={};n.exports=i;var a=s(0);(function(){i.on=function(o,u,l){for(var c=u.split(" "),f,h=0;h<c.length;h++)f=c[h],o.events=o.events||{},o.events[f]=o.events[f]||[],o.events[f].push(l);return l},i.off=function(o,u,l){if(!u){o.events={};return}typeof u=="function"&&(l=u,u=a.keys(o.events).join(" "));for(var c=u.split(" "),f=0;f<c.length;f++){var h=o.events[c[f]],d=[];if(l&&h)for(var m=0;m<h.length;m++)h[m]!==l&&d.push(h[m]);o.events[c[f]]=d}},i.trigger=function(o,u,l){var c,f,h,d,m=o.events;if(m&&a.keys(m).length>0){l||(l={}),c=u.split(" ");for(var p=0;p<c.length;p++)if(f=c[p],h=m[f],h){d=a.clone(l,!1),d.name=f,d.source=o;for(var g=0;g<h.length;g++)h[g].apply(o,[d])}}}})()}),(function(n,r,s){var i={};n.exports=i;var a=s(5),o=s(0),u=s(1),l=s(4);(function(){i.create=function(c){return o.extend({id:o.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{},cache:{allBodies:null,allConstraints:null,allComposites:null}},c)},i.setModified=function(c,f,h,d){if(c.isModified=f,f&&c.cache&&(c.cache.allBodies=null,c.cache.allConstraints=null,c.cache.allComposites=null),h&&c.parent&&i.setModified(c.parent,f,h,d),d)for(var m=0;m<c.composites.length;m++){var p=c.composites[m];i.setModified(p,f,h,d)}},i.add=function(c,f){var h=[].concat(f);a.trigger(c,"beforeAdd",{object:f});for(var d=0;d<h.length;d++){var m=h[d];switch(m.type){case"body":if(m.parent!==m){o.warn("Composite.add: skipped adding a compound body part (you must add its parent instead)");break}i.addBody(c,m);break;case"constraint":i.addConstraint(c,m);break;case"composite":i.addComposite(c,m);break;case"mouseConstraint":i.addConstraint(c,m.constraint);break}}return a.trigger(c,"afterAdd",{object:f}),c},i.remove=function(c,f,h){var d=[].concat(f);a.trigger(c,"beforeRemove",{object:f});for(var m=0;m<d.length;m++){var p=d[m];switch(p.type){case"body":i.removeBody(c,p,h);break;case"constraint":i.removeConstraint(c,p,h);break;case"composite":i.removeComposite(c,p,h);break;case"mouseConstraint":i.removeConstraint(c,p.constraint);break}}return a.trigger(c,"afterRemove",{object:f}),c},i.addComposite=function(c,f){return c.composites.push(f),f.parent=c,i.setModified(c,!0,!0,!1),c},i.removeComposite=function(c,f,h){var d=o.indexOf(c.composites,f);if(d!==-1&&i.removeCompositeAt(c,d),h)for(var m=0;m<c.composites.length;m++)i.removeComposite(c.composites[m],f,!0);return c},i.removeCompositeAt=function(c,f){return c.composites.splice(f,1),i.setModified(c,!0,!0,!1),c},i.addBody=function(c,f){return c.bodies.push(f),i.setModified(c,!0,!0,!1),c},i.removeBody=function(c,f,h){var d=o.indexOf(c.bodies,f);if(d!==-1&&i.removeBodyAt(c,d),h)for(var m=0;m<c.composites.length;m++)i.removeBody(c.composites[m],f,!0);return c},i.removeBodyAt=function(c,f){return c.bodies.splice(f,1),i.setModified(c,!0,!0,!1),c},i.addConstraint=function(c,f){return c.constraints.push(f),i.setModified(c,!0,!0,!1),c},i.removeConstraint=function(c,f,h){var d=o.indexOf(c.constraints,f);if(d!==-1&&i.removeConstraintAt(c,d),h)for(var m=0;m<c.composites.length;m++)i.removeConstraint(c.composites[m],f,!0);return c},i.removeConstraintAt=function(c,f){return c.constraints.splice(f,1),i.setModified(c,!0,!0,!1),c},i.clear=function(c,f,h){if(h)for(var d=0;d<c.composites.length;d++)i.clear(c.composites[d],f,!0);return f?c.bodies=c.bodies.filter(function(m){return m.isStatic}):c.bodies.length=0,c.constraints.length=0,c.composites.length=0,i.setModified(c,!0,!0,!1),c},i.allBodies=function(c){if(c.cache&&c.cache.allBodies)return c.cache.allBodies;for(var f=[].concat(c.bodies),h=0;h<c.composites.length;h++)f=f.concat(i.allBodies(c.composites[h]));return c.cache&&(c.cache.allBodies=f),f},i.allConstraints=function(c){if(c.cache&&c.cache.allConstraints)return c.cache.allConstraints;for(var f=[].concat(c.constraints),h=0;h<c.composites.length;h++)f=f.concat(i.allConstraints(c.composites[h]));return c.cache&&(c.cache.allConstraints=f),f},i.allComposites=function(c){if(c.cache&&c.cache.allComposites)return c.cache.allComposites;for(var f=[].concat(c.composites),h=0;h<c.composites.length;h++)f=f.concat(i.allComposites(c.composites[h]));return c.cache&&(c.cache.allComposites=f),f},i.get=function(c,f,h){var d,m;switch(h){case"body":d=i.allBodies(c);break;case"constraint":d=i.allConstraints(c);break;case"composite":d=i.allComposites(c).concat(c);break}return d?(m=d.filter(function(p){return p.id.toString()===f.toString()}),m.length===0?null:m[0]):null},i.move=function(c,f,h){return i.remove(c,f),i.add(h,f),c},i.rebase=function(c){for(var f=i.allBodies(c).concat(i.allConstraints(c)).concat(i.allComposites(c)),h=0;h<f.length;h++)f[h].id=o.nextId();return c},i.translate=function(c,f,h){for(var d=h?i.allBodies(c):c.bodies,m=0;m<d.length;m++)l.translate(d[m],f);return c},i.rotate=function(c,f,h,d){for(var m=Math.cos(f),p=Math.sin(f),g=d?i.allBodies(c):c.bodies,y=0;y<g.length;y++){var v=g[y],T=v.position.x-h.x,C=v.position.y-h.y;l.setPosition(v,{x:h.x+(T*m-C*p),y:h.y+(T*p+C*m)}),l.rotate(v,f)}return c},i.scale=function(c,f,h,d,m){for(var p=m?i.allBodies(c):c.bodies,g=0;g<p.length;g++){var y=p[g],v=y.position.x-d.x,T=y.position.y-d.y;l.setPosition(y,{x:d.x+v*f,y:d.y+T*h}),l.scale(y,f,h)}return c},i.bounds=function(c){for(var f=i.allBodies(c),h=[],d=0;d<f.length;d+=1){var m=f[d];h.push(m.bounds.min,m.bounds.max)}return u.create(h)}})()}),(function(n,r,s){var i={};n.exports=i;var a=s(4),o=s(5),u=s(0);(function(){i._motionWakeThreshold=.18,i._motionSleepThreshold=.08,i._minBias=.9,i.update=function(l,c){for(var f=c/u._baseDelta,h=i._motionSleepThreshold,d=0;d<l.length;d++){var m=l[d],p=a.getSpeed(m),g=a.getAngularSpeed(m),y=p*p+g*g;if(m.force.x!==0||m.force.y!==0){i.set(m,!1);continue}var v=Math.min(m.motion,y),T=Math.max(m.motion,y);m.motion=i._minBias*v+(1-i._minBias)*T,m.sleepThreshold>0&&m.motion<h?(m.sleepCounter+=1,m.sleepCounter>=m.sleepThreshold/f&&i.set(m,!0)):m.sleepCounter>0&&(m.sleepCounter-=1)}},i.afterCollisions=function(l){for(var c=i._motionSleepThreshold,f=0;f<l.length;f++){var h=l[f];if(h.isActive){var d=h.collision,m=d.bodyA.parent,p=d.bodyB.parent;if(!(m.isSleeping&&p.isSleeping||m.isStatic||p.isStatic)&&(m.isSleeping||p.isSleeping)){var g=m.isSleeping&&!m.isStatic?m:p,y=g===m?p:m;!g.isStatic&&y.motion>c&&i.set(g,!1)}}}},i.set=function(l,c){var f=l.isSleeping;c?(l.isSleeping=!0,l.sleepCounter=l.sleepThreshold,l.positionImpulse.x=0,l.positionImpulse.y=0,l.positionPrev.x=l.position.x,l.positionPrev.y=l.position.y,l.anglePrev=l.angle,l.speed=0,l.angularSpeed=0,l.motion=0,f||o.trigger(l,"sleepStart")):(l.isSleeping=!1,l.sleepCounter=0,f&&o.trigger(l,"sleepEnd"))}})()}),(function(n,r,s){var i={};n.exports=i;var a=s(3),o=s(9);(function(){var u=[],l={overlap:0,axis:null},c={overlap:0,axis:null};i.create=function(f,h){return{pair:null,collided:!1,bodyA:f,bodyB:h,parentA:f.parent,parentB:h.parent,depth:0,normal:{x:0,y:0},tangent:{x:0,y:0},penetration:{x:0,y:0},supports:[]}},i.collides=function(f,h,d){if(i._overlapAxes(l,f.vertices,h.vertices,f.axes),l.overlap<=0||(i._overlapAxes(c,h.vertices,f.vertices,h.axes),c.overlap<=0))return null;var m=d&&d.table[o.id(f,h)],p;m?p=m.collision:(p=i.create(f,h),p.collided=!0,p.bodyA=f.id<h.id?f:h,p.bodyB=f.id<h.id?h:f,p.parentA=p.bodyA.parent,p.parentB=p.bodyB.parent),f=p.bodyA,h=p.bodyB;var g;l.overlap<c.overlap?g=l:g=c;var y=p.normal,v=p.supports,T=g.axis,C=T.x,E=T.y;C*(h.position.x-f.position.x)+E*(h.position.y-f.position.y)<0?(y.x=C,y.y=E):(y.x=-C,y.y=-E),p.tangent.x=-y.y,p.tangent.y=y.x,p.depth=g.overlap,p.penetration.x=y.x*p.depth,p.penetration.y=y.y*p.depth;var k=i._findSupports(f,h,y,1),_=0;if(a.contains(f.vertices,k[0])&&(v[_++]=k[0]),a.contains(f.vertices,k[1])&&(v[_++]=k[1]),_<2){var A=i._findSupports(h,f,y,-1);a.contains(h.vertices,A[0])&&(v[_++]=A[0]),_<2&&a.contains(h.vertices,A[1])&&(v[_++]=A[1])}return _===0&&(v[_++]=k[0]),v.length=_,p},i._overlapAxes=function(f,h,d,m){var p=h.length,g=d.length,y=h[0].x,v=h[0].y,T=d[0].x,C=d[0].y,E=m.length,k=Number.MAX_VALUE,_=0,A,I,S,L,N,j;for(N=0;N<E;N++){var P=m[N],D=P.x,H=P.y,z=y*D+v*H,F=T*D+C*H,q=z,R=F;for(j=1;j<p;j+=1)L=h[j].x*D+h[j].y*H,L>q?q=L:L<z&&(z=L);for(j=1;j<g;j+=1)L=d[j].x*D+d[j].y*H,L>R?R=L:L<F&&(F=L);if(I=q-F,S=R-z,A=I<S?I:S,A<k&&(k=A,_=N,A<=0))break}f.axis=m[_],f.overlap=k},i._projectToAxis=function(f,h,d){for(var m=h[0].x*d.x+h[0].y*d.y,p=m,g=1;g<h.length;g+=1){var y=h[g].x*d.x+h[g].y*d.y;y>p?p=y:y<m&&(m=y)}f.min=m,f.max=p},i._findSupports=function(f,h,d,m){var p=h.vertices,g=p.length,y=f.position.x,v=f.position.y,T=d.x*m,C=d.y*m,E=Number.MAX_VALUE,k,_,A,I,S;for(S=0;S<g;S+=1)_=p[S],I=T*(y-_.x)+C*(v-_.y),I<E&&(E=I,k=_);return A=p[(g+k.index-1)%g],E=T*(y-A.x)+C*(v-A.y),_=p[(k.index+1)%g],T*(y-_.x)+C*(v-_.y)<E?(u[0]=k,u[1]=_,u):(u[0]=k,u[1]=A,u)}})()}),(function(n,r,s){var i={};n.exports=i;var a=s(16);(function(){i.create=function(o,u){var l=o.bodyA,c=o.bodyB,f={id:i.id(l,c),bodyA:l,bodyB:c,collision:o,contacts:[],activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:l.isSensor||c.isSensor,timeCreated:u,timeUpdated:u,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return i.update(f,o,u),f},i.update=function(o,u,l){var c=o.contacts,f=u.supports,h=o.activeContacts,d=u.parentA,m=u.parentB,p=d.vertices.length;o.isActive=!0,o.timeUpdated=l,o.collision=u,o.separation=u.depth,o.inverseMass=d.inverseMass+m.inverseMass,o.friction=d.friction<m.friction?d.friction:m.friction,o.frictionStatic=d.frictionStatic>m.frictionStatic?d.frictionStatic:m.frictionStatic,o.restitution=d.restitution>m.restitution?d.restitution:m.restitution,o.slop=d.slop>m.slop?d.slop:m.slop,u.pair=o,h.length=0;for(var g=0;g<f.length;g++){var y=f[g],v=y.body===d?y.index:p+y.index,T=c[v];T?h.push(T):h.push(c[v]=a.create(y))}},i.setActive=function(o,u,l){u?(o.isActive=!0,o.timeUpdated=l):(o.isActive=!1,o.activeContacts.length=0)},i.id=function(o,u){return o.id<u.id?"A"+o.id+"B"+u.id:"A"+u.id+"B"+o.id}})()}),(function(n,r,s){var i={};n.exports=i;var a=s(3),o=s(2),u=s(7),l=s(1),c=s(11),f=s(0);(function(){i._warming=.4,i._torqueDampen=1,i._minLength=1e-6,i.create=function(h){var d=h;d.bodyA&&!d.pointA&&(d.pointA={x:0,y:0}),d.bodyB&&!d.pointB&&(d.pointB={x:0,y:0});var m=d.bodyA?o.add(d.bodyA.position,d.pointA):d.pointA,p=d.bodyB?o.add(d.bodyB.position,d.pointB):d.pointB,g=o.magnitude(o.sub(m,p));d.length=typeof d.length<"u"?d.length:g,d.id=d.id||f.nextId(),d.label=d.label||"Constraint",d.type="constraint",d.stiffness=d.stiffness||(d.length>0?1:.7),d.damping=d.damping||0,d.angularStiffness=d.angularStiffness||0,d.angleA=d.bodyA?d.bodyA.angle:d.angleA,d.angleB=d.bodyB?d.bodyB.angle:d.angleB,d.plugin={};var y={visible:!0,lineWidth:2,strokeStyle:"#ffffff",type:"line",anchors:!0};return d.length===0&&d.stiffness>.1?(y.type="pin",y.anchors=!1):d.stiffness<.9&&(y.type="spring"),d.render=f.extend(y,d.render),d},i.preSolveAll=function(h){for(var d=0;d<h.length;d+=1){var m=h[d],p=m.constraintImpulse;m.isStatic||p.x===0&&p.y===0&&p.angle===0||(m.position.x+=p.x,m.position.y+=p.y,m.angle+=p.angle)}},i.solveAll=function(h,d){for(var m=f.clamp(d/f._baseDelta,0,1),p=0;p<h.length;p+=1){var g=h[p],y=!g.bodyA||g.bodyA&&g.bodyA.isStatic,v=!g.bodyB||g.bodyB&&g.bodyB.isStatic;(y||v)&&i.solve(h[p],m)}for(p=0;p<h.length;p+=1)g=h[p],y=!g.bodyA||g.bodyA&&g.bodyA.isStatic,v=!g.bodyB||g.bodyB&&g.bodyB.isStatic,!y&&!v&&i.solve(h[p],m)},i.solve=function(h,d){var m=h.bodyA,p=h.bodyB,g=h.pointA,y=h.pointB;if(!(!m&&!p)){m&&!m.isStatic&&(o.rotate(g,m.angle-h.angleA,g),h.angleA=m.angle),p&&!p.isStatic&&(o.rotate(y,p.angle-h.angleB,y),h.angleB=p.angle);var v=g,T=y;if(m&&(v=o.add(m.position,g)),p&&(T=o.add(p.position,y)),!(!v||!T)){var C=o.sub(v,T),E=o.magnitude(C);E<i._minLength&&(E=i._minLength);var k=(E-h.length)/E,_=h.stiffness>=1||h.length===0,A=_?h.stiffness*d:h.stiffness*d*d,I=h.damping*d,S=o.mult(C,k*A),L=(m?m.inverseMass:0)+(p?p.inverseMass:0),N=(m?m.inverseInertia:0)+(p?p.inverseInertia:0),j=L+N,P,D,H,z,F;if(I>0){var q=o.create();H=o.div(C,E),F=o.sub(p&&o.sub(p.position,p.positionPrev)||q,m&&o.sub(m.position,m.positionPrev)||q),z=o.dot(H,F)}m&&!m.isStatic&&(D=m.inverseMass/L,m.constraintImpulse.x-=S.x*D,m.constraintImpulse.y-=S.y*D,m.position.x-=S.x*D,m.position.y-=S.y*D,I>0&&(m.positionPrev.x-=I*H.x*z*D,m.positionPrev.y-=I*H.y*z*D),P=o.cross(g,S)/j*i._torqueDampen*m.inverseInertia*(1-h.angularStiffness),m.constraintImpulse.angle-=P,m.angle-=P),p&&!p.isStatic&&(D=p.inverseMass/L,p.constraintImpulse.x+=S.x*D,p.constraintImpulse.y+=S.y*D,p.position.x+=S.x*D,p.position.y+=S.y*D,I>0&&(p.positionPrev.x+=I*H.x*z*D,p.positionPrev.y+=I*H.y*z*D),P=o.cross(y,S)/j*i._torqueDampen*p.inverseInertia*(1-h.angularStiffness),p.constraintImpulse.angle+=P,p.angle+=P)}}},i.postSolveAll=function(h){for(var d=0;d<h.length;d++){var m=h[d],p=m.constraintImpulse;if(!(m.isStatic||p.x===0&&p.y===0&&p.angle===0)){u.set(m,!1);for(var g=0;g<m.parts.length;g++){var y=m.parts[g];a.translate(y.vertices,p),g>0&&(y.position.x+=p.x,y.position.y+=p.y),p.angle!==0&&(a.rotate(y.vertices,p.angle,m.position),c.rotate(y.axes,p.angle),g>0&&o.rotateAbout(y.position,p.angle,m.position,y.position)),l.update(y.bounds,y.vertices,m.velocity)}p.angle*=i._warming,p.x*=i._warming,p.y*=i._warming}}},i.pointAWorld=function(h){return{x:(h.bodyA?h.bodyA.position.x:0)+(h.pointA?h.pointA.x:0),y:(h.bodyA?h.bodyA.position.y:0)+(h.pointA?h.pointA.y:0)}},i.pointBWorld=function(h){return{x:(h.bodyB?h.bodyB.position.x:0)+(h.pointB?h.pointB.x:0),y:(h.bodyB?h.bodyB.position.y:0)+(h.pointB?h.pointB.y:0)}}})()}),(function(n,r,s){var i={};n.exports=i;var a=s(2),o=s(0);(function(){i.fromVertices=function(u){for(var l={},c=0;c<u.length;c++){var f=(c+1)%u.length,h=a.normalise({x:u[f].y-u[c].y,y:u[c].x-u[f].x}),d=h.y===0?1/0:h.x/h.y;d=d.toFixed(3).toString(),l[d]=h}return o.values(l)},i.rotate=function(u,l){if(l!==0)for(var c=Math.cos(l),f=Math.sin(l),h=0;h<u.length;h++){var d=u[h],m;m=d.x*c-d.y*f,d.y=d.x*f+d.y*c,d.x=m}}})()}),(function(n,r,s){var i={};n.exports=i;var a=s(3),o=s(0),u=s(4),l=s(1),c=s(2);(function(){i.rectangle=function(f,h,d,m,p){p=p||{};var g={label:"Rectangle Body",position:{x:f,y:h},vertices:a.fromPath("L 0 0 L "+d+" 0 L "+d+" "+m+" L 0 "+m)};if(p.chamfer){var y=p.chamfer;g.vertices=a.chamfer(g.vertices,y.radius,y.quality,y.qualityMin,y.qualityMax),delete p.chamfer}return u.create(o.extend({},g,p))},i.trapezoid=function(f,h,d,m,p,g){g=g||{},p*=.5;var y=(1-p*2)*d,v=d*p,T=v+y,C=T+v,E;p<.5?E="L 0 0 L "+v+" "+-m+" L "+T+" "+-m+" L "+C+" 0":E="L 0 0 L "+T+" "+-m+" L "+C+" 0";var k={label:"Trapezoid Body",position:{x:f,y:h},vertices:a.fromPath(E)};if(g.chamfer){var _=g.chamfer;k.vertices=a.chamfer(k.vertices,_.radius,_.quality,_.qualityMin,_.qualityMax),delete g.chamfer}return u.create(o.extend({},k,g))},i.circle=function(f,h,d,m,p){m=m||{};var g={label:"Circle Body",circleRadius:d};p=p||25;var y=Math.ceil(Math.max(10,Math.min(p,d)));return y%2===1&&(y+=1),i.polygon(f,h,y,d,o.extend({},g,m))},i.polygon=function(f,h,d,m,p){if(p=p||{},d<3)return i.circle(f,h,m,p);for(var g=2*Math.PI/d,y="",v=g*.5,T=0;T<d;T+=1){var C=v+T*g,E=Math.cos(C)*m,k=Math.sin(C)*m;y+="L "+E.toFixed(3)+" "+k.toFixed(3)+" "}var _={label:"Polygon Body",position:{x:f,y:h},vertices:a.fromPath(y)};if(p.chamfer){var A=p.chamfer;_.vertices=a.chamfer(_.vertices,A.radius,A.quality,A.qualityMin,A.qualityMax),delete p.chamfer}return u.create(o.extend({},_,p))},i.fromVertices=function(f,h,d,m,p,g,y,v){var T=o.getDecomp(),C,E,k,_,A,I,S,L,N,j,P;for(C=!!(T&&T.quickDecomp),m=m||{},k=[],p=typeof p<"u"?p:!1,g=typeof g<"u"?g:.01,y=typeof y<"u"?y:10,v=typeof v<"u"?v:.01,o.isArray(d[0])||(d=[d]),j=0;j<d.length;j+=1)if(I=d[j],_=a.isConvex(I),A=!_,A&&!C&&o.warnOnce("Bodies.fromVertices: Install the 'poly-decomp' library and use Common.setDecomp or provide 'decomp' as a global to decompose concave vertices."),_||!C)_?I=a.clockwiseSort(I):I=a.hull(I),k.push({position:{x:f,y:h},vertices:I});else{var D=I.map(function(V){return[V.x,V.y]});T.makeCCW(D),g!==!1&&T.removeCollinearPoints(D,g),v!==!1&&T.removeDuplicatePoints&&T.removeDuplicatePoints(D,v);var H=T.quickDecomp(D);for(S=0;S<H.length;S++){var z=H[S],F=z.map(function(V){return{x:V[0],y:V[1]}});y>0&&a.area(F)<y||k.push({position:a.centre(F),vertices:F})}}for(S=0;S<k.length;S++)k[S]=u.create(o.extend(k[S],m));if(p){var q=5;for(S=0;S<k.length;S++){var R=k[S];for(L=S+1;L<k.length;L++){var $=k[L];if(l.overlaps(R.bounds,$.bounds)){var W=R.vertices,M=$.vertices;for(N=0;N<R.vertices.length;N++)for(P=0;P<$.vertices.length;P++){var ee=c.magnitudeSquared(c.sub(W[(N+1)%W.length],M[P])),oe=c.magnitudeSquared(c.sub(W[N],M[(P+1)%M.length]));ee<q&&oe<q&&(W[N].isInternal=!0,M[P].isInternal=!0)}}}}}return k.length>1?(E=u.create(o.extend({parts:k.slice(0)},m)),u.setPosition(E,{x:f,y:h}),E):k[0]}})()}),(function(n,r,s){var i={};n.exports=i;var a=s(0),o=s(8);(function(){i.create=function(u){var l={bodies:[],pairs:null};return a.extend(l,u)},i.setBodies=function(u,l){u.bodies=l.slice(0)},i.clear=function(u){u.bodies=[]},i.collisions=function(u){var l=[],c=u.pairs,f=u.bodies,h=f.length,d=i.canCollide,m=o.collides,p,g;for(f.sort(i._compareBoundsX),p=0;p<h;p++){var y=f[p],v=y.bounds,T=y.bounds.max.x,C=y.bounds.max.y,E=y.bounds.min.y,k=y.isStatic||y.isSleeping,_=y.parts.length,A=_===1;for(g=p+1;g<h;g++){var I=f[g],S=I.bounds;if(S.min.x>T)break;if(!(C<S.min.y||E>S.max.y)&&!(k&&(I.isStatic||I.isSleeping))&&d(y.collisionFilter,I.collisionFilter)){var L=I.parts.length;if(A&&L===1){var N=m(y,I,c);N&&l.push(N)}else for(var j=_>1?1:0,P=L>1?1:0,D=j;D<_;D++)for(var H=y.parts[D],v=H.bounds,z=P;z<L;z++){var F=I.parts[z],S=F.bounds;if(!(v.min.x>S.max.x||v.max.x<S.min.x||v.max.y<S.min.y||v.min.y>S.max.y)){var N=m(H,F,c);N&&l.push(N)}}}}}return l},i.canCollide=function(u,l){return u.group===l.group&&u.group!==0?u.group>0:(u.mask&l.category)!==0&&(l.mask&u.category)!==0},i._compareBoundsX=function(u,l){return u.bounds.min.x-l.bounds.min.x}})()}),(function(n,r,s){var i={};n.exports=i;var a=s(0);(function(){i.create=function(o){var u={};return o||a.log("Mouse.create: element was undefined, defaulting to document.body","warn"),u.element=o||document.body,u.absolute={x:0,y:0},u.position={x:0,y:0},u.mousedownPosition={x:0,y:0},u.mouseupPosition={x:0,y:0},u.offset={x:0,y:0},u.scale={x:1,y:1},u.wheelDelta=0,u.button=-1,u.pixelRatio=parseInt(u.element.getAttribute("data-pixel-ratio"),10)||1,u.sourceEvents={mousemove:null,mousedown:null,mouseup:null,mousewheel:null},u.mousemove=function(l){var c=i._getRelativeMousePosition(l,u.element,u.pixelRatio),f=l.changedTouches;f&&(u.button=0,l.preventDefault()),u.absolute.x=c.x,u.absolute.y=c.y,u.position.x=u.absolute.x*u.scale.x+u.offset.x,u.position.y=u.absolute.y*u.scale.y+u.offset.y,u.sourceEvents.mousemove=l},u.mousedown=function(l){var c=i._getRelativeMousePosition(l,u.element,u.pixelRatio),f=l.changedTouches;f?(u.button=0,l.preventDefault()):u.button=l.button,u.absolute.x=c.x,u.absolute.y=c.y,u.position.x=u.absolute.x*u.scale.x+u.offset.x,u.position.y=u.absolute.y*u.scale.y+u.offset.y,u.mousedownPosition.x=u.position.x,u.mousedownPosition.y=u.position.y,u.sourceEvents.mousedown=l},u.mouseup=function(l){var c=i._getRelativeMousePosition(l,u.element,u.pixelRatio),f=l.changedTouches;f&&l.preventDefault(),u.button=-1,u.absolute.x=c.x,u.absolute.y=c.y,u.position.x=u.absolute.x*u.scale.x+u.offset.x,u.position.y=u.absolute.y*u.scale.y+u.offset.y,u.mouseupPosition.x=u.position.x,u.mouseupPosition.y=u.position.y,u.sourceEvents.mouseup=l},u.mousewheel=function(l){u.wheelDelta=Math.max(-1,Math.min(1,l.wheelDelta||-l.detail)),l.preventDefault()},i.setElement(u,u.element),u},i.setElement=function(o,u){o.element=u,u.addEventListener("mousemove",o.mousemove),u.addEventListener("mousedown",o.mousedown),u.addEventListener("mouseup",o.mouseup),u.addEventListener("mousewheel",o.mousewheel),u.addEventListener("DOMMouseScroll",o.mousewheel),u.addEventListener("touchmove",o.mousemove),u.addEventListener("touchstart",o.mousedown),u.addEventListener("touchend",o.mouseup)},i.clearSourceEvents=function(o){o.sourceEvents.mousemove=null,o.sourceEvents.mousedown=null,o.sourceEvents.mouseup=null,o.sourceEvents.mousewheel=null,o.wheelDelta=0},i.setOffset=function(o,u){o.offset.x=u.x,o.offset.y=u.y,o.position.x=o.absolute.x*o.scale.x+o.offset.x,o.position.y=o.absolute.y*o.scale.y+o.offset.y},i.setScale=function(o,u){o.scale.x=u.x,o.scale.y=u.y,o.position.x=o.absolute.x*o.scale.x+o.offset.x,o.position.y=o.absolute.y*o.scale.y+o.offset.y},i._getRelativeMousePosition=function(o,u,l){var c=u.getBoundingClientRect(),f=document.documentElement||document.body.parentNode||document.body,h=window.pageXOffset!==void 0?window.pageXOffset:f.scrollLeft,d=window.pageYOffset!==void 0?window.pageYOffset:f.scrollTop,m=o.changedTouches,p,g;return m?(p=m[0].pageX-c.left-h,g=m[0].pageY-c.top-d):(p=o.pageX-c.left-h,g=o.pageY-c.top-d),{x:p/(u.clientWidth/(u.width||u.clientWidth)*l),y:g/(u.clientHeight/(u.height||u.clientHeight)*l)}}})()}),(function(n,r,s){var i={};n.exports=i;var a=s(0);(function(){i._registry={},i.register=function(o){if(i.isPlugin(o)||a.warn("Plugin.register:",i.toString(o),"does not implement all required fields."),o.name in i._registry){var u=i._registry[o.name],l=i.versionParse(o.version).number,c=i.versionParse(u.version).number;l>c?(a.warn("Plugin.register:",i.toString(u),"was upgraded to",i.toString(o)),i._registry[o.name]=o):l<c?a.warn("Plugin.register:",i.toString(u),"can not be downgraded to",i.toString(o)):o!==u&&a.warn("Plugin.register:",i.toString(o),"is already registered to different plugin object")}else i._registry[o.name]=o;return o},i.resolve=function(o){return i._registry[i.dependencyParse(o).name]},i.toString=function(o){return typeof o=="string"?o:(o.name||"anonymous")+"@"+(o.version||o.range||"0.0.0")},i.isPlugin=function(o){return o&&o.name&&o.version&&o.install},i.isUsed=function(o,u){return o.used.indexOf(u)>-1},i.isFor=function(o,u){var l=o.for&&i.dependencyParse(o.for);return!o.for||u.name===l.name&&i.versionSatisfies(u.version,l.range)},i.use=function(o,u){if(o.uses=(o.uses||[]).concat(u||[]),o.uses.length===0){a.warn("Plugin.use:",i.toString(o),"does not specify any dependencies to install.");return}for(var l=i.dependencies(o),c=a.topologicalSort(l),f=[],h=0;h<c.length;h+=1)if(c[h]!==o.name){var d=i.resolve(c[h]);if(!d){f.push("❌ "+c[h]);continue}i.isUsed(o,d.name)||(i.isFor(d,o)||(a.warn("Plugin.use:",i.toString(d),"is for",d.for,"but installed on",i.toString(o)+"."),d._warned=!0),d.install?d.install(o):(a.warn("Plugin.use:",i.toString(d),"does not specify an install function."),d._warned=!0),d._warned?(f.push("🔶 "+i.toString(d)),delete d._warned):f.push("✅ "+i.toString(d)),o.used.push(d.name))}f.length>0&&a.info(f.join(" "))},i.dependencies=function(o,u){var l=i.dependencyParse(o),c=l.name;if(u=u||{},!(c in u)){o=i.resolve(o)||o,u[c]=a.map(o.uses||[],function(h){i.isPlugin(h)&&i.register(h);var d=i.dependencyParse(h),m=i.resolve(h);return m&&!i.versionSatisfies(m.version,d.range)?(a.warn("Plugin.dependencies:",i.toString(m),"does not satisfy",i.toString(d),"used by",i.toString(l)+"."),m._warned=!0,o._warned=!0):m||(a.warn("Plugin.dependencies:",i.toString(h),"used by",i.toString(l),"could not be resolved."),o._warned=!0),d.name});for(var f=0;f<u[c].length;f+=1)i.dependencies(u[c][f],u);return u}},i.dependencyParse=function(o){if(a.isString(o)){var u=/^[\w-]+(@(\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-+]+)?))?$/;return u.test(o)||a.warn("Plugin.dependencyParse:",o,"is not a valid dependency string."),{name:o.split("@")[0],range:o.split("@")[1]||"*"}}return{name:o.name,range:o.range||o.version}},i.versionParse=function(o){var u=/^(\*)|(\^|~|>=|>)?\s*((\d+)\.(\d+)\.(\d+))(-[0-9A-Za-z-+]+)?$/;u.test(o)||a.warn("Plugin.versionParse:",o,"is not a valid version or range.");var l=u.exec(o),c=Number(l[4]),f=Number(l[5]),h=Number(l[6]);return{isRange:!!(l[1]||l[2]),version:l[3],range:o,operator:l[1]||l[2]||"",major:c,minor:f,patch:h,parts:[c,f,h],prerelease:l[7],number:c*1e8+f*1e4+h}},i.versionSatisfies=function(o,u){u=u||"*";var l=i.versionParse(u),c=i.versionParse(o);if(l.isRange){if(l.operator==="*"||o==="*")return!0;if(l.operator===">")return c.number>l.number;if(l.operator===">=")return c.number>=l.number;if(l.operator==="~")return c.major===l.major&&c.minor===l.minor&&c.patch>=l.patch;if(l.operator==="^")return l.major>0?c.major===l.major&&c.number>=l.number:l.minor>0?c.minor===l.minor&&c.patch>=l.patch:c.patch===l.patch}return o===u||o==="*"}})()}),(function(n,r){var s={};n.exports=s,(function(){s.create=function(i){return{vertex:i,normalImpulse:0,tangentImpulse:0}}})()}),(function(n,r,s){var i={};n.exports=i;var a=s(7),o=s(18),u=s(13),l=s(19),c=s(5),f=s(6),h=s(10),d=s(0),m=s(4);(function(){i.create=function(p){p=p||{};var g={positionIterations:6,velocityIterations:4,constraintIterations:2,enableSleeping:!1,events:[],plugin:{},gravity:{x:0,y:1,scale:.001},timing:{timestamp:0,timeScale:1,lastDelta:0,lastElapsed:0}},y=d.extend(g,p);return y.world=p.world||f.create({label:"World"}),y.pairs=p.pairs||l.create(),y.detector=p.detector||u.create(),y.grid={buckets:[]},y.world.gravity=y.gravity,y.broadphase=y.grid,y.metrics={},y},i.update=function(p,g){var y=d.now(),v=p.world,T=p.detector,C=p.pairs,E=p.timing,k=E.timestamp,_;g=typeof g<"u"?g:d._baseDelta,g*=E.timeScale,E.timestamp+=g,E.lastDelta=g;var A={timestamp:E.timestamp,delta:g};c.trigger(p,"beforeUpdate",A);var I=f.allBodies(v),S=f.allConstraints(v);for(v.isModified&&(u.setBodies(T,I),f.setModified(v,!1,!1,!0)),p.enableSleeping&&a.update(I,g),i._bodiesApplyGravity(I,p.gravity),g>0&&i._bodiesUpdate(I,g),h.preSolveAll(I),_=0;_<p.constraintIterations;_++)h.solveAll(S,g);h.postSolveAll(I),T.pairs=p.pairs;var L=u.collisions(T);l.update(C,L,k),p.enableSleeping&&a.afterCollisions(C.list),C.collisionStart.length>0&&c.trigger(p,"collisionStart",{pairs:C.collisionStart});var N=d.clamp(20/p.positionIterations,0,1);for(o.preSolvePosition(C.list),_=0;_<p.positionIterations;_++)o.solvePosition(C.list,g,N);for(o.postSolvePosition(I),h.preSolveAll(I),_=0;_<p.constraintIterations;_++)h.solveAll(S,g);for(h.postSolveAll(I),o.preSolveVelocity(C.list),_=0;_<p.velocityIterations;_++)o.solveVelocity(C.list,g);return i._bodiesUpdateVelocities(I),C.collisionActive.length>0&&c.trigger(p,"collisionActive",{pairs:C.collisionActive}),C.collisionEnd.length>0&&c.trigger(p,"collisionEnd",{pairs:C.collisionEnd}),i._bodiesClearForces(I),c.trigger(p,"afterUpdate",A),p.timing.lastElapsed=d.now()-y,p},i.merge=function(p,g){if(d.extend(p,g),g.world){p.world=g.world,i.clear(p);for(var y=f.allBodies(p.world),v=0;v<y.length;v++){var T=y[v];a.set(T,!1),T.id=d.nextId()}}},i.clear=function(p){l.clear(p.pairs),u.clear(p.detector)},i._bodiesClearForces=function(p){for(var g=p.length,y=0;y<g;y++){var v=p[y];v.force.x=0,v.force.y=0,v.torque=0}},i._bodiesApplyGravity=function(p,g){var y=typeof g.scale<"u"?g.scale:.001,v=p.length;if(!(g.x===0&&g.y===0||y===0))for(var T=0;T<v;T++){var C=p[T];C.isStatic||C.isSleeping||(C.force.y+=C.mass*g.y*y,C.force.x+=C.mass*g.x*y)}},i._bodiesUpdate=function(p,g){for(var y=p.length,v=0;v<y;v++){var T=p[v];T.isStatic||T.isSleeping||m.update(T,g)}},i._bodiesUpdateVelocities=function(p){for(var g=p.length,y=0;y<g;y++)m.updateVelocities(p[y])}})()}),(function(n,r,s){var i={};n.exports=i;var a=s(3),o=s(0),u=s(1);(function(){i._restingThresh=2,i._restingThreshTangent=Math.sqrt(6),i._positionDampen=.9,i._positionWarming=.8,i._frictionNormalMultiplier=5,i._frictionMaxStatic=Number.MAX_VALUE,i.preSolvePosition=function(l){var c,f,h,d=l.length;for(c=0;c<d;c++)f=l[c],f.isActive&&(h=f.activeContacts.length,f.collision.parentA.totalContacts+=h,f.collision.parentB.totalContacts+=h)},i.solvePosition=function(l,c,f){var h,d,m,p,g,y,v,T,C=i._positionDampen*(f||1),E=o.clamp(c/o._baseDelta,0,1),k=l.length;for(h=0;h<k;h++)d=l[h],!(!d.isActive||d.isSensor)&&(m=d.collision,p=m.parentA,g=m.parentB,y=m.normal,d.separation=y.x*(g.positionImpulse.x+m.penetration.x-p.positionImpulse.x)+y.y*(g.positionImpulse.y+m.penetration.y-p.positionImpulse.y));for(h=0;h<k;h++)d=l[h],!(!d.isActive||d.isSensor)&&(m=d.collision,p=m.parentA,g=m.parentB,y=m.normal,T=d.separation-d.slop*E,(p.isStatic||g.isStatic)&&(T*=2),p.isStatic||p.isSleeping||(v=C/p.totalContacts,p.positionImpulse.x+=y.x*T*v,p.positionImpulse.y+=y.y*T*v),g.isStatic||g.isSleeping||(v=C/g.totalContacts,g.positionImpulse.x-=y.x*T*v,g.positionImpulse.y-=y.y*T*v))},i.postSolvePosition=function(l){for(var c=i._positionWarming,f=l.length,h=a.translate,d=u.update,m=0;m<f;m++){var p=l[m],g=p.positionImpulse,y=g.x,v=g.y,T=p.velocity;if(p.totalContacts=0,y!==0||v!==0){for(var C=0;C<p.parts.length;C++){var E=p.parts[C];h(E.vertices,g),d(E.bounds,E.vertices,T),E.position.x+=y,E.position.y+=v}p.positionPrev.x+=y,p.positionPrev.y+=v,y*T.x+v*T.y<0?(g.x=0,g.y=0):(g.x*=c,g.y*=c)}}},i.preSolveVelocity=function(l){var c=l.length,f,h;for(f=0;f<c;f++){var d=l[f];if(!(!d.isActive||d.isSensor)){var m=d.activeContacts,p=m.length,g=d.collision,y=g.parentA,v=g.parentB,T=g.normal,C=g.tangent;for(h=0;h<p;h++){var E=m[h],k=E.vertex,_=E.normalImpulse,A=E.tangentImpulse;if(_!==0||A!==0){var I=T.x*_+C.x*A,S=T.y*_+C.y*A;y.isStatic||y.isSleeping||(y.positionPrev.x+=I*y.inverseMass,y.positionPrev.y+=S*y.inverseMass,y.anglePrev+=y.inverseInertia*((k.x-y.position.x)*S-(k.y-y.position.y)*I)),v.isStatic||v.isSleeping||(v.positionPrev.x-=I*v.inverseMass,v.positionPrev.y-=S*v.inverseMass,v.anglePrev-=v.inverseInertia*((k.x-v.position.x)*S-(k.y-v.position.y)*I))}}}}},i.solveVelocity=function(l,c){var f=c/o._baseDelta,h=f*f,d=h*f,m=-i._restingThresh*f,p=i._restingThreshTangent,g=i._frictionNormalMultiplier*f,y=i._frictionMaxStatic,v=l.length,T,C,E,k;for(E=0;E<v;E++){var _=l[E];if(!(!_.isActive||_.isSensor)){var A=_.collision,I=A.parentA,S=A.parentB,L=I.velocity,N=S.velocity,j=A.normal.x,P=A.normal.y,D=A.tangent.x,H=A.tangent.y,z=_.activeContacts,F=z.length,q=1/F,R=I.inverseMass+S.inverseMass,$=_.friction*_.frictionStatic*g;for(L.x=I.position.x-I.positionPrev.x,L.y=I.position.y-I.positionPrev.y,N.x=S.position.x-S.positionPrev.x,N.y=S.position.y-S.positionPrev.y,I.angularVelocity=I.angle-I.anglePrev,S.angularVelocity=S.angle-S.anglePrev,k=0;k<F;k++){var W=z[k],M=W.vertex,ee=M.x-I.position.x,oe=M.y-I.position.y,V=M.x-S.position.x,X=M.y-S.position.y,Z=L.x-oe*I.angularVelocity,be=L.y+ee*I.angularVelocity,me=N.x-X*S.angularVelocity,te=N.y+V*S.angularVelocity,ne=Z-me,de=be-te,ye=j*ne+P*de,Ne=D*ne+H*de,tt=_.separation+ye,Ee=Math.min(tt,1);Ee=tt<0?0:Ee;var qe=Ee*$;Ne<-qe||Ne>qe?(C=Ne>0?Ne:-Ne,T=_.friction*(Ne>0?1:-1)*d,T<-C?T=-C:T>C&&(T=C)):(T=Ne,C=y);var re=ee*P-oe*j,Ae=V*P-X*j,Ve=q/(R+I.inverseInertia*re*re+S.inverseInertia*Ae*Ae),Ge=(1+_.restitution)*ye*Ve;if(T*=Ve,ye<m)W.normalImpulse=0;else{var Xe=W.normalImpulse;W.normalImpulse+=Ge,W.normalImpulse>0&&(W.normalImpulse=0),Ge=W.normalImpulse-Xe}if(Ne<-p||Ne>p)W.tangentImpulse=0;else{var Le=W.tangentImpulse;W.tangentImpulse+=T,W.tangentImpulse<-C&&(W.tangentImpulse=-C),W.tangentImpulse>C&&(W.tangentImpulse=C),T=W.tangentImpulse-Le}var He=j*Ge+D*T,K=P*Ge+H*T;I.isStatic||I.isSleeping||(I.positionPrev.x+=He*I.inverseMass,I.positionPrev.y+=K*I.inverseMass,I.anglePrev+=(ee*K-oe*He)*I.inverseInertia),S.isStatic||S.isSleeping||(S.positionPrev.x-=He*S.inverseMass,S.positionPrev.y-=K*S.inverseMass,S.anglePrev-=(V*K-X*He)*S.inverseInertia)}}}}})()}),(function(n,r,s){var i={};n.exports=i;var a=s(9),o=s(0);(function(){i.create=function(u){return o.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},u)},i.update=function(u,l,c){var f=u.list,h=f.length,d=u.table,m=l.length,p=u.collisionStart,g=u.collisionEnd,y=u.collisionActive,v,T,C,E;for(p.length=0,g.length=0,y.length=0,E=0;E<h;E++)f[E].confirmedActive=!1;for(E=0;E<m;E++)v=l[E],C=v.pair,C?(C.isActive?y.push(C):p.push(C),a.update(C,v,c),C.confirmedActive=!0):(C=a.create(v,c),d[C.id]=C,p.push(C),f.push(C));var k=[];for(h=f.length,E=0;E<h;E++)C=f[E],C.confirmedActive||(a.setActive(C,!1,c),g.push(C),!C.collision.bodyA.isSleeping&&!C.collision.bodyB.isSleeping&&k.push(E));for(E=0;E<k.length;E++)T=k[E]-E,C=f[T],f.splice(T,1),delete d[C.id]},i.clear=function(u){return u.table={},u.list.length=0,u.collisionStart.length=0,u.collisionActive.length=0,u.collisionEnd.length=0,u}})()}),(function(n,r,s){var i=n.exports=s(21);i.Axes=s(11),i.Bodies=s(12),i.Body=s(4),i.Bounds=s(1),i.Collision=s(8),i.Common=s(0),i.Composite=s(6),i.Composites=s(22),i.Constraint=s(10),i.Contact=s(16),i.Detector=s(13),i.Engine=s(17),i.Events=s(5),i.Grid=s(23),i.Mouse=s(14),i.MouseConstraint=s(24),i.Pair=s(9),i.Pairs=s(19),i.Plugin=s(15),i.Query=s(25),i.Render=s(26),i.Resolver=s(18),i.Runner=s(27),i.SAT=s(28),i.Sleeping=s(7),i.Svg=s(29),i.Vector=s(2),i.Vertices=s(3),i.World=s(30),i.Engine.run=i.Runner.run,i.Common.deprecated(i.Engine,"run","Engine.run ➤ use Matter.Runner.run(engine) instead")}),(function(n,r,s){var i={};n.exports=i;var a=s(15),o=s(0);(function(){i.name="matter-js",i.version="0.19.0",i.uses=[],i.used=[],i.use=function(){a.use(i,Array.prototype.slice.call(arguments))},i.before=function(u,l){return u=u.replace(/^Matter./,""),o.chainPathBefore(i,u,l)},i.after=function(u,l){return u=u.replace(/^Matter./,""),o.chainPathAfter(i,u,l)}})()}),(function(n,r,s){var i={};n.exports=i;var a=s(6),o=s(10),u=s(0),l=s(4),c=s(12),f=u.deprecated;(function(){i.stack=function(h,d,m,p,g,y,v){for(var T=a.create({label:"Stack"}),C=h,E=d,k,_=0,A=0;A<p;A++){for(var I=0,S=0;S<m;S++){var L=v(C,E,S,A,k,_);if(L){var N=L.bounds.max.y-L.bounds.min.y,j=L.bounds.max.x-L.bounds.min.x;N>I&&(I=N),l.translate(L,{x:j*.5,y:N*.5}),C=L.bounds.max.x+g,a.addBody(T,L),k=L,_+=1}else C+=g}E+=I+y,C=h}return T},i.chain=function(h,d,m,p,g,y){for(var v=h.bodies,T=1;T<v.length;T++){var C=v[T-1],E=v[T],k=C.bounds.max.y-C.bounds.min.y,_=C.bounds.max.x-C.bounds.min.x,A=E.bounds.max.y-E.bounds.min.y,I=E.bounds.max.x-E.bounds.min.x,S={bodyA:C,pointA:{x:_*d,y:k*m},bodyB:E,pointB:{x:I*p,y:A*g}},L=u.extend(S,y);a.addConstraint(h,o.create(L))}return h.label+=" Chain",h},i.mesh=function(h,d,m,p,g){var y=h.bodies,v,T,C,E,k;for(v=0;v<m;v++){for(T=1;T<d;T++)C=y[T-1+v*d],E=y[T+v*d],a.addConstraint(h,o.create(u.extend({bodyA:C,bodyB:E},g)));if(v>0)for(T=0;T<d;T++)C=y[T+(v-1)*d],E=y[T+v*d],a.addConstraint(h,o.create(u.extend({bodyA:C,bodyB:E},g))),p&&T>0&&(k=y[T-1+(v-1)*d],a.addConstraint(h,o.create(u.extend({bodyA:k,bodyB:E},g)))),p&&T<d-1&&(k=y[T+1+(v-1)*d],a.addConstraint(h,o.create(u.extend({bodyA:k,bodyB:E},g))))}return h.label+=" Mesh",h},i.pyramid=function(h,d,m,p,g,y,v){return i.stack(h,d,m,p,g,y,function(T,C,E,k,_,A){var I=Math.min(p,Math.ceil(m/2)),S=_?_.bounds.max.x-_.bounds.min.x:0;if(!(k>I)){k=I-k;var L=k,N=m-1-k;if(!(E<L||E>N)){A===1&&l.translate(_,{x:(E+(m%2===1?1:-1))*S,y:0});var j=_?E*S:0;return v(h+j+E*g,C,E,k,_,A)}}})},i.newtonsCradle=function(h,d,m,p,g){for(var y=a.create({label:"Newtons Cradle"}),v=0;v<m;v++){var T=1.9,C=c.circle(h+v*(p*T),d+g,p,{inertia:1/0,restitution:1,friction:0,frictionAir:1e-4,slop:1}),E=o.create({pointA:{x:h+v*(p*T),y:d},bodyB:C});a.addBody(y,C),a.addConstraint(y,E)}return y},f(i,"newtonsCradle","Composites.newtonsCradle ➤ moved to newtonsCradle example"),i.car=function(h,d,m,p,g){var y=l.nextGroup(!0),v=20,T=-m*.5+v,C=m*.5-v,E=0,k=a.create({label:"Car"}),_=c.rectangle(h,d,m,p,{collisionFilter:{group:y},chamfer:{radius:p*.5},density:2e-4}),A=c.circle(h+T,d+E,g,{collisionFilter:{group:y},friction:.8}),I=c.circle(h+C,d+E,g,{collisionFilter:{group:y},friction:.8}),S=o.create({bodyB:_,pointB:{x:T,y:E},bodyA:A,stiffness:1,length:0}),L=o.create({bodyB:_,pointB:{x:C,y:E},bodyA:I,stiffness:1,length:0});return a.addBody(k,_),a.addBody(k,A),a.addBody(k,I),a.addConstraint(k,S),a.addConstraint(k,L),k},f(i,"car","Composites.car ➤ moved to car example"),i.softBody=function(h,d,m,p,g,y,v,T,C,E){C=u.extend({inertia:1/0},C),E=u.extend({stiffness:.2,render:{type:"line",anchors:!1}},E);var k=i.stack(h,d,m,p,g,y,function(_,A){return c.circle(_,A,T,C)});return i.mesh(k,m,p,v,E),k.label="Soft Body",k},f(i,"softBody","Composites.softBody ➤ moved to softBody and cloth examples")})()}),(function(n,r,s){var i={};n.exports=i;var a=s(9),o=s(0),u=o.deprecated;(function(){i.create=function(l){var c={buckets:{},pairs:{},pairsList:[],bucketWidth:48,bucketHeight:48};return o.extend(c,l)},i.update=function(l,c,f,h){var d,m,p,g=f.world,y=l.buckets,v,T,C=!1;for(d=0;d<c.length;d++){var E=c[d];if(!(E.isSleeping&&!h)&&!(g.bounds&&(E.bounds.max.x<g.bounds.min.x||E.bounds.min.x>g.bounds.max.x||E.bounds.max.y<g.bounds.min.y||E.bounds.min.y>g.bounds.max.y))){var k=i._getRegion(l,E);if(!E.region||k.id!==E.region.id||h){(!E.region||h)&&(E.region=k);var _=i._regionUnion(k,E.region);for(m=_.startCol;m<=_.endCol;m++)for(p=_.startRow;p<=_.endRow;p++){T=i._getBucketId(m,p),v=y[T];var A=m>=k.startCol&&m<=k.endCol&&p>=k.startRow&&p<=k.endRow,I=m>=E.region.startCol&&m<=E.region.endCol&&p>=E.region.startRow&&p<=E.region.endRow;!A&&I&&I&&v&&i._bucketRemoveBody(l,v,E),(E.region===k||A&&!I||h)&&(v||(v=i._createBucket(y,T)),i._bucketAddBody(l,v,E))}E.region=k,C=!0}}}C&&(l.pairsList=i._createActivePairsList(l))},u(i,"update","Grid.update ➤ replaced by Matter.Detector"),i.clear=function(l){l.buckets={},l.pairs={},l.pairsList=[]},u(i,"clear","Grid.clear ➤ replaced by Matter.Detector"),i._regionUnion=function(l,c){var f=Math.min(l.startCol,c.startCol),h=Math.max(l.endCol,c.endCol),d=Math.min(l.startRow,c.startRow),m=Math.max(l.endRow,c.endRow);return i._createRegion(f,h,d,m)},i._getRegion=function(l,c){var f=c.bounds,h=Math.floor(f.min.x/l.bucketWidth),d=Math.floor(f.max.x/l.bucketWidth),m=Math.floor(f.min.y/l.bucketHeight),p=Math.floor(f.max.y/l.bucketHeight);return i._createRegion(h,d,m,p)},i._createRegion=function(l,c,f,h){return{id:l+","+c+","+f+","+h,startCol:l,endCol:c,startRow:f,endRow:h}},i._getBucketId=function(l,c){return"C"+l+"R"+c},i._createBucket=function(l,c){var f=l[c]=[];return f},i._bucketAddBody=function(l,c,f){var h=l.pairs,d=a.id,m=c.length,p;for(p=0;p<m;p++){var g=c[p];if(!(f.id===g.id||f.isStatic&&g.isStatic)){var y=d(f,g),v=h[y];v?v[2]+=1:h[y]=[f,g,1]}}c.push(f)},i._bucketRemoveBody=function(l,c,f){var h=l.pairs,d=a.id,m;c.splice(o.indexOf(c,f),1);var p=c.length;for(m=0;m<p;m++){var g=h[d(f,c[m])];g&&(g[2]-=1)}},i._createActivePairsList=function(l){var c,f=l.pairs,h=o.keys(f),d=h.length,m=[],p;for(p=0;p<d;p++)c=f[h[p]],c[2]>0?m.push(c):delete f[h[p]];return m}})()}),(function(n,r,s){var i={};n.exports=i;var a=s(3),o=s(7),u=s(14),l=s(5),c=s(13),f=s(10),h=s(6),d=s(0),m=s(1);(function(){i.create=function(p,g){var y=(p?p.mouse:null)||(g?g.mouse:null);y||(p&&p.render&&p.render.canvas?y=u.create(p.render.canvas):g&&g.element?y=u.create(g.element):(y=u.create(),d.warn("MouseConstraint.create: options.mouse was undefined, options.element was undefined, may not function as expected")));var v=f.create({label:"Mouse Constraint",pointA:y.position,pointB:{x:0,y:0},length:.01,stiffness:.1,angularStiffness:1,render:{strokeStyle:"#90EE90",lineWidth:3}}),T={type:"mouseConstraint",mouse:y,element:null,body:null,constraint:v,collisionFilter:{category:1,mask:4294967295,group:0}},C=d.extend(T,g);return l.on(p,"beforeUpdate",function(){var E=h.allBodies(p.world);i.update(C,E),i._triggerEvents(C)}),C},i.update=function(p,g){var y=p.mouse,v=p.constraint,T=p.body;if(y.button===0){if(v.bodyB)o.set(v.bodyB,!1),v.pointA=y.position;else for(var C=0;C<g.length;C++)if(T=g[C],m.contains(T.bounds,y.position)&&c.canCollide(T.collisionFilter,p.collisionFilter))for(var E=T.parts.length>1?1:0;E<T.parts.length;E++){var k=T.parts[E];if(a.contains(k.vertices,y.position)){v.pointA=y.position,v.bodyB=p.body=T,v.pointB={x:y.position.x-T.position.x,y:y.position.y-T.position.y},v.angleB=T.angle,o.set(T,!1),l.trigger(p,"startdrag",{mouse:y,body:T});break}}}else v.bodyB=p.body=null,v.pointB=null,T&&l.trigger(p,"enddrag",{mouse:y,body:T})},i._triggerEvents=function(p){var g=p.mouse,y=g.sourceEvents;y.mousemove&&l.trigger(p,"mousemove",{mouse:g}),y.mousedown&&l.trigger(p,"mousedown",{mouse:g}),y.mouseup&&l.trigger(p,"mouseup",{mouse:g}),u.clearSourceEvents(g)}})()}),(function(n,r,s){var i={};n.exports=i;var a=s(2),o=s(8),u=s(1),l=s(12),c=s(3);(function(){i.collides=function(f,h){for(var d=[],m=h.length,p=f.bounds,g=o.collides,y=u.overlaps,v=0;v<m;v++){var T=h[v],C=T.parts.length,E=C===1?0:1;if(y(T.bounds,p))for(var k=E;k<C;k++){var _=T.parts[k];if(y(_.bounds,p)){var A=g(_,f);if(A){d.push(A);break}}}}return d},i.ray=function(f,h,d,m){m=m||1e-100;for(var p=a.angle(h,d),g=a.magnitude(a.sub(h,d)),y=(d.x+h.x)*.5,v=(d.y+h.y)*.5,T=l.rectangle(y,v,g,m,{angle:p}),C=i.collides(T,f),E=0;E<C.length;E+=1){var k=C[E];k.body=k.bodyB=k.bodyA}return C},i.region=function(f,h,d){for(var m=[],p=0;p<f.length;p++){var g=f[p],y=u.overlaps(g.bounds,h);(y&&!d||!y&&d)&&m.push(g)}return m},i.point=function(f,h){for(var d=[],m=0;m<f.length;m++){var p=f[m];if(u.contains(p.bounds,h))for(var g=p.parts.length===1?0:1;g<p.parts.length;g++){var y=p.parts[g];if(u.contains(y.bounds,h)&&c.contains(y.vertices,h)){d.push(p);break}}}return d}})()}),(function(n,r,s){var i={};n.exports=i;var a=s(4),o=s(0),u=s(6),l=s(1),c=s(5),f=s(2),h=s(14);(function(){var d,m;typeof window<"u"&&(d=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(E){window.setTimeout(function(){E(o.now())},1e3/60)},m=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame),i._goodFps=30,i._goodDelta=1e3/60,i.create=function(E){var k={engine:null,element:null,canvas:null,mouse:null,frameRequestId:null,timing:{historySize:60,delta:0,deltaHistory:[],lastTime:0,lastTimestamp:0,lastElapsed:0,timestampElapsed:0,timestampElapsedHistory:[],engineDeltaHistory:[],engineElapsedHistory:[],elapsedHistory:[]},options:{width:800,height:600,pixelRatio:1,background:"#14151f",wireframeBackground:"#14151f",hasBounds:!!E.bounds,enabled:!0,wireframes:!0,showSleeping:!0,showDebug:!1,showStats:!1,showPerformance:!1,showBounds:!1,showVelocity:!1,showCollisions:!1,showSeparations:!1,showAxes:!1,showPositions:!1,showAngleIndicator:!1,showIds:!1,showVertexNumbers:!1,showConvexHulls:!1,showInternalEdges:!1,showMousePosition:!1}},_=o.extend(k,E);return _.canvas&&(_.canvas.width=_.options.width||_.canvas.width,_.canvas.height=_.options.height||_.canvas.height),_.mouse=E.mouse,_.engine=E.engine,_.canvas=_.canvas||y(_.options.width,_.options.height),_.context=_.canvas.getContext("2d"),_.textures={},_.bounds=_.bounds||{min:{x:0,y:0},max:{x:_.canvas.width,y:_.canvas.height}},_.controller=i,_.options.showBroadphase=!1,_.options.pixelRatio!==1&&i.setPixelRatio(_,_.options.pixelRatio),o.isElement(_.element)&&_.element.appendChild(_.canvas),_},i.run=function(E){(function k(_){E.frameRequestId=d(k),p(E,_),i.world(E,_),(E.options.showStats||E.options.showDebug)&&i.stats(E,E.context,_),(E.options.showPerformance||E.options.showDebug)&&i.performance(E,E.context,_)})()},i.stop=function(E){m(E.frameRequestId)},i.setPixelRatio=function(E,k){var _=E.options,A=E.canvas;k==="auto"&&(k=v(A)),_.pixelRatio=k,A.setAttribute("data-pixel-ratio",k),A.width=_.width*k,A.height=_.height*k,A.style.width=_.width+"px",A.style.height=_.height+"px"},i.lookAt=function(E,k,_,A){A=typeof A<"u"?A:!0,k=o.isArray(k)?k:[k],_=_||{x:0,y:0};for(var I={min:{x:1/0,y:1/0},max:{x:-1/0,y:-1/0}},S=0;S<k.length;S+=1){var L=k[S],N=L.bounds?L.bounds.min:L.min||L.position||L,j=L.bounds?L.bounds.max:L.max||L.position||L;N&&j&&(N.x<I.min.x&&(I.min.x=N.x),j.x>I.max.x&&(I.max.x=j.x),N.y<I.min.y&&(I.min.y=N.y),j.y>I.max.y&&(I.max.y=j.y))}var P=I.max.x-I.min.x+2*_.x,D=I.max.y-I.min.y+2*_.y,H=E.canvas.height,z=E.canvas.width,F=z/H,q=P/D,R=1,$=1;q>F?$=q/F:R=F/q,E.options.hasBounds=!0,E.bounds.min.x=I.min.x,E.bounds.max.x=I.min.x+P*R,E.bounds.min.y=I.min.y,E.bounds.max.y=I.min.y+D*$,A&&(E.bounds.min.x+=P*.5-P*R*.5,E.bounds.max.x+=P*.5-P*R*.5,E.bounds.min.y+=D*.5-D*$*.5,E.bounds.max.y+=D*.5-D*$*.5),E.bounds.min.x-=_.x,E.bounds.max.x-=_.x,E.bounds.min.y-=_.y,E.bounds.max.y-=_.y,E.mouse&&(h.setScale(E.mouse,{x:(E.bounds.max.x-E.bounds.min.x)/E.canvas.width,y:(E.bounds.max.y-E.bounds.min.y)/E.canvas.height}),h.setOffset(E.mouse,E.bounds.min))},i.startViewTransform=function(E){var k=E.bounds.max.x-E.bounds.min.x,_=E.bounds.max.y-E.bounds.min.y,A=k/E.options.width,I=_/E.options.height;E.context.setTransform(E.options.pixelRatio/A,0,0,E.options.pixelRatio/I,0,0),E.context.translate(-E.bounds.min.x,-E.bounds.min.y)},i.endViewTransform=function(E){E.context.setTransform(E.options.pixelRatio,0,0,E.options.pixelRatio,0,0)},i.world=function(E,k){var _=o.now(),A=E.engine,I=A.world,S=E.canvas,L=E.context,N=E.options,j=E.timing,P=u.allBodies(I),D=u.allConstraints(I),H=N.wireframes?N.wireframeBackground:N.background,z=[],F=[],q,R={timestamp:A.timing.timestamp};if(c.trigger(E,"beforeRender",R),E.currentBackground!==H&&C(E,H),L.globalCompositeOperation="source-in",L.fillStyle="transparent",L.fillRect(0,0,S.width,S.height),L.globalCompositeOperation="source-over",N.hasBounds){for(q=0;q<P.length;q++){var $=P[q];l.overlaps($.bounds,E.bounds)&&z.push($)}for(q=0;q<D.length;q++){var W=D[q],M=W.bodyA,ee=W.bodyB,oe=W.pointA,V=W.pointB;M&&(oe=f.add(M.position,W.pointA)),ee&&(V=f.add(ee.position,W.pointB)),!(!oe||!V)&&(l.contains(E.bounds,oe)||l.contains(E.bounds,V))&&F.push(W)}i.startViewTransform(E),E.mouse&&(h.setScale(E.mouse,{x:(E.bounds.max.x-E.bounds.min.x)/E.options.width,y:(E.bounds.max.y-E.bounds.min.y)/E.options.height}),h.setOffset(E.mouse,E.bounds.min))}else F=D,z=P,E.options.pixelRatio!==1&&E.context.setTransform(E.options.pixelRatio,0,0,E.options.pixelRatio,0,0);!N.wireframes||A.enableSleeping&&N.showSleeping?i.bodies(E,z,L):(N.showConvexHulls&&i.bodyConvexHulls(E,z,L),i.bodyWireframes(E,z,L)),N.showBounds&&i.bodyBounds(E,z,L),(N.showAxes||N.showAngleIndicator)&&i.bodyAxes(E,z,L),N.showPositions&&i.bodyPositions(E,z,L),N.showVelocity&&i.bodyVelocity(E,z,L),N.showIds&&i.bodyIds(E,z,L),N.showSeparations&&i.separations(E,A.pairs.list,L),N.showCollisions&&i.collisions(E,A.pairs.list,L),N.showVertexNumbers&&i.vertexNumbers(E,z,L),N.showMousePosition&&i.mousePosition(E,E.mouse,L),i.constraints(F,L),N.hasBounds&&i.endViewTransform(E),c.trigger(E,"afterRender",R),j.lastElapsed=o.now()-_},i.stats=function(E,k,_){for(var A=E.engine,I=A.world,S=u.allBodies(I),L=0,N=55,j=44,P=0,D=0,H=0;H<S.length;H+=1)L+=S[H].parts.length;var z={Part:L,Body:S.length,Cons:u.allConstraints(I).length,Comp:u.allComposites(I).length,Pair:A.pairs.list.length};k.fillStyle="#0e0f19",k.fillRect(P,D,N*5.5,j),k.font="12px Arial",k.textBaseline="top",k.textAlign="right";for(var F in z){var q=z[F];k.fillStyle="#aaa",k.fillText(F,P+N,D+8),k.fillStyle="#eee",k.fillText(q,P+N,D+26),P+=N}},i.performance=function(E,k){var _=E.engine,A=E.timing,I=A.deltaHistory,S=A.elapsedHistory,L=A.timestampElapsedHistory,N=A.engineDeltaHistory,j=A.engineElapsedHistory,P=_.timing.lastDelta,D=g(I),H=g(S),z=g(N),F=g(j),q=g(L),R=q/D||0,$=1e3/D||0,W=4,M=12,ee=60,oe=34,V=10,X=69;k.fillStyle="#0e0f19",k.fillRect(0,50,M*4+ee*5+22,oe),i.status(k,V,X,ee,W,I.length,Math.round($)+" fps",$/i._goodFps,function(Z){return I[Z]/D-1}),i.status(k,V+M+ee,X,ee,W,N.length,P.toFixed(2)+" dt",i._goodDelta/P,function(Z){return N[Z]/z-1}),i.status(k,V+(M+ee)*2,X,ee,W,j.length,F.toFixed(2)+" ut",1-F/i._goodFps,function(Z){return j[Z]/F-1}),i.status(k,V+(M+ee)*3,X,ee,W,S.length,H.toFixed(2)+" rt",1-H/i._goodFps,function(Z){return S[Z]/H-1}),i.status(k,V+(M+ee)*4,X,ee,W,L.length,R.toFixed(2)+" x",R*R*R,function(Z){return(L[Z]/I[Z]/R||0)-1})},i.status=function(E,k,_,A,I,S,L,N,j){E.strokeStyle="#888",E.fillStyle="#444",E.lineWidth=1,E.fillRect(k,_+7,A,1),E.beginPath(),E.moveTo(k,_+7-I*o.clamp(.4*j(0),-2,2));for(var P=0;P<A;P+=1)E.lineTo(k+P,_+7-(P<S?I*o.clamp(.4*j(P),-2,2):0));E.stroke(),E.fillStyle="hsl("+o.clamp(25+95*N,0,120)+",100%,60%)",E.fillRect(k,_-7,4,4),E.font="12px Arial",E.textBaseline="middle",E.textAlign="right",E.fillStyle="#eee",E.fillText(L,k+A,_-5)},i.constraints=function(E,k){for(var _=k,A=0;A<E.length;A++){var I=E[A];if(!(!I.render.visible||!I.pointA||!I.pointB)){var S=I.bodyA,L=I.bodyB,N,j;if(S?N=f.add(S.position,I.pointA):N=I.pointA,I.render.type==="pin")_.beginPath(),_.arc(N.x,N.y,3,0,2*Math.PI),_.closePath();else{if(L?j=f.add(L.position,I.pointB):j=I.pointB,_.beginPath(),_.moveTo(N.x,N.y),I.render.type==="spring")for(var P=f.sub(j,N),D=f.perp(f.normalise(P)),H=Math.ceil(o.clamp(I.length/5,12,20)),z,F=1;F<H;F+=1)z=F%2===0?1:-1,_.lineTo(N.x+P.x*(F/H)+D.x*z*4,N.y+P.y*(F/H)+D.y*z*4);_.lineTo(j.x,j.y)}I.render.lineWidth&&(_.lineWidth=I.render.lineWidth,_.strokeStyle=I.render.strokeStyle,_.stroke()),I.render.anchors&&(_.fillStyle=I.render.strokeStyle,_.beginPath(),_.arc(N.x,N.y,3,0,2*Math.PI),_.arc(j.x,j.y,3,0,2*Math.PI),_.closePath(),_.fill())}}},i.bodies=function(E,k,_){var A=_;E.engine;var I=E.options,S=I.showInternalEdges||!I.wireframes,L,N,j,P;for(j=0;j<k.length;j++)if(L=k[j],!!L.render.visible){for(P=L.parts.length>1?1:0;P<L.parts.length;P++)if(N=L.parts[P],!!N.render.visible){if(I.showSleeping&&L.isSleeping?A.globalAlpha=.5*N.render.opacity:N.render.opacity!==1&&(A.globalAlpha=N.render.opacity),N.render.sprite&&N.render.sprite.texture&&!I.wireframes){var D=N.render.sprite,H=T(E,D.texture);A.translate(N.position.x,N.position.y),A.rotate(N.angle),A.drawImage(H,H.width*-D.xOffset*D.xScale,H.height*-D.yOffset*D.yScale,H.width*D.xScale,H.height*D.yScale),A.rotate(-N.angle),A.translate(-N.position.x,-N.position.y)}else{if(N.circleRadius)A.beginPath(),A.arc(N.position.x,N.position.y,N.circleRadius,0,2*Math.PI);else{A.beginPath(),A.moveTo(N.vertices[0].x,N.vertices[0].y);for(var z=1;z<N.vertices.length;z++)!N.vertices[z-1].isInternal||S?A.lineTo(N.vertices[z].x,N.vertices[z].y):A.moveTo(N.vertices[z].x,N.vertices[z].y),N.vertices[z].isInternal&&!S&&A.moveTo(N.vertices[(z+1)%N.vertices.length].x,N.vertices[(z+1)%N.vertices.length].y);A.lineTo(N.vertices[0].x,N.vertices[0].y),A.closePath()}I.wireframes?(A.lineWidth=1,A.strokeStyle="#bbb",A.stroke()):(A.fillStyle=N.render.fillStyle,N.render.lineWidth&&(A.lineWidth=N.render.lineWidth,A.strokeStyle=N.render.strokeStyle,A.stroke()),A.fill())}A.globalAlpha=1}}},i.bodyWireframes=function(E,k,_){var A=_,I=E.options.showInternalEdges,S,L,N,j,P;for(A.beginPath(),N=0;N<k.length;N++)if(S=k[N],!!S.render.visible)for(P=S.parts.length>1?1:0;P<S.parts.length;P++){for(L=S.parts[P],A.moveTo(L.vertices[0].x,L.vertices[0].y),j=1;j<L.vertices.length;j++)!L.vertices[j-1].isInternal||I?A.lineTo(L.vertices[j].x,L.vertices[j].y):A.moveTo(L.vertices[j].x,L.vertices[j].y),L.vertices[j].isInternal&&!I&&A.moveTo(L.vertices[(j+1)%L.vertices.length].x,L.vertices[(j+1)%L.vertices.length].y);A.lineTo(L.vertices[0].x,L.vertices[0].y)}A.lineWidth=1,A.strokeStyle="#bbb",A.stroke()},i.bodyConvexHulls=function(E,k,_){var A=_,I,S,L;for(A.beginPath(),S=0;S<k.length;S++)if(I=k[S],!(!I.render.visible||I.parts.length===1)){for(A.moveTo(I.vertices[0].x,I.vertices[0].y),L=1;L<I.vertices.length;L++)A.lineTo(I.vertices[L].x,I.vertices[L].y);A.lineTo(I.vertices[0].x,I.vertices[0].y)}A.lineWidth=1,A.strokeStyle="rgba(255,255,255,0.2)",A.stroke()},i.vertexNumbers=function(E,k,_){var A=_,I,S,L;for(I=0;I<k.length;I++){var N=k[I].parts;for(L=N.length>1?1:0;L<N.length;L++){var j=N[L];for(S=0;S<j.vertices.length;S++)A.fillStyle="rgba(255,255,255,0.2)",A.fillText(I+"_"+S,j.position.x+(j.vertices[S].x-j.position.x)*.8,j.position.y+(j.vertices[S].y-j.position.y)*.8)}}},i.mousePosition=function(E,k,_){var A=_;A.fillStyle="rgba(255,255,255,0.8)",A.fillText(k.position.x+" "+k.position.y,k.position.x+5,k.position.y-5)},i.bodyBounds=function(E,k,_){var A=_;E.engine;var I=E.options;A.beginPath();for(var S=0;S<k.length;S++){var L=k[S];if(L.render.visible)for(var N=k[S].parts,j=N.length>1?1:0;j<N.length;j++){var P=N[j];A.rect(P.bounds.min.x,P.bounds.min.y,P.bounds.max.x-P.bounds.min.x,P.bounds.max.y-P.bounds.min.y)}}I.wireframes?A.strokeStyle="rgba(255,255,255,0.08)":A.strokeStyle="rgba(0,0,0,0.1)",A.lineWidth=1,A.stroke()},i.bodyAxes=function(E,k,_){var A=_;E.engine;var I=E.options,S,L,N,j;for(A.beginPath(),L=0;L<k.length;L++){var P=k[L],D=P.parts;if(P.render.visible)if(I.showAxes)for(N=D.length>1?1:0;N<D.length;N++)for(S=D[N],j=0;j<S.axes.length;j++){var H=S.axes[j];A.moveTo(S.position.x,S.position.y),A.lineTo(S.position.x+H.x*20,S.position.y+H.y*20)}else for(N=D.length>1?1:0;N<D.length;N++)for(S=D[N],j=0;j<S.axes.length;j++)A.moveTo(S.position.x,S.position.y),A.lineTo((S.vertices[0].x+S.vertices[S.vertices.length-1].x)/2,(S.vertices[0].y+S.vertices[S.vertices.length-1].y)/2)}I.wireframes?(A.strokeStyle="indianred",A.lineWidth=1):(A.strokeStyle="rgba(255, 255, 255, 0.4)",A.globalCompositeOperation="overlay",A.lineWidth=2),A.stroke(),A.globalCompositeOperation="source-over"},i.bodyPositions=function(E,k,_){var A=_;E.engine;var I=E.options,S,L,N,j;for(A.beginPath(),N=0;N<k.length;N++)if(S=k[N],!!S.render.visible)for(j=0;j<S.parts.length;j++)L=S.parts[j],A.arc(L.position.x,L.position.y,3,0,2*Math.PI,!1),A.closePath();for(I.wireframes?A.fillStyle="indianred":A.fillStyle="rgba(0,0,0,0.5)",A.fill(),A.beginPath(),N=0;N<k.length;N++)S=k[N],S.render.visible&&(A.arc(S.positionPrev.x,S.positionPrev.y,2,0,2*Math.PI,!1),A.closePath());A.fillStyle="rgba(255,165,0,0.8)",A.fill()},i.bodyVelocity=function(E,k,_){var A=_;A.beginPath();for(var I=0;I<k.length;I++){var S=k[I];if(S.render.visible){var L=a.getVelocity(S);A.moveTo(S.position.x,S.position.y),A.lineTo(S.position.x+L.x,S.position.y+L.y)}}A.lineWidth=3,A.strokeStyle="cornflowerblue",A.stroke()},i.bodyIds=function(E,k,_){var A=_,I,S;for(I=0;I<k.length;I++)if(k[I].render.visible){var L=k[I].parts;for(S=L.length>1?1:0;S<L.length;S++){var N=L[S];A.font="12px Arial",A.fillStyle="rgba(255,255,255,0.5)",A.fillText(N.id,N.position.x+10,N.position.y-10)}}},i.collisions=function(E,k,_){var A=_,I=E.options,S,L,N,j;for(A.beginPath(),N=0;N<k.length;N++)if(S=k[N],!!S.isActive)for(L=S.collision,j=0;j<S.activeContacts.length;j++){var P=S.activeContacts[j],D=P.vertex;A.rect(D.x-1.5,D.y-1.5,3.5,3.5)}for(I.wireframes?A.fillStyle="rgba(255,255,255,0.7)":A.fillStyle="orange",A.fill(),A.beginPath(),N=0;N<k.length;N++)if(S=k[N],!!S.isActive&&(L=S.collision,S.activeContacts.length>0)){var H=S.activeContacts[0].vertex.x,z=S.activeContacts[0].vertex.y;S.activeContacts.length===2&&(H=(S.activeContacts[0].vertex.x+S.activeContacts[1].vertex.x)/2,z=(S.activeContacts[0].vertex.y+S.activeContacts[1].vertex.y)/2),L.bodyB===L.supports[0].body||L.bodyA.isStatic===!0?A.moveTo(H-L.normal.x*8,z-L.normal.y*8):A.moveTo(H+L.normal.x*8,z+L.normal.y*8),A.lineTo(H,z)}I.wireframes?A.strokeStyle="rgba(255,165,0,0.7)":A.strokeStyle="orange",A.lineWidth=1,A.stroke()},i.separations=function(E,k,_){var A=_,I=E.options,S,L,N,j,P;for(A.beginPath(),P=0;P<k.length;P++)if(S=k[P],!!S.isActive){L=S.collision,N=L.bodyA,j=L.bodyB;var D=1;!j.isStatic&&!N.isStatic&&(D=.5),j.isStatic&&(D=0),A.moveTo(j.position.x,j.position.y),A.lineTo(j.position.x-L.penetration.x*D,j.position.y-L.penetration.y*D),D=1,!j.isStatic&&!N.isStatic&&(D=.5),N.isStatic&&(D=0),A.moveTo(N.position.x,N.position.y),A.lineTo(N.position.x+L.penetration.x*D,N.position.y+L.penetration.y*D)}I.wireframes?A.strokeStyle="rgba(255,165,0,0.5)":A.strokeStyle="orange",A.stroke()},i.inspector=function(E,k){E.engine;var _=E.selected,A=E.render,I=A.options,S;if(I.hasBounds){var L=A.bounds.max.x-A.bounds.min.x,N=A.bounds.max.y-A.bounds.min.y,j=L/A.options.width,P=N/A.options.height;k.scale(1/j,1/P),k.translate(-A.bounds.min.x,-A.bounds.min.y)}for(var D=0;D<_.length;D++){var H=_[D].data;switch(k.translate(.5,.5),k.lineWidth=1,k.strokeStyle="rgba(255,165,0,0.9)",k.setLineDash([1,2]),H.type){case"body":S=H.bounds,k.beginPath(),k.rect(Math.floor(S.min.x-3),Math.floor(S.min.y-3),Math.floor(S.max.x-S.min.x+6),Math.floor(S.max.y-S.min.y+6)),k.closePath(),k.stroke();break;case"constraint":var z=H.pointA;H.bodyA&&(z=H.pointB),k.beginPath(),k.arc(z.x,z.y,10,0,2*Math.PI),k.closePath(),k.stroke();break}k.setLineDash([]),k.translate(-.5,-.5)}E.selectStart!==null&&(k.translate(.5,.5),k.lineWidth=1,k.strokeStyle="rgba(255,165,0,0.6)",k.fillStyle="rgba(255,165,0,0.1)",S=E.selectBounds,k.beginPath(),k.rect(Math.floor(S.min.x),Math.floor(S.min.y),Math.floor(S.max.x-S.min.x),Math.floor(S.max.y-S.min.y)),k.closePath(),k.stroke(),k.fill(),k.translate(-.5,-.5)),I.hasBounds&&k.setTransform(1,0,0,1,0,0)};var p=function(E,k){var _=E.engine,A=E.timing,I=A.historySize,S=_.timing.timestamp;A.delta=k-A.lastTime||i._goodDelta,A.lastTime=k,A.timestampElapsed=S-A.lastTimestamp||0,A.lastTimestamp=S,A.deltaHistory.unshift(A.delta),A.deltaHistory.length=Math.min(A.deltaHistory.length,I),A.engineDeltaHistory.unshift(_.timing.lastDelta),A.engineDeltaHistory.length=Math.min(A.engineDeltaHistory.length,I),A.timestampElapsedHistory.unshift(A.timestampElapsed),A.timestampElapsedHistory.length=Math.min(A.timestampElapsedHistory.length,I),A.engineElapsedHistory.unshift(_.timing.lastElapsed),A.engineElapsedHistory.length=Math.min(A.engineElapsedHistory.length,I),A.elapsedHistory.unshift(A.lastElapsed),A.elapsedHistory.length=Math.min(A.elapsedHistory.length,I)},g=function(E){for(var k=0,_=0;_<E.length;_+=1)k+=E[_];return k/E.length||0},y=function(E,k){var _=document.createElement("canvas");return _.width=E,_.height=k,_.oncontextmenu=function(){return!1},_.onselectstart=function(){return!1},_},v=function(E){var k=E.getContext("2d"),_=window.devicePixelRatio||1,A=k.webkitBackingStorePixelRatio||k.mozBackingStorePixelRatio||k.msBackingStorePixelRatio||k.oBackingStorePixelRatio||k.backingStorePixelRatio||1;return _/A},T=function(E,k){var _=E.textures[k];return _||(_=E.textures[k]=new Image,_.src=k,_)},C=function(E,k){var _=k;/(jpg|gif|png)$/.test(k)&&(_="url("+k+")"),E.canvas.style.background=_,E.canvas.style.backgroundSize="contain",E.currentBackground=k}})()}),(function(n,r,s){var i={};n.exports=i;var a=s(5),o=s(17),u=s(0);(function(){var l,c;if(typeof window<"u"&&(l=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame,c=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame),!l){var f;l=function(h){f=setTimeout(function(){h(u.now())},1e3/60)},c=function(){clearTimeout(f)}}i.create=function(h){var d={fps:60,deltaSampleSize:60,counterTimestamp:0,frameCounter:0,deltaHistory:[],timePrev:null,frameRequestId:null,isFixed:!1,enabled:!0},m=u.extend(d,h);return m.delta=m.delta||1e3/m.fps,m.deltaMin=m.deltaMin||1e3/m.fps,m.deltaMax=m.deltaMax||1e3/(m.fps*.5),m.fps=1e3/m.delta,m},i.run=function(h,d){return typeof h.positionIterations<"u"&&(d=h,h=i.create()),(function m(p){h.frameRequestId=l(m),p&&h.enabled&&i.tick(h,d,p)})(),h},i.tick=function(h,d,m){var p=d.timing,g;h.isFixed?g=h.delta:(g=m-h.timePrev||h.delta,h.timePrev=m,h.deltaHistory.push(g),h.deltaHistory=h.deltaHistory.slice(-h.deltaSampleSize),g=Math.min.apply(null,h.deltaHistory),g=g<h.deltaMin?h.deltaMin:g,g=g>h.deltaMax?h.deltaMax:g,h.delta=g);var y={timestamp:p.timestamp};a.trigger(h,"beforeTick",y),h.frameCounter+=1,m-h.counterTimestamp>=1e3&&(h.fps=h.frameCounter*((m-h.counterTimestamp)/1e3),h.counterTimestamp=m,h.frameCounter=0),a.trigger(h,"tick",y),a.trigger(h,"beforeUpdate",y),o.update(d,g),a.trigger(h,"afterUpdate",y),a.trigger(h,"afterTick",y)},i.stop=function(h){c(h.frameRequestId)},i.start=function(h,d){i.run(h,d)}})()}),(function(n,r,s){var i={};n.exports=i;var a=s(8),o=s(0),u=o.deprecated;(function(){i.collides=function(l,c){return a.collides(l,c)},u(i,"collides","SAT.collides ➤ replaced by Collision.collides")})()}),(function(n,r,s){var i={};n.exports=i,s(1);var a=s(0);(function(){i.pathToVertices=function(o,u){typeof window<"u"&&!("SVGPathSeg"in window)&&a.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var l,c,f,h,d,m,p,g,y,v,T=[],C,E,k=0,_=0,A=0;u=u||15;var I=function(L,N,j){var P=j%2===1&&j>1;if(!y||L!=y.x||N!=y.y){y&&P?(C=y.x,E=y.y):(C=0,E=0);var D={x:C+L,y:E+N};(P||!y)&&(y=D),T.push(D),_=C+L,A=E+N}},S=function(L){var N=L.pathSegTypeAsLetter.toUpperCase();if(N!=="Z"){switch(N){case"M":case"L":case"T":case"C":case"S":case"Q":_=L.x,A=L.y;break;case"H":_=L.x;break;case"V":A=L.y;break}I(_,A,L.pathSegType)}};for(i._svgPathToAbsolute(o),f=o.getTotalLength(),m=[],l=0;l<o.pathSegList.numberOfItems;l+=1)m.push(o.pathSegList.getItem(l));for(p=m.concat();k<f;){if(v=o.getPathSegAtLength(k),d=m[v],d!=g){for(;p.length&&p[0]!=d;)S(p.shift());g=d}switch(d.pathSegTypeAsLetter.toUpperCase()){case"C":case"T":case"S":case"Q":case"A":h=o.getPointAtLength(k),I(h.x,h.y,0);break}k+=u}for(l=0,c=p.length;l<c;++l)S(p[l]);return T},i._svgPathToAbsolute=function(o){for(var u,l,c,f,h,d,m=o.pathSegList,p=0,g=0,y=m.numberOfItems,v=0;v<y;++v){var T=m.getItem(v),C=T.pathSegTypeAsLetter;if(/[MLHVCSQTA]/.test(C))"x"in T&&(p=T.x),"y"in T&&(g=T.y);else switch("x1"in T&&(c=p+T.x1),"x2"in T&&(h=p+T.x2),"y1"in T&&(f=g+T.y1),"y2"in T&&(d=g+T.y2),"x"in T&&(p+=T.x),"y"in T&&(g+=T.y),C){case"m":m.replaceItem(o.createSVGPathSegMovetoAbs(p,g),v);break;case"l":m.replaceItem(o.createSVGPathSegLinetoAbs(p,g),v);break;case"h":m.replaceItem(o.createSVGPathSegLinetoHorizontalAbs(p),v);break;case"v":m.replaceItem(o.createSVGPathSegLinetoVerticalAbs(g),v);break;case"c":m.replaceItem(o.createSVGPathSegCurvetoCubicAbs(p,g,c,f,h,d),v);break;case"s":m.replaceItem(o.createSVGPathSegCurvetoCubicSmoothAbs(p,g,h,d),v);break;case"q":m.replaceItem(o.createSVGPathSegCurvetoQuadraticAbs(p,g,c,f),v);break;case"t":m.replaceItem(o.createSVGPathSegCurvetoQuadraticSmoothAbs(p,g),v);break;case"a":m.replaceItem(o.createSVGPathSegArcAbs(p,g,T.r1,T.r2,T.angle,T.largeArcFlag,T.sweepFlag),v);break;case"z":case"Z":p=u,g=l;break}(C=="M"||C=="m")&&(u=p,l=g)}}})()}),(function(n,r,s){var i={};n.exports=i;var a=s(6);s(0),(function(){i.create=a.create,i.add=a.add,i.remove=a.remove,i.clear=a.clear,i.addComposite=a.addComposite,i.addBody=a.addBody,i.addConstraint=a.addConstraint})()})])})})(es)),es.exports}var Nx=Ix();const cn=mu(Nx);{const e=cn.Resolver;e&&typeof e._restingThresh=="number"&&(e._restingThresh=1.4)}const Rx=6,Bt=28,dn=.92,ma=1.12,Lx=34;function ql(e,t,n){return Math.hypot(t-e.startX,n-e.startY)<Rx?"click":"drag"}function Mx(e){const t=e.length;if(t===0)return"";const n=s=>`${s.x.toFixed(1)} ${s.y.toFixed(1)}`;if(t===1)return`M ${n(e[0])}`;if(t===2)return`M ${n(e[0])} L ${n(e[1])}`;let r=`M ${n(e[0])}`;for(let s=1;s<t-1;s++){const i=e[s],a=e[s+1];r+=` Q ${n(i)} ${((i.x+a.x)/2).toFixed(1)} ${((i.y+a.y)/2).toFixed(1)}`}return`${r} L ${n(e[t-1])}`}function Px(e,t){return e*Math.exp(-t/90)}function Dx(e,t,n,r){const s=`translate3d(${e.toFixed(1)}px, ${t.toFixed(1)}px, 0)`;if(n<.01)return s;const i=r*180/Math.PI,a=Math.min(.35,n);return`${s} rotate(${i.toFixed(1)}deg) scale(${(1+a).toFixed(3)}, ${(1-a).toFixed(3)}) rotate(${(-i).toFixed(1)}deg)`}const Ah=4e-5,Ox=5e-4;function Ch(e,t,n){return Math.sin(n*37e-5+t*.0013)*.6+Math.sin(n*19e-5+e*7e-4+1.7)*.4}function _h(e){switch(e){case"storm":return{wind:.95,gust:1,rainRate:.006,snowRate:0,airDrag:1.05};case"rain":return{wind:.6,gust:.25,rainRate:.004,snowRate:0,airDrag:1};case"snow":return{wind:.25,gust:0,rainRate:0,snowRate:4e-4,airDrag:1};case"fog":return{wind:.06,gust:0,rainRate:0,snowRate:0,airDrag:1.7};case"cloudy":return{wind:.4,gust:.1,rainRate:0,snowRate:0,airDrag:1};case"clear":default:return{wind:.3,gust:0,rainRate:0,snowRate:0,airDrag:1}}}function Ih(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t^=t>>>16,t=Math.imul(t,2246822507),t^=t>>>13,t=Math.imul(t,3266489909),t^=t>>>16,(t>>>0)/4294967295}const Nr=120,Fx=.9,$l=.7,Bx=.09,jx=2.2,Hx=2,pa=Bt*2.45,Ux=.006,ga=22,xa=.06;function zx(e){var j;const t=e.ballRadius??Bt,n=_h(e.weather??"clear"),{Engine:r,Bodies:s,Body:i,Composite:a,Constraint:o,Events:u}=cn,l=r.create();l.gravity.y=1,l.positionIterations=8,l.velocityIterations=4;const c=e.nodes.map(P=>{var F,q;const D=((F=P.spawn)==null?void 0:F.x)??P.x,H=((q=P.spawn)==null?void 0:q.y)??P.y,z=s.circle(D,H,t,{restitution:.5,friction:.01,frictionAir:.03*n.airDrag,density:P.isExam?.0016:.001,inertia:1/0,isStatic:!!P.locked,collisionFilter:{group:0,category:2,mask:6}});return{nodeId:P.id,body:z,layoutX:P.x,layoutY:P.y,isExam:!!P.isExam,snow:0,field:0,squash:0,squashAngle:0}});for(const P of c){a.add(l.world,P.body);const D=(j=e.nodes.find(H=>H.id===P.nodeId))==null?void 0:j.spawn;D&&(D.vx!==void 0||D.vy!==void 0)&&i.setVelocity(P.body,{x:D.vx??0,y:D.vy??0})}const f=Nr/2,h={isStatic:!0,restitution:.4,friction:.05,collisionFilter:{category:4,mask:2}},d=(P,D)=>({x:Math.min(e.width-t,Math.max(t,P)),y:Math.min(e.height-t,Math.max(t,D))});a.add(l.world,[s.rectangle(e.width/2,-f,e.width*3,Nr,h),s.rectangle(e.width/2,e.height+f,e.width*3,Nr,h),s.rectangle(-f,e.height/2,Nr,e.height*3,h),s.rectangle(e.width+f,e.height/2,Nr,e.height*3,h)]);const m=P=>({x:P.body.position.x,y:P.body.position.y+t*dn}),p=[];function g(P,D,H,z,F){return"body"in P?o.create({bodyA:P.body,pointA:P.offset,bodyB:D,pointB:H,length:z,stiffness:F,damping:.05}):o.create({pointA:P.point,bodyB:D,pointB:H,length:z,stiffness:F,damping:.05})}function y(P,D,H,z){const F={x:H.body.position.x,y:H.body.position.y+t*dn},q=F.x-P.x,R=F.y-P.y,$=Math.max(60,Math.hypot(q,R)),W=Math.max(5,Math.min(14,Math.round($/Lx))),M=$*ma/W,ee=[];let oe=D?{body:D,offset:{x:P.x-D.position.x,y:P.y-D.position.y}}:{point:P},V=!0;for(let X=1;X<W;X++){const Z=X/W,be=Math.sin(Math.PI*Z)*$*(ma-1)*.85,me=s.circle(P.x+q*Z,P.y+R*Z+be,3.5,{density:7e-4,frictionAir:.1*n.airDrag,collisionFilter:{category:8,mask:0}});ee.push(me),a.add(l.world,me),a.add(l.world,g(oe,me,void 0,M,V?$l:Fx)),V=!1,oe={body:me,offset:{x:0,y:0}}}a.add(l.world,g(oe,H.body,{x:0,y:t*dn},M,$l)),p.push({from:z,to:H.nodeId,restLen:$*ma,particles:ee})}const v=c[0],T=v?{x:e.anchorKnotX??v.layoutX,y:xs}:{x:e.width/2,y:xs};v&&y(T,null,v,"__anchor");for(let P=0;P<c.length-1;P++){const D=c[P],H=c[P+1];y(m(D),D.body,H,D.nodeId)}const C=c[c.length-1],E=e.nextKnot&&(C!=null&&C.isExam)?e.nextKnot:void 0;E&&C&&y(E,null,C,"__next");const k=new Map;for(const P of c){let D=0;for(const z of p)if(z.from===P.nodeId||z.to===P.nodeId)for(const F of z.particles)D+=F.mass*.5;const H=Math.min(.25,D/P.body.mass);k.set(P.nodeId,(1+H)*(.96+Ih(P.nodeId)*.08))}let _=0,A=1;u.on(l,"beforeUpdate",()=>{const P=l.timing.timestamp;_*=.97,n.gust>0&&Math.random()<.0025*n.gust&&(_=n.gust*(.6+Math.random()*.4),A=Math.random()<.5?-1:1);for(const D of c){const H=D.body.mass,z=l.gravity.y*l.gravity.scale,F=Ch(D.body.position.x,D.body.position.y,P)*n.wind*Ah*H+A*_*Ox*H;let q=-H*z*(k.get(D.nodeId)??1);n.rainRate>0&&Math.random()<n.rainRate&&(q+=H*z*.35,i.applyForce(D.body,D.body.position,{x:(Math.random()-.5)*H*z*.3,y:0})),i.applyForce(D.body,D.body.position,{x:F,y:q})}});const I=[],S=(P,D,H,z)=>{if(P.snow<=xa)return;const F=Math.max(1,Math.min(z,Math.round(P.snow*z)+1));for(let q=0;q<F;q++){const R=-(.35+Math.random()*1.9),$=t*(.55+Math.random()*.45);I.push({x:P.body.position.x+Math.cos(R)*$,y:P.body.position.y+Math.sin(R)*$,vx:P.body.velocity.x*.75+D.x*(.5+Math.random()*1.8)+(Math.random()-.5)*1.2,vy:P.body.velocity.y*.75+D.y*(.5+Math.random()*1.8)-.6-Math.random()*.8,amount:.02+Math.min(.05,H*.004)})}P.snow=Math.max(xa*.5,P.snow-F*(.03+Math.min(.07,H*.005))),I.length>96&&I.splice(0,I.length-96)},L=[];u.on(l,"collisionStart",P=>{var D;for(const H of P.pairs){const{bodyA:z,bodyB:F}=H,q=c.find(V=>V.body===z),R=c.find(V=>V.body===F);if(!q&&!R)continue;const $={x:z.velocity.x-F.velocity.x,y:z.velocity.y-F.velocity.y},W=Math.hypot($.x,$.y);if(W<jx)continue;const M=H.collision.normal,ee=(D=H.collision.supports)==null?void 0:D[0];L.push(ee?{x:ee.x,y:ee.y,speed:W}:{x:(z.position.x+F.position.x)/2,y:(z.position.y+F.position.y)/2,speed:W}),L.length>64&&L.shift();const oe=Math.min(.32,W*.028);q&&oe>q.squash&&(q.squash=oe,q.squashAngle=Math.atan2(M.y,M.x)),R&&oe>R.squash&&(R.squash=oe,R.squashAngle=Math.atan2(-M.y,-M.x)),q&&S(q,{x:M.x,y:M.y},W,5),R&&S(R,{x:-M.x,y:-M.y},W,5)}}),u.on(l,"afterUpdate",()=>{if(!(n.snowRate<=0))for(const P of c)P.snow=Math.min(1,P.snow+n.snowRate)});let N=null;return{balls:c,links:p,anchor:T,nextKnot:E,ball(P){return c.find(D=>D.nodeId===P)},step(P){r.update(l,Math.min(33,Math.max(8,P)));for(let D=0;D<c.length;D++){const H=c[D];for(let z=D+1;z<c.length;z++){const F=c[z],q=F.body.position.x-H.body.position.x,R=F.body.position.y-H.body.position.y,$=q*q+R*R;if($>=pa*pa||$<.01)continue;const W=Math.sqrt($),M=(W-2*t)/(pa-2*t),ee=M<=0?1:M>=1?0:1-M,V=Math.hypot(H.body.velocity.x-F.body.velocity.x,H.body.velocity.y-F.body.velocity.y)<1.2?Ux*ee*ee:0,X=q/W,Z=R/W;H.body.isStatic||i.applyForce(H.body,H.body.position,{x:-X*V*H.body.mass,y:-Z*V*H.body.mass}),F.body.isStatic||i.applyForce(F.body,F.body.position,{x:X*V*F.body.mass,y:Z*V*F.body.mass}),H.field=Math.max(H.field,ee),F.field=Math.max(F.field,ee)}}for(const D of c)D.field*=.88;for(const D of c){if(D.body.isStatic)continue;const H=D.body.velocity,z=Math.hypot(H.x,H.y);z>ga&&i.setVelocity(D.body,{x:H.x/z*ga,y:H.y/z*ga})}for(let D=0;D<c.length;D++){const H=c[D];for(let z=D+1;z<c.length;z++){const F=c[z];let q=F.body.position.x-H.body.position.x,R=F.body.position.y-H.body.position.y,$=Math.hypot(q,R);if($>=t*2)continue;$<.01&&(q=1,R=0,$=1);const W=t*2-$+.05,M=q/$,ee=R/$;H.body.isStatic&&F.body.isStatic||(H.body.isStatic?i.setPosition(F.body,{x:F.body.position.x+M*W,y:F.body.position.y+ee*W}):F.body.isStatic?i.setPosition(H.body,{x:H.body.position.x-M*W,y:H.body.position.y-ee*W}):(i.setPosition(H.body,{x:H.body.position.x-M*W/2,y:H.body.position.y-ee*W/2}),i.setPosition(F.body,{x:F.body.position.x+M*W/2,y:F.body.position.y+ee*W/2})))}}for(const D of c){const H=Math.hypot(D.body.velocity.x,D.body.velocity.y);D.snow>xa&&H>Hx&&S(D,{x:D.body.velocity.x/H,y:D.body.velocity.y/H},H,2)}for(const D of c){if(D.body.isStatic)continue;const H=D.body.position.x,z=D.body.position.y,F=Math.min(e.width-t,Math.max(t,H)),q=Math.min(e.height-t,Math.max(t,z));(F!==H||q!==z)&&(i.setPosition(D.body,{x:F,y:q}),i.setVelocity(D.body,{x:H<t||H>e.width-t?0:D.body.velocity.x,y:z<t||z>e.height-t?0:D.body.velocity.y}))}},beginDrag(P,D,H){this.endDrag();const z=this.ball(P);if(!z)return;const F=o.create({pointA:d(D,H),bodyB:z.body,length:0,stiffness:Bx,damping:.12});a.add(l.world,F),N={constraint:F,nodeId:P}},moveDrag(P,D){if(!N)return;const H=d(P,D);N.constraint.pointA=H},endDrag(){N&&(a.remove(l.world,N.constraint),N=null)},isDragging(){return N!==null},drainImpacts(){const P=L.slice();return L.length=0,P},drainFlakes(){const P=I.slice();return I.length=0,P},dispose(){this.endDrag(),u.off(l,"beforeUpdate"),u.off(l,"afterUpdate"),u.off(l,"collisionStart"),a.clear(l.world,!1),r.clear(l)}}}const xs=-12;function Di(e,t,n=20){return t<=n*2?t/2:n+Ih(e)*(t-n*2)}function Vx(e,t,n,r=Bt){if(t<=0||Math.abs(t-n)<=1)return e;const s=n/t,i={x:Math.min(n-r,Math.max(r,e.x*s)),y:e.y,vy:e.vy};return e.vx!==void 0&&(i.vx=e.vx*s),i}const Un=(e,t,n)=>e+(t-e)*n,Fs=(e,t,n)=>e<t?t:e>n?n:e,oi=e=>e<0?0:e>1?1:e*e*(3-2*e);function zn(e,t,n){return[Un(e[0],t[0],n),Un(e[1],t[1],n),Un(e[2],t[2],n)]}const ba=e=>`rgb(${e[0]|0},${e[1]|0},${e[2]|0})`,mr=(e,t)=>`rgba(${e[0]|0},${e[1]|0},${e[2]|0},${t})`;function Bs(){return[{t:0,top:[8,10,26],mid:[16,20,44],hor:[34,30,58]},{t:.12,top:[30,32,72],mid:[78,56,104],hor:[158,100,116]},{t:.22,top:[124,156,214],mid:[232,152,120],hor:[250,196,128]},{t:.36,top:[80,142,196],mid:[132,186,226],hor:[188,214,232]},{t:.5,top:[60,120,178],mid:[108,168,212],hor:[168,200,226]},{t:.62,top:[120,132,152],mid:[150,150,160],hor:[180,178,182]},{t:.74,top:[70,60,88],mid:[108,78,110],hor:[180,110,100]},{t:.86,top:[40,30,60],mid:[88,44,76],hor:[168,72,72]},{t:1,top:[8,10,26],mid:[16,20,44],hor:[34,30,58]}]}function js(e,t){return e.map(n=>({t:n.t,top:t(n.top),mid:t(n.mid),hor:t(n.hor)}))}const ya=()=>js(Bs(),e=>[e[0]*1,e[1]*1.15,e[2]*.7]),Oi=()=>js(Bs(),e=>[e[0]*.75,e[1]*1,Math.min(255,e[2]*1.25)]),Ea=()=>js(Bs(),e=>[Math.min(255,e[0]*1.35),e[1]*.8,e[2]*.55]),Wl=()=>js(Bs(),e=>{const t=(e[0]+e[1]+e[2])/3;return[t*.7+e[0]*.1,t*.7+e[1]*.1,t*.95+e[2]*.15]}),Ta={far:[28,50,36],near:[56,110,52],snowy:!1},Fi={far:[20,48,30],near:[34,82,40],snowy:!1},va={far:[54,36,24],near:[128,78,36],snowy:!1},Yl={far:[60,66,82],near:[232,236,244],snowy:!0};function Ot(e){return t=>{let n=e;return t>.3&&t<.5?n=Un(n,Math.min(1,n+.2),oi((t-.3)/.2)):t>=.5&&t<.74?n=Math.min(1,n+.15):t>=.74&&t<.84&&(n=Un(n,Math.max(0,n-.3),oi((t-.74)/.1))),Fs(n,0,1)}}const Nh={"spring|clear":{season:"spring",weather:"clear",sky:ya(),cloudCover:Ot(.1),particles:"none",lightning:!1,fogAlpha:0,ground:Ta},"spring|cloudy":{season:"spring",weather:"cloudy",sky:ya(),cloudCover:Ot(.5),particles:"none",lightning:!1,fogAlpha:0,ground:Ta},"spring|rain":{season:"spring",weather:"rain",sky:ya(),cloudCover:Ot(.85),particles:"rain",lightning:!1,fogAlpha:0,ground:Ta},"summer|clear":{season:"summer",weather:"clear",sky:Oi(),cloudCover:Ot(.1),particles:"none",lightning:!1,fogAlpha:0,ground:Fi},"summer|cloudy":{season:"summer",weather:"cloudy",sky:Oi(),cloudCover:Ot(.5),particles:"none",lightning:!1,fogAlpha:0,ground:Fi},"summer|rain":{season:"summer",weather:"rain",sky:Oi(),cloudCover:Ot(.85),particles:"rain",lightning:!1,fogAlpha:0,ground:Fi},"summer|storm":{season:"summer",weather:"storm",sky:Oi(),cloudCover:Ot(1),particles:"rain",lightning:!0,fogAlpha:0,ground:Fi},"autumn|clear":{season:"autumn",weather:"clear",sky:Ea(),cloudCover:Ot(.15),particles:"none",lightning:!1,fogAlpha:0,ground:va,sunTint:[255,180,110]},"autumn|cloudy":{season:"autumn",weather:"cloudy",sky:Ea(),cloudCover:Ot(.55),particles:"none",lightning:!1,fogAlpha:0,ground:va},"autumn|storm":{season:"autumn",weather:"storm",sky:Ea(),cloudCover:Ot(1),particles:"rain",lightning:!0,fogAlpha:0,ground:va},"winter|clear":{season:"winter",weather:"clear",sky:Wl(),cloudCover:Ot(.2),particles:"none",lightning:!1,fogAlpha:0,ground:Yl,sunTint:[220,230,245]},"winter|snow":{season:"winter",weather:"snow",sky:Wl(),cloudCover:Ot(.9),particles:"snow",lightning:!1,fogAlpha:.2,ground:Yl}},Gl=Object.keys(Nh);function qx(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t^=t>>>16,t=Math.imul(t,2246822507),t^=t>>>13,t=Math.imul(t,3266489909),t^=t>>>16,t>>>0}function $x(e){const t=`${e??"none"}:${Math.floor(performance.now()/1e3)}`;return Gl[qx(t)%Gl.length]}function Wx(e,t){let n=0;for(;n<t.length-1&&e>t[n+1].t;)n++;const r=t[n],s=t[Math.min(n+1,t.length-1)],i=oi(Fs((e-r.t)/(s.t-r.t||1),0,1));return{top:zn(r.top,s.top,i),mid:zn(r.mid,s.mid,i),hor:zn(r.hor,s.hor,i)}}function Yx(e,t,n,r,s){if(e<r||e>s)return null;const i=(e-r)/(s-r),a=Un(.1,.9,i),o=n*.26,u=n*.98,l=u-Math.sin(i*Math.PI)*(u-o);return{x:a*t,y:l,peakness:Math.sin(i*Math.PI)}}function Gx(e,t,n,r,s){let i;if(e>=r)i=(e-r)/(1-r+s);else if(e<=s)i=(1-r+e)/(1-r+s);else return null;const a=Un(.12,.88,i),o=n*.26,u=n*.98,l=u-Math.sin(i*Math.PI)*(u-o);return{x:a*t,y:l,peakness:Math.sin(i*Math.PI)}}function Rh(e){return function(){e|=0,e=e+1831565813|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}function Kl(e,t){const n=Rh(20260809),r=Math.max(28,Math.round(e*t/7e3)),s=[];for(let i=0;i<r;i++)s.push({x:n(),y:n()*.7,r:n()*1.2+.3,tw:n()*Math.PI*2,sp:.6+n()*1.4,big:n()<.06});return s}function Kx(){const e=Rh(7),t=[];for(let n=0;n<6;n++)t.push({x:e(),y:.12+e()*.4,s:.55+e()*1.2,speed:18e-6+e()*35e-6,seed:e()*1e3,drift:e()*.035+.008});return t}function Xx(e,t,n,r){const s=e.createLinearGradient(0,0,0,r);s.addColorStop(0,ba(t.top)),s.addColorStop(.55,ba(t.mid)),s.addColorStop(1,ba(t.hor)),e.fillStyle=s,e.fillRect(0,0,n,r)}function Qx(e,t,n,r,s,i){let a=0;if(t<.22?a=oi(1-t/.22):t>.8&&(a=oi((t-.8)/.2)),!(a<=.01))for(const o of n){const u=.55+.45*Math.sin(i*o.sp+o.tw),l=a*u;if(l<.02)continue;e.fillStyle=`rgba(255,248,228,${l})`;const c=o.big?o.r*1.8:o.r;e.beginPath(),e.arc(o.x*r,o.y*s,c,0,Math.PI*2),e.fill(),o.big&&(e.fillStyle=`rgba(255,240,210,${l*.35})`,e.fillRect(o.x*r-c*4,o.y*s-.4,c*8,.8),e.fillRect(o.x*r-.4,o.y*s-c*4,.8,c*8))}}function Zx(e,t,n){if(!t)return;const{x:r,y:s,peakness:i}=t,a=28+i*8,o=e.createRadialGradient(r,s,a*.4,r,s,a*5);o.addColorStop(0,"rgba(255,236,190,0.55)"),o.addColorStop(.4,"rgba(255,210,150,0.16)"),o.addColorStop(1,"rgba(255,200,140,0)"),e.fillStyle=o,e.fillRect(r-a*5,s-a*5,a*10,a*10);const u=e.createRadialGradient(r,s,0,r,s,a),l=n??[255,236,180],c=n?zn(n,[255,214,150],.5):[255,214,150];u.addColorStop(0,"rgba(255,252,238,1)"),u.addColorStop(.7,mr(l,1)),u.addColorStop(1,mr(c,.9)),e.fillStyle=u,e.beginPath(),e.arc(r,s,a,0,Math.PI*2),e.fill()}function Jx(e,t){if(!t)return;const{x:n,y:r}=t,s=24,i=e.createRadialGradient(n,r,s*.8,n,r,s*5);i.addColorStop(0,"rgba(220,232,255,0.38)"),i.addColorStop(.5,"rgba(220,232,255,0.1)"),i.addColorStop(1,"rgba(220,232,255,0)"),e.fillStyle=i,e.fillRect(n-s*5,r-s*5,s*10,s*10);const a=e.createRadialGradient(n-s*.25,r-s*.3,s*.2,n,r,s);a.addColorStop(0,"rgba(255,254,247,1)"),a.addColorStop(.7,"rgba(244,242,232,1)"),a.addColorStop(1,"rgba(214,222,236,1)"),e.fillStyle=a,e.beginPath(),e.arc(n,r,s,0,Math.PI*2),e.fill(),e.fillStyle="rgba(150,160,180,0.16)";const o=[[-10,-6,4],[5,3,5],[-3,9,3],[11,-8,3]];for(const[u,l,c]of o)e.beginPath(),e.arc(n+u,r+l,c,0,Math.PI*2),e.fill()}function eb(e,t,n,r,s,i){const a=18*r,o=[[0,0,1],[-1.1,.1,.8],[1.1,.1,.8],[-.5,-.5,.7],[.6,-.45,.75],[-1.8,.3,.6],[1.8,.3,.6]];e.save(),e.translate(t,n),e.fillStyle=mr([s[0]*.7,s[1]*.7,s[2]*.78],i*.9);for(const[u,l,c]of o)e.beginPath(),e.arc(u*a,l*a*1.1+a*.45,a*c*1.05,0,Math.PI*2),e.fill();e.fillStyle=mr(s,i);for(const[u,l,c]of o)e.beginPath(),e.arc(u*a,l*a,a*c,0,Math.PI*2),e.fill();e.restore()}function tb(e,t,n,r,s,i,a,o,u){const l=a(t);if(l<.02)return;const c=zn(o.hor,[255,255,255],.35),f=zn(o.mid,[20,20,30],.45),h=u?f:c;for(let d=0;d<n.length;d++){const m=n[d],p=(m.x+i*m.speed)%1.2-.1,g=m.y+Math.sin(i*1e-4+m.seed)*m.drift;d/n.length<l&&eb(e,p*r,g*s,m.s,h,Fs(l*.92,0,.92))}}const sr=[];let Pn=[];const Ur=[];let Dn=[];const Bi=[],Rr=[];let zr=[];function nb(e,t,n,r,s,i){if(s<.04)return;const a=r*(.02+s*.07),o=.12+s*.73,u=t-r*o,l=t+r*o,c=n-Math.sqrt(Math.max(0,r*r-r*o*(r*o))),f=n-r-a,h=(c+f)/2;e.save(),e.beginPath(),e.moveTo(u,c),e.bezierCurveTo(u,h,t-r*.3,f,t,f),e.bezierCurveTo(t+r*.3,f,l,h,l,c),e.quadraticCurveTo(t,n-r*.78,u,c),e.closePath();const d=e.createLinearGradient(0,f,0,c);d.addColorStop(0,"rgba(255,255,255,0.98)"),d.addColorStop(.65,"rgba(245,250,255,0.95)"),d.addColorStop(1,"rgba(218,230,246,0.9)"),e.fillStyle=d,e.fill(),e.strokeStyle="rgba(168,192,225,0.28)",e.lineWidth=1.5,e.beginPath(),e.moveTo(u,c),e.quadraticCurveTo(t,n-r*.78,l,c),e.stroke(),e.restore()}function ka(e,t,n,r,s){const i=Math.sin(r),a=Math.cos(r);return{x:e+Math.sin(s)*i*n,y:t-a*n}}function rb(e,t,n,r){e.save(),e.beginPath(),e.arc(t,n,r*.99,0,Math.PI*2),e.clip();const s=e.createRadialGradient(t-r*.35,n-r*.4,0,t-r*.35,n-r*.4,r*.8);s.addColorStop(0,"rgba(255,255,255,0.4)"),s.addColorStop(.5,"rgba(255,255,255,0.12)"),s.addColorStop(1,"rgba(255,255,255,0)"),e.fillStyle=s,e.fillRect(t-r,n-r,r*2,r*2),e.strokeStyle="rgba(255,255,255,0.55)",e.lineWidth=1.8,e.beginPath(),e.arc(t,n,r*.92,Math.PI*1.15,Math.PI*1.5),e.stroke(),e.restore()}function ib(e,t){if(t.length!==0){e.save();for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.x+=r.vx,r.y+=r.vy,r.vy+=.14,r.vx*=.985,r.vy*=.99,r.life--,r.life<=0){t.splice(n,1);continue}const s=r.life/r.maxLife;e.fillStyle=`rgba(248,250,255,${(.9*s).toFixed(3)})`,e.beginPath(),e.arc(r.x,r.y,r.r*(.5+.5*s),0,Math.PI*2),e.fill()}e.restore()}}function Lh(e,t){e.save();for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.x+=r.vx,r.y+=r.vy,r.vy+=.18,r.life--,r.life<=0){t.splice(n,1);continue}const s=Math.min(1,r.life/20)*.8;e.fillStyle=`rgba(215,238,255,${s})`,e.beginPath(),e.arc(r.x,r.y,1.3,0,Math.PI*2),e.fill()}e.restore()}function sb(e,t,n,r,s,i){e.save(),e.beginPath(),e.arc(t,n,r*.99,0,Math.PI*2),e.clip();for(let a=s.length-1;a>=0;a--){const o=s[a];if(o.prog+=o.speed,o.life--,o.prog>Math.PI*1.05||o.life<=0){s.splice(a,1);continue}const u=7;for(let f=0;f<u;f++){const h=o.prog-o.len*(f/u),d=o.prog-o.len*((f+1)/u),m=ka(t,n,r,h,o.theta),p=ka(t,n,r,d,o.theta),g=(1-f/u)*.42;e.strokeStyle=`rgba(200,228,250,${g})`,e.lineWidth=o.thick*(1-f/u*.7),e.lineCap="round",e.beginPath(),e.moveTo(m.x,m.y),e.lineTo(p.x,p.y),e.stroke()}const l=ka(t,n,r,o.prog,o.theta),c=e.createRadialGradient(l.x-1.2,l.y-1.2,0,l.x,l.y,o.thick*1.3);c.addColorStop(0,"rgba(255,255,255,0.85)"),c.addColorStop(.4,"rgba(180,215,240,0.5)"),c.addColorStop(1,"rgba(120,165,205,0.25)"),e.fillStyle=c,e.beginPath(),e.arc(l.x,l.y,o.thick*1.1,0,Math.PI*2),e.fill()}e.restore()}function ab(e,t,n,r){for(;sr.length<t.length;)sr.push([]);for(;Pn.length<t.length;)Pn.push(0);for(;zr.length<t.length;)zr.push(.3);for(;Ur.length<t.length;)Ur.push([]);for(;Dn.length<t.length;)Dn.push(0);for(let s=0;s<t.length;s++){const i=t[s];if(n.particles==="snow"){const a=i.snow!==void 0?i.snow:Math.min(1,(zr[s]??.3)+8e-4);zr[s]=a,nb(e,i.x,i.y,i.r,a)}else if(n.particles==="rain"){if(rb(e,i.x,i.y,i.r),Pn[s]=Pn[s]-1,Pn[s]<=0&&sr[s].length<3){const a=Math.random()<.5?-1:1;sr[s].push({theta:a*(.2+Math.random()*.3),prog:.1+Math.random()*.2,speed:.012+Math.random()*.012,len:.3+Math.random()*.3,thick:1.6+Math.random()*1.4,life:250+Math.random()*200}),Pn[s]=40+Math.random()*60}if(sb(e,i.x,i.y,i.r,sr[s]),Dn[s]=Dn[s]-1,Dn[s]<=0){const a=i.x+(Math.random()-.5)*i.r*1.2,o=a-i.x,u=i.y-Math.sqrt(Math.max(0,i.r*i.r-o*o)),l=4+Math.floor(Math.random()*3);for(let c=0;c<l;c++){const f=o<0?-1:1;Ur[s].push({x:a,y:u,vx:f*(.5+Math.random()*2)*(Math.random()<.5?-1:1),vy:-(1.5+Math.random()*2.5),life:18+Math.floor(Math.random()*14)})}Dn[s]=30+Math.floor(Math.random()*50)}Lh(e,Ur[s])}}}function ob(e,t,n,r,s){e.save(),e.strokeStyle=s?"rgba(205,224,244,0.42)":"rgba(210,224,238,0.3)",e.lineWidth=s?1:.7,e.lineCap="round";const i=s?.013:.007;for(const a of r){a.y+=a.v*i,a.y>1&&(a.y-=1,a.x=Math.random());const o=a.x*t,u=a.y*n;e.beginPath(),e.moveTo(o,u),e.lineTo(o,u+a.len),e.stroke()}e.restore()}function ub(e,t,n,r,s){e.save(),e.fillStyle="rgba(250,250,255,0.85)";for(const i of r){i.y+=i.v*.004;const a=(i.x+Math.sin(s*5e-4+i.phase)*.02)*t,o=i.y*n;i.y>1&&(i.y-=1),e.beginPath(),e.arc(a,o,i.r,0,Math.PI*2),e.fill()}e.restore()}function lb(e,t,n,r,s){const i=e.createLinearGradient(0,n*.4,0,n),a=zn(s.hor,[255,255,255],.3);i.addColorStop(0,mr(a,0)),i.addColorStop(1,mr(a,r)),e.fillStyle=i,e.fillRect(0,n*.4,t,n*.6)}let tr=0,Xl=0;function cb(e,t,n,r,s){if(s>Xl&&(tr=1,Xl=s+1400+Math.random()*2600),tr*=.86,tr<.02){tr=0;return}if(e.fillStyle=`rgba(255,255,255,${tr*.5})`,e.fillRect(0,0,t,n),tr>.6){e.save(),e.strokeStyle="rgba(255,255,255,0.95)",e.lineWidth=2.2,e.shadowColor="rgba(220,230,255,0.9)",e.shadowBlur=22;let i=t*(.3+Math.random()*.4),a=0;for(e.beginPath(),e.moveTo(i,a);a<n*.6;)i+=(Math.random()-.5)*60,a+=24+Math.random()*30,e.lineTo(i,a);e.stroke(),e.restore()}}function db(e,t,n,r){const s=e.getContext("2d");if(!s)return()=>{};const i=s,a=n;let o=0,u=0,l=1,c=Kl(1,1);const f=Kx();let h=[],d=[],m=0,p=0,g=!0;const y=performance.now(),v=window.matchMedia("(prefers-reduced-motion: reduce)").matches;function T(){const I=a.getBoundingClientRect();if(l=Math.min(window.devicePixelRatio||1,2),o=Math.max(1,I.width),u=Math.max(1,I.height),e.width=Math.floor(o*l),e.height=Math.floor(u*l),e.style.width=o+"px",e.style.height=u+"px",i.setTransform(l,0,0,l,0,0),c=Kl(o,u),r.particles==="rain"&&h.length===0){const S=r.weather==="storm",L=S?140:70;for(let N=0;N<L;N++)h.push({x:Math.random(),y:Math.random(),len:S?12+Math.random()*14:6+Math.random()*8,v:S?.9+Math.random()*.4:.5+Math.random()*.3})}if(r.particles==="snow"&&d.length===0)for(let S=0;S<120;S++)d.push({x:Math.random(),y:Math.random(),r:.8+Math.random()*1.6,v:.5+Math.random()*.8,phase:Math.random()*Math.PI*2})}function C(){const I=t.scrollHeight-t.clientHeight;m=I>0?Fs(t.scrollTop/I,0,1):0}function E(I){if(!g)return;const S=m,L=v?0:(I-y)/1e3,N=Wx(S,r.sky);Xx(i,N,o,u),Qx(i,S,c,o,u,L),Jx(i,Gx(S,o,u,.92,.08)),Zx(i,Yx(S,o,u,.16,.88),r.sunTint),tb(i,S,f,o,u,I,r.cloudCover,N,r.weather==="storm"),r.particles==="rain"&&ob(i,o,u,h,r.weather==="storm"),r.particles==="snow"&&ub(i,o,u,d,I),r.fogAlpha>0&&lb(i,o,u,r.fogAlpha,N),r.lightning&&cb(i,o,u,!0,I),v||(p=requestAnimationFrame(E))}const k=()=>C(),_=new ResizeObserver(()=>{T(),C()});_.observe(a),T(),C();let A;if(v){let I=!1;A=()=>{C(),I||(I=!0,requestAnimationFrame(()=>{I=!1,E(performance.now())}))},t.addEventListener("scroll",A,{passive:!0}),E(performance.now())}else A=k,t.addEventListener("scroll",A,{passive:!0}),p=requestAnimationFrame(E);return()=>{g=!1,cancelAnimationFrame(p),_.disconnect(),t.removeEventListener("scroll",A)}}function fb(e,t,n,r,s,i){const a=()=>{sr.length=0,zr.length=0,Pn.length=0,Ur.length=0,Dn.length=0,Bi.length=0,Rr.length=0;const v=e.getContext("2d");v&&v.clearRect(0,0,e.width,e.height)};if(a(),window.matchMedia("(prefers-reduced-motion: reduce)").matches)return()=>{};if(n.particles!=="rain"&&n.particles!=="snow")return()=>{};const u=e.getContext("2d");if(!u)return()=>{};const l=u;let c=0,f=0,h=1,d=0,m=!0;function p(){const v=t.getBoundingClientRect();h=Math.min(window.devicePixelRatio||1,2),c=Math.max(1,v.width),f=Math.max(1,v.height),e.width=Math.floor(c*h),e.height=Math.floor(f*h),e.style.width=c+"px",e.style.height=f+"px",l.setTransform(h,0,0,h,0,0)}function g(v){if(!m)return;l.clearRect(0,0,c,f);const T=r();if(ab(l,T,n),s){for(const C of s()){const E=3+Math.min(5,Math.floor(C.speed/3));for(let k=0;k<E;k++)Bi.push({x:C.x,y:C.y,vx:(Math.random()-.5)*3.2,vy:-(1.5+Math.random()*2.5),life:16+Math.floor(Math.random()*12)})}Bi.length>0&&Lh(l,Bi)}if(i){for(const C of i()){const E=1+Math.min(2,Math.round(C.amount*40));for(let k=0;k<E;k++){const _=55+Math.floor(Math.random()*40);Rr.push({x:C.x+(Math.random()-.5)*8,y:C.y+(Math.random()-.5)*6,vx:C.vx*.6+(Math.random()-.5)*.8,vy:C.vy*.6-Math.random()*.5,life:_,maxLife:_,r:1.2+Math.random()*2.2})}}for(;Rr.length>240;)Rr.shift();ib(l,Rr)}d=requestAnimationFrame(g)}const y=new ResizeObserver(p);return y.observe(t),p(),d=requestAnimationFrame(g),()=>{m=!1,cancelAnimationFrame(d),y.disconnect(),a()}}const hb=w.lazy(()=>ve(()=>import("./CourseSearchPanel-5HfObta6.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(e=>({default:e.CourseSearchPanel})));function mb(e){const t=We(),[n,r]=w.useState("import"),[s,i]=w.useState("study"),a=w.useRef(null),o=w.useRef(null),u=Math.round(e.overallMastery*100),c=!pu(),f=w.useRef([]),h=w.useRef(N=>{f.current.push(...N),f.current.length>64&&f.current.splice(0,f.current.length-64)}).current,d=w.useRef([]),m=w.useRef(new Map),p=w.useRef(N=>{d.current.push(...N),d.current.length>96&&d.current.splice(0,d.current.length-96)}).current,g=e.sections.filter(N=>(N.world??"study")===s),y=e.sections.some(N=>N.world==="practice"),[v,T]=w.useState(null);w.useEffect(()=>{T($x(e.courseId))},[e.courseId]);const C=v?Nh[v]??null:null;w.useEffect(()=>(Cl({nav:a.current,visible:n==="map",weather:(C==null?void 0:C.weather)??"clear"}),()=>{Cl({visible:!1,nav:null})}),[n,C,a]);const[E,k]=w.useState(!1);w.useEffect(()=>{if(!e.selectedNodeId)return;const N=o.current;if(!N)return;const j=N.querySelector(`[data-node-id="${CSS.escape(e.selectedNodeId)}"]`);if(!j)return;const P=N.getBoundingClientRect(),D=j.getBoundingClientRect();(D.top<P.top+60||D.bottom>P.bottom-60)&&j.scrollIntoView({behavior:"smooth",block:"center"})},[e.selectedNodeId]);const _=w.useRef(null);w.useEffect(()=>{k(!1),e.courseId&&(_.current===null||_.current!==e.courseId)&&(r("map"),i("study")),!e.courseId&&_.current!==null&&(r("import"),i("study")),_.current=e.courseId},[e.courseId]);const[A,I]=w.useState(null),S=w.useRef({}),L=w.useRef(null);return w.useEffect(()=>{var D,H;const N=S.current,j={};let P=null;for(const z of e.tree){const F=((D=e.progressMap[z.id])==null?void 0:D.status)??"locked";j[z.id]=F,N[z.id]==="locked"&&F!=="locked"&&!P&&(P=z.id)}if(P&&Object.keys(N).length>0){const z=(H=a.current)==null?void 0:H.querySelector(`[data-testid="map-node-${P.slice(0,8)}"], [data-testid="exam-node-${P.slice(0,8)}"]`),F=z==null?void 0:z.getBoundingClientRect(),q=!!F&&F.width>0&&F.left>=0&&F.right<=window.innerWidth&&F.top>=0;Zi("unlock",q?{origin:{x:F.left+F.width/2,y:F.top+4}}:void 0)}S.current=j},[e.tree,e.progressMap]),x.jsxs("nav",{ref:a,className:`map-rail-scope relative h-full flex flex-col bg-surface-rail shrink-0 overflow-hidden ${e.fullWidth?"w-full":"w-[300px]"}`,"data-testid":"map-rail",children:[C&&x.jsxs(x.Fragment,{children:[x.jsx(gb,{scrollRef:o,navRef:a,preset:C}),x.jsx(xb,{scrollRef:o,navRef:a,preset:C,getImpacts:()=>f.current.splice(0),getFlakes:()=>d.current.splice(0),orbSnowRef:m})]}),x.jsxs("div",{className:"absolute top-0 left-0 right-0 z-40 px-2 pt-2 pb-2 pointer-events-none [&_button]:pointer-events-auto","data-testid":"map-rail-topbar",children:[x.jsxs("div",{className:"flex p-1 rounded-lg gap-1 mb-2",style:{background:"rgb(var(--surface-rail-rgb) / 0.55)",backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)"},children:[x.jsxs("button",{onClick:()=>r("map"),"data-testid":"map-tab-map",className:`flex-1 flex items-center justify-center gap-1 py-1.5 rounded-md text-label font-bold transition-colors ${n==="map"?"bg-brand/20 text-brand":"text-white/50 hover:text-white/80"}`,children:[x.jsx(fh,{className:"w-3 h-3"})," ",t("map.tab.map")]}),x.jsxs("button",{onClick:()=>r("import"),"data-testid":"map-tab-import",className:`flex-1 flex items-center justify-center gap-1 py-1.5 rounded-md text-label font-bold transition-colors ${n==="import"?"bg-brand/20 text-brand":"text-white/50 hover:text-white/80"}`,children:[x.jsx(Ds,{className:"w-3 h-3"})," ",t("map.tab.import")]})]}),n==="map"&&x.jsxs("div",{className:"px-3 py-2 rounded-lg pointer-events-auto",style:{background:"rgb(var(--surface-rail-rgb) / 0.55)",backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)"},children:[x.jsxs("div",{className:"flex items-center gap-1.5",children:[x.jsx("h2",{className:"text-body font-extrabold text-white truncate flex-1","data-tooltip":e.courseTitle??"",children:e.courseTitle??t("map.course.none")}),e.availableLanguages.length>0&&x.jsx(kb,{available:e.availableLanguages,current:e.currentLocale,onChange:e.onLocaleChange}),e.courseId&&x.jsx("button",{onClick:N=>{const j=N.currentTarget.getBoundingClientRect();I({id:e.courseId,title:e.courseTitle??"",rect:j})},"data-testid":"course-delete-btn","aria-label":t("import.delete.current"),"data-tooltip":t("import.delete.current"),className:"shrink-0 flex items-center justify-center w-5 h-5 rounded-md text-white/40 hover:text-warning hover:bg-white/10 transition-colors",children:x.jsx(gh,{className:"w-3 h-3"})})]}),x.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[x.jsx("div",{className:"flex-1 h-2.5 bg-black/40 rounded-full overflow-hidden ring-1 ring-white/10",children:x.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${u>=100?"bg-gold":"bg-brand"}`,style:{width:`${Math.max(3,u)}%`}})}),x.jsxs("span",{className:"text-label font-extrabold tabular-nums text-white drop-shadow-[0_1px_3px_rgba(0,0,0,0.6)]",children:[u,"%"]})]}),x.jsxs("div",{className:"flex items-center justify-end gap-1.5 mt-1.5 text-caption",children:[x.jsxs("button",{onClick:()=>k(!0),"data-testid":"map-search-btn",className:"flex items-center gap-1 px-1.5 py-0.5 rounded-full bg-white/5 ring-1 ring-white/10 hover:bg-white/10 transition-colors",children:[x.jsx(ax,{className:"w-3 h-3 text-white/50"}),x.jsx("span",{className:"font-bold text-white/60",children:t("map.search.label")})]}),x.jsxs("button",{onClick:e.onOpenReview,className:`flex items-center gap-1 px-1.5 py-0.5 rounded-full transition-colors ${e.dueCount>0?"bg-review/20 ring-1 ring-review/30 hover:bg-review/30":"bg-white/5 ring-1 ring-white/10 hover:bg-white/10"}`,"data-testid":"map-review-badge",children:[x.jsx(kn,{className:`w-3 h-3 ${e.dueCount>0?"text-review":"text-white/50"}`}),x.jsx("span",{className:`font-bold ${e.dueCount>0?"text-review":"text-white/60"}`,children:t("map.review.label")}),e.dueCount>0&&x.jsx("span",{className:"font-extrabold text-review tabular-nums",children:e.dueCount})]})]}),y&&x.jsxs("div",{className:"flex gap-1 mt-1.5 p-0.5 rounded-lg bg-black/30",children:[x.jsxs("button",{onClick:()=>i("study"),"data-testid":"world-tab-study",className:`flex-1 flex items-center justify-center gap-1 py-1 rounded-md text-caption font-bold transition-colors ${s==="study"?"bg-brand/30 text-brand":"text-white/50 hover:text-white/80"}`,children:[x.jsx(kn,{className:"w-3 h-3"})," ",t("map.world.study")]}),x.jsxs("button",{onClick:()=>i("practice"),"data-testid":"world-tab-practice",className:`flex-1 flex items-center justify-center gap-1 py-1 rounded-md text-caption font-bold transition-colors ${s==="practice"?"bg-accent/30 text-accent":"text-white/50 hover:text-white/80"}`,children:[x.jsx(bh,{className:"w-3 h-3"})," ",t("map.world.practice")]})]})]})]}),x.jsx("div",{className:"absolute inset-0 overflow-hidden z-10",children:x.jsxs("div",{className:"flex h-full transition-transform duration-300",style:{transform:n==="map"?"translateX(0)":"translateX(-50%)",width:"200%"},children:[x.jsx("div",{className:"w-1/2 h-full relative",children:x.jsx("div",{ref:o,className:"map-path h-full overflow-y-auto overflow-x-hidden px-2 pt-48 pb-4","data-testid":"map-path",onPointerDown:N=>{L.current={x:N.clientX,y:N.clientY}},onClick:N=>{const j=L.current;L.current=null,!(!j||Math.hypot(N.clientX-j.x,N.clientY-j.y)>6)&&(N.target.closest("button, a, input, textarea, select")||Gg(N.clientX,N.clientY))},children:x.jsxs("div",{className:`map-sky-content ${C?`env-${C.season} env-${C.weather}`:""}`,children:[e.streaming&&x.jsxs("div",{className:"mb-3 mx-1 px-3 py-2 rounded-xl bg-brand/10 border border-brand/30 flex items-center gap-2 text-label text-brand font-medium backdrop-blur-sm","data-testid":"streaming-notice",children:[x.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),t("map.streaming.notice")]}),e.sections.length===0?e.courseTitle?x.jsxs("div",{className:"text-center text-label text-white/60 mt-8 px-4 flex items-center justify-center gap-2",children:[x.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),t("map.generating")]}):x.jsxs("button",{onClick:()=>r("import"),className:"block w-full mt-8 mx-auto p-4 rounded-2xl border-2 border-dashed border-brand/40 hover:border-brand hover:bg-brand/5 transition-all text-center group","data-testid":"map-empty-cta",children:[x.jsx("div",{className:"text-3xl mb-2 group-hover:scale-110 transition-transform",children:"🗺️"}),x.jsx("div",{className:"text-body font-bold text-white/90 mb-1",children:t("map.empty.cta.title")}),x.jsx("div",{className:"text-label text-white/60 leading-relaxed",children:t("map.empty.cta.desc")}),x.jsx("div",{className:"mt-2 text-caption text-brand font-bold",children:t("map.empty.cta.btn")})]}):g.length===0?x.jsx("div",{className:"text-center text-label text-white/60 mt-8 px-4",children:t(s==="practice"?"map.empty.practice":"map.generating")}):x.jsx("div",{className:"space-y-6 pt-2",children:g.map((N,j)=>x.jsx(bb,{section:N,sectionIndex:j,tree:e.tree,progressMap:e.progressMap,selectedNodeId:e.selectedNodeId,dueNodeIds:e.dueNodeIds,streamingNodeIds:e.streamingNodeIds,onJumpNode:e.onJumpNode,physics:c,physicsWeather:(C==null?void 0:C.weather)??"clear",scrollRef:o,navRef:a,onImpacts:h,onFlakes:p,orbSnowRef:m},N.id))})]})})}),x.jsx("div",{className:"w-1/2 h-full overflow-y-auto px-3 pt-20 pb-3 space-y-2.5",children:x.jsx(pb,{courses:e.courses,selectedCourseId:e.courseId,onSelectCourse:N=>{e.onSelectCourse(N),r("map")},onDeleteCourse:(N,j,P)=>I({id:N,title:j,rect:P}),onCoursesChanged:e.onCoursesChanged})})]})}),E&&e.courseId&&x.jsx(w.Suspense,{fallback:null,children:x.jsx(hb,{sections:e.sections,tree:e.tree,progressMap:e.progressMap,selectedNodeId:e.selectedNodeId,onJump:N=>{i(N.world??"study"),k(!1),po(null,null,N.id),e.onJumpNode(N.id)},onClose:()=>k(!1)})}),A&&x.jsx(wh,{anchorRect:A.rect,message:`${A.title} — ${t("import.delete.confirm")}`,danger:!0,confirmLabel:t("import.delete"),testid:"course-delete-confirm",onConfirm:()=>{e.onDeleteCourse(A.id),I(null)},onCancel:()=>I(null)})]})}function pb({courses:e,selectedCourseId:t,onSelectCourse:n,onDeleteCourse:r,onCoursesChanged:s}){const i=We(),[a,o]=w.useState("url"),[u,l]=w.useState(!1),[c,f]=w.useState(""),[h,d]=w.useState(""),m=w.useRef(null),p=w.useRef(null),g=w.useRef(null),[y,v]=w.useState(""),[T,C]=w.useState(""),[E,k]=w.useState(!1),[_,A]=w.useState(null),[I,S]=w.useState(null),[L,N]=w.useState(null),[j,P]=w.useState(null),[D,H]=w.useState([]),[,z]=w.useState(0),F=w.useRef(null);w.useEffect(()=>{const te=ce.on("import:progress",de=>{H(ye=>{const Ne=/\d+\/\d+/.test(de),tt=ye[ye.length-1];if(Ne&&tt&&tt.status==="working"){const qe=[...ye];return qe[qe.length-1]={...tt,msg:de},qe}const Ee=ye.map(qe=>qe.status==="working"?{...qe,status:"done"}:qe);return Ee.push({msg:de,status:"working",ts:Date.now()}),Ee})}),ne=setInterval(()=>z(de=>de+1),1e3);return()=>{te(),clearInterval(ne)}},[]),w.useEffect(()=>ce.on("import:done",ne=>{k(!1),Dt(!1),ne.cancelled||Qg(ne.ok),N(ne.ok?null:ne.planId??null),ne.ok?(S(`${i("import.success.folder")}: ${ne.title??""}${ne.reused?`(${i("import.success.reused")})`:""}`),P(ne.courseId?{courseId:ne.courseId,packable:ne.packable??!1}:null),s()):ne.cancelled?(H([]),A(null),S(i("import.cancelled"))):A(ne.error??"导入失败")}),[s,i]),w.useEffect(()=>{const te=F.current;te&&(te.scrollTop=te.scrollHeight)},[D]);const q=async()=>{if(!(!c.trim()||E)){A(null),S(null),H([]);try{await ce.importUrl(c.trim()),k(!0),Dt(!0)}catch(te){A(te instanceof Error?te.message:String(te))}}},R=async()=>{if(!(!y.trim()||E)){A(null),S(null),H([]);try{await ce.importText({name:T.trim()||void 0,text:y.trim()}),k(!0),Dt(!0)}catch(te){A(te instanceof Error?te.message:String(te))}}},$=async()=>{var ne;if(E)return;if(A(null),S(null),H([]),!un){(ne=p.current)==null||ne.click();return}await ce.importEpub().catch(de=>(A(de instanceof Error?de.message:String(de)),null))&&(k(!0),Dt(!0))},W=async te=>{if(!(!te||E)){A(null),S(null),H([]);try{const ne=new Uint8Array(await te.arrayBuffer());let de="";for(let Ne=0;Ne<ne.length;Ne+=32768)de+=String.fromCharCode(...ne.subarray(Ne,Ne+32768));await ce.importEpub({fileName:te.name,contentBase64:btoa(de)})&&k(!0),Dt(!0)}catch(ne){A(ne instanceof Error?ne.message:String(ne))}}},M=async()=>{if(E)return;if(A(null),S(null),H([]),!un){const ne=h.trim();if(!ne){A(i("import.folder.pathRequired"));return}try{await ce.importLocalFolder(ne)&&k(!0),Dt(!0)}catch(de){A(de instanceof Error?de.message:String(de))}return}await ce.importLocalFolder()&&(k(!0),Dt(!0))},ee=async()=>{var ne;if(E)return;if(A(null),S(null),H([]),!un){(ne=m.current)==null||ne.click();return}await ce.importPack().catch(de=>(A(de instanceof Error?de.message:String(de)),null))&&(k(!0),Dt(!0))},oe=async te=>{if(!(!te||E)){A(null),S(null),H([]);try{const ne=await te.text();await ce.importPack({fileName:te.name,content:ne})&&k(!0),Dt(!0)}catch(ne){A(ne instanceof Error?ne.message:String(ne))}}},V=async()=>{var ne;if(E)return;if(A(null),S(null),H([]),!un){(ne=g.current)==null||ne.click();return}await ce.importAudio().catch(de=>(A(de instanceof Error?de.message:String(de)),null))&&(k(!0),Dt(!0))},X=async te=>{if(!(!te||te.length===0||E)){A(null),S(null),H([]);try{const ne=[];for(const ye of Array.from(te)){const Ne=new Uint8Array(await ye.arrayBuffer());let tt="";for(let Ee=0;Ee<Ne.length;Ee+=32768)tt+=String.fromCharCode(...Ne.subarray(Ee,Ee+32768));ne.push({fileName:ye.name,contentBase64:btoa(tt)})}await ce.importAudio(ne)&&k(!0),Dt(!0)}catch(ne){A(ne instanceof Error?ne.message:String(ne))}}},Z=async te=>{if(!E){A(null),H([]);try{await ce.importResume(te),k(!0),Dt(!0)}catch(ne){A(ne instanceof Error?ne.message:String(ne))}}},be=async te=>{try{const ne=await ce.exportPack(te);ne!=null&&ne.content&&ne.fileName?(me(ne.fileName,ne.content),S(i("import.pack.exported",{path:ne.fileName}))):ne!=null&&ne.path&&S(i("import.pack.exported",{path:ne.path}))}catch(ne){A(ne instanceof Error?ne.message:String(ne))}},me=(te,ne)=>{const de=new Blob([ne],{type:"application/json"}),ye=URL.createObjectURL(de),Ne=document.createElement("a");Ne.href=ye,Ne.download=te,Ne.click(),setTimeout(()=>URL.revokeObjectURL(ye),5e3)};return x.jsxs(x.Fragment,{children:[e.length===0?x.jsxs("div",{className:"text-center py-10",children:[x.jsx("div",{className:"text-3xl mb-2 opacity-30",children:"📚"}),x.jsx("p",{className:"text-label text-white/45 leading-relaxed",children:i("import.empty")})]}):x.jsx("div",{className:"space-y-2","data-testid":"course-list",children:e.map(te=>{const ne=te.id===t;return x.jsxs("div",{"data-testid":"course-row",className:`relative rounded-xl transition-all duration-150 group ${ne?"bg-brand/12 ring-1 ring-brand/40":"bg-white/5 hover:bg-white/10 hover:-translate-y-0.5"}`,children:[x.jsx("button",{onClick:()=>n(te.id),className:"w-full text-left p-3",children:x.jsxs("div",{className:"flex items-start justify-between gap-2",children:[x.jsxs("div",{className:"flex-1 min-w-0",children:[x.jsx("div",{className:`text-body font-bold truncate ${ne?"text-brand":"text-white/90"}`,children:te.title}),x.jsx("div",{className:"text-caption text-white/40 truncate mt-0.5",children:te.repoName})]}),ne&&x.jsx("span",{className:"shrink-0 w-5 h-5 rounded-full bg-brand flex items-center justify-center",children:x.jsx(vn,{className:"w-3 h-3 text-white"})})]})}),x.jsxs("div",{className:"absolute bottom-1.5 right-2 flex items-center gap-2.5 opacity-0 group-hover:opacity-100 pointer-coarse:opacity-100 focus-within:opacity-100 transition-opacity",children:[x.jsxs("button",{onClick:de=>{de.stopPropagation(),A(null),S(null),ce.exportPack(te.id).then(ye=>{ye!=null&&ye.content&&ye.fileName?(me(ye.fileName,ye.content),S(i("import.pack.exported",{path:ye.fileName}))):ye!=null&&ye.path&&S(i("import.pack.exported",{path:ye.path}))}).catch(ye=>{A(ye instanceof Error?ye.message:String(ye))})},"data-testid":"course-row-export",className:"text-caption text-white/40 hover:text-brand flex items-center gap-0.5",children:[x.jsx(Bl,{className:"w-2.5 h-2.5"})," ",i("import.export")]}),x.jsxs("button",{onClick:de=>{de.stopPropagation();const ye=de.currentTarget.getBoundingClientRect();r(te.id,te.title,ye)},"data-testid":"course-row-delete",className:"text-caption text-white/40 hover:text-warning flex items-center gap-0.5",children:[x.jsx(gh,{className:"w-2.5 h-2.5"})," ",i("import.delete")]})]})]},te.id)})}),x.jsxs("div",{className:e.length>0?"mt-6":"",children:[x.jsxs("button",{onClick:()=>l(!u),className:`w-full flex items-center justify-center gap-1.5 py-3 rounded-xl border-2 border-dashed transition-all text-body font-bold ${u?"border-brand/40 bg-brand/8 text-brand":"border-white/20 hover:border-brand/50 hover:bg-brand/8 text-white/70 hover:text-brand"}`,children:[x.jsx(mh,{className:`w-4 h-4 transition-transform ${u?"rotate-45":""}`})," ",i("import.cta")]}),u&&x.jsxs("div",{className:"mt-3 space-y-3",children:[E?x.jsxs("div",{className:"rounded-xl bg-black/30 border border-brand/30 p-4","data-testid":"import-progress",children:[x.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[x.jsx("span",{className:"inline-block w-4 h-4 border-2 border-brand border-t-transparent rounded-full animate-spin shrink-0"}),x.jsx("span",{className:"text-body font-bold text-white/90",children:i("import.progress.title")}),x.jsx("button",{onClick:()=>{ce.importCancel()},"data-testid":"import-cancel-btn",className:"ml-auto text-caption text-white/50 hover:text-warning transition-colors",children:i("import.progress.cancel")})]}),x.jsx("div",{className:"text-caption text-white/40 mb-2.5",children:i("import.progress.note")}),(a==="url"?c.trim():a==="markdown"&&T.trim())?x.jsx("div",{className:"text-caption text-white/40 font-mono truncate mb-2.5",children:a==="url"?c.trim():T.trim()}):null,x.jsx("div",{ref:F,className:"space-y-1.5 max-h-[40vh] overflow-y-auto pr-1",children:D.length===0?x.jsx("div",{className:"text-caption text-white/50 py-1",children:i("import.progress.starting")}):D.map((te,ne)=>x.jsxs("div",{className:"flex items-start gap-1.5 text-caption",children:[te.status==="done"?x.jsx(vn,{className:"w-3 h-3 text-brand shrink-0 mt-px"}):x.jsx("span",{className:"inline-block w-2.5 h-2.5 border-2 border-brand border-t-transparent rounded-full animate-spin shrink-0 mt-px"}),x.jsxs("span",{className:te.status==="done"?"text-white/40":"text-white/90",children:[te.msg,te.status==="working"&&x.jsxs("span",{className:"text-white/35 ml-1",children:["(",i("import.progress.elapsed",{s:Math.floor((Date.now()-te.ts)/1e3)}),")"]})]})]},ne))})]}):x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"@container flex flex-wrap gap-1 p-1 bg-white/5 rounded-lg",children:[{k:"url",label:i("import.tab.url"),icon:K1},{k:"markdown",label:i("import.tab.md"),icon:Ds},{k:"folder",label:i("import.tab.folder"),icon:H1},{k:"epub",label:i("import.tab.epub"),icon:kn},{k:"audio",label:i("import.tab.audio"),icon:Ji},{k:"pack",label:i("import.tab.pack"),icon:Bl}].map(({k:te,label:ne,icon:de})=>x.jsxs("button",{onClick:()=>o(te),className:`min-w-[72px] flex-1 flex items-center justify-center gap-0.5 py-1.5 px-0.5 rounded-md font-bold transition-colors ${a===te?"bg-brand/15 text-brand":"text-white/50 hover:text-white/80"}`,children:[x.jsx(de,{className:"w-3 h-3 shrink-0"}),x.jsx("span",{className:"whitespace-nowrap",style:{fontSize:"clamp(0.75rem, 4cqi, 0.875rem)"},children:ne})]},te))}),a==="url"?x.jsxs("section",{className:"space-y-2","data-testid":"import-url-section",children:[x.jsx("input",{type:"text",value:c,onChange:te=>f(te.target.value),placeholder:i("import.url.placeholder"),"data-testid":"repo-url-input",className:"w-full bg-black/25 text-white placeholder:text-white/35 text-body rounded-lg px-3 py-2 border border-white/15 focus:border-brand focus:outline-none transition-colors"}),x.jsx("p",{className:"text-caption text-white/45 leading-relaxed",children:i("import.url.desc")}),x.jsx("button",{onClick:q,disabled:!c.trim()||E,"data-testid":"import-url-btn",className:"btn-3d-brand w-full px-3 py-2 text-body disabled:opacity-40",children:i("import.btn.url")})]}):a==="markdown"?x.jsxs("section",{className:"space-y-2","data-testid":"import-md-section",children:[x.jsx("input",{type:"text",value:T,onChange:te=>C(te.target.value),placeholder:i("import.placeholder.name"),"data-testid":"md-name-input",className:"w-full bg-black/25 text-white placeholder:text-white/35 text-body rounded-lg px-3 py-2 border border-white/15 focus:border-brand focus:outline-none transition-colors"}),x.jsx("textarea",{value:y,onChange:te=>v(te.target.value),placeholder:i("import.placeholder.md"),"data-testid":"md-text-input",rows:4,className:"w-full bg-black/25 text-white placeholder:text-white/35 text-body rounded-lg px-3 py-2 border border-white/15 focus:border-brand focus:outline-none transition-colors resize-none"}),x.jsx("button",{onClick:R,disabled:!y.trim()||E,"data-testid":"import-md-btn",className:"btn-3d-brand w-full px-3 py-2 text-body disabled:opacity-40",children:i("import.btn.md")})]}):a==="folder"?x.jsxs("section",{className:"space-y-2","data-testid":"import-folder-section",children:[x.jsx("p",{className:"text-caption text-white/50 leading-relaxed",children:i("import.folder.desc")}),!un&&x.jsx("input",{type:"text",value:h,onChange:te=>d(te.target.value),placeholder:i("import.folder.pathPlaceholder"),"data-testid":"import-folder-path",className:"w-full bg-black/25 text-white placeholder:text-white/35 text-body rounded-lg px-3 py-2 border border-white/15 focus:border-brand focus:outline-none transition-colors"}),x.jsx("button",{onClick:M,disabled:E||!un&&!h.trim(),"data-testid":"import-folder-btn",className:"btn-3d-brand w-full px-3 py-2 text-body disabled:opacity-40",children:i("import.btn.folder")})]}):a==="epub"?x.jsxs("section",{className:"space-y-2","data-testid":"import-epub-section",children:[x.jsx("p",{className:"text-caption text-white/50 leading-relaxed",children:i("import.epub.desc")}),!un&&x.jsx("input",{ref:p,type:"file",accept:".epub,application/epub+zip",className:"hidden","data-testid":"import-epub-file",onChange:te=>{var ne;W((ne=te.target.files)==null?void 0:ne[0]),te.currentTarget.value=""}}),x.jsx("button",{onClick:$,disabled:E,"data-testid":"import-epub-btn",className:"btn-3d-brand w-full px-3 py-2 text-body disabled:opacity-40",children:i("import.btn.epub")})]}):a==="audio"?x.jsxs("section",{className:"space-y-2","data-testid":"import-audio-section",children:[x.jsx("p",{className:"text-caption text-white/50 leading-relaxed",children:i("import.audio.desc")}),!un&&x.jsx("input",{ref:g,type:"file",multiple:!0,accept:".wav,.mp3,.m4a,.flac,.aac,.ogg,.opus,audio/*",className:"hidden","data-testid":"import-audio-file",onChange:te=>{X(te.target.files),te.currentTarget.value=""}}),x.jsx("button",{onClick:V,disabled:E,"data-testid":"import-audio-btn",className:"btn-3d-brand w-full px-3 py-2 text-body disabled:opacity-40",children:i("import.btn.audio")})]}):x.jsxs("section",{className:"space-y-2","data-testid":"import-pack-section",children:[x.jsx("p",{className:"text-caption text-white/50 leading-relaxed",children:i("import.pack.desc")}),!un&&x.jsx("input",{ref:m,type:"file",accept:".json,application/json",className:"hidden","data-testid":"import-pack-file",onChange:te=>{var ne;oe((ne=te.target.files)==null?void 0:ne[0]),te.currentTarget.value=""}}),x.jsx("button",{onClick:ee,disabled:E,"data-testid":"import-pack-btn",className:"btn-3d-brand w-full px-3 py-2 text-body disabled:opacity-40",children:i("import.btn.pack")})]})]}),_&&x.jsxs("div",{className:"border border-warning/40 text-warning-light text-label rounded-lg p-2 whitespace-pre-wrap","data-testid":"import-error",children:[_,L&&x.jsx("button",{onClick:()=>void Z(L),disabled:E,"data-testid":"import-resume-btn",className:"block mt-1.5 text-label font-bold text-warning-light hover:text-warning underline underline-offset-2 disabled:opacity-40",children:i("import.error.resume")})]}),I&&x.jsxs("div",{className:"border border-brand/30 text-brand text-label rounded-lg p-2","data-testid":"import-success",children:[x.jsx(vn,{className:"inline-block w-3.5 h-3.5 mr-1 align-[-3px]"}),I,(j==null?void 0:j.packable)&&x.jsx("button",{onClick:()=>void be(j.courseId),disabled:E,"data-testid":"import-export-pack-btn",className:"block mt-1.5 text-label font-bold hover:underline underline-offset-2 disabled:opacity-40",children:i("import.pack.export")})]})]})]})]})}function gb({scrollRef:e,navRef:t,preset:n}){const r=w.useRef(null);return w.useEffect(()=>{const s=r.current,i=e.current,a=t.current;return!s||!i||!a?void 0:db(s,i,a,n)},[e,t,n]),x.jsx("canvas",{ref:r,className:"map-sky-canvas","aria-hidden":"true"})}function xb({scrollRef:e,navRef:t,preset:n,getImpacts:r,getFlakes:s,orbSnowRef:i}){const a=w.useRef(null);return w.useEffect(()=>{const o=a.current,u=t.current,l=e.current;if(!o||!u||!l)return;let c=null,f=null;const h=()=>{c=null,f=null},d=new MutationObserver(h);d.observe(l,{childList:!0,subtree:!0}),window.addEventListener("resize",h);const p=fb(o,u,n,()=>{var v,T;c||(c=Array.from(l.querySelectorAll(".lesson-bubble")));const g=f??u.getBoundingClientRect();f=g;const y=[];for(const C of c){const E=C.getBoundingClientRect();if(E.bottom<g.top||E.top>g.bottom)continue;const k=(v=C.closest("[data-node-id]"))==null?void 0:v.getAttribute("data-node-id"),_=k?(T=i==null?void 0:i.current)==null?void 0:T.get(k):void 0;y.push({x:E.left-g.left+E.width/2,y:E.top-g.top+E.height/2,r:E.width/2,..._!==void 0?{snow:_}:{}})}return y},r,s);return()=>{p(),d.disconnect(),window.removeEventListener("resize",h)}},[e,t,n,r,s]),x.jsx("canvas",{ref:a,className:"map-orb-weather-canvas","aria-hidden":"true"})}function bb({section:e,sectionIndex:t,tree:n,progressMap:r,selectedNodeId:s,dueNodeIds:i,streamingNodeIds:a,onJumpNode:o,physics:u,physicsWeather:l,scrollRef:c,navRef:f,onImpacts:h,onFlakes:d,orbSnowRef:m}){const p=n.filter(V=>V.parentId===e.id).sort((V,X)=>V.orderIdx-X.orderIdx),g=p.filter(V=>V.type==="lesson"),y=g.length>0&&g.every(V=>{var X;return(((X=r[V.id])==null?void 0:X.mastery)??0)>=xx}),v=w.useRef(null),[T,C]=w.useState(268);w.useEffect(()=>{if(!v.current)return;const V=()=>{var be;const Z=((be=v.current)==null?void 0:be.clientWidth)??268;C(Z>0?Z:268)};V();const X=new ResizeObserver(V);return X.observe(v.current),()=>X.disconnect()},[]);const E=Ax(p.length,T,e.id),k=E.height,_=110,A=76,I=w.useRef(null),S=w.useRef(new Map),L=w.useRef(0),N=w.useRef(null),j=w.useRef(0),P=p.map(V=>V.id).join(","),D=p.map(V=>{var X;return(V.type==="exam"?!y:(((X=r[V.id])==null?void 0:X.status)??"locked")==="locked")?1:0}).join("");w.useEffect(()=>{var Le,He;if(!u||p.length===0||T<=0)return;const V=v.current,X=c.current;if(!V||!X)return;let Z;const be=p[p.length-1];if((be==null?void 0:be.type)==="exam"){const K=(He=(Le=V.closest("section"))==null?void 0:Le.nextElementSibling)==null?void 0:He.querySelector(".map-signpost");K&&(Z={x:Di(`${e.id}:next`,T),y:K.getBoundingClientRect().top-V.getBoundingClientRect().top})}const me=zx({nodes:E.nodes.map((K,se)=>{const xe=p[se];return{id:xe.id,x:K.x,y:K.y,isExam:xe.type==="exam",locked:H(xe),spawn:(()=>{const he=S.current.get(xe.id);return he?Vx(he,L.current,T):void 0})()}}),width:T,height:E.height+40,weather:l,anchorKnotX:Di(`${e.id}:knot`,T),nextKnot:Z});I.current=me,Kg(e.id,me,V);const te=V.querySelector("[data-next-knot]");te&&(me.nextKnot?(te.setAttribute("cx",String(me.nextKnot.x)),te.setAttribute("cy",String(me.nextKnot.y))):te.setAttribute("opacity","0"));const ne=V.querySelector("[data-exam-rope]");ne&&!me.nextKnot&&ne.setAttribute("opacity","0");const de=new Map;for(const K of V.querySelectorAll("[data-node-id]"))K.dataset.nodeId&&de.set(K.dataset.nodeId,K);const ye=Array.from(V.querySelectorAll("[data-rope]")),Ne=Array.from(V.querySelectorAll("[data-pulse]")),tt=Array.from(V.querySelectorAll("[data-field]"));let Ee=!0;const qe=new IntersectionObserver(K=>{for(const se of K)Ee=se.isIntersecting},{root:X,rootMargin:"200px 0px 200px 0px"});qe.observe(V);const re=520,Ae=[];let Ve=0,Ge=performance.now();const Xe=K=>{var _e;Ve=requestAnimationFrame(Xe);const se=Math.min(50,K-Ge);if(Ge=K,!Ee)return;me.step(se);for(const le of me.balls){const Te=de.get(le.nodeId);Te&&(Te.style.transform=Dx(le.body.position.x-le.layoutX,le.body.position.y-le.layoutY,le.squash,le.squashAngle)),le.squash=Px(le.squash,se),(_e=m.current)==null||_e.set(le.nodeId,le.snow)}const xe=le=>{if(le==="__anchor")return me.anchor;if(le==="__next")return me.nextKnot??me.anchor;const Te=me.ball(le);if(Te)return{x:Te.body.position.x,y:Te.body.position.y+Bt*dn};const Be=p.findIndex(ut=>ut.id===le),Ue=Be>=0?E.nodes[Be]:void 0;return Ue?{x:Ue.x,y:Ue.y+Bt*dn}:{x:0,y:0}};for(let le=0;le<me.links.length&&le<ye.length;le++){const Te=me.links[le],Be=[xe(Te.from)];for(const Ue of Te.particles)Be.push({x:Ue.position.x,y:Ue.position.y});Be.push(xe(Te.to)),ye[le].setAttribute("d",Mx(Be))}for(let le=0;le<me.balls.length&&le<tt.length;le++){const Te=me.balls[le],Be=tt[le];Te.field>.03?(Be.setAttribute("cx",String(Te.body.position.x)),Be.setAttribute("cy",String(Te.body.position.y)),Be.setAttribute("r",String(Bt+4+Te.field*5)),Be.setAttribute("opacity",String((.3*Te.field).toFixed(3)))):Be.setAttribute("opacity","0")}const he=me.drainImpacts();for(const le of he)Ae.push({x:le.x,y:le.y,t0:K,s:Math.min(1,le.speed/14)});for(let le=Ae.length-1;le>=0;le--)K-Ae[le].t0>re&&Ae.splice(le,1);for(let le=0;le<Ne.length;le++){const Te=Ae[le],Be=Ne[le];if(!Te){Be.setAttribute("opacity","0");continue}const Ue=(K-Te.t0)/re;Be.setAttribute("cx",String(Te.x)),Be.setAttribute("cy",String(Te.y)),Be.setAttribute("r",String(6+Ue*(14+Te.s*14))),Be.setAttribute("opacity",String(.55*(1-Ue))),Be.setAttribute("stroke-width",String(2+Te.s*1.5))}const Ce=me.drainFlakes();if((he.length>0||Ce.length>0)&&f.current){const le=V.getBoundingClientRect(),Te=f.current.getBoundingClientRect(),Be=Ue=>({x:Ue.x+le.left-Te.left,y:Ue.y+le.top-Te.top});he.length>0&&h(he.map(Ue=>({...Be(Ue),speed:Ue.speed}))),Ce.length>0&&d(Ce.map(Ue=>({...Be(Ue),vx:Ue.vx,vy:Ue.vy,amount:Ue.amount})))}};return Ve=requestAnimationFrame(Xe),()=>{cancelAnimationFrame(Ve),qe.disconnect();for(const K of me.balls)S.current.set(K.nodeId,{x:K.body.position.x,y:K.body.position.y,vx:K.body.velocity.x,vy:K.body.velocity.y});L.current=T,Xg(e.id),me.dispose(),I.current=null;for(const K of de.values())K.style.transform=""}},[u,T,P,D,e.id,l]);const H=V=>{var X;return V?V.type==="exam"?!y:(((X=r[V.id])==null?void 0:X.status)??"locked")==="locked":!0},z=(V,X)=>{if(!(!I.current||V.button!==0||H(p.find(me=>me.id===X))||!v.current)){try{V.currentTarget.setPointerCapture(V.pointerId)}catch{}j.current=0,N.current={track:{startX:V.clientX,startY:V.clientY},id:V.pointerId,dragging:!1,nodeId:X}}},F=V=>{const X=N.current,Z=I.current;if(!X||!Z||V.pointerId!==X.id)return;const be=v.current;if(!be||(!X.dragging&&ql(X.track,V.clientX,V.clientY)==="drag"&&(X.dragging=!0,V.currentTarget.style.zIndex="40",Z.beginDrag(X.nodeId,V.clientX-be.getBoundingClientRect().left,V.clientY-be.getBoundingClientRect().top)),!X.dragging))return;const me=be.getBoundingClientRect();Z.moveDrag(V.clientX-me.left,V.clientY-me.top)},q=V=>{var Z;const X=N.current;if(!(!X||V.pointerId!==X.id)){if((Z=I.current)==null||Z.endDrag(),V.currentTarget.style.zIndex="",ql(X.track,V.clientX,V.clientY)==="drag")j.current=Date.now()+300;else{const be=p.find(me=>me.id===X.nodeId);be&&Date.now()>=j.current&&!H(be)&&(po(V.clientX,V.clientY,be.id),o(be.id))}N.current=null}},R=V=>{const X=p[V],Z=X?r[X.id]:void 0,be=(Z==null?void 0:Z.status)==="mastered"||(Z==null?void 0:Z.status)==="in_progress"||(Z==null?void 0:Z.status)==="available";return{stroke:be?"var(--brand)":"var(--ink-faint)",strokeWidth:be?4:2.5,strokeOpacity:be?.6:.5,strokeDasharray:be?"none":"3 7"}},$=E.nodes[0]?{x:Di(`${e.id}:knot`,T),y:xs}:{x:T/2,y:xs},W=p[p.length-1],M=(W==null?void 0:W.type)==="exam",ee=E.nodes[E.nodes.length-1],oe=M&&ee?{x:Di(`${e.id}:next`,T),y:k+24}:void 0;return x.jsxs("section",{"data-testid":`map-section-${e.id.slice(0,8)}`,className:"py-3 px-2",children:[x.jsxs("div",{className:"map-signpost flex items-center gap-2 mb-3 px-2.5 py-1.5 rounded-lg shadow-sm",children:[x.jsx("span",{className:"w-6 h-6 rounded-full bg-gold text-neutral-900 text-caption font-extrabold flex items-center justify-center shrink-0 ring-2 ring-gold/40 shadow-sm",children:t+1}),x.jsx("span",{className:"text-label font-bold text-white truncate flex-1 drop-shadow-[0_1px_2px_rgba(0,0,0,0.7)]",children:e.title})]}),x.jsxs("div",{ref:v,className:"relative",style:{minHeight:k},children:[x.jsx("svg",{className:"absolute inset-0 w-full h-full pointer-events-none","aria-hidden":"true",style:{height:k,overflow:"visible"},children:u?x.jsxs(x.Fragment,{children:[E.nodes[0]&&x.jsx("circle",{cx:$.x,cy:$.y,r:3.5,fill:"#ffc800",opacity:.9}),E.nodes[0]&&x.jsx("path",{"data-rope":0,d:`M ${$.x} ${$.y} L ${E.nodes[0].x} ${E.nodes[0].y+Bt*dn}`,fill:"none",strokeLinecap:"round",strokeLinejoin:"round",style:R(0)}),E.segments.map((V,X)=>x.jsx("path",{"data-rope":X+1,d:`M ${V.from.x} ${V.from.y+Bt*dn} L ${V.to.x} ${V.to.y+Bt*dn}`,fill:"none",strokeLinecap:"round",strokeLinejoin:"round",style:R(V.index)},V.index)),oe&&ee&&x.jsxs(x.Fragment,{children:[x.jsx("path",{"data-rope":E.segments.length+1,"data-exam-rope":!0,d:`M ${oe.x} ${oe.y} L ${ee.x} ${ee.y+Bt*dn}`,fill:"none",strokeLinecap:"round",strokeLinejoin:"round",style:R(p.length-1)}),x.jsx("circle",{"data-next-knot":!0,cx:oe.x,cy:oe.y,r:3.5,fill:"#ffc800",opacity:.9})]}),Array.from({length:8},(V,X)=>x.jsx("circle",{"data-pulse":X,cx:0,cy:0,r:0,fill:"none",stroke:"white",opacity:0},X)),p.map((V,X)=>x.jsx("circle",{"data-field":X,cx:0,cy:0,r:0,fill:"none",stroke:"#1cb0f6",strokeWidth:2,opacity:0},`f-${V.id}`))]}):E.segments.map(V=>{const X=yb(p[V.index],r);return x.jsx("path",{d:Cx(V),stroke:X?"var(--brand)":"var(--ink-faint)",strokeWidth:X?4:2.5,strokeOpacity:X?.6:.5,fill:"none",strokeLinecap:"round",strokeDasharray:X?"none":"3 7",style:X?{pathLength:1,animation:"path-draw 600ms var(--ease-out-expo)"}:void 0},V.index)})}),p.map((V,X)=>{const Z=E.nodes[X];if(!Z)return null;const be=Eo(V.id),me=`${be%40/10}s`,te=`${5+be%30/10}s`;return x.jsx("div",{"data-node-id":V.id,"data-noswipe":"",className:u?`absolute hover:z-30 will-change-transform ${H(V)?"cursor-not-allowed":"cursor-grab active:cursor-grabbing"}`:"absolute balloon-bob hover:z-30",style:{left:Z.x-_/2,top:Z.y-A/2+10,width:_,...u?{touchAction:"pan-y"}:{"--bob-delay":me,"--bob-duration":te}},onPointerDown:u?ne=>z(ne,V.id):void 0,onPointerMove:u?F:void 0,onPointerUp:u?q:void 0,onPointerCancel:u?q:void 0,children:x.jsx(Eb,{lesson:V,progress:r[V.id],isSelected:V.id===s,isDue:i.has(V.id),isStreaming:a.includes(V.id),chapterLessonsMastered:y,onClick:()=>{Date.now()<j.current||(po(null,null,V.id),o(V.id))}})},V.id)})]})]})}function yb(e,t){const n=e?t[e.id]:void 0;return(n==null?void 0:n.status)==="mastered"||(n==null?void 0:n.status)==="in_progress"||(n==null?void 0:n.status)==="available"}function Eb({lesson:e,progress:t,isSelected:n,isDue:r,isStreaming:s,chapterLessonsMastered:i,onClick:a}){const o=We(),u=(t==null?void 0:t.status)??"locked",l=(t==null?void 0:t.crownLevel)??0,c=e.type==="exam",f=Math.min(3,l),h=c?!i:u==="locked",d=c&&h,m=!c&&(u==="in_progress"||u==="mastered"),p=u==="mastered"?100:u==="in_progress"?Math.round(((t==null?void 0:t.mastery)??0)*100):0;return x.jsxs("div",{className:"group relative flex flex-col items-center w-full",children:[x.jsxs("button",{onClick:()=>!h&&a(),disabled:h,"data-testid":`${c?"exam-node":"map-node"}-${e.id.slice(0,8)}`,className:`group relative w-14 h-14 flex items-center justify-center text-2xl rounded-full transition-all duration-200 ${c?d?"lesson-bubble exam-bubble-locked":vb(l>0):Tb(u)} ${h?"cursor-not-allowed":"cursor-pointer hover:scale-105"} ${n?"ring-4 ring-accent ring-offset-2 ring-offset-neutral-50 dark:ring-offset-neutral-950":""}`,title:void 0,"data-tooltip":d?`🔒 ${e.title}${o("node.locked.chapterHint")}`:c?`🎯 ${e.title}`:h?`🔒 ${e.title}`:r?`📖 ${e.title}${o("node.due.hint")}`:e.title,children:[s&&x.jsx(dh,{className:"absolute -top-1.5 -right-1.5 z-10 w-4 h-4 text-accent bg-surface-0 rounded-full p-0.5 animate-spin shadow-pop pointer-events-none","aria-label":o("thread.streamingBadge"),"data-testid":`node-streaming-${e.id.slice(0,8)}`}),m&&x.jsxs("svg",{className:"absolute inset-0 w-full h-full -rotate-90 pointer-events-none",viewBox:"0 0 56 56","aria-hidden":"true",children:[x.jsx("circle",{cx:"28",cy:"28",r:"25",fill:"none",stroke:"rgb(255 255 255 / 0.2)",strokeWidth:"2.5"}),x.jsx("circle",{cx:"28",cy:"28",r:"25",fill:"none",stroke:u==="mastered"?"#ffc800":"white",strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${p/100*157} 157`,className:"transition-all duration-500"})]}),c?d?x.jsx("span",{"aria-label":"exam-locked",className:"relative z-10 opacity-60",children:"🔒"}):x.jsx(fx,{"aria-label":"exam",className:"relative z-10 w-6 h-6 text-white drop-shadow-[0_1px_2px_rgba(0,0,0,0.4)]",strokeWidth:2.5}):h?x.jsx("span",{"aria-label":"locked",className:"relative z-10 opacity-50",children:"🔒"}):u==="mastered"?x.jsx("span",{"aria-label":"mastered",className:"relative z-10 drop-shadow-lg crown-sparkle",children:"👑"}):u==="in_progress"?x.jsx(kn,{"aria-label":"in-progress",className:"relative z-10 w-6 h-6 text-white drop-shadow-[0_1px_2px_rgba(0,0,0,0.4)]",strokeWidth:2.5}):x.jsx("span",{"aria-label":"available",className:"relative z-10 drop-shadow",children:"⭐"}),r&&!h&&!c&&x.jsx("span",{className:"absolute -top-1 -right-1 w-4 h-4 rounded-full bg-review text-white text-caption flex items-center justify-center font-bold border-2 border-neutral-50 dark:border-neutral-950",children:"!"})]}),c&&x.jsx("div",{className:"flex gap-0.5 mt-1","data-testid":`map-stars-${e.id.slice(0,8)}`,children:[0,1,2].map(g=>x.jsx("span",{className:`text-caption ${g<f?"text-gold":"text-white/25"}`,children:"★"},g))}),n&&x.jsx("div",{className:"mt-1 text-caption text-center leading-tight max-w-[120px] font-bold px-1.5 py-0.5 rounded-md bg-brand/90 text-white shadow-sm",children:e.title})]})}function Tb(e){switch(e){case"locked":return"lesson-bubble lesson-bubble-locked";case"available":return"lesson-bubble lesson-bubble-available";case"in_progress":return"lesson-bubble lesson-bubble-in-progress";case"mastered":return"lesson-bubble lesson-bubble-mastered";default:return"lesson-bubble lesson-bubble-locked"}}function vb(e){return e?"lesson-bubble exam-bubble-passed":"lesson-bubble exam-bubble"}function kb({available:e,current:t,onChange:n}){const r=We(),[s,i]=w.useState(!1),a={en:"English","zh-CN":"中文","zh-TW":"繁體",ja:"日本語",ko:"한국어",fr:"Français",de:"Deutsch",es:"Español","pt-BR":"Português",ru:"Русский",it:"Italiano",ar:"العربية",hi:"हिन्दी",tr:"Türkçe",pl:"Polski",nl:"Nederlands",id:"Indonesia",vi:"Tiếng Việt",th:"ไทย",sv:"Svenska",fi:"Suomi"},o=t?a[t]??t:r("lang.original");return x.jsxs("div",{className:"relative shrink-0",children:[x.jsxs("button",{onClick:()=>i(!s),className:"flex items-center gap-1 px-1.5 py-0.5 rounded-md text-caption font-bold text-white/80 hover:text-white hover:bg-white/10 transition-colors","data-testid":"lang-switcher-btn",children:[x.jsx(z1,{className:"w-3 h-3"}),o]}),s&&x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>i(!1)}),x.jsxs("div",{className:"absolute top-full right-0 mt-1 z-50 bg-surface-0 rounded-lg shadow-elevated p-1 min-w-[100px] max-h-48 overflow-y-auto",children:[x.jsx("button",{"data-testid":"lang-option-original",onClick:()=>{n(null),i(!1)},className:`w-full text-left px-2 py-1 rounded-md text-caption font-bold transition-colors ${t===null?"bg-brand/15 text-brand":"text-ink-muted hover:bg-neutral-100 dark:hover:bg-neutral-800"}`,children:r("lang.original")}),e.map(u=>x.jsx("button",{"data-testid":`lang-option-${u}`,onClick:()=>{n(u),i(!1)},className:`w-full text-left px-2 py-1 rounded-md text-caption font-bold transition-colors ${t===u?"bg-brand/15 text-brand":"text-ink-muted hover:bg-neutral-100 dark:hover:bg-neutral-800"}`,children:a[u]??u},u))]})]})]})}const wb=500,Nn=8;function Sb(){const[e,t]=w.useState(null),[n,r]=w.useState({mode:"cursor",x:0,y:0}),[s,i]=w.useState({w:0,h:0}),a=w.useRef(null),o=w.useCallback(()=>window.matchMedia("(pointer: coarse)").matches,[]),u=w.useCallback(g=>{o()||r(y=>y.mode==="cursor"?{...y,x:g.clientX,y:g.clientY}:y)},[o]),l=w.useCallback(g=>{var T;if(o())return;const y=(T=g.target)==null?void 0:T.closest("[data-tooltip]"),v=y==null?void 0:y.getAttribute("data-tooltip");if(v){t(v),r({mode:"cursor",x:g.clientX,y:g.clientY});return}t(null)},[o]),c=w.useCallback(g=>{var v,T;if(o())return;((T=(v=g.target)==null?void 0:v.closest)==null?void 0:T.call(v,"[data-tooltip]"))&&t(null)},[o]);if(w.useEffect(()=>(document.addEventListener("mousemove",u,{passive:!0}),document.addEventListener("mouseover",l,{passive:!0}),document.addEventListener("mouseout",c,{passive:!0}),()=>{document.removeEventListener("mousemove",u),document.removeEventListener("mouseover",l),document.removeEventListener("mouseout",c)}),[u,l,c]),w.useEffect(()=>{let g=null;const y=()=>{g&&(clearTimeout(g),g=null)},v=k=>{var S;if(!o()||k.touches.length!==1)return y();const _=(S=k.target)==null?void 0:S.closest("[data-tooltip]"),A=_==null?void 0:_.getAttribute("data-tooltip");if(!A||!_)return y();const I=_;y(),g=setTimeout(()=>{I.isConnected&&(t(A),r({mode:"rect",x:0,y:0,rect:I.getBoundingClientRect()}))},wb)},T=()=>{y(),t(k=>k&&null)},C=()=>y(),E=()=>{y(),t(null)};return document.addEventListener("touchstart",v,{passive:!0}),document.addEventListener("touchend",T,{passive:!0}),document.addEventListener("touchmove",C,{passive:!0}),document.addEventListener("touchcancel",E,{passive:!0}),()=>{y(),document.removeEventListener("touchstart",v),document.removeEventListener("touchend",T),document.removeEventListener("touchmove",C),document.removeEventListener("touchcancel",E)}},[o]),w.useLayoutEffect(()=>{a.current&&e&&i({w:a.current.offsetWidth,h:a.current.offsetHeight})},[e]),!e)return null;const f=window.innerWidth,h=window.innerHeight;let d,m,p;if(n.mode==="rect"&&n.rect){const g=n.rect;d=g.left+g.width/2-s.w/2,m=g.top-s.h-6,p="none",m<Nn&&(m=g.bottom+6)}else d=n.x,m=n.y-6,p="translate(0, -100%)";return d=Math.min(Math.max(d,Nn),Math.max(Nn,f-s.w-Nn)),m=Math.min(Math.max(m,Nn),Math.max(Nn,h-s.h-Nn)),Eh.createPortal(x.jsx("div",{ref:a,style:{position:"fixed",left:d,top:m,transform:p,zIndex:99999,pointerEvents:"none",visibility:s.w?"visible":"hidden",background:"rgb(var(--surface-0-rgb) / 0.92)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",color:"var(--ink)",border:"1px solid rgb(var(--border-rgb) / 0.5)",fontSize:"0.875rem",fontWeight:600,lineHeight:1.4,padding:"4px 10px",borderRadius:"8px",maxWidth:"260px",wordBreak:"break-word",boxShadow:"0 4px 12px rgb(var(--shadow-rgb) / 0.15)",whiteSpace:"normal"},children:e}),document.body)}function Z4(){}function Ql(e){const t=[],n=String(e||"");let r=n.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const a=n.slice(s,r).trim();(a||!i)&&t.push(a),s=r+1,r=n.indexOf(",",s)}return t}function Mh(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Ab=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Cb=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_b={};function Zl(e,t){return(_b.jsx?Cb:Ab).test(e)}const Ib=/[ \t\n\f\r]/g;function Nb(e){return typeof e=="object"?e.type==="text"?Jl(e.value):!1:Jl(e)}function Jl(e){return e.replace(Ib,"")===""}class xi{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}xi.prototype.normal={};xi.prototype.property={};xi.prototype.space=void 0;function Ph(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new xi(n,r,t)}function ui(e){return e.toLowerCase()}class Nt{constructor(t,n){this.attribute=n,this.property=t}}Nt.prototype.attribute="";Nt.prototype.booleanish=!1;Nt.prototype.boolean=!1;Nt.prototype.commaOrSpaceSeparated=!1;Nt.prototype.commaSeparated=!1;Nt.prototype.defined=!1;Nt.prototype.mustUseProperty=!1;Nt.prototype.number=!1;Nt.prototype.overloadedBoolean=!1;Nt.prototype.property="";Nt.prototype.spaceSeparated=!1;Nt.prototype.space=void 0;let Rb=0;const Ie=Xn(),ct=Xn(),To=Xn(),ue=Xn(),Qe=Xn(),Vn=Xn(),Lt=Xn();function Xn(){return 2**++Rb}const vo=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ie,booleanish:ct,commaOrSpaceSeparated:Lt,commaSeparated:Vn,number:ue,overloadedBoolean:To,spaceSeparated:Qe},Symbol.toStringTag,{value:"Module"})),wa=Object.keys(vo);class ku extends Nt{constructor(t,n,r,s){let i=-1;if(super(t,n),ec(this,"space",s),typeof r=="number")for(;++i<wa.length;){const a=wa[i];ec(this,wa[i],(r&vo[a])===vo[a])}}}ku.prototype.defined=!0;function ec(e,t,n){n&&(e[t]=n)}function yr(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const i=new ku(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[ui(r)]=r,n[ui(i.attribute)]=r}return new xi(t,n,e.space)}const Dh=yr({properties:{ariaActiveDescendant:null,ariaAtomic:ct,ariaAutoComplete:null,ariaBusy:ct,ariaChecked:ct,ariaColCount:ue,ariaColIndex:ue,ariaColSpan:ue,ariaControls:Qe,ariaCurrent:null,ariaDescribedBy:Qe,ariaDetails:null,ariaDisabled:ct,ariaDropEffect:Qe,ariaErrorMessage:null,ariaExpanded:ct,ariaFlowTo:Qe,ariaGrabbed:ct,ariaHasPopup:null,ariaHidden:ct,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Qe,ariaLevel:ue,ariaLive:null,ariaModal:ct,ariaMultiLine:ct,ariaMultiSelectable:ct,ariaOrientation:null,ariaOwns:Qe,ariaPlaceholder:null,ariaPosInSet:ue,ariaPressed:ct,ariaReadOnly:ct,ariaRelevant:null,ariaRequired:ct,ariaRoleDescription:Qe,ariaRowCount:ue,ariaRowIndex:ue,ariaRowSpan:ue,ariaSelected:ct,ariaSetSize:ue,ariaSort:null,ariaValueMax:ue,ariaValueMin:ue,ariaValueNow:ue,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Oh(e,t){return t in e?e[t]:t}function Fh(e,t){return Oh(e,t.toLowerCase())}const Lb=yr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Vn,acceptCharset:Qe,accessKey:Qe,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alpha:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:Qe,autoFocus:Ie,autoPlay:Ie,blocking:Qe,capture:null,charSet:null,checked:Ie,cite:null,className:Qe,closedBy:null,colorSpace:null,cols:ue,colSpan:ue,command:null,commandFor:null,content:null,contentEditable:ct,controls:Ie,controlsList:Qe,coords:ue|Vn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:To,draggable:ct,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:Qe,height:ue,hidden:To,high:ue,href:null,hrefLang:null,htmlFor:Qe,httpEquiv:Qe,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:Qe,itemRef:Qe,itemScope:Ie,itemType:Qe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:ue,manifest:null,max:null,maxLength:ue,media:null,method:null,min:null,minLength:ue,multiple:Ie,muted:Ie,name:null,nonce:null,noModule:Ie,noValidate:Ie,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:Ie,optimum:ue,pattern:null,ping:Qe,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:Qe,required:Ie,reversed:Ie,rows:ue,rowSpan:ue,sandbox:Qe,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootCustomElementRegistry:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shadowRootSerializable:Ie,shape:null,size:ue,sizes:null,slot:null,span:ue,spellCheck:ct,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ue,step:null,style:null,tabIndex:ue,target:null,title:null,translate:null,type:null,typeMustMatch:Ie,useMap:null,value:ct,width:ue,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Qe,axis:null,background:null,bgColor:null,border:ue,borderColor:null,bottomMargin:ue,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ie,declare:Ie,event:null,face:null,frame:null,frameBorder:null,hSpace:ue,leftMargin:ue,link:null,longDesc:null,lowSrc:null,marginHeight:ue,marginWidth:ue,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:ue,rules:null,scheme:null,scrolling:ct,standby:null,summary:null,text:null,topMargin:ue,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ue,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ie,disablePictureInPicture:Ie,disableRemotePlayback:Ie,exportParts:Vn,part:Qe,prefix:null,property:null,results:ue,security:null,unselectable:null},space:"html",transform:Fh}),Mb=yr({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Lt,accentHeight:ue,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ue,amplitude:ue,arabicForm:null,ascent:ue,attributeName:null,attributeType:null,azimuth:ue,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ue,by:null,calcMode:null,capHeight:ue,className:Qe,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:ue,diffuseConstant:ue,direction:null,display:null,dur:null,divisor:ue,dominantBaseline:null,download:Ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:ue,enableBackground:null,end:null,event:null,exponent:ue,externalResourcesRequired:null,fill:null,fillOpacity:ue,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:Vn,g2:Vn,glyphName:Vn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ue,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ue,horizOriginX:ue,horizOriginY:ue,id:null,ideographic:ue,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ue,k:ue,k1:ue,k2:ue,k3:ue,k4:ue,kernelMatrix:Lt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ue,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ue,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:ue,overlineThickness:ue,paintOrder:null,panose1:null,path:null,pathLength:ue,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Qe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ue,pointsAtY:ue,pointsAtZ:ue,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Lt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Lt,rev:Lt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Lt,requiredFeatures:Lt,requiredFonts:Lt,requiredFormats:Lt,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:ue,specularExponent:ue,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ue,strikethroughThickness:ue,string:null,stroke:null,strokeDashArray:Lt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ue,strokeOpacity:ue,strokeWidth:null,style:null,surfaceScale:ue,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Lt,tabIndex:ue,tableValues:null,target:null,targetX:ue,targetY:ue,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Lt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ue,underlineThickness:ue,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ue,values:null,vAlphabetic:ue,vMathematical:ue,vectorEffect:null,vHanging:ue,vIdeographic:ue,version:null,vertAdvY:ue,vertOriginX:ue,vertOriginY:ue,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ue,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Oh}),Bh=yr({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()}}),jh=yr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Fh}),Hh=yr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Pb={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"},Db=/[A-Z]/g,tc=/-[a-z]/g,Ob=/^data[-\w.:]+$/i;function Hs(e,t){const n=ui(t);let r=t,s=Nt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Ob.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(tc,Bb);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!tc.test(i)){let a=i.replace(Db,Fb);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}s=ku}return new s(r,t)}function Fb(e){return"-"+e.toLowerCase()}function Bb(e){return e.charAt(1).toUpperCase()}const bi=Ph([Dh,Lb,Bh,jh,Hh],"html"),An=Ph([Dh,Mb,Bh,jh,Hh],"svg");function nc(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Uh(e){return e.join(" ").trim()}var nr={},Sa,rc;function jb(){if(rc)return Sa;rc=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,o=/^\s+|\s+$/g,u=`
|
|
413
|
-
`,l="/",c="*",f="",h="comment",d="declaration";function m(g,y){if(typeof g!="string")throw new TypeError("First argument must be a string");if(!g)return[];y=y||{};var v=1,T=1;function C(P){var D=P.match(t);D&&(v+=D.length);var H=P.lastIndexOf(u);T=~H?P.length-H:T+P.length}function E(){var P={line:v,column:T};return function(D){return D.position=new k(P),I(),D}}function k(P){this.start=P,this.end={line:v,column:T},this.source=y.source}k.prototype.content=g;function _(P){var D=new Error(y.source+":"+v+":"+T+": "+P);if(D.reason=P,D.filename=y.source,D.line=v,D.column=T,D.source=g,!y.silent)throw D}function A(P){var D=P.exec(g);if(D){var H=D[0];return C(H),g=g.slice(H.length),D}}function I(){A(n)}function S(P){var D;for(P=P||[];D=L();)D!==!1&&P.push(D);return P}function L(){var P=E();if(!(l!=g.charAt(0)||c!=g.charAt(1))){for(var D=2;f!=g.charAt(D)&&(c!=g.charAt(D)||l!=g.charAt(D+1));)++D;if(D+=2,f===g.charAt(D-1))return _("End of comment missing");var H=g.slice(2,D-2);return T+=2,C(H),g=g.slice(D),T+=2,P({type:h,comment:H})}}function N(){var P=E(),D=A(r);if(D){if(L(),!A(s))return _("property missing ':'");var H=A(i),z=P({type:d,property:p(D[0].replace(e,f)),value:H?p(H[0].replace(e,f)):f});return A(a),z}}function j(){var P=[];S(P);for(var D;D=N();)D!==!1&&(P.push(D),S(P));return P}return I(),j()}function p(g){return g?g.replace(o,f):f}return Sa=m,Sa}var ic;function Hb(){if(ic)return nr;ic=1;var e=nr&&nr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(nr,"__esModule",{value:!0}),nr.default=n;const t=e(jb());function n(r,s){let i=null;if(!r||typeof r!="string")return i;const a=(0,t.default)(r),o=typeof s=="function";return a.forEach(u=>{if(u.type!=="declaration")return;const{property:l,value:c}=u;o?s(l,c,u):c&&(i=i||{},i[l]=c)}),i}return nr}var Lr={},sc;function Ub(){if(sc)return Lr;sc=1,Object.defineProperty(Lr,"__esModule",{value:!0}),Lr.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(l){return!l||n.test(l)||e.test(l)},a=function(l,c){return c.toUpperCase()},o=function(l,c){return"".concat(c,"-")},u=function(l,c){return c===void 0&&(c={}),i(l)?l:(l=l.toLowerCase(),c.reactCompat?l=l.replace(s,o):l=l.replace(r,o),l.replace(t,a))};return Lr.camelCase=u,Lr}var Mr,ac;function zb(){if(ac)return Mr;ac=1;var e=Mr&&Mr.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(Hb()),n=Ub();function r(s,i){var a={};return!s||typeof s!="string"||(0,t.default)(s,function(o,u){o&&u&&(a[(0,n.camelCase)(o,i)]=u)}),a}return r.default=r,Mr=r,Mr}var Vb=zb();const qb=mu(Vb),Us=zh("end"),an=zh("start");function zh(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 Vh(e){const t=an(e),n=Us(e);if(t&&n)return{start:t,end:n}}function Wr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?oc(e.position):"start"in e||"end"in e?oc(e):"line"in e||"column"in e?ko(e):""}function ko(e){return uc(e&&e.line)+":"+uc(e&&e.column)}function oc(e){return ko(e&&e.start)+"-"+ko(e&&e.end)}function uc(e){return e&&typeof e=="number"?e:1}class Et extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",i={},a=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?s=t:!i.cause&&t&&(a=!0,s=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?i.ruleId=r:(i.source=r.slice(0,u),i.ruleId=r.slice(u+1))}if(!i.place&&i.ancestors&&i.ancestors){const u=i.ancestors[i.ancestors.length-1];u&&(i.place=u.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=o?o.line:void 0,this.name=Wr(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Et.prototype.file="";Et.prototype.name="";Et.prototype.reason="";Et.prototype.message="";Et.prototype.stack="";Et.prototype.column=void 0;Et.prototype.line=void 0;Et.prototype.ancestors=void 0;Et.prototype.cause=void 0;Et.prototype.fatal=void 0;Et.prototype.place=void 0;Et.prototype.ruleId=void 0;Et.prototype.source=void 0;const wu={}.hasOwnProperty,$b=new Map,Wb=/[A-Z]/g,Yb=new Set(["table","tbody","thead","tfoot","tr"]),Gb=new Set(["td","th"]),qh="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Kb(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=ry(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=ny(n,t.jsx,t.jsxs)}const s={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"?An:bi,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=$h(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function $h(e,t,n){if(t.type==="element")return Xb(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Qb(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Jb(e,t,n);if(t.type==="mdxjsEsm")return Zb(e,t);if(t.type==="root")return ey(e,t,n);if(t.type==="text")return ty(e,t)}function Xb(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=An,e.schema=s),e.ancestors.push(t);const i=Yh(e,t.tagName,!1),a=iy(e,t);let o=Au(e,t);return Yb.has(t.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!Nb(u):!0})),Wh(e,a,i,t),Su(a,o),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function Qb(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)}li(e,t.position)}function Zb(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);li(e,t.position)}function Jb(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=An,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:Yh(e,t.name,!0),a=sy(e,t),o=Au(e,t);return Wh(e,a,i,t),Su(a,o),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function ey(e,t,n){const r={};return Su(r,Au(e,t)),e.create(t,e.Fragment,r,n)}function ty(e,t){return t.value}function Wh(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Su(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function ny(e,t,n){return r;function r(s,i,a,o){const l=Array.isArray(a.children)?n:t;return o?l(i,a,o):l(i,a)}}function ry(e,t){return n;function n(r,s,i,a){const o=Array.isArray(i.children),u=an(r);return t(s,i,a,o,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function iy(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&wu.call(t.properties,s)){const i=ay(e,s,t.properties[s]);if(i){const[a,o]=i;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&Gb.has(t.tagName)?r=o:n[a]=o}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function sy(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else li(e,t.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,i=e.evaluater.evaluateExpression(o.expression)}else li(e,t.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function Au(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:$b;for(;++r<t.children.length;){const i=t.children[r];let a;if(e.passKeys){const u=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(u){const l=s.get(u)||0;a=u+"-"+l,s.set(u,l+1)}}const o=$h(e,i,a);o!==void 0&&n.push(o)}return n}function ay(e,t,n){const r=Hs(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Mh(n):Uh(n)),r.property==="style"){let s=typeof n=="object"?n:oy(e,String(n));return e.stylePropertyNameCase==="css"&&(s=uy(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?Pb[r.property]||r.property:r.attribute,n]}}function oy(e,t){try{return qb(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new Et("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=qh+"#cannot-parse-style-attribute",s}}function Yh(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let i=-1,a;for(;++i<s.length;){const o=Zl(s[i])?{type:"Identifier",name:s[i]}:{type:"Literal",value:s[i]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(i&&o.type==="Literal"),optional:!1}:o}r=a}else r=Zl(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return wu.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);li(e)}function li(e,t){const n=new Et("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=qh+"#cannot-handle-mdx-estrees-without-createevaluater",n}function uy(e){const t={};let n;for(n in e)wu.call(e,n)&&(t[ly(n)]=e[n]);return t}function ly(e){let t=e.replace(Wb,cy);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function cy(e){return"-"+e.toLowerCase()}const Aa={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"]},dy={};function Cu(e,t){const n=dy,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Gh(e,r,s)}function Gh(e,t,n){if(fy(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 lc(e.children,t,n)}return Array.isArray(e)?lc(e,t,n):""}function lc(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=Gh(e[s],t,n);return r.join("")}function fy(e){return!!(e&&typeof e=="object")}const cc=document.createElement("i");function _u(e){const t="&"+e+";";cc.innerHTML=t;const n=cc.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Mt(e,t,n,r){const s=e.length;let i=0,a;if(t<0?t=-t>s?0:s+t:t=t>s?s: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);i<r.length;)a=r.slice(i,i+1e4),a.unshift(t,0),e.splice(...a),i+=1e4,t+=1e4}function jt(e,t){return e.length>0?(Mt(e,e.length,0,t),e):t}const dc={}.hasOwnProperty;function Kh(e){const t={};let n=-1;for(;++n<e.length;)hy(t,e[n]);return t}function hy(e,t){let n;for(n in t){const s=(dc.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let a;if(i)for(a in i){dc.call(s,a)||(s[a]=[]);const o=i[a];my(s[a],Array.isArray(o)?o:o?[o]:[])}}}function my(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Mt(e,0,0,r)}function Xh(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)}function Wt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const vt=Cn(/[A-Za-z]/),yt=Cn(/[\dA-Za-z]/),py=Cn(/[#-'*+\--9=?A-Z^-~]/);function bs(e){return e!==null&&(e<32||e===127)}const wo=Cn(/\d/),gy=Cn(/[\dA-Fa-f]/),xy=Cn(/[!-/:-@[-`{-~]/);function we(e){return e!==null&&e<-2}function et(e){return e!==null&&(e<0||e===32)}function Oe(e){return e===-2||e===-1||e===32}const zs=Cn(new RegExp("\\p{P}|\\p{S}","u")),Gn=Cn(/\s/);function Cn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Er(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const i=e.charCodeAt(n);let a="";if(i===37&&yt(e.charCodeAt(n+1))&&yt(e.charCodeAt(n+2)))s=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){const o=e.charCodeAt(n+1);i<56320&&o>56319&&o<57344?(a=String.fromCharCode(i,o),s=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+s+1,a=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function je(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(u){return Oe(u)?(e.enter(n),o(u)):t(u)}function o(u){return Oe(u)&&i++<s?(e.consume(u),o):(e.exit(n),t(u))}}const by={tokenize:yy};function yy(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),je(e,t,"linePrefix")}function s(o){return e.enter("paragraph"),i(o)}function i(o){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,a(o)}function a(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return we(o)?(e.consume(o),e.exit("chunkText"),i):(e.consume(o),a)}}const Ey={tokenize:Ty},fc={tokenize:vy};function Ty(e){const t=this,n=[];let r=0,s,i,a;return o;function o(T){if(r<n.length){const C=n[r];return t.containerState=C[1],e.attempt(C[0].continuation,u,l)(T)}return l(T)}function u(T){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&v();const C=t.events.length;let E=C,k;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){k=t.events[E][1].end;break}y(r);let _=C;for(;_<t.events.length;)t.events[_][1].end={...k},_++;return Mt(t.events,E+1,0,t.events.slice(C)),t.events.length=_,l(T)}return o(T)}function l(T){if(r===n.length){if(!s)return h(T);if(s.currentConstruct&&s.currentConstruct.concrete)return m(T);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(fc,c,f)(T)}function c(T){return s&&v(),y(r),h(T)}function f(T){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,m(T)}function h(T){return t.containerState={},e.attempt(fc,d,m)(T)}function d(T){return r++,n.push([t.currentConstruct,t.containerState]),h(T)}function m(T){if(T===null){s&&v(),y(0),e.consume(T);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:i}),p(T)}function p(T){if(T===null){g(e.exit("chunkFlow"),!0),y(0),e.consume(T);return}return we(T)?(e.consume(T),g(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(T),p)}function g(T,C){const E=t.sliceStream(T);if(C&&E.push(null),T.previous=i,i&&(i.next=T),i=T,s.defineSkip(T.start),s.write(E),t.parser.lazy[T.start.line]){let k=s.events.length;for(;k--;)if(s.events[k][1].start.offset<a&&(!s.events[k][1].end||s.events[k][1].end.offset>a))return;const _=t.events.length;let A=_,I,S;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){if(I){S=t.events[A][1].end;break}I=!0}for(y(r),k=_;k<t.events.length;)t.events[k][1].end={...S},k++;Mt(t.events,A+1,0,t.events.slice(_)),t.events.length=k}}function y(T){let C=n.length;for(;C-- >T;){const E=n[C];t.containerState=E[1],E[0].exit.call(t,e)}n.length=T}function v(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function vy(e,t,n){return je(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function pr(e){if(e===null||et(e)||Gn(e))return 1;if(zs(e))return 2}function Vs(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const i=e[s].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const So={name:"attention",resolveAll:ky,tokenize:wy};function ky(e,t){let n=-1,r,s,i,a,o,u,l,c;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;u=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 f={...e[r][1].end},h={...e[n][1].start};hc(f,-u),hc(h,u),a={type:u>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},o={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},i={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:u>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[n][1].start={...o.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=jt(l,[["enter",e[r][1],t],["exit",e[r][1],t]])),l=jt(l,[["enter",s,t],["enter",a,t],["exit",a,t],["enter",i,t]]),l=jt(l,Vs(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=jt(l,[["exit",i,t],["enter",o,t],["exit",o,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,l=jt(l,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,Mt(e,r-1,n-r+3,l),n=r+l.length-c-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function wy(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=pr(r);let i;return a;function a(u){return i=u,e.enter("attentionSequence"),o(u)}function o(u){if(u===i)return e.consume(u),o;const l=e.exit("attentionSequence"),c=pr(u),f=!c||c===2&&s||n.includes(u),h=!s||s===2&&c||n.includes(r);return l._open=!!(i===42?f:f&&(s||!h)),l._close=!!(i===42?h:h&&(c||!f)),t(u)}}function hc(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Sy={name:"autolink",tokenize:Ay};function Ay(e,t,n){let r=0;return s;function s(d){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(d){return vt(d)?(e.consume(d),a):d===64?n(d):l(d)}function a(d){return d===43||d===45||d===46||yt(d)?(r=1,o(d)):l(d)}function o(d){return d===58?(e.consume(d),r=0,u):(d===43||d===45||d===46||yt(d))&&r++<32?(e.consume(d),o):(r=0,l(d))}function u(d){return d===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):d===null||d===32||d===60||bs(d)?n(d):(e.consume(d),u)}function l(d){return d===64?(e.consume(d),c):py(d)?(e.consume(d),l):n(d)}function c(d){return yt(d)?f(d):n(d)}function f(d){return d===46?(e.consume(d),r=0,c):d===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):h(d)}function h(d){if((d===45||yt(d))&&r++<63){const m=d===45?h:f;return e.consume(d),m}return n(d)}}const yi={partial:!0,tokenize:Cy};function Cy(e,t,n){return r;function r(i){return Oe(i)?je(e,s,"linePrefix")(i):s(i)}function s(i){return i===null||we(i)?t(i):n(i)}}const Qh={continuation:{tokenize:Iy},exit:Ny,name:"blockQuote",tokenize:_y};function _y(e,t,n){const r=this;return s;function s(a){if(a===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),i}return n(a)}function i(a){return Oe(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function Iy(e,t,n){const r=this;return s;function s(a){return Oe(a)?je(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):i(a)}function i(a){return e.attempt(Qh,t,n)(a)}}function Ny(e){e.exit("blockQuote")}const Zh={name:"characterEscape",tokenize:Ry};function Ry(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),s}function s(i){return xy(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const Jh={name:"characterReference",tokenize:Ly};function Ly(e,t,n){const r=this;let s=0,i,a;return o;function o(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),u}function u(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),i=31,a=yt,c(f))}function l(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,a=gy,c):(e.enter("characterReferenceValue"),i=7,a=wo,c(f))}function c(f){if(f===59&&s){const h=e.exit("characterReferenceValue");return a===yt&&!_u(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(f)&&s++<i?(e.consume(f),c):n(f)}}const mc={partial:!0,tokenize:Py},pc={concrete:!0,name:"codeFenced",tokenize:My};function My(e,t,n){const r=this,s={partial:!0,tokenize:E};let i=0,a=0,o;return u;function u(k){return l(k)}function l(k){const _=r.events[r.events.length-1];return i=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,o=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(k)}function c(k){return k===o?(a++,e.consume(k),c):a<3?n(k):(e.exit("codeFencedFenceSequence"),Oe(k)?je(e,f,"whitespace")(k):f(k))}function f(k){return k===null||we(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(mc,p,C)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(k))}function h(k){return k===null||we(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(k)):Oe(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),je(e,d,"whitespace")(k)):k===96&&k===o?n(k):(e.consume(k),h)}function d(k){return k===null||we(k)?f(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(k))}function m(k){return k===null||we(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(k)):k===96&&k===o?n(k):(e.consume(k),m)}function p(k){return e.attempt(s,C,g)(k)}function g(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),y}function y(k){return i>0&&Oe(k)?je(e,v,"linePrefix",i+1)(k):v(k)}function v(k){return k===null||we(k)?e.check(mc,p,C)(k):(e.enter("codeFlowValue"),T(k))}function T(k){return k===null||we(k)?(e.exit("codeFlowValue"),v(k)):(e.consume(k),T)}function C(k){return e.exit("codeFenced"),t(k)}function E(k,_,A){let I=0;return S;function S(D){return k.enter("lineEnding"),k.consume(D),k.exit("lineEnding"),L}function L(D){return k.enter("codeFencedFence"),Oe(D)?je(k,N,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):N(D)}function N(D){return D===o?(k.enter("codeFencedFenceSequence"),j(D)):A(D)}function j(D){return D===o?(I++,k.consume(D),j):I>=a?(k.exit("codeFencedFenceSequence"),Oe(D)?je(k,P,"whitespace")(D):P(D)):A(D)}function P(D){return D===null||we(D)?(k.exit("codeFencedFence"),_(D)):A(D)}}}function Py(e,t,n){const r=this;return s;function s(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const Ca={name:"codeIndented",tokenize:Oy},Dy={partial:!0,tokenize:Fy};function Oy(e,t,n){const r=this;return s;function s(l){return e.enter("codeIndented"),je(e,i,"linePrefix",5)(l)}function i(l){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?a(l):n(l)}function a(l){return l===null?u(l):we(l)?e.attempt(Dy,a,u)(l):(e.enter("codeFlowValue"),o(l))}function o(l){return l===null||we(l)?(e.exit("codeFlowValue"),a(l)):(e.consume(l),o)}function u(l){return e.exit("codeIndented"),t(l)}}function Fy(e,t,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):we(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):je(e,i,"linePrefix",5)(a)}function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):we(a)?s(a):n(a)}}const By={name:"codeText",previous:Hy,resolve:jy,tokenize:Uy};function jy(e){let t=e.length-4,n=3,r,s;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;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function Hy(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Uy(e,t,n){let r=0,s,i;return a;function a(f){return e.enter("codeText"),e.enter("codeTextSequence"),o(f)}function o(f){return f===96?(e.consume(f),r++,o):(e.exit("codeTextSequence"),u(f))}function u(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),u):f===96?(i=e.enter("codeTextSequence"),s=0,c(f)):we(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("codeTextData"),l(f))}function l(f){return f===null||f===32||f===96||we(f)?(e.exit("codeTextData"),u(f)):(e.consume(f),l)}function c(f){return f===96?(e.consume(f),s++,c):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(i.type="codeTextData",l(f))}}class zy{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 s=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Pr(this.left,r),i.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),Pr(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Pr(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);Pr(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Pr(this.left,n.reverse())}}}function Pr(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 em(e){const t={};let n=-1,r,s,i,a,o,u,l;const c=new zy(e);for(;++n<c.length;){for(;n in t;)n=t[n];if(r=c.get(n),n&&r[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,i=0,i<u.length&&u[i][1].type==="lineEndingBlank"&&(i+=2),i<u.length&&u[i][1].type==="content"))for(;++i<u.length&&u[i][1].type!=="content";)u[i][1].type==="chunkText"&&(u[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Vy(c,n)),n=t[n],l=!0);else if(r[1]._container){for(i=n,s=void 0;i--;)if(a=c.get(i),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(s&&(c.get(s)[1].type="lineEndingBlank"),a[1].type="lineEnding",s=i);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;s&&(r[1].end={...c.get(s)[1].start},o=c.slice(s,n),o.unshift(r),c.splice(s,n-s+1,o))}}return Mt(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!l}function Vy(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const i=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,u=[],l={};let c,f,h=-1,d=n,m=0,p=0;const g=[p];for(;d;){for(;e.get(++s)[1]!==d;);i.push(s),d._tokenizer||(c=r.sliceStream(d),d.next||c.push(null),f&&a.defineSkip(d.start),d._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(c),d._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),f=d,d=d.next}for(d=n;++h<o.length;)o[h][0]==="exit"&&o[h-1][0]==="enter"&&o[h][1].type===o[h-1][1].type&&o[h][1].start.line!==o[h][1].end.line&&(p=h+1,g.push(p),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(a.events=[],d?(d._tokenizer=void 0,d.previous=void 0):g.pop(),h=g.length;h--;){const y=o.slice(g[h],g[h+1]),v=i.pop();u.push([v,v+y.length-1]),e.splice(v,2,y)}for(u.reverse(),h=-1;++h<u.length;)l[m+u[h][0]]=m+u[h][1],m+=u[h][1]-u[h][0]-1;return l}const qy={resolve:Wy,tokenize:Yy},$y={partial:!0,tokenize:Gy};function Wy(e){return em(e),e}function Yy(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(o)}function s(o){return o===null?i(o):we(o)?e.check($y,a,i)(o):(e.consume(o),s)}function i(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function a(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function Gy(e,t,n){const r=this;return s;function s(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),je(e,i,"linePrefix")}function i(a){if(a===null||we(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function tm(e,t,n,r,s,i,a,o,u){const l=u||Number.POSITIVE_INFINITY;let c=0;return f;function f(y){return y===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(y),e.exit(i),h):y===null||y===32||y===41||bs(y)?n(y):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),p(y))}function h(y){return y===62?(e.enter(i),e.consume(y),e.exit(i),e.exit(s),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),d(y))}function d(y){return y===62?(e.exit("chunkString"),e.exit(o),h(y)):y===null||y===60||we(y)?n(y):(e.consume(y),y===92?m:d)}function m(y){return y===60||y===62||y===92?(e.consume(y),d):d(y)}function p(y){return!c&&(y===null||y===41||et(y))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(y)):c<l&&y===40?(e.consume(y),c++,p):y===41?(e.consume(y),c--,p):y===null||y===32||y===40||bs(y)?n(y):(e.consume(y),y===92?g:p)}function g(y){return y===40||y===41||y===92?(e.consume(y),p):p(y)}}function nm(e,t,n,r,s,i){const a=this;let o=0,u;return l;function l(d){return e.enter(r),e.enter(s),e.consume(d),e.exit(s),e.enter(i),c}function c(d){return o>999||d===null||d===91||d===93&&!u||d===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):d===93?(e.exit(i),e.enter(s),e.consume(d),e.exit(s),e.exit(r),t):we(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===null||d===91||d===93||we(d)||o++>999?(e.exit("chunkString"),c(d)):(e.consume(d),u||(u=!Oe(d)),d===92?h:f)}function h(d){return d===91||d===92||d===93?(e.consume(d),o++,f):f(d)}}function rm(e,t,n,r,s,i){let a;return o;function o(h){return h===34||h===39||h===40?(e.enter(r),e.enter(s),e.consume(h),e.exit(s),a=h===40?41:h,u):n(h)}function u(h){return h===a?(e.enter(s),e.consume(h),e.exit(s),e.exit(r),t):(e.enter(i),l(h))}function l(h){return h===a?(e.exit(i),u(a)):h===null?n(h):we(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),je(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===a||h===null||we(h)?(e.exit("chunkString"),l(h)):(e.consume(h),h===92?f:c)}function f(h){return h===a||h===92?(e.consume(h),c):c(h)}}function Yr(e,t){let n;return r;function r(s){return we(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):Oe(s)?je(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const Ky={name:"definition",tokenize:Qy},Xy={partial:!0,tokenize:Zy};function Qy(e,t,n){const r=this;let s;return i;function i(d){return e.enter("definition"),a(d)}function a(d){return nm.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function o(d){return s=Wt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),u):n(d)}function u(d){return et(d)?Yr(e,l)(d):l(d)}function l(d){return tm(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return e.attempt(Xy,f,f)(d)}function f(d){return Oe(d)?je(e,h,"whitespace")(d):h(d)}function h(d){return d===null||we(d)?(e.exit("definition"),r.parser.defined.push(s),t(d)):n(d)}}function Zy(e,t,n){return r;function r(o){return et(o)?Yr(e,s)(o):n(o)}function s(o){return rm(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return Oe(o)?je(e,a,"whitespace")(o):a(o)}function a(o){return o===null||we(o)?t(o):n(o)}}const Jy={name:"hardBreakEscape",tokenize:e2};function e2(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return we(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const t2={name:"headingAtx",resolve:n2,tokenize:r2};function n2(e,t){let n=e.length-2,r=3,s,i;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&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Mt(e,r,n-r+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function r2(e,t,n){let r=0;return s;function s(c){return e.enter("atxHeading"),i(c)}function i(c){return e.enter("atxHeadingSequence"),a(c)}function a(c){return c===35&&r++<6?(e.consume(c),a):c===null||et(c)?(e.exit("atxHeadingSequence"),o(c)):n(c)}function o(c){return c===35?(e.enter("atxHeadingSequence"),u(c)):c===null||we(c)?(e.exit("atxHeading"),t(c)):Oe(c)?je(e,o,"whitespace")(c):(e.enter("atxHeadingText"),l(c))}function u(c){return c===35?(e.consume(c),u):(e.exit("atxHeadingSequence"),o(c))}function l(c){return c===null||c===35||et(c)?(e.exit("atxHeadingText"),o(c)):(e.consume(c),l)}}const i2=["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"],gc=["pre","script","style","textarea"],s2={concrete:!0,name:"htmlFlow",resolveTo:u2,tokenize:l2},a2={partial:!0,tokenize:d2},o2={partial:!0,tokenize:c2};function u2(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 l2(e,t,n){const r=this;let s,i,a,o,u;return l;function l(M){return c(M)}function c(M){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(M),f}function f(M){return M===33?(e.consume(M),h):M===47?(e.consume(M),i=!0,p):M===63?(e.consume(M),s=3,r.interrupt?t:R):vt(M)?(e.consume(M),a=String.fromCharCode(M),g):n(M)}function h(M){return M===45?(e.consume(M),s=2,d):M===91?(e.consume(M),s=5,o=0,m):vt(M)?(e.consume(M),s=4,r.interrupt?t:R):n(M)}function d(M){return M===45?(e.consume(M),r.interrupt?t:R):n(M)}function m(M){const ee="CDATA[";return M===ee.charCodeAt(o++)?(e.consume(M),o===ee.length?r.interrupt?t:N:m):n(M)}function p(M){return vt(M)?(e.consume(M),a=String.fromCharCode(M),g):n(M)}function g(M){if(M===null||M===47||M===62||et(M)){const ee=M===47,oe=a.toLowerCase();return!ee&&!i&&gc.includes(oe)?(s=1,r.interrupt?t(M):N(M)):i2.includes(a.toLowerCase())?(s=6,ee?(e.consume(M),y):r.interrupt?t(M):N(M)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(M):i?v(M):T(M))}return M===45||yt(M)?(e.consume(M),a+=String.fromCharCode(M),g):n(M)}function y(M){return M===62?(e.consume(M),r.interrupt?t:N):n(M)}function v(M){return Oe(M)?(e.consume(M),v):S(M)}function T(M){return M===47?(e.consume(M),S):M===58||M===95||vt(M)?(e.consume(M),C):Oe(M)?(e.consume(M),T):S(M)}function C(M){return M===45||M===46||M===58||M===95||yt(M)?(e.consume(M),C):E(M)}function E(M){return M===61?(e.consume(M),k):Oe(M)?(e.consume(M),E):T(M)}function k(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),u=M,_):Oe(M)?(e.consume(M),k):A(M)}function _(M){return M===u?(e.consume(M),u=null,I):M===null||we(M)?n(M):(e.consume(M),_)}function A(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||et(M)?E(M):(e.consume(M),A)}function I(M){return M===47||M===62||Oe(M)?T(M):n(M)}function S(M){return M===62?(e.consume(M),L):n(M)}function L(M){return M===null||we(M)?N(M):Oe(M)?(e.consume(M),L):n(M)}function N(M){return M===45&&s===2?(e.consume(M),H):M===60&&s===1?(e.consume(M),z):M===62&&s===4?(e.consume(M),$):M===63&&s===3?(e.consume(M),R):M===93&&s===5?(e.consume(M),q):we(M)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(a2,W,j)(M)):M===null||we(M)?(e.exit("htmlFlowData"),j(M)):(e.consume(M),N)}function j(M){return e.check(o2,P,W)(M)}function P(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),D}function D(M){return M===null||we(M)?j(M):(e.enter("htmlFlowData"),N(M))}function H(M){return M===45?(e.consume(M),R):N(M)}function z(M){return M===47?(e.consume(M),a="",F):N(M)}function F(M){if(M===62){const ee=a.toLowerCase();return gc.includes(ee)?(e.consume(M),$):N(M)}return vt(M)&&a.length<8?(e.consume(M),a+=String.fromCharCode(M),F):N(M)}function q(M){return M===93?(e.consume(M),R):N(M)}function R(M){return M===62?(e.consume(M),$):M===45&&s===2?(e.consume(M),R):N(M)}function $(M){return M===null||we(M)?(e.exit("htmlFlowData"),W(M)):(e.consume(M),$)}function W(M){return e.exit("htmlFlow"),t(M)}}function c2(e,t,n){const r=this;return s;function s(a){return we(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):n(a)}function i(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function d2(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(yi,t,n)}}const f2={name:"htmlText",tokenize:h2};function h2(e,t,n){const r=this;let s,i,a;return o;function o(R){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(R),u}function u(R){return R===33?(e.consume(R),l):R===47?(e.consume(R),E):R===63?(e.consume(R),T):vt(R)?(e.consume(R),A):n(R)}function l(R){return R===45?(e.consume(R),c):R===91?(e.consume(R),i=0,m):vt(R)?(e.consume(R),v):n(R)}function c(R){return R===45?(e.consume(R),d):n(R)}function f(R){return R===null?n(R):R===45?(e.consume(R),h):we(R)?(a=f,z(R)):(e.consume(R),f)}function h(R){return R===45?(e.consume(R),d):f(R)}function d(R){return R===62?H(R):R===45?h(R):f(R)}function m(R){const $="CDATA[";return R===$.charCodeAt(i++)?(e.consume(R),i===$.length?p:m):n(R)}function p(R){return R===null?n(R):R===93?(e.consume(R),g):we(R)?(a=p,z(R)):(e.consume(R),p)}function g(R){return R===93?(e.consume(R),y):p(R)}function y(R){return R===62?H(R):R===93?(e.consume(R),y):p(R)}function v(R){return R===null||R===62?H(R):we(R)?(a=v,z(R)):(e.consume(R),v)}function T(R){return R===null?n(R):R===63?(e.consume(R),C):we(R)?(a=T,z(R)):(e.consume(R),T)}function C(R){return R===62?H(R):T(R)}function E(R){return vt(R)?(e.consume(R),k):n(R)}function k(R){return R===45||yt(R)?(e.consume(R),k):_(R)}function _(R){return we(R)?(a=_,z(R)):Oe(R)?(e.consume(R),_):H(R)}function A(R){return R===45||yt(R)?(e.consume(R),A):R===47||R===62||et(R)?I(R):n(R)}function I(R){return R===47?(e.consume(R),H):R===58||R===95||vt(R)?(e.consume(R),S):we(R)?(a=I,z(R)):Oe(R)?(e.consume(R),I):H(R)}function S(R){return R===45||R===46||R===58||R===95||yt(R)?(e.consume(R),S):L(R)}function L(R){return R===61?(e.consume(R),N):we(R)?(a=L,z(R)):Oe(R)?(e.consume(R),L):I(R)}function N(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),s=R,j):we(R)?(a=N,z(R)):Oe(R)?(e.consume(R),N):(e.consume(R),P)}function j(R){return R===s?(e.consume(R),s=void 0,D):R===null?n(R):we(R)?(a=j,z(R)):(e.consume(R),j)}function P(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||et(R)?I(R):(e.consume(R),P)}function D(R){return R===47||R===62||et(R)?I(R):n(R)}function H(R){return R===62?(e.consume(R),e.exit("htmlTextData"),e.exit("htmlText"),t):n(R)}function z(R){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),F}function F(R){return Oe(R)?je(e,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):q(R)}function q(R){return e.enter("htmlTextData"),a(R)}}const Iu={name:"labelEnd",resolveAll:x2,resolveTo:b2,tokenize:y2},m2={tokenize:E2},p2={tokenize:T2},g2={tokenize:v2};function x2(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 s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&Mt(e,0,e.length,n),e}function b2(e,t){let n=e.length,r=0,s,i,a,o;for(;n--;)if(s=e[n][1],i){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(i=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(a=n);const u={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},l={type:"label",start:{...e[i][1].start},end:{...e[a][1].end}},c={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[["enter",u,t],["enter",l,t]],o=jt(o,e.slice(i+1,i+r+3)),o=jt(o,[["enter",c,t]]),o=jt(o,Vs(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=jt(o,[["exit",c,t],e[a-2],e[a-1],["exit",l,t]]),o=jt(o,e.slice(a+1)),o=jt(o,[["exit",u,t]]),Mt(e,i,e.length,o),e}function y2(e,t,n){const r=this;let s=r.events.length,i,a;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){i=r.events[s][1];break}return o;function o(h){return i?i._inactive?f(h):(a=r.parser.defined.includes(Wt(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),u):n(h)}function u(h){return h===40?e.attempt(m2,c,a?c:f)(h):h===91?e.attempt(p2,c,a?l:f)(h):a?c(h):f(h)}function l(h){return e.attempt(g2,c,f)(h)}function c(h){return t(h)}function f(h){return i._balanced=!0,n(h)}}function E2(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),s}function s(f){return et(f)?Yr(e,i)(f):i(f)}function i(f){return f===41?c(f):tm(e,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function a(f){return et(f)?Yr(e,u)(f):c(f)}function o(f){return n(f)}function u(f){return f===34||f===39||f===40?rm(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function l(f){return et(f)?Yr(e,c)(f):c(f)}function c(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function T2(e,t,n){const r=this;return s;function s(o){return nm.call(r,e,i,a,"reference","referenceMarker","referenceString")(o)}function i(o){return r.parser.defined.includes(Wt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function a(o){return n(o)}}function v2(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),s}function s(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const k2={name:"labelStartImage",resolveAll:Iu.resolveAll,tokenize:w2};function w2(e,t,n){const r=this;return s;function s(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),i}function i(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),a):n(o)}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const S2={name:"labelStartLink",resolveAll:Iu.resolveAll,tokenize:A2};function A2(e,t,n){const r=this;return s;function s(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),i}function i(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const _a={name:"lineEnding",tokenize:C2};function C2(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),je(e,t,"linePrefix")}}const ts={name:"thematicBreak",tokenize:_2};function _2(e,t,n){let r=0,s;return i;function i(l){return e.enter("thematicBreak"),a(l)}function a(l){return s=l,o(l)}function o(l){return l===s?(e.enter("thematicBreakSequence"),u(l)):r>=3&&(l===null||we(l))?(e.exit("thematicBreak"),t(l)):n(l)}function u(l){return l===s?(e.consume(l),r++,u):(e.exit("thematicBreakSequence"),Oe(l)?je(e,o,"whitespace")(l):o(l))}}const It={continuation:{tokenize:L2},exit:P2,name:"list",tokenize:R2},I2={partial:!0,tokenize:D2},N2={partial:!0,tokenize:M2};function R2(e,t,n){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return o;function o(d){const m=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:wo(d)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(ts,n,l)(d):l(d);if(!r.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(d)}return n(d)}function u(d){return wo(d)&&++a<10?(e.consume(d),u):(!r.interrupt||a<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),l(d)):n(d)}function l(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,e.check(yi,r.interrupt?n:c,e.attempt(I2,h,f))}function c(d){return r.containerState.initialBlankLine=!0,i++,h(d)}function f(d){return Oe(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),h):n(d)}function h(d){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function L2(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(yi,s,i);function s(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,je(e,t,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!Oe(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(N2,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,je(e,e.attempt(It,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function M2(e,t,n){const r=this;return je(e,s,"listItemIndent",r.containerState.size+1);function s(i){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(i):n(i)}}function P2(e){e.exit(this.containerState.type)}function D2(e,t,n){const r=this;return je(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!Oe(i)&&a&&a[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const xc={name:"setextUnderline",resolveTo:O2,tokenize:F2};function O2(e,t){let n=e.length,r,s,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",a,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function F2(e,t,n){const r=this;let s;return i;function i(l){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),s=l,a(l)):n(l)}function a(l){return e.enter("setextHeadingLineSequence"),o(l)}function o(l){return l===s?(e.consume(l),o):(e.exit("setextHeadingLineSequence"),Oe(l)?je(e,u,"lineSuffix")(l):u(l))}function u(l){return l===null||we(l)?(e.exit("setextHeadingLine"),t(l)):n(l)}}const B2={tokenize:j2};function j2(e){const t=this,n=e.attempt(yi,r,e.attempt(this.parser.constructs.flowInitial,s,je(e,e.attempt(this.parser.constructs.flow,s,e.attempt(qy,s)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const H2={resolveAll:sm()},U2=im("string"),z2=im("text");function im(e){return{resolveAll:sm(e==="text"?V2:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],i=n.attempt(s,a,o);return a;function a(c){return l(c)?i(c):o(c)}function o(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),u}function u(c){return l(c)?(n.exit("data"),i(c)):(n.consume(c),u)}function l(c){if(c===null)return!0;const f=s[c];let h=-1;if(f)for(;++h<f.length;){const d=f[h];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function sm(e){return t;function t(n,r){let s=-1,i;for(;++s<=n.length;)i===void 0?n[s]&&n[s][1].type==="data"&&(i=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==i+2&&(n[i][1].end=n[s-1][1].end,n.splice(i+2,s-i-2),s=i+2),i=void 0);return e?e(n,r):n}}function V2(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],s=t.sliceStream(r);let i=s.length,a=-1,o=0,u;for(;i--;){const l=s[i];if(typeof l=="string"){for(a=l.length;l.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(l===-2)u=!0,o++;else if(l!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const l={type:n===e.length||u||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?a:r.start._bufferIndex+a,_index:r.start._index+i,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...l.start},r.start.offset===r.end.offset?Object.assign(r,l):(e.splice(n,0,["enter",l,t],["exit",l,t]),n+=2)}n++}return e}const q2={42:It,43:It,45:It,48:It,49:It,50:It,51:It,52:It,53:It,54:It,55:It,56:It,57:It,62:Qh},$2={91:Ky},W2={[-2]:Ca,[-1]:Ca,32:Ca},Y2={35:t2,42:ts,45:[xc,ts],60:s2,61:xc,95:ts,96:pc,126:pc},G2={38:Jh,92:Zh},K2={[-5]:_a,[-4]:_a,[-3]:_a,33:k2,38:Jh,42:So,60:[Sy,f2],91:S2,92:[Jy,Zh],93:Iu,95:So,96:By},X2={null:[So,H2]},Q2={null:[42,95]},Z2={null:[]},J2=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Q2,contentInitial:$2,disable:Z2,document:q2,flow:Y2,flowInitial:W2,insideSpan:X2,string:G2,text:K2},Symbol.toStringTag,{value:"Module"}));function eE(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 s={},i=[];let a=[],o=[];const u={attempt:_(E),check:_(k),consume:v,enter:T,exit:C,interrupt:_(k,{interrupt:!0})},l={code:null,containerState:{},defineSkip:p,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:d,write:f};let c=t.tokenize.call(l,u);return t.resolveAll&&i.push(t),l;function f(L){return a=jt(a,L),g(),a[a.length-1]!==null?[]:(A(t,0),l.events=Vs(i,l.events,l),l.events)}function h(L,N){return nE(d(L),N)}function d(L){return tE(a,L)}function m(){const{_bufferIndex:L,_index:N,line:j,column:P,offset:D}=r;return{_bufferIndex:L,_index:N,line:j,column:P,offset:D}}function p(L){s[L.line]=L.column,S()}function g(){let L;for(;r._index<a.length;){const N=a[r._index];if(typeof N=="string")for(L=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===L&&r._bufferIndex<N.length;)y(N.charCodeAt(r._bufferIndex));else y(N)}}function y(L){c=c(L)}function v(L){we(L)?(r.line++,r.column=1,r.offset+=L===-3?2:1,S()):L!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=L}function T(L,N){const j=N||{};return j.type=L,j.start=m(),l.events.push(["enter",j,l]),o.push(j),j}function C(L){const N=o.pop();return N.end=m(),l.events.push(["exit",N,l]),N}function E(L,N){A(L,N.from)}function k(L,N){N.restore()}function _(L,N){return j;function j(P,D,H){let z,F,q,R;return Array.isArray(P)?W(P):"tokenize"in P?W([P]):$(P);function $(V){return X;function X(Z){const be=Z!==null&&V[Z],me=Z!==null&&V.null,te=[...Array.isArray(be)?be:be?[be]:[],...Array.isArray(me)?me:me?[me]:[]];return W(te)(Z)}}function W(V){return z=V,F=0,V.length===0?H:M(V[F])}function M(V){return X;function X(Z){return R=I(),q=V,V.partial||(l.currentConstruct=V),V.name&&l.parser.constructs.disable.null.includes(V.name)?oe():V.tokenize.call(N?Object.assign(Object.create(l),N):l,u,ee,oe)(Z)}}function ee(V){return L(q,R),D}function oe(V){return R.restore(),++F<z.length?M(z[F]):H}}}function A(L,N){L.resolveAll&&!i.includes(L)&&i.push(L),L.resolve&&Mt(l.events,N,l.events.length-N,L.resolve(l.events.slice(N),l)),L.resolveTo&&(l.events=L.resolveTo(l.events,l))}function I(){const L=m(),N=l.previous,j=l.currentConstruct,P=l.events.length,D=Array.from(o);return{from:P,restore:H};function H(){r=L,l.previous=N,l.currentConstruct=j,l.events.length=P,o=D,S()}}function S(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function tE(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,i=t.end._bufferIndex;let a;if(n===s)a=[e[n].slice(r,i)];else{if(a=e.slice(n,s),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}i>0&&a.push(e[s].slice(0,i))}return a}function nE(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const i=e[n];let a;if(typeof i=="string")a=i;else switch(i){case-5:{a="\r";break}case-4:{a=`
|
|
414
|
-
`;break}case-3:{a=`\r
|
|
415
|
-
`;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&s)continue;a=" ";break}default:a=String.fromCharCode(i)}s=i===-2,r.push(a)}return r.join("")}function rE(e){const r={constructs:Kh([J2,...(e||{}).extensions||[]]),content:s(by),defined:[],document:s(Ey),flow:s(B2),lazy:{},string:s(U2),text:s(z2)};return r;function s(i){return a;function a(o){return eE(r,i,o)}}}function iE(e){for(;!em(e););return e}const bc=/[\0\t\n\r]/g;function sE(){let e=1,t="",n=!0,r;return s;function s(i,a,o){const u=[];let l,c,f,h,d;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(a||void 0).decode(i)),f=0,t="",n&&(i.charCodeAt(0)===65279&&f++,n=void 0);f<i.length;){if(bc.lastIndex=f,l=bc.exec(i),h=l&&l.index!==void 0?l.index:i.length,d=i.charCodeAt(h),!l){t=i.slice(f);break}if(d===10&&f===h&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),f<h&&(u.push(i.slice(f,h)),e+=h-f),d){case 0:{u.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,u.push(-2);e++<c;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return o&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const aE=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function oE(e){return e.replace(aE,uE)}function uE(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),i=s===120||s===88;return Xh(n.slice(i?2:1),i?16:10)}return _u(n)||e}const am={}.hasOwnProperty;function lE(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),cE(n)(iE(rE(n).document().write(sE()(e,t,!0))))}function cE(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(re),autolinkProtocol:I,autolinkEmail:I,atxHeading:i(Ne),blockQuote:i(me),characterEscape:I,characterReference:I,codeFenced:i(te),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(te,a),codeText:i(ne,a),codeTextData:I,data:I,codeFlowValue:I,definition:i(de),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(ye),hardBreakEscape:i(tt),hardBreakTrailing:i(tt),htmlFlow:i(Ee,a),htmlFlowData:I,htmlText:i(Ee,a),htmlTextData:I,image:i(qe),label:a,link:i(re),listItem:i(Ve),listItemValue:h,listOrdered:i(Ae,f),listUnordered:i(Ae),paragraph:i(Ge),reference:M,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(Ne),strong:i(Xe),thematicBreak:i(He)},exit:{atxHeading:u(),atxHeadingSequence:E,autolink:u(),autolinkEmail:be,autolinkProtocol:Z,blockQuote:u(),characterEscapeValue:S,characterReferenceMarkerHexadecimal:oe,characterReferenceMarkerNumeric:oe,characterReferenceValue:V,characterReference:X,codeFenced:u(g),codeFencedFence:p,codeFencedFenceInfo:d,codeFencedFenceMeta:m,codeFlowValue:S,codeIndented:u(y),codeText:u(D),codeTextData:S,data:S,definition:u(),definitionDestinationString:C,definitionLabelString:v,definitionTitleString:T,emphasis:u(),hardBreakEscape:u(N),hardBreakTrailing:u(N),htmlFlow:u(j),htmlFlowData:S,htmlText:u(P),htmlTextData:S,image:u(z),label:q,labelText:F,lineEnding:L,link:u(H),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ee,resourceDestinationString:R,resourceTitleString:$,resource:W,setextHeading:u(A),setextHeadingLineSequence:_,setextHeadingText:k,strong:u(),thematicBreak:u()}};om(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(K){let se={type:"root",children:[]};const xe={stack:[se],tokenStack:[],config:t,enter:o,exit:l,buffer:a,resume:c,data:n},he=[];let Ce=-1;for(;++Ce<K.length;)if(K[Ce][1].type==="listOrdered"||K[Ce][1].type==="listUnordered")if(K[Ce][0]==="enter")he.push(Ce);else{const _e=he.pop();Ce=s(K,_e,Ce)}for(Ce=-1;++Ce<K.length;){const _e=t[K[Ce][0]];am.call(_e,K[Ce][1].type)&&_e[K[Ce][1].type].call(Object.assign({sliceSerialize:K[Ce][2].sliceSerialize},xe),K[Ce][1])}if(xe.tokenStack.length>0){const _e=xe.tokenStack[xe.tokenStack.length-1];(_e[1]||yc).call(xe,void 0,_e[0])}for(se.position={start:pn(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:pn(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},Ce=-1;++Ce<t.transforms.length;)se=t.transforms[Ce](se)||se;return se}function s(K,se,xe){let he=se-1,Ce=-1,_e=!1,le,Te,Be,Ue;for(;++he<=xe;){const ut=K[he];switch(ut[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ut[0]==="enter"?Ce++:Ce--,Ue=void 0;break}case"lineEndingBlank":{ut[0]==="enter"&&(le&&!Ue&&!Ce&&!Be&&(Be=he),Ue=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ue=void 0}if(!Ce&&ut[0]==="enter"&&ut[1].type==="listItemPrefix"||Ce===-1&&ut[0]==="exit"&&(ut[1].type==="listUnordered"||ut[1].type==="listOrdered")){if(le){let St=he;for(Te=void 0;St--;){const Me=K[St];if(Me[1].type==="lineEnding"||Me[1].type==="lineEndingBlank"){if(Me[0]==="exit")continue;Te&&(K[Te][1].type="lineEndingBlank",_e=!0),Me[1].type="lineEnding",Te=St}else if(!(Me[1].type==="linePrefix"||Me[1].type==="blockQuotePrefix"||Me[1].type==="blockQuotePrefixWhitespace"||Me[1].type==="blockQuoteMarker"||Me[1].type==="listItemIndent"))break}Be&&(!Te||Be<Te)&&(le._spread=!0),le.end=Object.assign({},Te?K[Te][1].start:ut[1].end),K.splice(Te||he,0,["exit",le,ut[2]]),he++,xe++}if(ut[1].type==="listItemPrefix"){const St={type:"listItem",_spread:!1,start:Object.assign({},ut[1].start),end:void 0};le=St,K.splice(he,0,["enter",St,ut[2]]),he++,xe++,Be=void 0,Ue=!0}}}return K[se][1]._spread=_e,xe}function i(K,se){return xe;function xe(he){o.call(this,K(he),he),se&&se.call(this,he)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(K,se,xe){this.stack[this.stack.length-1].children.push(K),this.stack.push(K),this.tokenStack.push([se,xe||void 0]),K.position={start:pn(se.start),end:void 0}}function u(K){return se;function se(xe){K&&K.call(this,xe),l.call(this,xe)}}function l(K,se){const xe=this.stack.pop(),he=this.tokenStack.pop();if(he)he[0].type!==K.type&&(se?se.call(this,K,he[0]):(he[1]||yc).call(this,K,he[0]));else throw new Error("Cannot close `"+K.type+"` ("+Wr({start:K.start,end:K.end})+"): it’s not open");xe.position.end=pn(K.end)}function c(){return Cu(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(K){if(this.data.expectingFirstListItemValue){const se=this.stack[this.stack.length-2];se.start=Number.parseInt(this.sliceSerialize(K),10),this.data.expectingFirstListItemValue=void 0}}function d(){const K=this.resume(),se=this.stack[this.stack.length-1];se.lang=K}function m(){const K=this.resume(),se=this.stack[this.stack.length-1];se.meta=K}function p(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const K=this.resume(),se=this.stack[this.stack.length-1];se.value=K.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const K=this.resume(),se=this.stack[this.stack.length-1];se.value=K.replace(/(\r?\n|\r)$/g,"")}function v(K){const se=this.resume(),xe=this.stack[this.stack.length-1];xe.label=se,xe.identifier=Wt(this.sliceSerialize(K)).toLowerCase()}function T(){const K=this.resume(),se=this.stack[this.stack.length-1];se.title=K}function C(){const K=this.resume(),se=this.stack[this.stack.length-1];se.url=K}function E(K){const se=this.stack[this.stack.length-1];if(!se.depth){const xe=this.sliceSerialize(K).length;se.depth=xe}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function _(K){const se=this.stack[this.stack.length-1];se.depth=this.sliceSerialize(K).codePointAt(0)===61?1:2}function A(){this.data.setextHeadingSlurpLineEnding=void 0}function I(K){const xe=this.stack[this.stack.length-1].children;let he=xe[xe.length-1];(!he||he.type!=="text")&&(he=Le(),he.position={start:pn(K.start),end:void 0},xe.push(he)),this.stack.push(he)}function S(K){const se=this.stack.pop();se.value+=this.sliceSerialize(K),se.position.end=pn(K.end)}function L(K){const se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const xe=se.children[se.children.length-1];xe.position.end=pn(K.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(se.type)&&(I.call(this,K),S.call(this,K))}function N(){this.data.atHardBreak=!0}function j(){const K=this.resume(),se=this.stack[this.stack.length-1];se.value=K}function P(){const K=this.resume(),se=this.stack[this.stack.length-1];se.value=K}function D(){const K=this.resume(),se=this.stack[this.stack.length-1];se.value=K}function H(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=se,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function z(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const se=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=se,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function F(K){const se=this.sliceSerialize(K),xe=this.stack[this.stack.length-2];xe.label=oE(se),xe.identifier=Wt(se).toLowerCase()}function q(){const K=this.stack[this.stack.length-1],se=this.resume(),xe=this.stack[this.stack.length-1];if(this.data.inReference=!0,xe.type==="link"){const he=K.children;xe.children=he}else xe.alt=se}function R(){const K=this.resume(),se=this.stack[this.stack.length-1];se.url=K}function $(){const K=this.resume(),se=this.stack[this.stack.length-1];se.title=K}function W(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function ee(K){const se=this.resume(),xe=this.stack[this.stack.length-1];xe.label=se,xe.identifier=Wt(this.sliceSerialize(K)).toLowerCase(),this.data.referenceType="full"}function oe(K){this.data.characterReferenceType=K.type}function V(K){const se=this.sliceSerialize(K),xe=this.data.characterReferenceType;let he;xe?(he=Xh(se,xe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):he=_u(se);const Ce=this.stack[this.stack.length-1];Ce.value+=he}function X(K){const se=this.stack.pop();se.position.end=pn(K.end)}function Z(K){S.call(this,K);const se=this.stack[this.stack.length-1];se.url=this.sliceSerialize(K)}function be(K){S.call(this,K);const se=this.stack[this.stack.length-1];se.url="mailto:"+this.sliceSerialize(K)}function me(){return{type:"blockquote",children:[]}}function te(){return{type:"code",lang:null,meta:null,value:""}}function ne(){return{type:"inlineCode",value:""}}function de(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ye(){return{type:"emphasis",children:[]}}function Ne(){return{type:"heading",depth:0,children:[]}}function tt(){return{type:"break"}}function Ee(){return{type:"html",value:""}}function qe(){return{type:"image",title:null,url:"",alt:null}}function re(){return{type:"link",title:null,url:"",children:[]}}function Ae(K){return{type:"list",ordered:K.type==="listOrdered",start:null,spread:K._spread,children:[]}}function Ve(K){return{type:"listItem",spread:K._spread,checked:null,children:[]}}function Ge(){return{type:"paragraph",children:[]}}function Xe(){return{type:"strong",children:[]}}function Le(){return{type:"text",value:""}}function He(){return{type:"thematicBreak"}}}function pn(e){return{line:e.line,column:e.column,offset:e.offset}}function om(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?om(e,r):dE(e,r)}}function dE(e,t){let n;for(n in t)if(am.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 yc(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Wr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Wr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Wr({start:t.start,end:t.end})+") is still open")}function fE(e){const t=this;t.parser=n;function n(r){return lE(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function hE(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 mE(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
416
|
-
`}]}function pE(e,t){const n=t.value?t.value+`
|
|
417
|
-
`:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function gE(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function xE(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bE(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Er(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,o+=1,e.footnoteCounts.set(r,o);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,u);const l={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,l),e.applyData(t,l)}function yE(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 EE(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function um(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 s=e.all(t),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function TE(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return um(e,t);const s={src:Er(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,i),e.applyData(t,i)}function vE(e,t){const n={src:Er(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 kE(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 wE(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return um(e,t);const s={href:Er(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function SE(e,t){const n={href:Er(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 AE(e,t,n){const r=e.all(t),s=n?CE(n):lm(t),i={},a=[];if(typeof t.checked=="boolean"){const c=r[0];let f;c&&c.type==="element"&&c.tagName==="p"?f=c:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const c=r[o];(s||o!==0||c.type!=="element"||c.tagName!=="p")&&a.push({type:"text",value:`
|
|
418
|
-
`}),c.type==="element"&&c.tagName==="p"&&!s?a.push(...c.children):a.push(c)}const u=r[r.length-1];u&&(s||u.type!=="element"||u.tagName!=="p")&&a.push({type:"text",value:`
|
|
419
|
-
`});const l={type:"element",tagName:"li",properties:i,children:a};return e.patch(t,l),e.applyData(t,l)}function CE(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=lm(n[r])}return t}function lm(e){const t=e.spread;return t??e.children.length>1}function _E(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<r.length;){const a=r[s];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 i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function IE(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function NE(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function RE(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function LE(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),s.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=an(t.children[1]),u=Us(t.children[t.children.length-1]);o&&u&&(a.position={start:o,end:u}),s.push(a)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,i),e.applyData(t,i)}function ME(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:t.children.length;let u=-1;const l=[];for(;++u<o;){const f=t.children[u],h={},d=a?a[u]:void 0;d&&(h.align=d);let m={type:"element",tagName:i,properties:h,children:[]};f&&(m.children=e.all(f),e.patch(f,m),m=e.applyData(f,m)),l.push(m)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,c),e.applyData(t,c)}function PE(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Ec=9,Tc=32;function DE(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const i=[];for(;r;)i.push(vc(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return i.push(vc(t.slice(s),s>0,!1)),i.join("")}function vc(e,t,n){let r=0,s=e.length;if(t){let i=e.codePointAt(r);for(;i===Ec||i===Tc;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(s-1);for(;i===Ec||i===Tc;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function OE(e,t){const n={type:"text",value:DE(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function FE(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const BE={blockquote:hE,break:mE,code:pE,delete:gE,emphasis:xE,footnoteReference:bE,heading:yE,html:EE,imageReference:TE,image:vE,inlineCode:kE,linkReference:wE,link:SE,listItem:AE,list:_E,paragraph:IE,root:NE,strong:RE,table:LE,tableCell:PE,tableRow:ME,text:OE,thematicBreak:FE,toml:ji,yaml:ji,definition:ji,footnoteDefinition:ji};function ji(){}const cm=-1,qs=0,Gr=1,ys=2,Nu=3,Ru=4,Lu=5,Mu=6,dm=7,fm=8,hm=typeof self=="object"?self:globalThis,kc=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new hm[e](t)},jE=(e,t)=>{const n=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,a]=t[s];switch(i){case qs:case cm:return n(a,s);case Gr:{const o=n([],s);for(const u of a)o.push(r(u));return o}case ys:{const o=n({},s);for(const[u,l]of a)o[r(u)]=r(l);return o}case Nu:return n(new Date(a),s);case Ru:{const{source:o,flags:u}=a;return n(new RegExp(o,u),s)}case Lu:{const o=n(new Map,s);for(const[u,l]of a)o.set(r(u),r(l));return o}case Mu:{const o=n(new Set,s);for(const u of a)o.add(r(u));return o}case dm:{const{name:o,message:u}=a;return n(typeof hm[o]=="function"?kc(o,u):new Error(u),s)}case fm:return n(BigInt(a),s);case"BigInt":return n(Object(BigInt(a)),s);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}}return n(kc(i,a),s)};return r},wc=e=>jE(new Map,e)(0),On="",{toString:HE}={},{keys:UE}=Object,Dr=e=>{const t=typeof e;if(t!=="object"||!e)return[qs,t];const n=HE.call(e).slice(8,-1);switch(n){case"Array":return[Gr,On];case"Object":return[ys,On];case"Date":return[Nu,On];case"RegExp":return[Ru,On];case"Map":return[Lu,On];case"Set":return[Mu,On];case"DataView":return[Gr,n]}return n.includes("Array")?[Gr,n]:e instanceof Error?[dm,e.name||"Error"]:[ys,n]},Hi=([e,t])=>e===qs&&(t==="function"||t==="symbol"),zE=(e,t,n,r)=>{const s=(a,o)=>{const u=r.push(a)-1;return n.set(o,u),u},i=a=>{if(n.has(a))return n.get(a);let[o,u]=Dr(a);switch(o){case qs:{let c=a;switch(u){case"bigint":o=fm,c=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);c=null;break;case"undefined":return s([cm],a)}return s([o,c],a)}case Gr:{if(u){let h=a;return u==="DataView"?h=new Uint8Array(a.buffer):u==="ArrayBuffer"&&(h=new Uint8Array(a)),s([u,[...h]],a)}const c=[],f=s([o,c],a);for(const h of a)c.push(i(h));return f}case ys:{if(u)switch(u){case"BigInt":return s([u,a.toString()],a);case"Boolean":case"Number":case"String":return s([u,a.valueOf()],a)}if(t&&"toJSON"in a)return i(a.toJSON());const c=[],f=s([o,c],a);for(const h of UE(a))(e||!Hi(Dr(a[h])))&&c.push([i(h),i(a[h])]);return f}case Nu:return s([o,isNaN(a.getTime())?On:a.toISOString()],a);case Ru:{const{source:c,flags:f}=a;return s([o,{source:c,flags:f}],a)}case Lu:{const c=[],f=s([o,c],a);for(const[h,d]of a)(e||!(Hi(Dr(h))||Hi(Dr(d))))&&c.push([i(h),i(d)]);return f}case Mu:{const c=[],f=s([o,c],a);for(const h of a)(e||!Hi(Dr(h)))&&c.push(i(h));return f}}const{message:l}=a;return s([o,{name:u,message:l}],a)};return i},Sc=(e,{json:t,lossy:n}={})=>{const r=[];return zE(!(t||n),!!t,new Map,r)(e),r},Kn=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?wc(Sc(e,t)):structuredClone(e):(e,t)=>wc(Sc(e,t));function VE(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 qE(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function $E(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||VE,r=e.options.footnoteBackLabel||qE,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let u=-1;for(;++u<e.footnoteOrder.length;){const l=e.footnoteById.get(e.footnoteOrder[u]);if(!l)continue;const c=e.all(l),f=String(l.identifier).toUpperCase(),h=Er(f.toLowerCase());let d=0;const m=[],p=e.footnoteCounts.get(f);for(;p!==void 0&&++d<=p;){m.length>0&&m.push({type:"text",value:" "});let v=typeof n=="string"?n:n(u,d);typeof v=="string"&&(v={type:"text",value:v}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,d),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const g=c[c.length-1];if(g&&g.type==="element"&&g.tagName==="p"){const v=g.children[g.children.length-1];v&&v.type==="text"?v.value+=" ":g.children.push({type:"text",value:" "}),g.children.push(...m)}else c.push(...m);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(c,!0)};e.patch(l,y),o.push(y)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...Kn(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
420
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
|
|
421
|
-
`}]}}const $s=(function(e){if(e==null)return KE;if(typeof e=="function")return Ws(e);if(typeof e=="object")return Array.isArray(e)?WE(e):YE(e);if(typeof e=="string")return GE(e);throw new Error("Expected function, string, or object as test")});function WE(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=$s(e[n]);return Ws(r);function r(...s){let i=-1;for(;++i<t.length;)if(t[i].apply(this,s))return!0;return!1}}function YE(e){const t=e;return Ws(n);function n(r){const s=r;let i;for(i in e)if(s[i]!==t[i])return!1;return!0}}function GE(e){return Ws(t);function t(n){return n&&n.type===e}}function Ws(e){return t;function t(n,r,s){return!!(XE(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function KE(){return!0}function XE(e){return e!==null&&typeof e=="object"&&"type"in e}const mm=[],QE=!0,Ao=!1,ZE="skip";function pm(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const i=$s(s),a=r?-1:1;o(e,void 0,[])();function o(u,l,c){const f=u&&typeof u=="object"?u:{};if(typeof f.type=="string"){const d=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(u.type+(d?"<"+d+">":""))+")"})}return h;function h(){let d=mm,m,p,g;if((!t||i(u,l,c[c.length-1]||void 0))&&(d=JE(n(u,c)),d[0]===Ao))return d;if("children"in u&&u.children){const y=u;if(y.children&&d[0]!==ZE)for(p=(r?y.children.length:-1)+a,g=c.concat(y);p>-1&&p<y.children.length;){const v=y.children[p];if(m=o(v,p,g)(),m[0]===Ao)return m;p=typeof m[1]=="number"?m[1]:p+a}}return d}}}function JE(e){return Array.isArray(e)?e:typeof e=="number"?[QE,e]:e==null?mm:[e]}function Ys(e,t,n,r){let s,i,a;typeof t=="function"&&typeof n!="function"?(i=void 0,a=t,s=n):(i=t,a=n,s=r),pm(e,i,o,s);function o(u,l){const c=l[l.length-1],f=c?c.children.indexOf(u):void 0;return a(u,f,c)}}const Co={}.hasOwnProperty,eT={};function tT(e,t){const n=t||eT,r=new Map,s=new Map,i=new Map,a={...BE,...n.handlers},o={all:l,applyData:rT,definitionById:r,footnoteById:s,footnoteCounts:i,footnoteOrder:[],handlers:a,one:u,options:n,patch:nT,wrap:sT};return Ys(e,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){const f=c.type==="definition"?r:s,h=String(c.identifier).toUpperCase();f.has(h)||f.set(h,c)}}),o;function u(c,f){const h=c.type,d=o.handlers[h];if(Co.call(o.handlers,h)&&d)return d(o,c,f);if(o.options.passThrough&&o.options.passThrough.includes(h)){if("children"in c){const{children:p,...g}=c,y=Kn(g);return y.children=o.all(c),y}return Kn(c)}return(o.options.unknownHandler||iT)(o,c,f)}function l(c){const f=[];if("children"in c){const h=c.children;let d=-1;for(;++d<h.length;){const m=o.one(h[d],c);if(m){if(d&&h[d-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=Ac(m.value)),!Array.isArray(m)&&m.type==="element")){const p=m.children[0];p&&p.type==="text"&&(p.value=Ac(p.value))}Array.isArray(m)?f.push(...m):f.push(m)}}}return f}}function nT(e,t){e.position&&(t.position=Vh(e))}function rT(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,i=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"&&i&&Object.assign(n.properties,Kn(i)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function iT(e,t){const n=t.data||{},r="value"in t&&!(Co.call(n,"hProperties")||Co.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 sT(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
422
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
423
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
424
|
-
`}),n}function Ac(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Cc(e,t){const n=tT(e,t),r=n.one(e,void 0),s=$E(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:`
|
|
425
|
-
`},s),i}function aT(e,t){return e&&"run"in e?async function(n,r){const s=Cc(n,{file:r,...t});await e.run(s,r)}:function(n,r){return Cc(n,{file:r,...e||t})}}function _c(e){if(e)throw e}var Ia,Ic;function oT(){if(Ic)return Ia;Ic=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(l){return typeof Array.isArray=="function"?Array.isArray(l):t.call(l)==="[object Array]"},i=function(l){if(!l||t.call(l)!=="[object Object]")return!1;var c=e.call(l,"constructor"),f=l.constructor&&l.constructor.prototype&&e.call(l.constructor.prototype,"isPrototypeOf");if(l.constructor&&!c&&!f)return!1;var h;for(h in l);return typeof h>"u"||e.call(l,h)},a=function(l,c){n&&c.name==="__proto__"?n(l,c.name,{enumerable:!0,configurable:!0,value:c.newValue,writable:!0}):l[c.name]=c.newValue},o=function(l,c){if(c==="__proto__")if(e.call(l,c)){if(r)return r(l,c).value}else return;return l[c]};return Ia=function u(){var l,c,f,h,d,m,p=arguments[0],g=1,y=arguments.length,v=!1;for(typeof p=="boolean"&&(v=p,p=arguments[1]||{},g=2),(p==null||typeof p!="object"&&typeof p!="function")&&(p={});g<y;++g)if(l=arguments[g],l!=null)for(c in l)f=o(p,c),h=o(l,c),p!==h&&(v&&h&&(i(h)||(d=s(h)))?(d?(d=!1,m=f&&s(f)?f:[]):m=f&&i(f)?f:{},a(p,{name:c,newValue:u(v,m,h)})):typeof h<"u"&&a(p,{name:c,newValue:h}));return p},Ia}var uT=oT();const Na=mu(uT);function _o(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 lT(){const e=[],t={run:n,use:r};return t;function n(...s){let i=-1;const a=s.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...s);function o(u,...l){const c=e[++i];let f=-1;if(u){a(u);return}for(;++f<s.length;)(l[f]===null||l[f]===void 0)&&(l[f]=s[f]);s=l,c?cT(c,o)(...l):a(null,...l)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function cT(e,t){let n;return r;function r(...a){const o=e.length>a.length;let u;o&&a.push(s);try{u=e.apply(this,a)}catch(l){const c=l;if(o&&n)throw c;return s(c)}o||(u&&u.then&&typeof u.then=="function"?u.then(i,s):u instanceof Error?s(u):i(u))}function s(a,...o){n||(n=!0,t(a,...o))}function i(a){s(null,a)}}const Jt={basename:dT,dirname:fT,extname:hT,join:mT,sep:"/"};function dT(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ei(e);let n=0,r=-1,s=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,o=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){n=s+1;break}}else a<0&&(i=!0,a=s+1),o>-1&&(e.codePointAt(s)===t.codePointAt(o--)?o<0&&(r=s):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function fT(e){if(Ei(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 hT(e){Ei(e);let t=e.length,n=-1,r=0,s=-1,i=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),o===46?s<0?s=t:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||n<0||i===0||i===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function mT(...e){let t=-1,n;for(;++t<e.length;)Ei(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":pT(n)}function pT(e){Ei(e);const t=e.codePointAt(0)===47;let n=gT(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function gT(e,t){let n="",r=0,s=-1,i=0,a=-1,o,u;for(;++a<=e.length;){if(a<e.length)o=e.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(s===a-1||i===1))if(s!==a-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),s=a,i=0;continue}}else if(n.length>0){n="",r=0,s=a,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,a):n=e.slice(s+1,a),r=a-s-1;s=a,i=0}else o===46&&i>-1?i++:i=-1}return n}function Ei(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const xT={cwd:bT};function bT(){return"/"}function Io(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function yT(e){if(typeof e=="string")e=new URL(e);else if(!Io(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 ET(e)}function ET(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 s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const Ra=["history","path","basename","stem","extname","dirname"];class gm{constructor(t){let n;t?Io(t)?n={path:t}:typeof t=="string"||TT(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":xT.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ra.length;){const i=Ra[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let s;for(s in n)Ra.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?Jt.basename(this.path):void 0}set basename(t){Ma(t,"basename"),La(t,"basename"),this.path=Jt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Jt.dirname(this.path):void 0}set dirname(t){Nc(this.basename,"dirname"),this.path=Jt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Jt.extname(this.path):void 0}set extname(t){if(La(t,"extname"),Nc(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=Jt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Io(t)&&(t=yT(t)),Ma(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Jt.basename(this.path,this.extname):void 0}set stem(t){Ma(t,"stem"),La(t,"stem"),this.path=Jt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new Et(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function La(e,t){if(e&&e.includes(Jt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Jt.sep+"`")}function Ma(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Nc(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function TT(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const vT=(function(e){const r=this.constructor.prototype,s=r[e],i=function(){return s.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),kT={}.hasOwnProperty;class Pu extends vT{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=lT()}copy(){const t=new Pu;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Na(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Oa("data",this.frozen),this.namespace[t]=n,this):kT.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Oa("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 s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Ui(t),r=this.parser||this.Parser;return Pa("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Pa("process",this.parser||this.Parser),Da("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(i,a){const o=Ui(t),u=r.parse(o);r.run(u,o,function(c,f,h){if(c||!f||!h)return l(c);const d=f,m=r.stringify(d,h);AT(m)?h.value=m:h.result=m,l(c,h)});function l(c,f){c||!f?a(c):i?i(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),Pa("processSync",this.parser||this.Parser),Da("processSync",this.compiler||this.Compiler),this.process(t,s),Lc("processSync","process",n),r;function s(i,a){n=!0,_c(i),r=a}}run(t,n,r){Rc(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(a,o){const u=Ui(n);s.run(t,u,l);function l(c,f,h){const d=f||t;c?o(c):a?a(d):r(void 0,d,h)}}}runSync(t,n){let r=!1,s;return this.run(t,n,i),Lc("runSync","run",r),s;function i(a,o){_c(a),s=o,r=!0}}stringify(t,n){this.freeze();const r=Ui(n),s=this.compiler||this.Compiler;return Da("stringify",s),Rc(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(Oa("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(l){if(typeof l=="function")u(l,[]);else if(typeof l=="object")if(Array.isArray(l)){const[c,...f]=l;u(c,f)}else a(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function a(l){if(!("plugins"in l)&&!("settings"in l))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");o(l.plugins),l.settings&&(s.settings=Na(!0,s.settings,l.settings))}function o(l){let c=-1;if(l!=null)if(Array.isArray(l))for(;++c<l.length;){const f=l[c];i(f)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function u(l,c){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===l){h=f;break}if(h===-1)r.push([l,...c]);else if(c.length>0){let[d,...m]=c;const p=r[h][1];_o(p)&&_o(d)&&(d=Na(!0,p,d)),r[h]=[l,d,...m]}}}}const wT=new Pu().freeze();function Pa(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Da(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Oa(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 Rc(e){if(!_o(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Lc(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ui(e){return ST(e)?e:new gm(e)}function ST(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function AT(e){return typeof e=="string"||CT(e)}function CT(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const _T="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Mc=[],Pc={allowDangerousHtml:!0},IT=/^(https?|ircs?|mailto|xmpp)$/i,NT=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function xm(e){const t=RT(e),n=LT(e);return MT(t.runSync(t.parse(n),n),e)}function RT(e){const t=e.rehypePlugins||Mc,n=e.remarkPlugins||Mc,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Pc}:Pc;return wT().use(fE).use(n).use(aT,r).use(t)}function LT(e){const t=e.children||"",n=new gm;return typeof t=="string"&&(n.value=t),n}function MT(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,i=t.disallowedElements,a=t.skipHtml,o=t.unwrapDisallowed,u=t.urlTransform||PT;for(const c of NT)Object.hasOwn(t,c.from)&&(""+c.from+(c.to?"use `"+c.to+"` instead":"remove it")+_T+c.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),Ys(e,l),Kb(e,{Fragment:x.Fragment,components:s,ignoreInvalidStyle:!0,jsx:x.jsx,jsxs:x.jsxs,passKeys:!0,passNode:!0});function l(c,f,h){if(c.type==="raw"&&h&&typeof f=="number")return a?h.children.splice(f,1):h.children[f]={type:"text",value:c.value},f;if(c.type==="element"){let d;for(d in Aa)if(Object.hasOwn(Aa,d)&&Object.hasOwn(c.properties,d)){const m=c.properties[d],p=Aa[d];(p===null||p.includes(c.tagName))&&(c.properties[d]=u(String(m||""),d,c))}}if(c.type==="element"){let d=n?!n.includes(c.tagName):i?i.includes(c.tagName):!1;if(!d&&r&&typeof f=="number"&&(d=!r(c,f,h)),d&&h&&typeof f=="number")return o&&c.children?h.children.splice(f,1,...c.children):h.children.splice(f,1),f}}}function PT(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||IT.test(e.slice(0,t))?e:""}function Dc(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}function DT(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function OT(e,t,n){const s=$s((n||{}).ignore||[]),i=FT(t);let a=-1;for(;++a<i.length;)pm(e,"text",o);function o(l,c){let f=-1,h;for(;++f<c.length;){const d=c[f],m=h?h.children:void 0;if(s(d,m?m.indexOf(d):void 0,h))return;h=d}if(h)return u(l,c)}function u(l,c){const f=c[c.length-1],h=i[a][0],d=i[a][1];let m=0;const g=f.children.indexOf(l);let y=!1,v=[];h.lastIndex=0;let T=h.exec(l.value);for(;T;){const C=T.index,E={index:T.index,input:T.input,stack:[...c,l]};let k=d(...T,E);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1?h.lastIndex=C+1:(m!==C&&v.push({type:"text",value:l.value.slice(m,C)}),Array.isArray(k)?v.push(...k):k&&v.push(k),m=C+T[0].length,y=!0),!h.global)break;T=h.exec(l.value)}return y?(m<l.value.length&&v.push({type:"text",value:l.value.slice(m)}),f.children.splice(g,1,...v)):v=[l],g+v.length}}function FT(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 s=n[r];t.push([BT(s[0]),jT(s[1])])}return t}function BT(e){return typeof e=="string"?new RegExp(DT(e),"g"):e}function jT(e){return typeof e=="function"?e:function(){return e}}const Fa="phrasing",Ba=["autolink","link","image","label"];function HT(){return{transforms:[YT],enter:{literalAutolink:zT,literalAutolinkEmail:ja,literalAutolinkHttp:ja,literalAutolinkWww:ja},exit:{literalAutolink:WT,literalAutolinkEmail:$T,literalAutolinkHttp:VT,literalAutolinkWww:qT}}}function UT(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Fa,notInConstruct:Ba},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Fa,notInConstruct:Ba},{character:":",before:"[ps]",after:"\\/",inConstruct:Fa,notInConstruct:Ba}]}}function zT(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ja(e){this.config.enter.autolinkProtocol.call(this,e)}function VT(e){this.config.exit.autolinkProtocol.call(this,e)}function qT(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 $T(e){this.config.exit.autolinkEmail.call(this,e)}function WT(e){this.exit(e)}function YT(e){OT(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,GT],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),KT]],{ignore:["link","linkReference"]})}function GT(e,t,n,r,s){let i="";if(!bm(s)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!XT(n)))return!1;const a=QT(n+r);if(!a[0])return!1;const o={type:"link",title:null,url:i+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[o,{type:"text",value:a[1]}]:o}function KT(e,t,n,r){return!bm(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function XT(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 QT(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 s=Dc(e,"(");let i=Dc(e,")");for(;r!==-1&&s>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}function bm(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Gn(n)||zs(n))&&(!t||n!==47)}ym.peek=av;function ZT(){this.buffer()}function JT(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function ev(){this.buffer()}function tv(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function nv(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Wt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function rv(e){this.exit(e)}function iv(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Wt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function sv(e){this.exit(e)}function av(){return"["}function ym(e,t,n,r){const s=n.createTracker(r);let i=s.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return i+=s.move(n.safe(n.associationId(e),{after:"]",before:i})),o(),a(),i+=s.move("]"),i}function ov(){return{enter:{gfmFootnoteCallString:ZT,gfmFootnoteCall:JT,gfmFootnoteDefinitionLabelString:ev,gfmFootnoteDefinition:tv},exit:{gfmFootnoteCallString:nv,gfmFootnoteCall:rv,gfmFootnoteDefinitionLabelString:iv,gfmFootnoteDefinition:sv}}}function uv(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:ym},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,i,a){const o=i.createTracker(a);let u=o.move("[^");const l=i.enter("footnoteDefinition"),c=i.enter("label");return u+=o.move(i.safe(i.associationId(r),{before:u,after:"]"})),c(),u+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),u+=o.move((t?`
|
|
426
|
-
`:" ")+i.indentLines(i.containerFlow(r,o.current()),t?Em:lv))),l(),u}}function lv(e,t,n){return t===0?e:Em(e,t,n)}function Em(e,t,n){return(n?"":" ")+e}const cv=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Tm.peek=pv;function dv(){return{canContainEols:["delete"],enter:{strikethrough:hv},exit:{strikethrough:mv}}}function fv(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:cv}],handlers:{delete:Tm}}}function hv(e){this.enter({type:"delete",children:[]},e)}function mv(e){this.exit(e)}function Tm(e,t,n,r){const s=n.createTracker(r),i=n.enter("strikethrough");let a=s.move("~~");return a+=n.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),i(),a}function pv(){return"~"}function gv(e){return e.length}function xv(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||gv,i=[],a=[],o=[],u=[];let l=0,c=-1;for(;++c<e.length;){const p=[],g=[];let y=-1;for(e[c].length>l&&(l=e[c].length);++y<e[c].length;){const v=bv(e[c][y]);if(n.alignDelimiters!==!1){const T=s(v);g[y]=T,(u[y]===void 0||T>u[y])&&(u[y]=T)}p.push(v)}a[c]=p,o[c]=g}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<l;)i[f]=Oc(r[f]);else{const p=Oc(r);for(;++f<l;)i[f]=p}f=-1;const h=[],d=[];for(;++f<l;){const p=i[f];let g="",y="";p===99?(g=":",y=":"):p===108?g=":":p===114&&(y=":");let v=n.alignDelimiters===!1?1:Math.max(1,u[f]-g.length-y.length);const T=g+"-".repeat(v)+y;n.alignDelimiters!==!1&&(v=g.length+v+y.length,v>u[f]&&(u[f]=v),d[f]=v),h[f]=T}a.splice(1,0,h),o.splice(1,0,d),c=-1;const m=[];for(;++c<a.length;){const p=a[c],g=o[c];f=-1;const y=[];for(;++f<l;){const v=p[f]||"";let T="",C="";if(n.alignDelimiters!==!1){const E=u[f]-(g[f]||0),k=i[f];k===114?T=" ".repeat(E):k===99?E%2?(T=" ".repeat(E/2+.5),C=" ".repeat(E/2-.5)):(T=" ".repeat(E/2),C=T):C=" ".repeat(E)}n.delimiterStart!==!1&&!f&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||f)&&y.push(" "),n.alignDelimiters!==!1&&y.push(T),y.push(v),n.alignDelimiters!==!1&&y.push(C),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||f!==l-1)&&y.push("|")}m.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return m.join(`
|
|
427
|
-
`)}function bv(e){return e==null?"":String(e)}function Oc(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}const Fc={}.hasOwnProperty;function vm(e,t){const n=t||{};function r(s,...i){let a=r.invalid;const o=r.handlers;if(s&&Fc.call(s,e)){const u=String(s[e]);a=Fc.call(o,u)?o[u]:r.unknown}if(a)return a.call(this,s,...i)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}function yv(e,t,n,r){const s=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const a=n.indentLines(n.containerFlow(e,i.current()),Ev);return s(),a}function Ev(e,t,n){return">"+(n?"":" ")+e}function Tv(e,t){return Bc(e,t.inConstruct,!0)&&!Bc(e,t.notInConstruct,!1)}function Bc(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 jc(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
|
|
428
|
-
`&&Tv(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
429
|
-
`}function vv(e,t){const n=String(e);let r=n.indexOf(t),s=r,i=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++i>a&&(a=i):i=1,s=r+t.length,r=n.indexOf(t,s);return a}function kv(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 wv(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 Sv(e,t,n,r){const s=wv(n),i=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(kv(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(i,Av);return f(),h}const o=n.createTracker(r),u=s.repeat(Math.max(vv(i,s)+1,3)),l=n.enter("codeFenced");let c=o.move(u);if(e.lang){const f=n.enter(`codeFencedLang${a}`);c+=o.move(n.safe(e.lang,{before:c,after:" ",encode:["`"],...o.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${a}`);c+=o.move(" "),c+=o.move(n.safe(e.meta,{before:c,after:`
|
|
430
|
-
`,encode:["`"],...o.current()})),f()}return c+=o.move(`
|
|
431
|
-
`),i&&(c+=o.move(i+`
|
|
432
|
-
`)),c+=o.move(u),l(),c}function Av(e,t,n){return(n?"":" ")+e}function Du(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 Cv(e,t,n,r){const s=Du(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const u=n.createTracker(r);let l=u.move("[");return l+=u.move(n.safe(n.associationId(e),{before:l,after:"]",...u.current()})),l+=u.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(n.safe(e.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(o=n.enter("destinationRaw"),l+=u.move(n.safe(e.url,{before:l,after:e.title?" ":`
|
|
433
|
-
`,...u.current()}))),o(),e.title&&(o=n.enter(`title${i}`),l+=u.move(" "+s),l+=u.move(n.safe(e.title,{before:l,after:s,...u.current()})),l+=u.move(s),o()),a(),l}function _v(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 ci(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Es(e,t,n){const r=pr(e),s=pr(t);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}km.peek=Iv;function km(e,t,n,r){const s=_v(n),i=n.enter("emphasis"),a=n.createTracker(r),o=a.move(s);let u=a.move(n.containerPhrasing(e,{after:s,before:o,...a.current()}));const l=u.charCodeAt(0),c=Es(r.before.charCodeAt(r.before.length-1),l,s);c.inside&&(u=ci(l)+u.slice(1));const f=u.charCodeAt(u.length-1),h=Es(r.after.charCodeAt(0),f,s);h.inside&&(u=u.slice(0,-1)+ci(f));const d=a.move(s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:c.outside},o+u+d}function Iv(e,t,n){return n.options.emphasis||"*"}function Nv(e,t){let n=!1;return Ys(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ao}),!!((!e.depth||e.depth<3)&&Cu(e)&&(t.options.setext||n))}function Rv(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(Nv(e,n)){const c=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...i.current(),before:`
|
|
434
|
-
`,after:`
|
|
435
|
-
`});return f(),c(),h+`
|
|
436
|
-
`+(s===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
437
|
-
`))+1))}const a="#".repeat(s),o=n.enter("headingAtx"),u=n.enter("phrasing");i.move(a+" ");let l=n.containerPhrasing(e,{before:"# ",after:`
|
|
438
|
-
`,...i.current()});return/^[\t ]/.test(l)&&(l=ci(l.charCodeAt(0))+l.slice(1)),l=l?a+" "+l:a,n.options.closeAtx&&(l+=" "+a),u(),o(),l}wm.peek=Lv;function wm(e){return e.value||""}function Lv(){return"<"}Sm.peek=Mv;function Sm(e,t,n,r){const s=Du(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const u=n.createTracker(r);let l=u.move("![");return l+=u.move(n.safe(e.alt,{before:l,after:"]",...u.current()})),l+=u.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(n.safe(e.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(o=n.enter("destinationRaw"),l+=u.move(n.safe(e.url,{before:l,after:e.title?" ":")",...u.current()}))),o(),e.title&&(o=n.enter(`title${i}`),l+=u.move(" "+s),l+=u.move(n.safe(e.title,{before:l,after:s,...u.current()})),l+=u.move(s),o()),l+=u.move(")"),a(),l}function Mv(){return"!"}Am.peek=Pv;function Am(e,t,n,r){const s=e.referenceType,i=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let u=o.move("![");const l=n.safe(e.alt,{before:u,after:"]",...o.current()});u+=o.move(l+"]["),a();const c=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:u,after:"]",...o.current()});return a(),n.stack=c,i(),s==="full"||!l||l!==f?u+=o.move(f+"]"):s==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function Pv(){return"!"}Cm.peek=Dv;function Cm(e,t,n){let r=e.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const a=n.unsafe[i],o=n.compilePattern(a);let u;if(a.atBreak)for(;u=o.exec(r);){let l=u.index;r.charCodeAt(l)===10&&r.charCodeAt(l-1)===13&&l--,r=r.slice(0,l)+" "+r.slice(u.index+1)}}return s+r+s}function Dv(){return"`"}function _m(e,t){const n=Cu(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))}Im.peek=Ov;function Im(e,t,n,r){const s=Du(n),i=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,u;if(_m(e,n)){const c=n.stack;n.stack=[],o=n.enter("autolink");let f=a.move("<");return f+=a.move(n.containerPhrasing(e,{before:f,after:">",...a.current()})),f+=a.move(">"),o(),n.stack=c,f}o=n.enter("link"),u=n.enter("label");let l=a.move("[");return l+=a.move(n.containerPhrasing(e,{before:l,after:"](",...a.current()})),l+=a.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),l+=a.move("<"),l+=a.move(n.safe(e.url,{before:l,after:">",...a.current()})),l+=a.move(">")):(u=n.enter("destinationRaw"),l+=a.move(n.safe(e.url,{before:l,after:e.title?" ":")",...a.current()}))),u(),e.title&&(u=n.enter(`title${i}`),l+=a.move(" "+s),l+=a.move(n.safe(e.title,{before:l,after:s,...a.current()})),l+=a.move(s),u()),l+=a.move(")"),o(),l}function Ov(e,t,n){return _m(e,n)?"<":"["}Nm.peek=Fv;function Nm(e,t,n,r){const s=e.referenceType,i=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let u=o.move("[");const l=n.containerPhrasing(e,{before:u,after:"]",...o.current()});u+=o.move(l+"]["),a();const c=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:u,after:"]",...o.current()});return a(),n.stack=c,i(),s==="full"||!l||l!==f?u+=o.move(f+"]"):s==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function Fv(){return"["}function Ou(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 Bv(e){const t=Ou(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 jv(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 Rm(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 Hv(e,t,n,r){const s=n.enter("list"),i=n.bulletCurrent;let a=e.ordered?jv(n):Ou(n);const o=e.ordered?a==="."?")":".":Bv(n);let u=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const c=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&c&&(!c.children||!c.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&&(u=!0),Rm(n)===a&&c){let f=-1;for(;++f<e.children.length;){const h=e.children[f];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(a=o),n.bulletCurrent=a;const l=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=i,s(),l}function Uv(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 zv(e,t,n,r){const s=Uv(n);let i=n.bulletCurrent||Ou(n);t&&t.type==="list"&&t.ordered&&(i=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let a=i.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(i+" ".repeat(a-i.length)),o.shift(a);const u=n.enter("listItem"),l=n.indentLines(n.containerFlow(e,o.current()),c);return u(),l;function c(f,h,d){return h?(d?"":" ".repeat(a))+f:(d?i:i+" ".repeat(a-i.length))+f}}function Vv(e,t,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(e,r);return i(),s(),a}const qv=$s(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function $v(e,t,n,r){return(e.children.some(function(a){return qv(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Wv(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Lm.peek=Yv;function Lm(e,t,n,r){const s=Wv(n),i=n.enter("strong"),a=n.createTracker(r),o=a.move(s+s);let u=a.move(n.containerPhrasing(e,{after:s,before:o,...a.current()}));const l=u.charCodeAt(0),c=Es(r.before.charCodeAt(r.before.length-1),l,s);c.inside&&(u=ci(l)+u.slice(1));const f=u.charCodeAt(u.length-1),h=Es(r.after.charCodeAt(0),f,s);h.inside&&(u=u.slice(0,-1)+ci(f));const d=a.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:h.outside,before:c.outside},o+u+d}function Yv(e,t,n){return n.options.strong||"*"}function Gv(e,t,n,r){return n.safe(e.value,r)}function Kv(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 Xv(e,t,n){const r=(Rm(n)+(n.options.ruleSpaces?" ":"")).repeat(Kv(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Mm={blockquote:yv,break:jc,code:Sv,definition:Cv,emphasis:km,hardBreak:jc,heading:Rv,html:wm,image:Sm,imageReference:Am,inlineCode:Cm,link:Im,linkReference:Nm,list:Hv,listItem:zv,paragraph:Vv,root:$v,strong:Lm,text:Gv,thematicBreak:Xv};function Qv(){return{enter:{table:Zv,tableData:Hc,tableHeader:Hc,tableRow:ek},exit:{codeText:tk,table:Jv,tableData:Ha,tableHeader:Ha,tableRow:Ha}}}function Zv(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 Jv(e){this.exit(e),this.data.inTable=void 0}function ek(e){this.enter({type:"tableRow",children:[]},e)}function Ha(e){this.exit(e)}function Hc(e){this.enter({type:"tableCell",children:[]},e)}function tk(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,nk));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function nk(e,t){return t==="|"?t:e}function rk(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
439
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:a,tableCell:u,tableRow:o}};function a(d,m,p,g){return l(c(d,p,g),d.align)}function o(d,m,p,g){const y=f(d,p,g),v=l([y]);return v.slice(0,v.indexOf(`
|
|
440
|
-
`))}function u(d,m,p,g){const y=p.enter("tableCell"),v=p.enter("phrasing"),T=p.containerPhrasing(d,{...g,before:i,after:i});return v(),y(),T}function l(d,m){return xv(d,{align:m,alignDelimiters:r,padding:n,stringLength:s})}function c(d,m,p){const g=d.children;let y=-1;const v=[],T=m.enter("table");for(;++y<g.length;)v[y]=f(g[y],m,p);return T(),v}function f(d,m,p){const g=d.children;let y=-1;const v=[],T=m.enter("tableRow");for(;++y<g.length;)v[y]=u(g[y],d,m,p);return T(),v}function h(d,m,p){let g=Mm.inlineCode(d,m,p);return p.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function ik(){return{exit:{taskListCheckValueChecked:Uc,taskListCheckValueUnchecked:Uc,paragraph:ak}}}function sk(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:ok}}}function Uc(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function ak(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 s=t.children;let i=-1,a;for(;++i<s.length;){const o=s[i];if(o.type==="paragraph"){a=o;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 ok(e,t,n,r){const s=e.children[0],i=typeof e.checked=="boolean"&&s&&s.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);i&&o.move(a);let u=Mm.listItem(e,t,n,{...r,...o.current()});return i&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),u;function l(c){return c+a}}function uk(){return[HT(),ov(),dv(),Qv(),ik()]}function lk(e){return{extensions:[UT(),uv(e),fv(),rk(e),sk()]}}const ck={tokenize:gk,partial:!0},Pm={tokenize:xk,partial:!0},Dm={tokenize:bk,partial:!0},Om={tokenize:yk,partial:!0},dk={tokenize:Ek,partial:!0},Fm={name:"wwwAutolink",tokenize:mk,previous:jm},Bm={name:"protocolAutolink",tokenize:pk,previous:Hm},hn={name:"emailAutolink",tokenize:hk,previous:Um},on={};function fk(){return{text:on}}let Rn=48;for(;Rn<123;)on[Rn]=hn,Rn++,Rn===58?Rn=65:Rn===91&&(Rn=97);on[43]=hn;on[45]=hn;on[46]=hn;on[95]=hn;on[72]=[hn,Bm];on[104]=[hn,Bm];on[87]=[hn,Fm];on[119]=[hn,Fm];function hk(e,t,n){const r=this;let s,i;return a;function a(f){return!No(f)||!Um.call(r,r.previous)||Fu(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(f))}function o(f){return No(f)?(e.consume(f),o):f===64?(e.consume(f),u):n(f)}function u(f){return f===46?e.check(dk,c,l)(f):f===45||f===95||yt(f)?(i=!0,e.consume(f),u):c(f)}function l(f){return e.consume(f),s=!0,u}function c(f){return i&&s&&vt(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function mk(e,t,n){const r=this;return s;function s(a){return a!==87&&a!==119||!jm.call(r,r.previous)||Fu(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(ck,e.attempt(Pm,e.attempt(Dm,i),n),n)(a))}function i(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function pk(e,t,n){const r=this;let s="",i=!1;return a;function a(f){return(f===72||f===104)&&Hm.call(r,r.previous)&&!Fu(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(f),e.consume(f),o):n(f)}function o(f){if(vt(f)&&s.length<5)return s+=String.fromCodePoint(f),e.consume(f),o;if(f===58){const h=s.toLowerCase();if(h==="http"||h==="https")return e.consume(f),u}return n(f)}function u(f){return f===47?(e.consume(f),i?l:(i=!0,u)):n(f)}function l(f){return f===null||bs(f)||et(f)||Gn(f)||zs(f)?n(f):e.attempt(Pm,e.attempt(Dm,c),n)(f)}function c(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function gk(e,t,n){let r=0;return s;function s(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),s):a===46&&r===3?(e.consume(a),i):n(a)}function i(a){return a===null?n(a):t(a)}}function xk(e,t,n){let r,s,i;return a;function a(l){return l===46||l===95?e.check(Om,u,o)(l):l===null||et(l)||Gn(l)||l!==45&&zs(l)?u(l):(i=!0,e.consume(l),a)}function o(l){return l===95?r=!0:(s=r,r=void 0),e.consume(l),a}function u(l){return s||r||!i?n(l):t(l)}}function bk(e,t){let n=0,r=0;return s;function s(a){return a===40?(n++,e.consume(a),s):a===41&&r<n?i(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(Om,t,i)(a):a===null||et(a)||Gn(a)?t(a):(e.consume(a),s)}function i(a){return a===41&&r++,e.consume(a),s}}function yk(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),i):o===93?(e.consume(o),s):o===60||o===null||et(o)||Gn(o)?t(o):n(o)}function s(o){return o===null||o===40||o===91||et(o)||Gn(o)?t(o):r(o)}function i(o){return vt(o)?a(o):n(o)}function a(o){return o===59?(e.consume(o),r):vt(o)?(e.consume(o),a):n(o)}}function Ek(e,t,n){return r;function r(i){return e.consume(i),s}function s(i){return yt(i)?n(i):t(i)}}function jm(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||et(e)}function Hm(e){return!vt(e)}function Um(e){return!(e===47||No(e))}function No(e){return e===43||e===45||e===46||e===95||yt(e)}function Fu(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}const Tk={tokenize:Ik,partial:!0};function vk(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Ak,continuation:{tokenize:Ck},exit:_k}},text:{91:{name:"gfmFootnoteCall",tokenize:Sk},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:kk,resolveTo:wk}}}}function kk(e,t,n){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const u=r.events[s][1];if(u.type==="labelImage"){a=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return o;function o(u){if(!a||!a._balanced)return n(u);const l=Wt(r.sliceSerialize({start:a.end,end:r.now()}));return l.codePointAt(0)!==94||!i.includes(l.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function wk(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)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function Sk(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return o;function o(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),u}function u(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(f){if(i>999||f===93&&!a||f===null||f===91||et(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return s.includes(Wt(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return et(f)||(a=!0),i++,e.consume(f),f===92?c:l}function c(f){return f===91||f===92||f===93?(e.consume(f),i++,l):l(f)}}function Ak(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,o;return u;function u(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(m)}function c(m){if(a>999||m===93&&!o||m===null||m===91||et(m))return n(m);if(m===93){e.exit("chunkString");const p=e.exit("gfmFootnoteDefinitionLabelString");return i=Wt(r.sliceSerialize(p)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return et(m)||(o=!0),a++,e.consume(m),m===92?f:c}function f(m){return m===91||m===92||m===93?(e.consume(m),a++,c):c(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),s.includes(i)||s.push(i),je(e,d,"gfmFootnoteDefinitionWhitespace")):n(m)}function d(m){return t(m)}}function Ck(e,t,n){return e.check(yi,t,e.attempt(Tk,t,n))}function _k(e){e.exit("gfmFootnoteDefinition")}function Ik(e,t,n){const r=this;return je(e,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(i):n(i)}}function Nk(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,o){let u=-1;for(;++u<a.length;)if(a[u][0]==="enter"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._close){let l=u;for(;l--;)if(a[l][0]==="exit"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._open&&a[u][1].end.offset-a[u][1].start.offset===a[l][1].end.offset-a[l][1].start.offset){a[u][1].type="strikethroughSequence",a[l][1].type="strikethroughSequence";const c={type:"strikethrough",start:Object.assign({},a[l][1].start),end:Object.assign({},a[u][1].end)},f={type:"strikethroughText",start:Object.assign({},a[l][1].end),end:Object.assign({},a[u][1].start)},h=[["enter",c,o],["enter",a[l][1],o],["exit",a[l][1],o],["enter",f,o]],d=o.parser.constructs.insideSpan.null;d&&Mt(h,h.length,0,Vs(d,a.slice(l+1,u),o)),Mt(h,h.length,0,[["exit",f,o],["enter",a[u][1],o],["exit",a[u][1],o],["exit",c,o]]),Mt(a,l-1,u-l+3,h),u=l+h.length-2;break}}for(u=-1;++u<a.length;)a[u][1].type==="strikethroughSequenceTemporary"&&(a[u][1].type="data");return a}function i(a,o,u){const l=this.previous,c=this.events;let f=0;return h;function h(m){return l===126&&c[c.length-1][1].type!=="characterEscape"?u(m):(a.enter("strikethroughSequenceTemporary"),d(m))}function d(m){const p=pr(l);if(m===126)return f>1?u(m):(a.consume(m),f++,d);if(f<2&&!n)return u(m);const g=a.exit("strikethroughSequenceTemporary"),y=pr(m);return g._open=!y||y===2&&!!p,g._close=!p||p===2&&!!y,o(m)}}}class Rk{constructor(){this.map=[]}add(t,n,r){Lk(this,t,n,r)}consume(t){if(this.map.sort(function(i,a){return i[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 s=r.pop();for(;s;){for(const i of s)t.push(i);s=r.pop()}this.map.length=0}}function Lk(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...r);return}s+=1}e.map.push([t,n,r])}}function Mk(e,t){let n=!1;const r=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function Pk(){return{flow:{null:{name:"table",tokenize:Dk,resolveAll:Ok}}}}function Dk(e,t,n){const r=this;let s=0,i=0,a;return o;function o(S){let L=r.events.length-1;for(;L>-1;){const P=r.events[L][1].type;if(P==="lineEnding"||P==="linePrefix")L--;else break}const N=L>-1?r.events[L][1].type:null,j=N==="tableHead"||N==="tableRow"?k:u;return j===k&&r.parser.lazy[r.now().line]?n(S):j(S)}function u(S){return e.enter("tableHead"),e.enter("tableRow"),l(S)}function l(S){return S===124||(a=!0,i+=1),c(S)}function c(S){return S===null?n(S):we(S)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),d):n(S):Oe(S)?je(e,c,"whitespace")(S):(i+=1,a&&(a=!1,s+=1),S===124?(e.enter("tableCellDivider"),e.consume(S),e.exit("tableCellDivider"),a=!0,c):(e.enter("data"),f(S)))}function f(S){return S===null||S===124||et(S)?(e.exit("data"),c(S)):(e.consume(S),S===92?h:f)}function h(S){return S===92||S===124?(e.consume(S),f):f(S)}function d(S){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(S):(e.enter("tableDelimiterRow"),a=!1,Oe(S)?je(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):m(S))}function m(S){return S===45||S===58?g(S):S===124?(a=!0,e.enter("tableCellDivider"),e.consume(S),e.exit("tableCellDivider"),p):E(S)}function p(S){return Oe(S)?je(e,g,"whitespace")(S):g(S)}function g(S){return S===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(S),e.exit("tableDelimiterMarker"),y):S===45?(i+=1,y(S)):S===null||we(S)?C(S):E(S)}function y(S){return S===45?(e.enter("tableDelimiterFiller"),v(S)):E(S)}function v(S){return S===45?(e.consume(S),v):S===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(S),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(S))}function T(S){return Oe(S)?je(e,C,"whitespace")(S):C(S)}function C(S){return S===124?m(S):S===null||we(S)?!a||s!==i?E(S):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(S)):E(S)}function E(S){return n(S)}function k(S){return e.enter("tableRow"),_(S)}function _(S){return S===124?(e.enter("tableCellDivider"),e.consume(S),e.exit("tableCellDivider"),_):S===null||we(S)?(e.exit("tableRow"),t(S)):Oe(S)?je(e,_,"whitespace")(S):(e.enter("data"),A(S))}function A(S){return S===null||S===124||et(S)?(e.exit("data"),_(S)):(e.consume(S),S===92?I:A)}function I(S){return S===92||S===124?(e.consume(S),A):A(S)}}function Ok(e,t){let n=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],o=!1,u=0,l,c,f;const h=new Rk;for(;++n<e.length;){const d=e[n],m=d[1];d[0]==="enter"?m.type==="tableHead"?(o=!1,u!==0&&(zc(h,t,u,l,c),c=void 0,u=0),l={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",l,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,f=void 0,i=[0,0,0,0],a=[0,n+1,0,0],o&&(o=!1,c={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",c,t]])),s=m.type==="tableDelimiterRow"?2:c?3:1):s&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(i[1]!==0&&(a[0]=a[1],f=zi(h,t,i,s,void 0,f),i=[0,0,0,0]),a[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(a[0]=a[1],f=zi(h,t,i,s,void 0,f)),i=a,a=[i[1],n,0,0])):m.type==="tableHead"?(o=!0,u=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(u=n,i[1]!==0?(a[0]=a[1],f=zi(h,t,i,s,n,f)):a[1]!==0&&(f=zi(h,t,a,s,n,f)),s=0):s&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(a[3]=n)}for(u!==0&&zc(h,t,u,l,c),h.consume(t.events),n=-1;++n<t.events.length;){const d=t.events[n];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=Mk(t.events,n))}return e}function zi(e,t,n,r,s,i){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(i.end=Object.assign({},ar(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const u=ar(t.events,n[1]);if(i={type:a,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",i,t]]),n[2]!==0){const l=ar(t.events,n[2]),c=ar(t.events,n[3]),f={type:o,start:Object.assign({},l),end:Object.assign({},c)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const h=t.events[n[2]],d=t.events[n[3]];if(h[1].end=Object.assign({},d[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,p=n[3]-n[2]-1;e.add(m,p,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return s!==void 0&&(i.end=Object.assign({},ar(t.events,s)),e.add(s,0,[["exit",i,t]]),i=void 0),i}function zc(e,t,n,r,s){const i=[],a=ar(t.events,n);s&&(s.end=Object.assign({},a),i.push(["exit",s,t])),r.end=Object.assign({},a),i.push(["exit",r,t]),e.add(n+1,0,i)}function ar(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Fk={name:"tasklistCheck",tokenize:jk};function Bk(){return{text:{91:Fk}}}function jk(e,t,n){const r=this;return s;function s(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),i)}function i(u){return et(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),a):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),a):n(u)}function a(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(u)}function o(u){return we(u)?t(u):Oe(u)?e.check({tokenize:Hk},t,n)(u):n(u)}}function Hk(e,t,n){return je(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function Uk(e){return Kh([fk(),vk(),Nk(e),Pk(),Bk()])}const zk={};function zm(e){const t=this,n=e||zk,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(Uk(n)),i.push(uk()),a.push(lk(n))}const Vc=/[#.]/g;function Vk(e,t){const n=e||"",r={};let s=0,i,a;for(;s<n.length;){Vc.lastIndex=s;const o=Vc.exec(n),u=n.slice(s,o?o.index:n.length);u&&(i?i==="#"?r.id=u:Array.isArray(r.className)?r.className.push(u):r.className=[u]:a=u,s+=u.length),o&&(i=o[0],s++)}return{type:"element",tagName:a||t||"div",properties:r,children:[]}}function Vm(e,t,n){const r=n?Yk(n):void 0;function s(i,a,...o){let u;if(i==null){u={type:"root",children:[]};const l=a;o.unshift(l)}else{u=Vk(i,t);const l=u.tagName.toLowerCase(),c=r?r.get(l):void 0;if(u.tagName=c||l,qk(a))o.unshift(a);else for(const[f,h]of Object.entries(a))$k(e,u.properties,f,h)}for(const l of o)Ro(u.children,l);return u.type==="element"&&u.tagName==="template"&&(u.content={type:"root",children:u.children},u.children=[]),u}return s}function qk(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 s=t[r];if(s&&typeof s=="object"){if(!Array.isArray(s))return!0;const i=s;for(const a of i)if(typeof a!="number"&&typeof a!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function $k(e,t,n,r){const s=Hs(e,n);let i;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;i=r}else typeof r=="boolean"?i=r:typeof r=="string"?s.spaceSeparated?i=nc(r):s.commaSeparated?i=Ql(r):s.commaOrSpaceSeparated?i=nc(Ql(r).join(" ")):i=qc(s,s.property,r):Array.isArray(r)?i=[...r]:i=s.property==="style"?Wk(r):String(r);if(Array.isArray(i)){const a=[];for(const o of i)a.push(qc(s,s.property,o));i=a}s.property==="className"&&Array.isArray(t.className)&&(i=t.className.concat(i)),t[s.property]=i}}function Ro(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)Ro(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?Ro(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function qc(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||ui(n)===ui(t)))return!0}return n}function Wk(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function Yk(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const Gk=["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"],Kk=Vm(bi,"div"),Xk=Vm(An,"g",Gk);function Qk(e){const t=String(e),n=[];return{toOffset:s,toPoint:r};function r(i){if(typeof i=="number"&&i>-1&&i<=t.length){let a=0;for(;;){let o=n[a];if(o===void 0){const u=$c(t,n[a-1]);o=u===-1?t.length+1:u+1,n[a]=o}if(o>i)return{line:a+1,column:i-(a>0?n[a-1]:0)+1,offset:i};a++}}}function s(i){if(i&&typeof i.line=="number"&&typeof i.column=="number"&&!Number.isNaN(i.line)&&!Number.isNaN(i.column)){for(;n.length<i.line;){const o=n[n.length-1],u=$c(t,o),l=u===-1?t.length+1:u+1;if(o===l)break;n.push(l)}const a=(i.line>1?n[i.line-2]:0)+i.column-1;if(a<n[i.line-1])return a}}}function $c(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
|
|
441
|
-
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const Bn={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/"},qm={}.hasOwnProperty,Zk=Object.prototype;function Jk(e,t){const n=t||{};return Bu({file:n.file||void 0,location:!1,schema:n.space==="svg"?An:bi,verbose:n.verbose||!1},e)}function Bu(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},ns(e,r,n),n}case"#document":case"#document-fragment":{const r=t,s="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:$m(e,t.childNodes),data:{quirksMode:s}},e.file&&e.location){const i=String(e.file),a=Qk(i),o=a.toPoint(0),u=a.toPoint(i.length);n.position={start:o,end:u}}return n}case"#documentType":{const r=t;return n={type:"doctype"},ns(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},ns(e,r,n),n}default:return n=ew(e,t),n}}function $m(e,t){let n=-1;const r=[];for(;++n<t.length;){const s=Bu(e,t[n]);r.push(s)}return r}function ew(e,t){const n=e.schema;e.schema=t.namespaceURI===Bn.svg?An:bi;let r=-1;const s={};for(;++r<t.attrs.length;){const o=t.attrs[r],u=(o.prefix?o.prefix+":":"")+o.name;qm.call(Zk,u)||(s[u]=o.value)}const a=(e.schema.space==="svg"?Xk:Kk)(t.tagName,s,$m(e,t.childNodes));if(ns(e,t,a),a.tagName==="template"){const o=t,u=o.sourceCodeLocation,l=u&&u.startTag&&ur(u.startTag),c=u&&u.endTag&&ur(u.endTag),f=Bu(e,o.content);l&&c&&e.file&&(f.position={start:l.end,end:c.start}),a.content=f}return e.schema=n,a}function ns(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=tw(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function tw(e,t,n){const r=ur(n);if(t.type==="element"){const s=t.children[t.children.length-1];if(r&&!n.endTag&&s&&s.position&&s.position.end&&(r.end=Object.assign({},s.position.end)),e.verbose){const i={};let a;if(n.attrs)for(a in n.attrs)qm.call(n.attrs,a)&&(i[Hs(e.schema,a).property]=ur(n.attrs[a]));n.startTag;const o=ur(n.startTag),u=n.endTag?ur(n.endTag):void 0,l={opening:o};u&&(l.closing=u),l.properties=i,t.data={position:l}}}return r}function ur(e){const t=Wc({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=Wc({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function Wc(e){return e.line&&e.column?e:void 0}const nw={},rw={}.hasOwnProperty,Wm=vm("type",{handlers:{root:sw,element:cw,text:uw,comment:lw,doctype:ow}});function iw(e,t){const r=(t||nw).space;return Wm(e,r==="svg"?An:bi)}function sw(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=ju(e.children,n,t),Tr(e,n),n}function aw(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=ju(e.children,n,t),Tr(e,n),n}function ow(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Tr(e,t),t}function uw(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Tr(e,t),t}function lw(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Tr(e,t),t}function cw(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=An);const s=[];let i;if(e.properties){for(i in e.properties)if(i!=="children"&&rw.call(e.properties,i)){const u=dw(r,i,e.properties[i]);u&&s.push(u)}}const a=r.space,o={nodeName:e.tagName,tagName:e.tagName,attrs:s,namespaceURI:Bn[a],childNodes:[],parentNode:null};return o.childNodes=ju(e.children,o,r),Tr(e,o),e.tagName==="template"&&e.content&&(o.content=aw(e.content,r)),o}function dw(e,t,n){const r=Hs(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?Mh(n):Uh(n));const s={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const i=s.name.indexOf(":");i<0?s.prefix="":(s.name=s.name.slice(i+1),s.prefix=r.attribute.slice(0,i)),s.namespace=Bn[r.space]}return s}function ju(e,t,n){let r=-1;const s=[];if(e)for(;++r<e.length;){const i=Wm(e[r],n);i.parentNode=t,s.push(i)}return s}function Tr(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 fw=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],hw=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]),rt="�";var O;(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"})(O||(O={}));const _t={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function Ym(e){return e>=55296&&e<=57343}function mw(e){return e>=56320&&e<=57343}function pw(e,t){return(e-55296)*1024+9216+t}function Gm(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function Km(e){return e>=64976&&e<=65007||hw.has(e)}var Q;(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"})(Q||(Q={}));const gw=65536;class xw{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=gw,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:s,offset:i}=this,a=s+n,o=i+n;return{code:t,startLine:r,endLine:r,startCol:a,endCol:a,startOffset:o,endOffset:o}}_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(mw(n))return this.pos++,this._addGap(),pw(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,O.EOF;return this._err(Q.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,O.EOF;const r=this.html.charCodeAt(n);return r===O.CARRIAGE_RETURN?O.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,O.EOF;let t=this.html.charCodeAt(this.pos);return t===O.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,O.LINE_FEED):t===O.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Ym(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===O.LINE_FEED||t===O.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){Gm(t)?this._err(Q.controlCharacterInInputStream):Km(t)&&this._err(Q.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var De;(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"})(De||(De={}));function Xm(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 bw=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))),yw=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 Ew(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=yw.get(e))!==null&&t!==void 0?t:e}var pt;(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"})(pt||(pt={}));const Tw=32;var En;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(En||(En={}));function Lo(e){return e>=pt.ZERO&&e<=pt.NINE}function vw(e){return e>=pt.UPPER_A&&e<=pt.UPPER_F||e>=pt.LOWER_A&&e<=pt.LOWER_F}function kw(e){return e>=pt.UPPER_A&&e<=pt.UPPER_Z||e>=pt.LOWER_A&&e<=pt.LOWER_Z||Lo(e)}function ww(e){return e===pt.EQUALS||kw(e)}var mt;(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"})(mt||(mt={}));var fn;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(fn||(fn={}));class Sw{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=mt.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=fn.Strict}startEntity(t){this.decodeMode=t,this.state=mt.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case mt.EntityStart:return t.charCodeAt(n)===pt.NUM?(this.state=mt.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=mt.NamedEntity,this.stateNamedEntity(t,n));case mt.NumericStart:return this.stateNumericStart(t,n);case mt.NumericDecimal:return this.stateNumericDecimal(t,n);case mt.NumericHex:return this.stateNumericHex(t,n);case mt.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|Tw)===pt.LOWER_X?(this.state=mt.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=mt.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,s){if(n!==r){const i=r-n;this.result=this.result*Math.pow(s,i)+Number.parseInt(t.substr(n,i),s),this.consumed+=i}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const s=t.charCodeAt(n);if(Lo(s)||vw(s))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const s=t.charCodeAt(n);if(Lo(s))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(s,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===pt.SEMI)this.consumed+=1;else if(this.decodeMode===fn.Strict)return 0;return this.emitCodePoint(Ew(this.result),this.consumed),this.errors&&(t!==pt.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let s=r[this.treeIndex],i=(s&En.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const a=t.charCodeAt(n);if(this.treeIndex=Aw(r,s,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===fn.Attribute&&(i===0||ww(a))?0:this.emitNotTerminatedNamedEntity();if(s=r[this.treeIndex],i=(s&En.VALUE_LENGTH)>>14,i!==0){if(a===pt.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==fn.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,s=(r[n]&En.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,s,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:s}=this;return this.emitCodePoint(n===1?s[t]&~En.VALUE_LENGTH:s[t+1],r),n===3&&this.emitCodePoint(s[t+2],r),r}end(){var t;switch(this.state){case mt.NamedEntity:return this.result!==0&&(this.decodeMode!==fn.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case mt.NumericDecimal:return this.emitNumericEntity(0,2);case mt.NumericHex:return this.emitNumericEntity(0,3);case mt.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case mt.EntityStart:return 0}}}function Aw(e,t,n,r){const s=(t&En.BRANCH_LENGTH)>>7,i=t&En.JUMP_TABLE;if(s===0)return i!==0&&r===i?n:-1;if(i){const u=r-i;return u<0||u>=s?-1:e[n+u]-1}let a=n,o=a+s-1;for(;a<=o;){const u=a+o>>>1,l=e[u];if(l<r)a=u+1;else if(l>r)o=u-1;else return e[u+s]}return-1}var ie;(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/"})(ie||(ie={}));var qn;(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"})(qn||(qn={}));var Ht;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Ht||(Ht={}));var G;(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"})(G||(G={}));var b;(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"})(b||(b={}));const Cw=new Map([[G.A,b.A],[G.ADDRESS,b.ADDRESS],[G.ANNOTATION_XML,b.ANNOTATION_XML],[G.APPLET,b.APPLET],[G.AREA,b.AREA],[G.ARTICLE,b.ARTICLE],[G.ASIDE,b.ASIDE],[G.B,b.B],[G.BASE,b.BASE],[G.BASEFONT,b.BASEFONT],[G.BGSOUND,b.BGSOUND],[G.BIG,b.BIG],[G.BLOCKQUOTE,b.BLOCKQUOTE],[G.BODY,b.BODY],[G.BR,b.BR],[G.BUTTON,b.BUTTON],[G.CAPTION,b.CAPTION],[G.CENTER,b.CENTER],[G.CODE,b.CODE],[G.COL,b.COL],[G.COLGROUP,b.COLGROUP],[G.DD,b.DD],[G.DESC,b.DESC],[G.DETAILS,b.DETAILS],[G.DIALOG,b.DIALOG],[G.DIR,b.DIR],[G.DIV,b.DIV],[G.DL,b.DL],[G.DT,b.DT],[G.EM,b.EM],[G.EMBED,b.EMBED],[G.FIELDSET,b.FIELDSET],[G.FIGCAPTION,b.FIGCAPTION],[G.FIGURE,b.FIGURE],[G.FONT,b.FONT],[G.FOOTER,b.FOOTER],[G.FOREIGN_OBJECT,b.FOREIGN_OBJECT],[G.FORM,b.FORM],[G.FRAME,b.FRAME],[G.FRAMESET,b.FRAMESET],[G.H1,b.H1],[G.H2,b.H2],[G.H3,b.H3],[G.H4,b.H4],[G.H5,b.H5],[G.H6,b.H6],[G.HEAD,b.HEAD],[G.HEADER,b.HEADER],[G.HGROUP,b.HGROUP],[G.HR,b.HR],[G.HTML,b.HTML],[G.I,b.I],[G.IMG,b.IMG],[G.IMAGE,b.IMAGE],[G.INPUT,b.INPUT],[G.IFRAME,b.IFRAME],[G.KEYGEN,b.KEYGEN],[G.LABEL,b.LABEL],[G.LI,b.LI],[G.LINK,b.LINK],[G.LISTING,b.LISTING],[G.MAIN,b.MAIN],[G.MALIGNMARK,b.MALIGNMARK],[G.MARQUEE,b.MARQUEE],[G.MATH,b.MATH],[G.MENU,b.MENU],[G.META,b.META],[G.MGLYPH,b.MGLYPH],[G.MI,b.MI],[G.MO,b.MO],[G.MN,b.MN],[G.MS,b.MS],[G.MTEXT,b.MTEXT],[G.NAV,b.NAV],[G.NOBR,b.NOBR],[G.NOFRAMES,b.NOFRAMES],[G.NOEMBED,b.NOEMBED],[G.NOSCRIPT,b.NOSCRIPT],[G.OBJECT,b.OBJECT],[G.OL,b.OL],[G.OPTGROUP,b.OPTGROUP],[G.OPTION,b.OPTION],[G.P,b.P],[G.PARAM,b.PARAM],[G.PLAINTEXT,b.PLAINTEXT],[G.PRE,b.PRE],[G.RB,b.RB],[G.RP,b.RP],[G.RT,b.RT],[G.RTC,b.RTC],[G.RUBY,b.RUBY],[G.S,b.S],[G.SCRIPT,b.SCRIPT],[G.SEARCH,b.SEARCH],[G.SECTION,b.SECTION],[G.SELECT,b.SELECT],[G.SOURCE,b.SOURCE],[G.SMALL,b.SMALL],[G.SPAN,b.SPAN],[G.STRIKE,b.STRIKE],[G.STRONG,b.STRONG],[G.STYLE,b.STYLE],[G.SUB,b.SUB],[G.SUMMARY,b.SUMMARY],[G.SUP,b.SUP],[G.TABLE,b.TABLE],[G.TBODY,b.TBODY],[G.TEMPLATE,b.TEMPLATE],[G.TEXTAREA,b.TEXTAREA],[G.TFOOT,b.TFOOT],[G.TD,b.TD],[G.TH,b.TH],[G.THEAD,b.THEAD],[G.TITLE,b.TITLE],[G.TR,b.TR],[G.TRACK,b.TRACK],[G.TT,b.TT],[G.U,b.U],[G.UL,b.UL],[G.SVG,b.SVG],[G.VAR,b.VAR],[G.WBR,b.WBR],[G.XMP,b.XMP]]);function vr(e){var t;return(t=Cw.get(e))!==null&&t!==void 0?t:b.UNKNOWN}const ae=b,_w={[ie.HTML]:new Set([ae.ADDRESS,ae.APPLET,ae.AREA,ae.ARTICLE,ae.ASIDE,ae.BASE,ae.BASEFONT,ae.BGSOUND,ae.BLOCKQUOTE,ae.BODY,ae.BR,ae.BUTTON,ae.CAPTION,ae.CENTER,ae.COL,ae.COLGROUP,ae.DD,ae.DETAILS,ae.DIR,ae.DIV,ae.DL,ae.DT,ae.EMBED,ae.FIELDSET,ae.FIGCAPTION,ae.FIGURE,ae.FOOTER,ae.FORM,ae.FRAME,ae.FRAMESET,ae.H1,ae.H2,ae.H3,ae.H4,ae.H5,ae.H6,ae.HEAD,ae.HEADER,ae.HGROUP,ae.HR,ae.HTML,ae.IFRAME,ae.IMG,ae.INPUT,ae.LI,ae.LINK,ae.LISTING,ae.MAIN,ae.MARQUEE,ae.MENU,ae.META,ae.NAV,ae.NOEMBED,ae.NOFRAMES,ae.NOSCRIPT,ae.OBJECT,ae.OL,ae.P,ae.PARAM,ae.PLAINTEXT,ae.PRE,ae.SCRIPT,ae.SECTION,ae.SELECT,ae.SOURCE,ae.STYLE,ae.SUMMARY,ae.TABLE,ae.TBODY,ae.TD,ae.TEMPLATE,ae.TEXTAREA,ae.TFOOT,ae.TH,ae.THEAD,ae.TITLE,ae.TR,ae.TRACK,ae.UL,ae.WBR,ae.XMP]),[ie.MATHML]:new Set([ae.MI,ae.MO,ae.MN,ae.MS,ae.MTEXT,ae.ANNOTATION_XML]),[ie.SVG]:new Set([ae.TITLE,ae.FOREIGN_OBJECT,ae.DESC]),[ie.XLINK]:new Set,[ie.XML]:new Set,[ie.XMLNS]:new Set},Mo=new Set([ae.H1,ae.H2,ae.H3,ae.H4,ae.H5,ae.H6]);G.STYLE,G.SCRIPT,G.XMP,G.IFRAME,G.NOEMBED,G.NOFRAMES,G.PLAINTEXT;var B;(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"})(B||(B={}));const ot={DATA:B.DATA,RCDATA:B.RCDATA,RAWTEXT:B.RAWTEXT,SCRIPT_DATA:B.SCRIPT_DATA,PLAINTEXT:B.PLAINTEXT,CDATA_SECTION:B.CDATA_SECTION};function Iw(e){return e>=O.DIGIT_0&&e<=O.DIGIT_9}function Vr(e){return e>=O.LATIN_CAPITAL_A&&e<=O.LATIN_CAPITAL_Z}function Nw(e){return e>=O.LATIN_SMALL_A&&e<=O.LATIN_SMALL_Z}function gn(e){return Nw(e)||Vr(e)}function Yc(e){return gn(e)||Iw(e)}function Vi(e){return e+32}function Qm(e){return e===O.SPACE||e===O.LINE_FEED||e===O.TABULATION||e===O.FORM_FEED}function Gc(e){return Qm(e)||e===O.SOLIDUS||e===O.GREATER_THAN_SIGN}function Rw(e){return e===O.NULL?Q.nullCharacterReference:e>1114111?Q.characterReferenceOutsideUnicodeRange:Ym(e)?Q.surrogateCharacterReference:Km(e)?Q.noncharacterCharacterReference:Gm(e)||e===O.CARRIAGE_RETURN?Q.controlCharacterReference:null}class Lw{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=B.DATA,this.returnState=B.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new xw(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Sw(bw,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(Q.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(Q.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=Rw(r);s&&this._err(s,1)}}:void 0)}_err(t,n=0){var r,s;(s=(r=this.handler).onParseError)===null||s===void 0||s.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==null||t())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r==null||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:De.START_TAG,tagName:"",tagID:b.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:De.END_TAG,tagName:"",tagID:b.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:De.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:De.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(Xm(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const s=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);s[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(Q.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=vr(t.tagName),t.type===De.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(Q.endTagWithAttributes),t.selfClosing&&this._err(Q.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 De.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case De.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case De.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:De.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=Qm(t)?De.WHITESPACE_CHARACTER:t===O.NULL?De.NULL_CHARACTER:De.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(De.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=B.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?fn.Attribute:fn.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===B.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===B.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===B.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case B.DATA:{this._stateData(t);break}case B.RCDATA:{this._stateRcdata(t);break}case B.RAWTEXT:{this._stateRawtext(t);break}case B.SCRIPT_DATA:{this._stateScriptData(t);break}case B.PLAINTEXT:{this._statePlaintext(t);break}case B.TAG_OPEN:{this._stateTagOpen(t);break}case B.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case B.TAG_NAME:{this._stateTagName(t);break}case B.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case B.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case B.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case B.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case B.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case B.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case B.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case B.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case B.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case B.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case B.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case B.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case B.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case B.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case B.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case B.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case B.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case B.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case B.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case B.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case B.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case B.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case B.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case B.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case B.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case B.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case B.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case B.BOGUS_COMMENT:{this._stateBogusComment(t);break}case B.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case B.COMMENT_START:{this._stateCommentStart(t);break}case B.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case B.COMMENT:{this._stateComment(t);break}case B.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case B.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case B.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case B.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case B.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case B.COMMENT_END:{this._stateCommentEnd(t);break}case B.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case B.DOCTYPE:{this._stateDoctype(t);break}case B.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case B.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case B.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case B.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case B.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case B.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case B.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case B.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case B.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case B.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case B.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case B.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case B.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case B.CDATA_SECTION:{this._stateCdataSection(t);break}case B.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case B.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case B.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case B.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case O.LESS_THAN_SIGN:{this.state=B.TAG_OPEN;break}case O.AMPERSAND:{this._startCharacterReference();break}case O.NULL:{this._err(Q.unexpectedNullCharacter),this._emitCodePoint(t);break}case O.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case O.AMPERSAND:{this._startCharacterReference();break}case O.LESS_THAN_SIGN:{this.state=B.RCDATA_LESS_THAN_SIGN;break}case O.NULL:{this._err(Q.unexpectedNullCharacter),this._emitChars(rt);break}case O.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case O.LESS_THAN_SIGN:{this.state=B.RAWTEXT_LESS_THAN_SIGN;break}case O.NULL:{this._err(Q.unexpectedNullCharacter),this._emitChars(rt);break}case O.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case O.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_LESS_THAN_SIGN;break}case O.NULL:{this._err(Q.unexpectedNullCharacter),this._emitChars(rt);break}case O.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case O.NULL:{this._err(Q.unexpectedNullCharacter),this._emitChars(rt);break}case O.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(gn(t))this._createStartTagToken(),this.state=B.TAG_NAME,this._stateTagName(t);else switch(t){case O.EXCLAMATION_MARK:{this.state=B.MARKUP_DECLARATION_OPEN;break}case O.SOLIDUS:{this.state=B.END_TAG_OPEN;break}case O.QUESTION_MARK:{this._err(Q.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=B.BOGUS_COMMENT,this._stateBogusComment(t);break}case O.EOF:{this._err(Q.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(Q.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=B.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(gn(t))this._createEndTagToken(),this.state=B.TAG_NAME,this._stateTagName(t);else switch(t){case O.GREATER_THAN_SIGN:{this._err(Q.missingEndTagName),this.state=B.DATA;break}case O.EOF:{this._err(Q.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(Q.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=B.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case O.SPACE:case O.LINE_FEED:case O.TABULATION:case O.FORM_FEED:{this.state=B.BEFORE_ATTRIBUTE_NAME;break}case O.SOLIDUS:{this.state=B.SELF_CLOSING_START_TAG;break}case O.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentTagToken();break}case O.NULL:{this._err(Q.unexpectedNullCharacter),n.tagName+=rt;break}case O.EOF:{this._err(Q.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Vr(t)?Vi(t):t)}}_stateRcdataLessThanSign(t){t===O.SOLIDUS?this.state=B.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=B.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){gn(t)?(this.state=B.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=B.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 O.SPACE:case O.LINE_FEED:case O.TABULATION:case O.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=B.BEFORE_ATTRIBUTE_NAME,!1;case O.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=B.SELF_CLOSING_START_TAG,!1;case O.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=B.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=B.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===O.SOLIDUS?this.state=B.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=B.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){gn(t)?(this.state=B.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=B.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=B.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case O.SOLIDUS:{this.state=B.SCRIPT_DATA_END_TAG_OPEN;break}case O.EXCLAMATION_MARK:{this.state=B.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=B.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){gn(t)?(this.state=B.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=B.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=B.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===O.HYPHEN_MINUS?(this.state=B.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=B.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===O.HYPHEN_MINUS?(this.state=B.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=B.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case O.HYPHEN_MINUS:{this.state=B.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case O.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case O.NULL:{this._err(Q.unexpectedNullCharacter),this._emitChars(rt);break}case O.EOF:{this._err(Q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case O.HYPHEN_MINUS:{this.state=B.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case O.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case O.NULL:{this._err(Q.unexpectedNullCharacter),this.state=B.SCRIPT_DATA_ESCAPED,this._emitChars(rt);break}case O.EOF:{this._err(Q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=B.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case O.HYPHEN_MINUS:{this._emitChars("-");break}case O.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case O.GREATER_THAN_SIGN:{this.state=B.SCRIPT_DATA,this._emitChars(">");break}case O.NULL:{this._err(Q.unexpectedNullCharacter),this.state=B.SCRIPT_DATA_ESCAPED,this._emitChars(rt);break}case O.EOF:{this._err(Q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=B.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===O.SOLIDUS?this.state=B.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:gn(t)?(this._emitChars("<"),this.state=B.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=B.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){gn(t)?(this.state=B.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=B.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=B.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(_t.SCRIPT,!1)&&Gc(this.preprocessor.peek(_t.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<_t.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=B.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case O.HYPHEN_MINUS:{this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case O.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case O.NULL:{this._err(Q.unexpectedNullCharacter),this._emitChars(rt);break}case O.EOF:{this._err(Q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case O.HYPHEN_MINUS:{this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case O.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case O.NULL:{this._err(Q.unexpectedNullCharacter),this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(rt);break}case O.EOF:{this._err(Q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case O.HYPHEN_MINUS:{this._emitChars("-");break}case O.LESS_THAN_SIGN:{this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case O.GREATER_THAN_SIGN:{this.state=B.SCRIPT_DATA,this._emitChars(">");break}case O.NULL:{this._err(Q.unexpectedNullCharacter),this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(rt);break}case O.EOF:{this._err(Q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===O.SOLIDUS?(this.state=B.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(_t.SCRIPT,!1)&&Gc(this.preprocessor.peek(_t.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<_t.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=B.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=B.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case O.SPACE:case O.LINE_FEED:case O.TABULATION:case O.FORM_FEED:break;case O.SOLIDUS:case O.GREATER_THAN_SIGN:case O.EOF:{this.state=B.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case O.EQUALS_SIGN:{this._err(Q.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=B.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=B.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case O.SPACE:case O.LINE_FEED:case O.TABULATION:case O.FORM_FEED:case O.SOLIDUS:case O.GREATER_THAN_SIGN:case O.EOF:{this._leaveAttrName(),this.state=B.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case O.EQUALS_SIGN:{this._leaveAttrName(),this.state=B.BEFORE_ATTRIBUTE_VALUE;break}case O.QUOTATION_MARK:case O.APOSTROPHE:case O.LESS_THAN_SIGN:{this._err(Q.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case O.NULL:{this._err(Q.unexpectedNullCharacter),this.currentAttr.name+=rt;break}default:this.currentAttr.name+=String.fromCodePoint(Vr(t)?Vi(t):t)}}_stateAfterAttributeName(t){switch(t){case O.SPACE:case O.LINE_FEED:case O.TABULATION:case O.FORM_FEED:break;case O.SOLIDUS:{this.state=B.SELF_CLOSING_START_TAG;break}case O.EQUALS_SIGN:{this.state=B.BEFORE_ATTRIBUTE_VALUE;break}case O.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentTagToken();break}case O.EOF:{this._err(Q.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=B.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case O.SPACE:case O.LINE_FEED:case O.TABULATION:case O.FORM_FEED:break;case O.QUOTATION_MARK:{this.state=B.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case O.APOSTROPHE:{this.state=B.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case O.GREATER_THAN_SIGN:{this._err(Q.missingAttributeValue),this.state=B.DATA,this.emitCurrentTagToken();break}default:this.state=B.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case O.QUOTATION_MARK:{this.state=B.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case O.AMPERSAND:{this._startCharacterReference();break}case O.NULL:{this._err(Q.unexpectedNullCharacter),this.currentAttr.value+=rt;break}case O.EOF:{this._err(Q.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case O.APOSTROPHE:{this.state=B.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case O.AMPERSAND:{this._startCharacterReference();break}case O.NULL:{this._err(Q.unexpectedNullCharacter),this.currentAttr.value+=rt;break}case O.EOF:{this._err(Q.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case O.SPACE:case O.LINE_FEED:case O.TABULATION:case O.FORM_FEED:{this._leaveAttrValue(),this.state=B.BEFORE_ATTRIBUTE_NAME;break}case O.AMPERSAND:{this._startCharacterReference();break}case O.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=B.DATA,this.emitCurrentTagToken();break}case O.NULL:{this._err(Q.unexpectedNullCharacter),this.currentAttr.value+=rt;break}case O.QUOTATION_MARK:case O.APOSTROPHE:case O.LESS_THAN_SIGN:case O.EQUALS_SIGN:case O.GRAVE_ACCENT:{this._err(Q.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case O.EOF:{this._err(Q.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case O.SPACE:case O.LINE_FEED:case O.TABULATION:case O.FORM_FEED:{this._leaveAttrValue(),this.state=B.BEFORE_ATTRIBUTE_NAME;break}case O.SOLIDUS:{this._leaveAttrValue(),this.state=B.SELF_CLOSING_START_TAG;break}case O.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=B.DATA,this.emitCurrentTagToken();break}case O.EOF:{this._err(Q.eofInTag),this._emitEOFToken();break}default:this._err(Q.missingWhitespaceBetweenAttributes),this.state=B.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case O.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=B.DATA,this.emitCurrentTagToken();break}case O.EOF:{this._err(Q.eofInTag),this._emitEOFToken();break}default:this._err(Q.unexpectedSolidusInTag),this.state=B.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case O.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentComment(n);break}case O.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case O.NULL:{this._err(Q.unexpectedNullCharacter),n.data+=rt;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(_t.DASH_DASH,!0)?(this._createCommentToken(_t.DASH_DASH.length+1),this.state=B.COMMENT_START):this._consumeSequenceIfMatch(_t.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(_t.DOCTYPE.length+1),this.state=B.DOCTYPE):this._consumeSequenceIfMatch(_t.CDATA_START,!0)?this.inForeignNode?this.state=B.CDATA_SECTION:(this._err(Q.cdataInHtmlContent),this._createCommentToken(_t.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=B.BOGUS_COMMENT):this._ensureHibernation()||(this._err(Q.incorrectlyOpenedComment),this._createCommentToken(2),this.state=B.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case O.HYPHEN_MINUS:{this.state=B.COMMENT_START_DASH;break}case O.GREATER_THAN_SIGN:{this._err(Q.abruptClosingOfEmptyComment),this.state=B.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=B.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case O.HYPHEN_MINUS:{this.state=B.COMMENT_END;break}case O.GREATER_THAN_SIGN:{this._err(Q.abruptClosingOfEmptyComment),this.state=B.DATA,this.emitCurrentComment(n);break}case O.EOF:{this._err(Q.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=B.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case O.HYPHEN_MINUS:{this.state=B.COMMENT_END_DASH;break}case O.LESS_THAN_SIGN:{n.data+="<",this.state=B.COMMENT_LESS_THAN_SIGN;break}case O.NULL:{this._err(Q.unexpectedNullCharacter),n.data+=rt;break}case O.EOF:{this._err(Q.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case O.EXCLAMATION_MARK:{n.data+="!",this.state=B.COMMENT_LESS_THAN_SIGN_BANG;break}case O.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=B.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===O.HYPHEN_MINUS?this.state=B.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=B.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===O.HYPHEN_MINUS?this.state=B.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=B.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==O.GREATER_THAN_SIGN&&t!==O.EOF&&this._err(Q.nestedComment),this.state=B.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case O.HYPHEN_MINUS:{this.state=B.COMMENT_END;break}case O.EOF:{this._err(Q.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=B.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case O.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentComment(n);break}case O.EXCLAMATION_MARK:{this.state=B.COMMENT_END_BANG;break}case O.HYPHEN_MINUS:{n.data+="-";break}case O.EOF:{this._err(Q.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=B.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case O.HYPHEN_MINUS:{n.data+="--!",this.state=B.COMMENT_END_DASH;break}case O.GREATER_THAN_SIGN:{this._err(Q.incorrectlyClosedComment),this.state=B.DATA,this.emitCurrentComment(n);break}case O.EOF:{this._err(Q.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=B.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case O.SPACE:case O.LINE_FEED:case O.TABULATION:case O.FORM_FEED:{this.state=B.BEFORE_DOCTYPE_NAME;break}case O.GREATER_THAN_SIGN:{this.state=B.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case O.EOF:{this._err(Q.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Q.missingWhitespaceBeforeDoctypeName),this.state=B.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Vr(t))this._createDoctypeToken(String.fromCharCode(Vi(t))),this.state=B.DOCTYPE_NAME;else switch(t){case O.SPACE:case O.LINE_FEED:case O.TABULATION:case O.FORM_FEED:break;case O.NULL:{this._err(Q.unexpectedNullCharacter),this._createDoctypeToken(rt),this.state=B.DOCTYPE_NAME;break}case O.GREATER_THAN_SIGN:{this._err(Q.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case O.EOF:{this._err(Q.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=B.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case O.SPACE:case O.LINE_FEED:case O.TABULATION:case O.FORM_FEED:{this.state=B.AFTER_DOCTYPE_NAME;break}case O.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentDoctype(n);break}case O.NULL:{this._err(Q.unexpectedNullCharacter),n.name+=rt;break}case O.EOF:{this._err(Q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Vr(t)?Vi(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case O.SPACE:case O.LINE_FEED:case O.TABULATION:case O.FORM_FEED:break;case O.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentDoctype(n);break}case O.EOF:{this._err(Q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(_t.PUBLIC,!1)?this.state=B.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(_t.SYSTEM,!1)?this.state=B.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(Q.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case O.SPACE:case O.LINE_FEED:case O.TABULATION:case O.FORM_FEED:{this.state=B.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case O.QUOTATION_MARK:{this._err(Q.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=B.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case O.APOSTROPHE:{this._err(Q.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=B.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case O.GREATER_THAN_SIGN:{this._err(Q.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=B.DATA,this.emitCurrentDoctype(n);break}case O.EOF:{this._err(Q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Q.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case O.SPACE:case O.LINE_FEED:case O.TABULATION:case O.FORM_FEED:break;case O.QUOTATION_MARK:{n.publicId="",this.state=B.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case O.APOSTROPHE:{n.publicId="",this.state=B.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case O.GREATER_THAN_SIGN:{this._err(Q.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=B.DATA,this.emitCurrentDoctype(n);break}case O.EOF:{this._err(Q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Q.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case O.QUOTATION_MARK:{this.state=B.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case O.NULL:{this._err(Q.unexpectedNullCharacter),n.publicId+=rt;break}case O.GREATER_THAN_SIGN:{this._err(Q.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case O.EOF:{this._err(Q.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 O.APOSTROPHE:{this.state=B.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case O.NULL:{this._err(Q.unexpectedNullCharacter),n.publicId+=rt;break}case O.GREATER_THAN_SIGN:{this._err(Q.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case O.EOF:{this._err(Q.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 O.SPACE:case O.LINE_FEED:case O.TABULATION:case O.FORM_FEED:{this.state=B.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case O.GREATER_THAN_SIGN:{this.state=B.DATA,this.emitCurrentDoctype(n);break}case O.QUOTATION_MARK:{this._err(Q.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case O.APOSTROPHE:{this._err(Q.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case O.EOF:{this._err(Q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Q.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case O.SPACE:case O.LINE_FEED:case O.TABULATION:case O.FORM_FEED:break;case O.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=B.DATA;break}case O.QUOTATION_MARK:{n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case O.APOSTROPHE:{n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case O.EOF:{this._err(Q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Q.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case O.SPACE:case O.LINE_FEED:case O.TABULATION:case O.FORM_FEED:{this.state=B.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case O.QUOTATION_MARK:{this._err(Q.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case O.APOSTROPHE:{this._err(Q.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case O.GREATER_THAN_SIGN:{this._err(Q.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.DATA,this.emitCurrentDoctype(n);break}case O.EOF:{this._err(Q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Q.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case O.SPACE:case O.LINE_FEED:case O.TABULATION:case O.FORM_FEED:break;case O.QUOTATION_MARK:{n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case O.APOSTROPHE:{n.systemId="",this.state=B.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case O.GREATER_THAN_SIGN:{this._err(Q.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.DATA,this.emitCurrentDoctype(n);break}case O.EOF:{this._err(Q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Q.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case O.QUOTATION_MARK:{this.state=B.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case O.NULL:{this._err(Q.unexpectedNullCharacter),n.systemId+=rt;break}case O.GREATER_THAN_SIGN:{this._err(Q.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case O.EOF:{this._err(Q.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 O.APOSTROPHE:{this.state=B.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case O.NULL:{this._err(Q.unexpectedNullCharacter),n.systemId+=rt;break}case O.GREATER_THAN_SIGN:{this._err(Q.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=B.DATA;break}case O.EOF:{this._err(Q.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 O.SPACE:case O.LINE_FEED:case O.TABULATION:case O.FORM_FEED:break;case O.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=B.DATA;break}case O.EOF:{this._err(Q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(Q.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=B.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case O.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=B.DATA;break}case O.NULL:{this._err(Q.unexpectedNullCharacter);break}case O.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case O.RIGHT_SQUARE_BRACKET:{this.state=B.CDATA_SECTION_BRACKET;break}case O.EOF:{this._err(Q.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===O.RIGHT_SQUARE_BRACKET?this.state=B.CDATA_SECTION_END:(this._emitChars("]"),this.state=B.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case O.GREATER_THAN_SIGN:{this.state=B.DATA;break}case O.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=B.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(O.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Yc(this.preprocessor.peek(1))?B.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){Yc(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===O.SEMICOLON&&this._err(Q.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const Zm=new Set([b.DD,b.DT,b.LI,b.OPTGROUP,b.OPTION,b.P,b.RB,b.RP,b.RT,b.RTC]),Kc=new Set([...Zm,b.CAPTION,b.COLGROUP,b.TBODY,b.TD,b.TFOOT,b.TH,b.THEAD,b.TR]),Ts=new Set([b.APPLET,b.CAPTION,b.HTML,b.MARQUEE,b.OBJECT,b.TABLE,b.TD,b.TEMPLATE,b.TH]),Mw=new Set([...Ts,b.OL,b.UL]),Pw=new Set([...Ts,b.BUTTON]),Xc=new Set([b.ANNOTATION_XML,b.MI,b.MN,b.MO,b.MS,b.MTEXT]),Qc=new Set([b.DESC,b.FOREIGN_OBJECT,b.TITLE]),Dw=new Set([b.TR,b.TEMPLATE,b.HTML]),Ow=new Set([b.TBODY,b.TFOOT,b.THEAD,b.TEMPLATE,b.HTML]),Fw=new Set([b.TABLE,b.TEMPLATE,b.HTML]),Bw=new Set([b.TD,b.TH]);class jw{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=b.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===b.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===ie.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 s=this._indexOf(t)+1;this.items.splice(s,0,n),this.tagIDs.splice(s,0,r),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===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])!==ie.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(Mo,ie.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Bw,ie.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(Fw,ie.HTML)}clearBackToTableBodyContext(){this.clearBackTo(Ow,ie.HTML)}clearBackToTableRowContext(){this.clearBackTo(Dw,ie.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]===b.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]===b.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const s=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case ie.HTML:{if(s===t)return!0;if(n.has(s))return!1;break}case ie.SVG:{if(Qc.has(s))return!1;break}case ie.MATHML:{if(Xc.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Ts)}hasInListItemScope(t){return this.hasInDynamicScope(t,Mw)}hasInButtonScope(t){return this.hasInDynamicScope(t,Pw)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case ie.HTML:{if(Mo.has(n))return!0;if(Ts.has(n))return!1;break}case ie.SVG:{if(Qc.has(n))return!1;break}case ie.MATHML:{if(Xc.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ie.HTML)switch(this.tagIDs[n]){case t:return!0;case b.TABLE:case b.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===ie.HTML)switch(this.tagIDs[t]){case b.TBODY:case b.THEAD:case b.TFOOT:return!0;case b.TABLE:case b.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ie.HTML)switch(this.tagIDs[n]){case t:return!0;case b.OPTION:case b.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Zm.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Kc.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&Kc.has(this.currentTagId);)this.pop()}}const Ua=3;var tn;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(tn||(tn={}));const Zc={type:tn.Marker};class Hw{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],s=n.length,i=this.treeAdapter.getTagName(t),a=this.treeAdapter.getNamespaceURI(t);for(let o=0;o<this.entries.length;o++){const u=this.entries[o];if(u.type===tn.Marker)break;const{element:l}=u;if(this.treeAdapter.getTagName(l)===i&&this.treeAdapter.getNamespaceURI(l)===a){const c=this.treeAdapter.getAttrList(l);c.length===s&&r.push({idx:o,attrs:c})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<Ua)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<Ua)return;const s=new Map(n.map(a=>[a.name,a.value]));let i=0;for(let a=0;a<r.length;a++){const o=r[a];o.attrs.every(u=>s.get(u.name)===u.value)&&(i+=1,i>=Ua&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(Zc)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:tn.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:tn.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(Zc);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===tn.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===tn.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===tn.Element&&n.element===t)}}const xn={createDocument(){return{nodeName:"#document",mode:Ht.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 s=e.childNodes.find(i=>i.nodeName==="#documentType");if(s)s.name=t,s.publicId=n,s.systemId=r;else{const i={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};xn.appendChild(e,i)}},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(xn.isTextNode(n)){n.value+=t;return}}xn.appendChild(e,xn.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&xn.isTextNode(r)?r.value+=t:xn.insertBefore(e,xn.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}}},Jm="html",Uw="about:legacy-compat",zw="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",ep=["+//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//"],Vw=[...ep,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],qw=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),tp=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],$w=[...tp,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Jc(e,t){return t.some(n=>e.startsWith(n))}function Ww(e){return e.name===Jm&&e.publicId===null&&(e.systemId===null||e.systemId===Uw)}function Yw(e){if(e.name!==Jm)return Ht.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===zw)return Ht.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),qw.has(n))return Ht.QUIRKS;let r=t===null?Vw:ep;if(Jc(n,r))return Ht.QUIRKS;if(r=t===null?tp:$w,Jc(n,r))return Ht.LIMITED_QUIRKS}return Ht.NO_QUIRKS}const ed={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},Gw="definitionurl",Kw="definitionURL",Xw=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])),Qw=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:ie.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:ie.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:ie.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:ie.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:ie.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:ie.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:ie.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:ie.XML}],["xml:space",{prefix:"xml",name:"space",namespace:ie.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:ie.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:ie.XMLNS}]]),Zw=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])),Jw=new Set([b.B,b.BIG,b.BLOCKQUOTE,b.BODY,b.BR,b.CENTER,b.CODE,b.DD,b.DIV,b.DL,b.DT,b.EM,b.EMBED,b.H1,b.H2,b.H3,b.H4,b.H5,b.H6,b.HEAD,b.HR,b.I,b.IMG,b.LI,b.LISTING,b.MENU,b.META,b.NOBR,b.OL,b.P,b.PRE,b.RUBY,b.S,b.SMALL,b.SPAN,b.STRONG,b.STRIKE,b.SUB,b.SUP,b.TABLE,b.TT,b.U,b.UL,b.VAR]);function eS(e){const t=e.tagID;return t===b.FONT&&e.attrs.some(({name:r})=>r===qn.COLOR||r===qn.SIZE||r===qn.FACE)||Jw.has(t)}function np(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===Gw){e.attrs[t].name=Kw;break}}function rp(e){for(let t=0;t<e.attrs.length;t++){const n=Xw.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function Hu(e){for(let t=0;t<e.attrs.length;t++){const n=Qw.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 tS(e){const t=Zw.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=vr(e.tagName))}function nS(e,t){return t===ie.MATHML&&(e===b.MI||e===b.MO||e===b.MN||e===b.MS||e===b.MTEXT)}function rS(e,t,n){if(t===ie.MATHML&&e===b.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===qn.ENCODING){const s=n[r].value.toLowerCase();return s===ed.TEXT_HTML||s===ed.APPLICATION_XML}}return t===ie.SVG&&(e===b.FOREIGN_OBJECT||e===b.DESC||e===b.TITLE)}function iS(e,t,n,r){return(!r||r===ie.HTML)&&rS(e,t,n)||(!r||r===ie.MATHML)&&nS(e,t)}const sS="hidden",aS=8,oS=3;var U;(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"})(U||(U={}));const uS={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},ip=new Set([b.TABLE,b.TBODY,b.TFOOT,b.THEAD,b.TR]),td={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:xn,onParseError:null};class nd{constructor(t,n,r=null,s=null){this.fragmentContext=r,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=U.INITIAL,this.originalInsertionMode=U.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={...td,...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 Lw(this.options,this),this.activeFormattingElements=new Hw(this.treeAdapter),this.fragmentContextID=r?vr(this.treeAdapter.getTagName(r)):b.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new jw(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={...td,...n};t??(t=r.treeAdapter.createElement(G.TEMPLATE,ie.HTML,[]));const s=r.treeAdapter.createElement("documentmock",ie.HTML,[]),i=new this(r,s,t);return i.fragmentContextID===b.TEMPLATE&&i.tmplInsertionModeStack.unshift(U.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var s;if(!this.onParseError)return;const i=(s=t.location)!==null&&s!==void 0?s:uS,a={code:n,startLine:i.startLine,startCol:i.startCol,startOffset:i.startOffset,endLine:r?i.startLine:i.endLine,endCol:r?i.startCol:i.endCol,endOffset:r?i.startOffset:i.endOffset};this.onParseError(a)}onItemPush(t,n,r){var s,i;(i=(s=this.treeAdapter).onItemPush)===null||i===void 0||i.call(s,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(s=(r=this.treeAdapter).onItemPop)===null||s===void 0||s.call(r,t,this.openElements.current),n){let i,a;this.openElements.stackTop===0&&this.fragmentContext?(i=this.fragmentContext,a=this.fragmentContextID):{current:i,currentTagId:a}=this.openElements,this._setContextModes(i,a)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===ie.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,ie.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=U.TEXT}switchToPlaintextParsing(){this.insertionMode=U.TEXT,this.originalInsertionMode=U.IN_BODY,this.tokenizer.state=ot.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)===G.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==ie.HTML))switch(this.fragmentContextID){case b.TITLE:case b.TEXTAREA:{this.tokenizer.state=ot.RCDATA;break}case b.STYLE:case b.XMP:case b.IFRAME:case b.NOEMBED:case b.NOFRAMES:case b.NOSCRIPT:{this.tokenizer.state=ot.RAWTEXT;break}case b.SCRIPT:{this.tokenizer.state=ot.SCRIPT_DATA;break}case b.PLAINTEXT:{this.tokenizer.state=ot.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",s=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,s),t.location){const a=this.treeAdapter.getChildNodes(this.document).find(o=>this.treeAdapter.isDocumentTypeNode(o));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,ie.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,ie.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(G.HTML,ie.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,b.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 s=this.treeAdapter.getChildNodes(n),i=r?s.lastIndexOf(r):s.length,a=s[i-1];if(this.treeAdapter.getNodeSourceCodeLocation(a)){const{endLine:u,endCol:l,endOffset:c}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:u,endCol:l,endOffset:c})}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,s=this.treeAdapter.getTagName(t),i=n.type===De.END_TAG&&s===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,i)}}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===b.SVG&&this.treeAdapter.getTagName(n)===G.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===ie.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===b.MGLYPH||t.tagID===b.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,ie.HTML)}_processToken(t){switch(t.type){case De.CHARACTER:{this.onCharacter(t);break}case De.NULL_CHARACTER:{this.onNullCharacter(t);break}case De.COMMENT:{this.onComment(t);break}case De.DOCTYPE:{this.onDoctype(t);break}case De.START_TAG:{this._processStartTag(t);break}case De.END_TAG:{this.onEndTag(t);break}case De.EOF:{this.onEof(t);break}case De.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const s=this.treeAdapter.getNamespaceURI(n),i=this.treeAdapter.getAttrList(n);return iS(t,s,i,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===tn.Marker||this.openElements.contains(s.element)),r=n===-1?t-1:n-1;for(let s=r;s>=0;s--){const i=this.activeFormattingElements.entries[s];this._insertElement(i.token,this.treeAdapter.getNamespaceURI(i.element)),i.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=U.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(b.P),this.openElements.popUntilTagNamePopped(b.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case b.TR:{this.insertionMode=U.IN_ROW;return}case b.TBODY:case b.THEAD:case b.TFOOT:{this.insertionMode=U.IN_TABLE_BODY;return}case b.CAPTION:{this.insertionMode=U.IN_CAPTION;return}case b.COLGROUP:{this.insertionMode=U.IN_COLUMN_GROUP;return}case b.TABLE:{this.insertionMode=U.IN_TABLE;return}case b.BODY:{this.insertionMode=U.IN_BODY;return}case b.FRAMESET:{this.insertionMode=U.IN_FRAMESET;return}case b.SELECT:{this._resetInsertionModeForSelect(t);return}case b.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case b.HTML:{this.insertionMode=this.headElement?U.AFTER_HEAD:U.BEFORE_HEAD;return}case b.TD:case b.TH:{if(t>0){this.insertionMode=U.IN_CELL;return}break}case b.HEAD:{if(t>0){this.insertionMode=U.IN_HEAD;return}break}}this.insertionMode=U.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===b.TEMPLATE)break;if(r===b.TABLE){this.insertionMode=U.IN_SELECT_IN_TABLE;return}}this.insertionMode=U.IN_SELECT}_isElementCausesFosterParenting(t){return ip.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 b.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===ie.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case b.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 _w[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){BA(this,t);return}switch(this.insertionMode){case U.INITIAL:{Or(this,t);break}case U.BEFORE_HTML:{Kr(this,t);break}case U.BEFORE_HEAD:{Xr(this,t);break}case U.IN_HEAD:{Qr(this,t);break}case U.IN_HEAD_NO_SCRIPT:{Zr(this,t);break}case U.AFTER_HEAD:{Jr(this,t);break}case U.IN_BODY:case U.IN_CAPTION:case U.IN_CELL:case U.IN_TEMPLATE:{ap(this,t);break}case U.TEXT:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case U.IN_TABLE:case U.IN_TABLE_BODY:case U.IN_ROW:{za(this,t);break}case U.IN_TABLE_TEXT:{fp(this,t);break}case U.IN_COLUMN_GROUP:{vs(this,t);break}case U.AFTER_BODY:{ks(this,t);break}case U.AFTER_AFTER_BODY:{rs(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){FA(this,t);return}switch(this.insertionMode){case U.INITIAL:{Or(this,t);break}case U.BEFORE_HTML:{Kr(this,t);break}case U.BEFORE_HEAD:{Xr(this,t);break}case U.IN_HEAD:{Qr(this,t);break}case U.IN_HEAD_NO_SCRIPT:{Zr(this,t);break}case U.AFTER_HEAD:{Jr(this,t);break}case U.TEXT:{this._insertCharacters(t);break}case U.IN_TABLE:case U.IN_TABLE_BODY:case U.IN_ROW:{za(this,t);break}case U.IN_COLUMN_GROUP:{vs(this,t);break}case U.AFTER_BODY:{ks(this,t);break}case U.AFTER_AFTER_BODY:{rs(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){Po(this,t);return}switch(this.insertionMode){case U.INITIAL:case U.BEFORE_HTML:case U.BEFORE_HEAD:case U.IN_HEAD:case U.IN_HEAD_NO_SCRIPT:case U.AFTER_HEAD:case U.IN_BODY:case U.IN_TABLE:case U.IN_CAPTION:case U.IN_COLUMN_GROUP:case U.IN_TABLE_BODY:case U.IN_ROW:case U.IN_CELL:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:case U.IN_TEMPLATE:case U.IN_FRAMESET:case U.AFTER_FRAMESET:{Po(this,t);break}case U.IN_TABLE_TEXT:{Fr(this,t);break}case U.AFTER_BODY:{pS(this,t);break}case U.AFTER_AFTER_BODY:case U.AFTER_AFTER_FRAMESET:{gS(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case U.INITIAL:{xS(this,t);break}case U.BEFORE_HEAD:case U.IN_HEAD:case U.IN_HEAD_NO_SCRIPT:case U.AFTER_HEAD:{this._err(t,Q.misplacedDoctype);break}case U.IN_TABLE_TEXT:{Fr(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,Q.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?jA(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case U.INITIAL:{Or(this,t);break}case U.BEFORE_HTML:{bS(this,t);break}case U.BEFORE_HEAD:{ES(this,t);break}case U.IN_HEAD:{Gt(this,t);break}case U.IN_HEAD_NO_SCRIPT:{kS(this,t);break}case U.AFTER_HEAD:{SS(this,t);break}case U.IN_BODY:{Tt(this,t);break}case U.IN_TABLE:{gr(this,t);break}case U.IN_TABLE_TEXT:{Fr(this,t);break}case U.IN_CAPTION:{TA(this,t);break}case U.IN_COLUMN_GROUP:{Vu(this,t);break}case U.IN_TABLE_BODY:{Xs(this,t);break}case U.IN_ROW:{Qs(this,t);break}case U.IN_CELL:{wA(this,t);break}case U.IN_SELECT:{pp(this,t);break}case U.IN_SELECT_IN_TABLE:{AA(this,t);break}case U.IN_TEMPLATE:{_A(this,t);break}case U.AFTER_BODY:{NA(this,t);break}case U.IN_FRAMESET:{RA(this,t);break}case U.AFTER_FRAMESET:{MA(this,t);break}case U.AFTER_AFTER_BODY:{DA(this,t);break}case U.AFTER_AFTER_FRAMESET:{OA(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?HA(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case U.INITIAL:{Or(this,t);break}case U.BEFORE_HTML:{yS(this,t);break}case U.BEFORE_HEAD:{TS(this,t);break}case U.IN_HEAD:{vS(this,t);break}case U.IN_HEAD_NO_SCRIPT:{wS(this,t);break}case U.AFTER_HEAD:{AS(this,t);break}case U.IN_BODY:{Ks(this,t);break}case U.TEXT:{dA(this,t);break}case U.IN_TABLE:{di(this,t);break}case U.IN_TABLE_TEXT:{Fr(this,t);break}case U.IN_CAPTION:{vA(this,t);break}case U.IN_COLUMN_GROUP:{kA(this,t);break}case U.IN_TABLE_BODY:{Do(this,t);break}case U.IN_ROW:{mp(this,t);break}case U.IN_CELL:{SA(this,t);break}case U.IN_SELECT:{gp(this,t);break}case U.IN_SELECT_IN_TABLE:{CA(this,t);break}case U.IN_TEMPLATE:{IA(this,t);break}case U.AFTER_BODY:{bp(this,t);break}case U.IN_FRAMESET:{LA(this,t);break}case U.AFTER_FRAMESET:{PA(this,t);break}case U.AFTER_AFTER_BODY:{rs(this,t);break}}}onEof(t){switch(this.insertionMode){case U.INITIAL:{Or(this,t);break}case U.BEFORE_HTML:{Kr(this,t);break}case U.BEFORE_HEAD:{Xr(this,t);break}case U.IN_HEAD:{Qr(this,t);break}case U.IN_HEAD_NO_SCRIPT:{Zr(this,t);break}case U.AFTER_HEAD:{Jr(this,t);break}case U.IN_BODY:case U.IN_TABLE:case U.IN_CAPTION:case U.IN_COLUMN_GROUP:case U.IN_TABLE_BODY:case U.IN_ROW:case U.IN_CELL:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:{cp(this,t);break}case U.TEXT:{fA(this,t);break}case U.IN_TABLE_TEXT:{Fr(this,t);break}case U.IN_TEMPLATE:{xp(this,t);break}case U.AFTER_BODY:case U.IN_FRAMESET:case U.AFTER_FRAMESET:case U.AFTER_AFTER_BODY:case U.AFTER_AFTER_FRAMESET:{zu(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===O.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 U.IN_HEAD:case U.IN_HEAD_NO_SCRIPT:case U.AFTER_HEAD:case U.TEXT:case U.IN_COLUMN_GROUP:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:case U.IN_FRAMESET:case U.AFTER_FRAMESET:{this._insertCharacters(t);break}case U.IN_BODY:case U.IN_CAPTION:case U.IN_CELL:case U.IN_TEMPLATE:case U.AFTER_BODY:case U.AFTER_AFTER_BODY:case U.AFTER_AFTER_FRAMESET:{sp(this,t);break}case U.IN_TABLE:case U.IN_TABLE_BODY:case U.IN_ROW:{za(this,t);break}case U.IN_TABLE_TEXT:{dp(this,t);break}}}}function lS(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):lp(e,t),n}function cS(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const s=e.openElements.items[r];if(s===t.element)break;e._isSpecialElement(s,e.openElements.tagIDs[r])&&(n=s)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function dS(e,t,n){let r=t,s=e.openElements.getCommonAncestor(t);for(let i=0,a=s;a!==n;i++,a=s){s=e.openElements.getCommonAncestor(a);const o=e.activeFormattingElements.getElementEntry(a),u=o&&i>=oS;!o||u?(u&&e.activeFormattingElements.removeEntry(o),e.openElements.remove(a)):(a=fS(e,o),r===t&&(e.activeFormattingElements.bookmark=o),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(a,r),r=a)}return r}function fS(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 hS(e,t,n){const r=e.treeAdapter.getTagName(t),s=vr(r);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(n);else{const i=e.treeAdapter.getNamespaceURI(t);s===b.TEMPLATE&&i===ie.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function mS(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:s}=n,i=e.treeAdapter.createElement(s.tagName,r,s.attrs);e._adoptNodes(t,i),e.treeAdapter.appendChild(t,i),e.activeFormattingElements.insertElementAfterBookmark(i,s),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,i,s.tagID)}function Uu(e,t){for(let n=0;n<aS;n++){const r=lS(e,t);if(!r)break;const s=cS(e,r);if(!s)break;e.activeFormattingElements.bookmark=r;const i=dS(e,s,r.element),a=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(i),a&&hS(e,a,i),mS(e,s,r)}}function Po(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function pS(e,t){e._appendCommentNode(t,e.openElements.items[0])}function gS(e,t){e._appendCommentNode(t,e.document)}function zu(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],s=e.treeAdapter.getNodeSourceCodeLocation(r);if(s&&!s.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const i=e.openElements.items[1],a=e.treeAdapter.getNodeSourceCodeLocation(i);a&&!a.endTag&&e._setEndLocation(i,t)}}}}function xS(e,t){e._setDocumentType(t);const n=t.forceQuirks?Ht.QUIRKS:Yw(t);Ww(t)||e._err(t,Q.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=U.BEFORE_HTML}function Or(e,t){e._err(t,Q.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Ht.QUIRKS),e.insertionMode=U.BEFORE_HTML,e._processToken(t)}function bS(e,t){t.tagID===b.HTML?(e._insertElement(t,ie.HTML),e.insertionMode=U.BEFORE_HEAD):Kr(e,t)}function yS(e,t){const n=t.tagID;(n===b.HTML||n===b.HEAD||n===b.BODY||n===b.BR)&&Kr(e,t)}function Kr(e,t){e._insertFakeRootElement(),e.insertionMode=U.BEFORE_HEAD,e._processToken(t)}function ES(e,t){switch(t.tagID){case b.HTML:{Tt(e,t);break}case b.HEAD:{e._insertElement(t,ie.HTML),e.headElement=e.openElements.current,e.insertionMode=U.IN_HEAD;break}default:Xr(e,t)}}function TS(e,t){const n=t.tagID;n===b.HEAD||n===b.BODY||n===b.HTML||n===b.BR?Xr(e,t):e._err(t,Q.endTagWithoutMatchingOpenElement)}function Xr(e,t){e._insertFakeElement(G.HEAD,b.HEAD),e.headElement=e.openElements.current,e.insertionMode=U.IN_HEAD,e._processToken(t)}function Gt(e,t){switch(t.tagID){case b.HTML:{Tt(e,t);break}case b.BASE:case b.BASEFONT:case b.BGSOUND:case b.LINK:case b.META:{e._appendElement(t,ie.HTML),t.ackSelfClosing=!0;break}case b.TITLE:{e._switchToTextParsing(t,ot.RCDATA);break}case b.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,ot.RAWTEXT):(e._insertElement(t,ie.HTML),e.insertionMode=U.IN_HEAD_NO_SCRIPT);break}case b.NOFRAMES:case b.STYLE:{e._switchToTextParsing(t,ot.RAWTEXT);break}case b.SCRIPT:{e._switchToTextParsing(t,ot.SCRIPT_DATA);break}case b.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=U.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(U.IN_TEMPLATE);break}case b.HEAD:{e._err(t,Q.misplacedStartTagForHeadElement);break}default:Qr(e,t)}}function vS(e,t){switch(t.tagID){case b.HEAD:{e.openElements.pop(),e.insertionMode=U.AFTER_HEAD;break}case b.BODY:case b.BR:case b.HTML:{Qr(e,t);break}case b.TEMPLATE:{Qn(e,t);break}default:e._err(t,Q.endTagWithoutMatchingOpenElement)}}function Qn(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==b.TEMPLATE&&e._err(t,Q.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(b.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,Q.endTagWithoutMatchingOpenElement)}function Qr(e,t){e.openElements.pop(),e.insertionMode=U.AFTER_HEAD,e._processToken(t)}function kS(e,t){switch(t.tagID){case b.HTML:{Tt(e,t);break}case b.BASEFONT:case b.BGSOUND:case b.HEAD:case b.LINK:case b.META:case b.NOFRAMES:case b.STYLE:{Gt(e,t);break}case b.NOSCRIPT:{e._err(t,Q.nestedNoscriptInHead);break}default:Zr(e,t)}}function wS(e,t){switch(t.tagID){case b.NOSCRIPT:{e.openElements.pop(),e.insertionMode=U.IN_HEAD;break}case b.BR:{Zr(e,t);break}default:e._err(t,Q.endTagWithoutMatchingOpenElement)}}function Zr(e,t){const n=t.type===De.EOF?Q.openElementsLeftAfterEof:Q.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=U.IN_HEAD,e._processToken(t)}function SS(e,t){switch(t.tagID){case b.HTML:{Tt(e,t);break}case b.BODY:{e._insertElement(t,ie.HTML),e.framesetOk=!1,e.insertionMode=U.IN_BODY;break}case b.FRAMESET:{e._insertElement(t,ie.HTML),e.insertionMode=U.IN_FRAMESET;break}case b.BASE:case b.BASEFONT:case b.BGSOUND:case b.LINK:case b.META:case b.NOFRAMES:case b.SCRIPT:case b.STYLE:case b.TEMPLATE:case b.TITLE:{e._err(t,Q.abandonedHeadElementChild),e.openElements.push(e.headElement,b.HEAD),Gt(e,t),e.openElements.remove(e.headElement);break}case b.HEAD:{e._err(t,Q.misplacedStartTagForHeadElement);break}default:Jr(e,t)}}function AS(e,t){switch(t.tagID){case b.BODY:case b.HTML:case b.BR:{Jr(e,t);break}case b.TEMPLATE:{Qn(e,t);break}default:e._err(t,Q.endTagWithoutMatchingOpenElement)}}function Jr(e,t){e._insertFakeElement(G.BODY,b.BODY),e.insertionMode=U.IN_BODY,Gs(e,t)}function Gs(e,t){switch(t.type){case De.CHARACTER:{ap(e,t);break}case De.WHITESPACE_CHARACTER:{sp(e,t);break}case De.COMMENT:{Po(e,t);break}case De.START_TAG:{Tt(e,t);break}case De.END_TAG:{Ks(e,t);break}case De.EOF:{cp(e,t);break}}}function sp(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function ap(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function CS(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function _S(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function IS(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,ie.HTML),e.insertionMode=U.IN_FRAMESET)}function NS(e,t){e.openElements.hasInButtonScope(b.P)&&e._closePElement(),e._insertElement(t,ie.HTML)}function RS(e,t){e.openElements.hasInButtonScope(b.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Mo.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,ie.HTML)}function LS(e,t){e.openElements.hasInButtonScope(b.P)&&e._closePElement(),e._insertElement(t,ie.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function MS(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(b.P)&&e._closePElement(),e._insertElement(t,ie.HTML),n||(e.formElement=e.openElements.current))}function PS(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const s=e.openElements.tagIDs[r];if(n===b.LI&&s===b.LI||(n===b.DD||n===b.DT)&&(s===b.DD||s===b.DT)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.popUntilTagNamePopped(s);break}if(s!==b.ADDRESS&&s!==b.DIV&&s!==b.P&&e._isSpecialElement(e.openElements.items[r],s))break}e.openElements.hasInButtonScope(b.P)&&e._closePElement(),e._insertElement(t,ie.HTML)}function DS(e,t){e.openElements.hasInButtonScope(b.P)&&e._closePElement(),e._insertElement(t,ie.HTML),e.tokenizer.state=ot.PLAINTEXT}function OS(e,t){e.openElements.hasInScope(b.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(b.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,ie.HTML),e.framesetOk=!1}function FS(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(G.A);n&&(Uu(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,ie.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function BS(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ie.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function jS(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(b.NOBR)&&(Uu(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,ie.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function HS(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ie.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function US(e,t){e.treeAdapter.getDocumentMode(e.document)!==Ht.QUIRKS&&e.openElements.hasInButtonScope(b.P)&&e._closePElement(),e._insertElement(t,ie.HTML),e.framesetOk=!1,e.insertionMode=U.IN_TABLE}function op(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ie.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function up(e){const t=Xm(e,qn.TYPE);return t!=null&&t.toLowerCase()===sS}function zS(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ie.HTML),up(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function VS(e,t){e._appendElement(t,ie.HTML),t.ackSelfClosing=!0}function qS(e,t){e.openElements.hasInButtonScope(b.P)&&e._closePElement(),e._appendElement(t,ie.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function $S(e,t){t.tagName=G.IMG,t.tagID=b.IMG,op(e,t)}function WS(e,t){e._insertElement(t,ie.HTML),e.skipNextNewLine=!0,e.tokenizer.state=ot.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=U.TEXT}function YS(e,t){e.openElements.hasInButtonScope(b.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,ot.RAWTEXT)}function GS(e,t){e.framesetOk=!1,e._switchToTextParsing(t,ot.RAWTEXT)}function rd(e,t){e._switchToTextParsing(t,ot.RAWTEXT)}function KS(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ie.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===U.IN_TABLE||e.insertionMode===U.IN_CAPTION||e.insertionMode===U.IN_TABLE_BODY||e.insertionMode===U.IN_ROW||e.insertionMode===U.IN_CELL?U.IN_SELECT_IN_TABLE:U.IN_SELECT}function XS(e,t){e.openElements.currentTagId===b.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,ie.HTML)}function QS(e,t){e.openElements.hasInScope(b.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,ie.HTML)}function ZS(e,t){e.openElements.hasInScope(b.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(b.RTC),e._insertElement(t,ie.HTML)}function JS(e,t){e._reconstructActiveFormattingElements(),np(t),Hu(t),t.selfClosing?e._appendElement(t,ie.MATHML):e._insertElement(t,ie.MATHML),t.ackSelfClosing=!0}function eA(e,t){e._reconstructActiveFormattingElements(),rp(t),Hu(t),t.selfClosing?e._appendElement(t,ie.SVG):e._insertElement(t,ie.SVG),t.ackSelfClosing=!0}function id(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ie.HTML)}function Tt(e,t){switch(t.tagID){case b.I:case b.S:case b.B:case b.U:case b.EM:case b.TT:case b.BIG:case b.CODE:case b.FONT:case b.SMALL:case b.STRIKE:case b.STRONG:{BS(e,t);break}case b.A:{FS(e,t);break}case b.H1:case b.H2:case b.H3:case b.H4:case b.H5:case b.H6:{RS(e,t);break}case b.P:case b.DL:case b.OL:case b.UL:case b.DIV:case b.DIR:case b.NAV:case b.MAIN:case b.MENU:case b.ASIDE:case b.CENTER:case b.FIGURE:case b.FOOTER:case b.HEADER:case b.HGROUP:case b.DIALOG:case b.DETAILS:case b.ADDRESS:case b.ARTICLE:case b.SEARCH:case b.SECTION:case b.SUMMARY:case b.FIELDSET:case b.BLOCKQUOTE:case b.FIGCAPTION:{NS(e,t);break}case b.LI:case b.DD:case b.DT:{PS(e,t);break}case b.BR:case b.IMG:case b.WBR:case b.AREA:case b.EMBED:case b.KEYGEN:{op(e,t);break}case b.HR:{qS(e,t);break}case b.RB:case b.RTC:{QS(e,t);break}case b.RT:case b.RP:{ZS(e,t);break}case b.PRE:case b.LISTING:{LS(e,t);break}case b.XMP:{YS(e,t);break}case b.SVG:{eA(e,t);break}case b.HTML:{CS(e,t);break}case b.BASE:case b.LINK:case b.META:case b.STYLE:case b.TITLE:case b.SCRIPT:case b.BGSOUND:case b.BASEFONT:case b.TEMPLATE:{Gt(e,t);break}case b.BODY:{_S(e,t);break}case b.FORM:{MS(e,t);break}case b.NOBR:{jS(e,t);break}case b.MATH:{JS(e,t);break}case b.TABLE:{US(e,t);break}case b.INPUT:{zS(e,t);break}case b.PARAM:case b.TRACK:case b.SOURCE:{VS(e,t);break}case b.IMAGE:{$S(e,t);break}case b.BUTTON:{OS(e,t);break}case b.APPLET:case b.OBJECT:case b.MARQUEE:{HS(e,t);break}case b.IFRAME:{GS(e,t);break}case b.SELECT:{KS(e,t);break}case b.OPTION:case b.OPTGROUP:{XS(e,t);break}case b.NOEMBED:case b.NOFRAMES:{rd(e,t);break}case b.FRAMESET:{IS(e,t);break}case b.TEXTAREA:{WS(e,t);break}case b.NOSCRIPT:{e.options.scriptingEnabled?rd(e,t):id(e,t);break}case b.PLAINTEXT:{DS(e,t);break}case b.COL:case b.TH:case b.TD:case b.TR:case b.HEAD:case b.FRAME:case b.TBODY:case b.TFOOT:case b.THEAD:case b.CAPTION:case b.COLGROUP:break;default:id(e,t)}}function tA(e,t){if(e.openElements.hasInScope(b.BODY)&&(e.insertionMode=U.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function nA(e,t){e.openElements.hasInScope(b.BODY)&&(e.insertionMode=U.AFTER_BODY,bp(e,t))}function rA(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function iA(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(b.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(b.FORM):n&&e.openElements.remove(n))}function sA(e){e.openElements.hasInButtonScope(b.P)||e._insertFakeElement(G.P,b.P),e._closePElement()}function aA(e){e.openElements.hasInListItemScope(b.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(b.LI),e.openElements.popUntilTagNamePopped(b.LI))}function oA(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function uA(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function lA(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function cA(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(G.BR,b.BR),e.openElements.pop(),e.framesetOk=!1}function lp(e,t){const n=t.tagName,r=t.tagID;for(let s=e.openElements.stackTop;s>0;s--){const i=e.openElements.items[s],a=e.openElements.tagIDs[s];if(r===a&&(r!==b.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=s&&e.openElements.shortenToLength(s);break}if(e._isSpecialElement(i,a))break}}function Ks(e,t){switch(t.tagID){case b.A:case b.B:case b.I:case b.S:case b.U:case b.EM:case b.TT:case b.BIG:case b.CODE:case b.FONT:case b.NOBR:case b.SMALL:case b.STRIKE:case b.STRONG:{Uu(e,t);break}case b.P:{sA(e);break}case b.DL:case b.UL:case b.OL:case b.DIR:case b.DIV:case b.NAV:case b.PRE:case b.MAIN:case b.MENU:case b.ASIDE:case b.BUTTON:case b.CENTER:case b.FIGURE:case b.FOOTER:case b.HEADER:case b.HGROUP:case b.DIALOG:case b.ADDRESS:case b.ARTICLE:case b.DETAILS:case b.SEARCH:case b.SECTION:case b.SUMMARY:case b.LISTING:case b.FIELDSET:case b.BLOCKQUOTE:case b.FIGCAPTION:{rA(e,t);break}case b.LI:{aA(e);break}case b.DD:case b.DT:{oA(e,t);break}case b.H1:case b.H2:case b.H3:case b.H4:case b.H5:case b.H6:{uA(e);break}case b.BR:{cA(e);break}case b.BODY:{tA(e,t);break}case b.HTML:{nA(e,t);break}case b.FORM:{iA(e);break}case b.APPLET:case b.OBJECT:case b.MARQUEE:{lA(e,t);break}case b.TEMPLATE:{Qn(e,t);break}default:lp(e,t)}}function cp(e,t){e.tmplInsertionModeStack.length>0?xp(e,t):zu(e,t)}function dA(e,t){var n;t.tagID===b.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function fA(e,t){e._err(t,Q.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function za(e,t){if(e.openElements.currentTagId!==void 0&&ip.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=U.IN_TABLE_TEXT,t.type){case De.CHARACTER:{fp(e,t);break}case De.WHITESPACE_CHARACTER:{dp(e,t);break}}else Ti(e,t)}function hA(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,ie.HTML),e.insertionMode=U.IN_CAPTION}function mA(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ie.HTML),e.insertionMode=U.IN_COLUMN_GROUP}function pA(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(G.COLGROUP,b.COLGROUP),e.insertionMode=U.IN_COLUMN_GROUP,Vu(e,t)}function gA(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ie.HTML),e.insertionMode=U.IN_TABLE_BODY}function xA(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(G.TBODY,b.TBODY),e.insertionMode=U.IN_TABLE_BODY,Xs(e,t)}function bA(e,t){e.openElements.hasInTableScope(b.TABLE)&&(e.openElements.popUntilTagNamePopped(b.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function yA(e,t){up(t)?e._appendElement(t,ie.HTML):Ti(e,t),t.ackSelfClosing=!0}function EA(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,ie.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function gr(e,t){switch(t.tagID){case b.TD:case b.TH:case b.TR:{xA(e,t);break}case b.STYLE:case b.SCRIPT:case b.TEMPLATE:{Gt(e,t);break}case b.COL:{pA(e,t);break}case b.FORM:{EA(e,t);break}case b.TABLE:{bA(e,t);break}case b.TBODY:case b.TFOOT:case b.THEAD:{gA(e,t);break}case b.INPUT:{yA(e,t);break}case b.CAPTION:{hA(e,t);break}case b.COLGROUP:{mA(e,t);break}default:Ti(e,t)}}function di(e,t){switch(t.tagID){case b.TABLE:{e.openElements.hasInTableScope(b.TABLE)&&(e.openElements.popUntilTagNamePopped(b.TABLE),e._resetInsertionMode());break}case b.TEMPLATE:{Qn(e,t);break}case b.BODY:case b.CAPTION:case b.COL:case b.COLGROUP:case b.HTML:case b.TBODY:case b.TD:case b.TFOOT:case b.TH:case b.THEAD:case b.TR:break;default:Ti(e,t)}}function Ti(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Gs(e,t),e.fosterParentingEnabled=n}function dp(e,t){e.pendingCharacterTokens.push(t)}function fp(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Fr(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)Ti(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const hp=new Set([b.CAPTION,b.COL,b.COLGROUP,b.TBODY,b.TD,b.TFOOT,b.TH,b.THEAD,b.TR]);function TA(e,t){const n=t.tagID;hp.has(n)?e.openElements.hasInTableScope(b.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(b.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=U.IN_TABLE,gr(e,t)):Tt(e,t)}function vA(e,t){const n=t.tagID;switch(n){case b.CAPTION:case b.TABLE:{e.openElements.hasInTableScope(b.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(b.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=U.IN_TABLE,n===b.TABLE&&di(e,t));break}case b.BODY:case b.COL:case b.COLGROUP:case b.HTML:case b.TBODY:case b.TD:case b.TFOOT:case b.TH:case b.THEAD:case b.TR:break;default:Ks(e,t)}}function Vu(e,t){switch(t.tagID){case b.HTML:{Tt(e,t);break}case b.COL:{e._appendElement(t,ie.HTML),t.ackSelfClosing=!0;break}case b.TEMPLATE:{Gt(e,t);break}default:vs(e,t)}}function kA(e,t){switch(t.tagID){case b.COLGROUP:{e.openElements.currentTagId===b.COLGROUP&&(e.openElements.pop(),e.insertionMode=U.IN_TABLE);break}case b.TEMPLATE:{Qn(e,t);break}case b.COL:break;default:vs(e,t)}}function vs(e,t){e.openElements.currentTagId===b.COLGROUP&&(e.openElements.pop(),e.insertionMode=U.IN_TABLE,e._processToken(t))}function Xs(e,t){switch(t.tagID){case b.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,ie.HTML),e.insertionMode=U.IN_ROW;break}case b.TH:case b.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(G.TR,b.TR),e.insertionMode=U.IN_ROW,Qs(e,t);break}case b.CAPTION:case b.COL:case b.COLGROUP:case b.TBODY:case b.TFOOT:case b.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE,gr(e,t));break}default:gr(e,t)}}function Do(e,t){const n=t.tagID;switch(t.tagID){case b.TBODY:case b.TFOOT:case b.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE);break}case b.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE,di(e,t));break}case b.BODY:case b.CAPTION:case b.COL:case b.COLGROUP:case b.HTML:case b.TD:case b.TH:case b.TR:break;default:di(e,t)}}function Qs(e,t){switch(t.tagID){case b.TH:case b.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,ie.HTML),e.insertionMode=U.IN_CELL,e.activeFormattingElements.insertMarker();break}case b.CAPTION:case b.COL:case b.COLGROUP:case b.TBODY:case b.TFOOT:case b.THEAD:case b.TR:{e.openElements.hasInTableScope(b.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY,Xs(e,t));break}default:gr(e,t)}}function mp(e,t){switch(t.tagID){case b.TR:{e.openElements.hasInTableScope(b.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY);break}case b.TABLE:{e.openElements.hasInTableScope(b.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY,Do(e,t));break}case b.TBODY:case b.TFOOT:case b.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(b.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY,Do(e,t));break}case b.BODY:case b.CAPTION:case b.COL:case b.COLGROUP:case b.HTML:case b.TD:case b.TH:break;default:di(e,t)}}function wA(e,t){const n=t.tagID;hp.has(n)?(e.openElements.hasInTableScope(b.TD)||e.openElements.hasInTableScope(b.TH))&&(e._closeTableCell(),Qs(e,t)):Tt(e,t)}function SA(e,t){const n=t.tagID;switch(n){case b.TD:case b.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=U.IN_ROW);break}case b.TABLE:case b.TBODY:case b.TFOOT:case b.THEAD:case b.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),mp(e,t));break}case b.BODY:case b.CAPTION:case b.COL:case b.COLGROUP:case b.HTML:break;default:Ks(e,t)}}function pp(e,t){switch(t.tagID){case b.HTML:{Tt(e,t);break}case b.OPTION:{e.openElements.currentTagId===b.OPTION&&e.openElements.pop(),e._insertElement(t,ie.HTML);break}case b.OPTGROUP:{e.openElements.currentTagId===b.OPTION&&e.openElements.pop(),e.openElements.currentTagId===b.OPTGROUP&&e.openElements.pop(),e._insertElement(t,ie.HTML);break}case b.HR:{e.openElements.currentTagId===b.OPTION&&e.openElements.pop(),e.openElements.currentTagId===b.OPTGROUP&&e.openElements.pop(),e._appendElement(t,ie.HTML),t.ackSelfClosing=!0;break}case b.INPUT:case b.KEYGEN:case b.TEXTAREA:case b.SELECT:{e.openElements.hasInSelectScope(b.SELECT)&&(e.openElements.popUntilTagNamePopped(b.SELECT),e._resetInsertionMode(),t.tagID!==b.SELECT&&e._processStartTag(t));break}case b.SCRIPT:case b.TEMPLATE:{Gt(e,t);break}}}function gp(e,t){switch(t.tagID){case b.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===b.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===b.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===b.OPTGROUP&&e.openElements.pop();break}case b.OPTION:{e.openElements.currentTagId===b.OPTION&&e.openElements.pop();break}case b.SELECT:{e.openElements.hasInSelectScope(b.SELECT)&&(e.openElements.popUntilTagNamePopped(b.SELECT),e._resetInsertionMode());break}case b.TEMPLATE:{Qn(e,t);break}}}function AA(e,t){const n=t.tagID;n===b.CAPTION||n===b.TABLE||n===b.TBODY||n===b.TFOOT||n===b.THEAD||n===b.TR||n===b.TD||n===b.TH?(e.openElements.popUntilTagNamePopped(b.SELECT),e._resetInsertionMode(),e._processStartTag(t)):pp(e,t)}function CA(e,t){const n=t.tagID;n===b.CAPTION||n===b.TABLE||n===b.TBODY||n===b.TFOOT||n===b.THEAD||n===b.TR||n===b.TD||n===b.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(b.SELECT),e._resetInsertionMode(),e.onEndTag(t)):gp(e,t)}function _A(e,t){switch(t.tagID){case b.BASE:case b.BASEFONT:case b.BGSOUND:case b.LINK:case b.META:case b.NOFRAMES:case b.SCRIPT:case b.STYLE:case b.TEMPLATE:case b.TITLE:{Gt(e,t);break}case b.CAPTION:case b.COLGROUP:case b.TBODY:case b.TFOOT:case b.THEAD:{e.tmplInsertionModeStack[0]=U.IN_TABLE,e.insertionMode=U.IN_TABLE,gr(e,t);break}case b.COL:{e.tmplInsertionModeStack[0]=U.IN_COLUMN_GROUP,e.insertionMode=U.IN_COLUMN_GROUP,Vu(e,t);break}case b.TR:{e.tmplInsertionModeStack[0]=U.IN_TABLE_BODY,e.insertionMode=U.IN_TABLE_BODY,Xs(e,t);break}case b.TD:case b.TH:{e.tmplInsertionModeStack[0]=U.IN_ROW,e.insertionMode=U.IN_ROW,Qs(e,t);break}default:e.tmplInsertionModeStack[0]=U.IN_BODY,e.insertionMode=U.IN_BODY,Tt(e,t)}}function IA(e,t){t.tagID===b.TEMPLATE&&Qn(e,t)}function xp(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(b.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):zu(e,t)}function NA(e,t){t.tagID===b.HTML?Tt(e,t):ks(e,t)}function bp(e,t){var n;if(t.tagID===b.HTML){if(e.fragmentContext||(e.insertionMode=U.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===b.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 ks(e,t)}function ks(e,t){e.insertionMode=U.IN_BODY,Gs(e,t)}function RA(e,t){switch(t.tagID){case b.HTML:{Tt(e,t);break}case b.FRAMESET:{e._insertElement(t,ie.HTML);break}case b.FRAME:{e._appendElement(t,ie.HTML),t.ackSelfClosing=!0;break}case b.NOFRAMES:{Gt(e,t);break}}}function LA(e,t){t.tagID===b.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==b.FRAMESET&&(e.insertionMode=U.AFTER_FRAMESET))}function MA(e,t){switch(t.tagID){case b.HTML:{Tt(e,t);break}case b.NOFRAMES:{Gt(e,t);break}}}function PA(e,t){t.tagID===b.HTML&&(e.insertionMode=U.AFTER_AFTER_FRAMESET)}function DA(e,t){t.tagID===b.HTML?Tt(e,t):rs(e,t)}function rs(e,t){e.insertionMode=U.IN_BODY,Gs(e,t)}function OA(e,t){switch(t.tagID){case b.HTML:{Tt(e,t);break}case b.NOFRAMES:{Gt(e,t);break}}}function FA(e,t){t.chars=rt,e._insertCharacters(t)}function BA(e,t){e._insertCharacters(t),e.framesetOk=!1}function yp(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==ie.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function jA(e,t){if(eS(t))yp(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===ie.MATHML?np(t):r===ie.SVG&&(tS(t),rp(t)),Hu(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function HA(e,t){if(t.tagID===b.P||t.tagID===b.BR){yp(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)===ie.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(r);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}G.AREA,G.BASE,G.BASEFONT,G.BGSOUND,G.BR,G.COL,G.EMBED,G.FRAME,G.HR,G.IMG,G.INPUT,G.KEYGEN,G.LINK,G.META,G.PARAM,G.SOURCE,G.TRACK,G.WBR;const UA=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,zA=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),sd={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Ep(e,t){const n=ZA(e),r=vm("type",{handlers:{root:VA,element:qA,text:$A,comment:vp,doctype:WA,raw:GA},unknown:KA}),s={parser:n?new nd(sd):nd.getFragmentParser(void 0,sd),handle(o){r(o,s)},stitches:!1,options:t||{}};r(e,s),kr(s,an());const i=n?s.parser.document:s.parser.getFragment(),a=Jk(i,{file:s.options.file});return s.stitches&&Ys(a,"comment",function(o,u,l){const c=o;if(c.value.stitch&&l&&u!==void 0){const f=l.children;return f[u]=c.value.stitch,u}}),a.type==="root"&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function Tp(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function VA(e,t){Tp(e.children,t)}function qA(e,t){XA(e,t),Tp(e.children,t),QA(e,t)}function $A(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:De.CHARACTER,chars:e.value,location:vi(e)};kr(t,an(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function WA(e,t){const n={type:De.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:vi(e)};kr(t,an(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function YA(e,t){t.stitches=!0;const n=JA(e);if("children"in e&&"children"in n){const r=Ep({type:"root",children:e.children},t.options);n.children=r.children}vp({type:"comment",value:{stitch:n}},t)}function vp(e,t){const n=e.value,r={type:De.COMMENT,data:n,location:vi(e)};kr(t,an(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function GA(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,kp(t,an(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(UA,"<$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 KA(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))YA(n,t);else{let r="";throw zA.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 kr(e,t){kp(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=ot.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 kp(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 XA(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===ot.PLAINTEXT)return;kr(t,an(e));const r=t.parser.openElements.current;let s="namespaceURI"in r?r.namespaceURI:Bn.html;s===Bn.html&&n==="svg"&&(s=Bn.svg);const i=iw({...e,children:[]},{space:s===Bn.svg?"svg":"html"}),a={type:De.START_TAG,tagName:n,tagID:vr(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in i?i.attrs:[],location:vi(e)};t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function QA(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&fw.includes(n)||t.parser.tokenizer.state===ot.PLAINTEXT)return;kr(t,Us(e));const r={type:De.END_TAG,tagName:n,tagID:vr(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:vi(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===ot.RCDATA||t.parser.tokenizer.state===ot.RAWTEXT||t.parser.tokenizer.state===ot.SCRIPT_DATA)&&(t.parser.tokenizer.state=ot.DATA)}function ZA(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function vi(e){const t=an(e)||{line:void 0,column:void 0,offset:void 0},n=Us(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 JA(e){return"children"in e?Kn({...e,children:[]}):Kn(e)}function wp(e){return function(t,n){return Ep(t,{...e,file:n})}}const Ln=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],ei={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Ln,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Ln],h2:[["className","sr-only"]],img:[...Ln,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Ln,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Ln],table:[...Ln],ul:[...Ln,["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"]},yn={}.hasOwnProperty;function eC(e,t){let n={type:"root",children:[]};const r={schema:t?{...ei,...t}:ei,stack:[]},s=Sp(r,e);return s&&(Array.isArray(s)?s.length===1?n=s[0]:n.children=s:n=s),n}function Sp(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return tC(e,n);case"doctype":return nC(e,n);case"element":return rC(e,n);case"root":return iC(e,n);case"text":return sC(e,n)}}}function tC(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),i={type:"comment",value:r<0?n:n.slice(0,r)};return ki(i,t),i}}function nC(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return ki(n,t),n}}function rC(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=Ap(e,t.children),s=aC(e,t.properties);e.stack.pop();let i=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(i=!0,e.schema.ancestors&&yn.call(e.schema.ancestors,n))){const o=e.schema.ancestors[n];let u=-1;for(i=!1;++u<o.length;)e.stack.includes(o[u])&&(i=!0)}if(!i)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const a={type:"element",tagName:n,properties:s,children:r};return ki(a,t),a}function iC(e,t){const r={type:"root",children:Ap(e,t.children)};return ki(r,t),r}function sC(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return ki(r,t),r}function Ap(e,t){const n=[];if(Array.isArray(t)){const r=t;let s=-1;for(;++s<r.length;){const i=Sp(e,r[s]);i&&(Array.isArray(i)?n.push(...i):n.push(i))}}return n}function aC(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,s=e.schema.required,i=r&&yn.call(r,n)?r[n]:void 0,a=r&&yn.call(r,"*")?r["*"]:void 0,o=t&&typeof t=="object"?t:{},u={};let l;for(l in o)if(yn.call(o,l)){const c=o[l];let f=ad(e,od(i,l),l,c);f==null&&(f=ad(e,od(a,l),l,c)),f!=null&&(u[l]=f)}if(s&&yn.call(s,n)){const c=s[n];for(l in c)yn.call(c,l)&&!yn.call(u,l)&&(u[l]=c[l])}return u}function ad(e,t,n,r){return t?Array.isArray(r)?oC(e,t,n,r):Cp(e,t,n,r):void 0}function oC(e,t,n,r){let s=-1;const i=[];for(;++s<r.length;){const a=Cp(e,t,n,r[s]);(typeof a=="number"||typeof a=="string")&&i.push(a)}return i}function Cp(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&uC(e,n,r)){if(typeof t=="object"&&t.length>1){let s=!1,i=0;for(;++i<t.length;){const a=t[i];if(a&&typeof a=="object"&&"flags"in a){if(a.test(String(r))){s=!0;break}}else if(a===r){s=!0;break}}if(!s)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function uC(e,t,n){const r=e.schema.protocols&&yn.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const s=String(n),i=s.indexOf(":"),a=s.indexOf("?"),o=s.indexOf("#"),u=s.indexOf("/");if(i<0||u>-1&&i>u||a>-1&&i>a||o>-1&&i>o)return!0;let l=-1;for(;++l<r.length;){const c=r[l];if(i===c.length&&s.slice(0,c.length)===c)return!0}return!1}function ki(e,t){const n=Vh(t);t.data&&(e.data=Kn(t.data)),n&&(e.position=n)}function od(e,t){let n,r=-1;if(e)for(;++r<e.length;){const s=e[r],i=typeof s=="string"?s:s[0];if(i===t)return s;i==="data*"&&(n=s)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function _p(e){return function(t){return eC(t,e)}}var nh;const Ip={...ei,protocols:{...ei.protocols,src:[...((nh=ei.protocols)==null?void 0:nh.src)??["http","https","mailto"],"data"]}},lC={remarkPlugins:[zm],rehypePlugins:[wp,[_p,Ip]]};let qr=null,ud=null;function cC(){return qr?Promise.resolve(qr):(ud??(ud=Promise.all([ve(()=>import("./index-BdqyfaDB.js"),__vite__mapDeps([3,1,2]),import.meta.url),ve(()=>import("./index-B1IsZZhV.js"),__vite__mapDeps([4,1,2]),import.meta.url)]).then(([{default:e},{default:t}])=>(qr={remarkPlugins:[zm,e],rehypePlugins:[wp,[_p,Ip],t]},qr))),ud)}function dC(e){return e.includes("$")||e.includes("\\(")||e.includes("\\[")}function Np(e){const[t,n]=w.useState(qr),r=dC(e??"");return w.useEffect(()=>{if(!r||t)return;let s=!0;return cC().then(i=>{s&&n(i)}),()=>{s=!1}},[r,t]),t??lC}function fC({retry:e}){const t=We();return x.jsxs("div",{className:"text-body text-warning p-4 flex items-start gap-2",children:[x.jsx(Eu,{className:"w-4 h-4 shrink-0 mt-0.5"}),x.jsxs("span",{children:[t("error.renderFailed")," ",x.jsx("button",{className:"underline ml-1",onClick:e,children:t("error.retry")})]})]})}class hC extends w.Component{constructor(){super(...arguments);oa(this,"state",{error:null});oa(this,"retry",()=>this.setState({error:null}))}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,r){console.error("[ErrorBoundary caught]",n,r.componentStack)}render(){return this.state.error?this.props.fallback?this.props.fallback(this.state.error,this.retry):x.jsx(fC,{error:this.state.error,retry:this.retry}):this.props.children}}function fi(e,t,n){const r=[];let s="";const i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode(o){const u=o.parentElement;if(!u)return NodeFilter.FILTER_REJECT;const l=u.tagName;return l==="SCRIPT"||l==="STYLE"||u.closest(".katex-html")||u.closest(".katex-mathml")&&!u.closest("annotation")||!(n!=null&&n.includeMarks)&&u.closest("mark.lookatstudy-underline")||t&&!u.closest(t)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});let a;for(;a=i.nextNode();){const o=a,u=o.textContent??"",l=s.length;s+=u,r.push({node:o,start:l,end:s.length})}return{text:s,nodes:r}}function Rp(e,t){const n=ld(e.startContainer,e.startOffset,t,"start"),r=ld(e.endContainer,e.endOffset,t,"end");return n==null||r==null||r<=n?null:{start:n,end:r}}function ld(e,t,n,r){var s,i,a;if(e.nodeType===Node.TEXT_NODE){for(const o of n.nodes)if(o.node===e)return o.start+Math.min(t,((s=o.node.textContent)==null?void 0:s.length)??0);return r==="start"?((i=n.nodes[0])==null?void 0:i.start)??null:((a=n.nodes[n.nodes.length-1])==null?void 0:a.end)??null}if(e instanceof Element){const o=Array.from(e.childNodes);if(r==="end"){for(let l=t;l<o.length;l++){const c=Lp(o[l],n);if(c!=null)return c}const u=n.nodes[n.nodes.length-1];return u?u.end:null}else{for(let l=t;l>=0;l--){const c=Mp(o[l],n);if(c!=null)return c}const u=n.nodes[0];return u?u.start:null}}return null}function Lp(e,t){if(e.nodeType===Node.TEXT_NODE){for(const n of t.nodes)if(n.node===e)return n.start;return null}if(e instanceof Element)for(const n of e.childNodes){const r=Lp(n,t);if(r!=null)return r}return null}function Mp(e,t){if(e.nodeType===Node.TEXT_NODE){for(const n of t.nodes)if(n.node===e)return n.end;return null}if(e instanceof Element){let n=null;for(const r of e.childNodes){const s=Mp(r,t);s!=null&&(n=s)}return n}return null}function Pp(e,t,n){var o,u,l,c;if(n<=t)return null;let r=null,s=0,i=null,a=0;for(const f of e.nodes)if(!r&&t>=f.start&&t<f.end&&(r=f.node,s=t-f.start),!i&&n>f.start&&n<=f.end&&(i=f.node,a=n-f.start),r&&i)break;if(!r&&e.nodes.length>0){const f=e.nodes[e.nodes.length-1];r=f.node,s=((o=f.node.textContent)==null?void 0:o.length)??0}if(!i&&e.nodes.length>0){const f=e.nodes[e.nodes.length-1];i=f.node,a=((u=f.node.textContent)==null?void 0:u.length)??0}if(!r||!i)return null;try{const f=document.createRange();return f.setStart(r,Math.min(s,((l=r.textContent)==null?void 0:l.length)??0)),f.setEnd(i,Math.min(a,((c=i.textContent)==null?void 0:c.length)??0)),f}catch{return null}}function Dp(e,t){e.querySelectorAll("mark.lookatstudy-underline").forEach(i=>{const a=i.parentNode;if(a){for(;i.firstChild;)a.insertBefore(i.firstChild,i);a.removeChild(i)}}),e.normalize();const n=new Map;if(t.length===0)return n;const r=fi(e),s=[];for(const i of t){const a=mC(r.text,i.text,i.surrounding);a>=0&&s.push({noteId:i.noteId,start:a,end:a+i.text.length})}s.sort((i,a)=>a.start-i.start);for(const i of s){const a=Pp(r,i.start,i.end);if(!a)continue;const o=pC(a,i.noteId);o&&n.set(i.noteId,o)}return n}function mC(e,t,n){if(!t)return-1;let r=e.indexOf(t);if(r<0){const s=t.replace(/\s+/g," ").trim();if(r=e.replace(/\s+/g," ").indexOf(s),r<0)return-1;const a=t.slice(0,Math.min(15,t.length));return e.indexOf(a)}if(n&&n.length>5){const s=e.indexOf(n.slice(0,20));if(s>=0){let i=r,a=Math.abs(r-s),o=r+1;for(;;){const u=e.indexOf(t,o);if(u<0)break;const l=Math.abs(u-s);l<a&&(i=u,a=l),o=u+1}return i}}return r}function pC(e,t){const n="color: inherit; background: transparent; border-bottom: 2px solid rgb(34, 197, 94); padding-bottom: 1px;",r=document.createElement("mark");return r.className="lookatstudy-underline",r.dataset.noteId=t,r.style.cssText=n,Op(e,r)}function Op(e,t){var n;if(e.startContainer===e.endContainer&&e.startContainer.nodeType===Node.TEXT_NODE)try{return e.surroundContents(t),t}catch{}try{const r=[],s=document.createTreeWalker(e.commonAncestorContainer,NodeFilter.SHOW_TEXT,{acceptNode(o){return e.intersectsNode(o)&&(o===e.startContainer||o===e.endContainer||e.intersectsNode(o))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}});let i;for(;i=s.nextNode();)r.push(i);if(r.length===0)return null;let a=null;for(const o of r){let u=o;if(o===e.startContainer&&e.startOffset>0&&(u=o.splitText(e.startOffset)),o===e.endContainer||u===e.endContainer){const c=u===e.endContainer?e.endOffset:e.endOffset-(o===e.startContainer?e.startOffset:0);c<u.textContent.length&&u.splitText(c)}if(!u.textContent)continue;const l=a?t.cloneNode(!1):t;(n=u.parentNode)==null||n.insertBefore(l,u),l.appendChild(u),a||(a=l)}return a}catch{return null}}const Fp="cp-reading-mark",Bp="cp-reading";function $n(e){var n;const t=CSS;try{(n=t.highlights)==null||n.delete(Bp)}catch{}qu=null,e.querySelectorAll(`.${Fp}`).forEach(r=>{const s=r.parentNode;if(s){for(;r.firstChild;)s.insertBefore(r.firstChild,r);s.removeChild(r)}}),e.normalize()}const gC=/[0-9A-Za-z\u00C0-\u024F\u0370-\u03FF\u0400-\u04FF\u4E00-\u9FFF\u3040-\u30FF\uAC00-\uD7AF]/,xC=`「『(([【<《"'“‘`,bC=`。』」))]】>》"'”’!!??…,,、;;::`;function jp(e){const t=e.codePointAt(0);let n=e;return t>=65281&&t<=65374&&(n=String.fromCharCode(t-65248)),gC.test(n)?n.toLowerCase():null}function yC(e){let t="";const n=[];for(let r=0;r<e.length;r++){const s=jp(e[r]);s!==null&&(t+=s,n.push(r))}return{canon:t,map:n}}function EC(e,t){if(t<=0)return 0;let n=0,r=e.length;for(;n<r;){const s=n+r>>1;e[s]<t?n=s+1:r=s}return n}function cd(e,t,n){const{canon:r,map:s}=yC(e),i=t.trim().split(/\s+/).map(m=>[...m].map(jp).filter(Boolean).join("")).filter(m=>m.length>0);if(i.length===0||r.length===0){const m=t.trim();if(!m)return null;const p=e.indexOf(m,Math.max(0,n));return p>=0?{start:p,end:p+m.length}:null}const a=EC(s,Math.max(0,n)),o=i.join("");let u=-1,l=-1;const c=r.indexOf(o,a);if(c>=0)u=c,l=c+o.length-1;else{let m=a;for(const p of i){const g=r.indexOf(p,m);if(g<0)return null;u<0&&(u=g),l=g+p.length-1,m=l+1}if(u<0||l-u+1>o.length*3+40)return null}if(l>=s.length||u<0)return null;let f=s[u],h=s[l]+1;const d=n>0?n:0;for(let m=0;m<3&&f-1>=d&&xC.includes(e[f-1]);m++)f--;for(let m=0;m<4&&h<e.length&&bC.includes(e[h]);m++)h++;return{start:f,end:h}}const Oo=new WeakMap;function Hp(e){Oo.delete(e)}function Up(e,t,n){$n(e);const r=t.trim();if(!r)return null;const s=fi(e,n==null?void 0:n.within,{includeMarks:!0}),i=Oo.get(e)??0;let a=cd(s.text,r,i);if(!a&&i>0&&(a=cd(s.text,r,0)),!a)return null;Oo.set(e,a.end);const o=Pp(s,a.start,a.end);if(!o)return null;const u=CSS;if(typeof Highlight<"u"&&u.highlights)try{return u.highlights.set(Bp,new Highlight(o)),qu=o,o}catch{}const l=document.createElement("span");return l.className=Fp,Op(o,l)?o:null}let qu=null;function TC(){return qu}function zp(e,t){var a,o,u;const n=e.getClientRects(),r=n.length>0&&n[0].height>0?n[0]:(a=e.startContainer.parentElement??e.startContainer)==null?void 0:a.getBoundingClientRect();if(!r||r.height<=0)return;if(!t){(u=(o=e.startContainer.parentElement??e.startContainer)==null?void 0:o.scrollIntoView)==null||u.call(o,{behavior:"smooth",block:"center"});return}const s=t.getBoundingClientRect();if(r.top>=s.top+48&&r.bottom<=s.bottom-48)return;const i=t.scrollTop+(r.top+r.height/2)-(s.top+s.height/2);t.scrollTo({top:Math.max(0,i),behavior:"smooth"})}let is=null,Fo=null;function vC(e){is=e,Fo=(e==null?void 0:e.textContent)??null}function kC(){if(wC(is))return is;if(Fo){for(const e of document.querySelectorAll("mark.lookatstudy-underline"))if(e.textContent===Fo)return is=e,e}return null}function wC(e){return!!e&&e.isConnected}function Vp(e){e.scrollIntoView({behavior:"smooth",block:"center"}),e.style.transition="background 0.3s, border-bottom-color 0.3s, border-bottom-width 0.3s",e.style.background="rgba(250, 204, 21, 0.35)",e.style.borderBottom="4px solid rgb(34, 197, 94)",setTimeout(()=>{e.style.color="inherit",e.style.background="transparent",e.style.borderBottom="2px solid rgb(34, 197, 94)"},1500)}function qp(e){const t=[];let n=!1;for(const r of e.split(`
|
|
442
|
-
`)){if(/^[ \t]*(?:```|~~~)/.test(r)){t.push(r),n=!n;continue}t.push(n?r:r.replace(/\\\[|\\\]|\\\(|\\\)/g,s=>s==="\\["||s==="\\]"?"$$":"$"))}return t.join(`
|
|
443
|
-
`)}const ss=new Set(["。","!","?","!","?",";",";","…"]),SC=new Set([",",",","、",":",":"," "," "]),AC=/[\u{1F000}-\u{1FAFF}\u{2600}-\u{27BF}\u{2B00}-\u{2BFF}]/u;function dd(e){return e!=null&&AC.test(String.fromCodePoint(e))}const CC=/(?:[\u{1F000}-\u{1FAFF}\u{2600}-\u{27BF}\u{2B00}-\u{2BFF}](?:\uFE0F|\u200D[\u{1F000}-\u{1FAFF}\u{2600}-\u{27BF}\u{2B00}-\u{2BFF}]|[\u{1F3FB}-\u{1F3FF}])*)$/u,Bo=new Set(["”",'"',"」","』","》",")","】","])".slice(0,1)]);function _C(e){let t=e;return t=t.replace(/\r\n?/g,`
|
|
444
|
-
`),t=t.replace(/(?:^|\n)[ \t]*(?:```|~~~)[^\n]*\n[\s\S]*?(?:\n[ \t]*(?:```|~~~)[^\n]*|\n?$)/g,`
|
|
445
|
-
`),t=t.replace(/`[^`\n]*`/g,""),t=t.replace(/!\[[^\]]*\]\([^)\n]*\)/g,""),t=t.replace(/\[([^\]]+)\]\([^)\n]*\)/g,"$1"),t=t.replace(/^[ \t]{0,3}#{1,6}[ \t]+/gm,""),t=t.replace(/^[ \t]*(?:[-*+]|\d+\.)[ \t]+/gm,""),t=t.replace(/^[ \t]*>[ \t]?/gm,""),t=t.replace(/\|/g," "),t=t.replace(/^[ \t]*[-: ]{3,}[ \t]*$/gm,""),t=t.replace(/(\*\*|__)(.*?)\1/g,"$2"),t=t.replace(new RegExp("(?<![*\\w])(\\*|_)(?!\\s)(.+?)(?<!\\s)\\1(?![*\\w])","g"),"$2"),t=t.replace(/~~(.+?)~~/g,"$1"),t=t.replace(/\n{3,}/g,`
|
|
446
|
-
|
|
447
|
-
`),t.trim()}function IC(e){return NC(_C(e),{flush:!0}).sentences}function $p(e,t){if(t<0||t>=e.length)return"";let n=t;for(;n>0&&!RC(e[n-1]??"");)n--;const r=[];for(let s=n;s<=t;s++){const i=e[s];i&&i.trim()&&r.push(i)}return r.join(" ")}function NC(e,t={}){const n=Math.max(8,t.maxBuffer??120),r=t.flush??!1,s=[],i=e.length;let a=0,o=0,u=-1;const l=f=>{const h=e.slice(a,f).trim();h&&s.push(h),a=f,u=-1};for(;o<i;){const f=e[o],h=e.codePointAt(o);if(dd(h)){let d=o+(h>65535?2:1);for(;d<i;){const m=e.codePointAt(d),p=m>65535?2:1;if(m===65039||m===8205||m>=127995&&m<=127999||dd(m)){d+=p;continue}break}l(d),o=d;continue}if(f===`
|
|
448
|
-
`){const d=e.slice(a,o+1).replace(/[^\S\n]+$/,"");d.trim()&&s.push(d),a=o+1,u=-1,o++;continue}if(ss.has(f)){let d=o+1;for(;d<i&&(ss.has(e[d])||Bo.has(e[d]));)d++;l(d),o=d;continue}if(f==="."){const d=o>0?e[o-1]:"",m=o+1<i?e[o+1]:"";if((m===""||/\s/.test(m))&&!/\d/.test(d)){let p=o+1;for(;p<i&&(Bo.has(e[p])||ss.has(e[p]));)p++;l(p),o=p;continue}}if(SC.has(f)&&(u=o),o-a+1>n)if(u>a){const d=u;l(d),a=d+1}else{l(o+1),o++;continue}o++}const c=e.slice(a).trim();return r&&c&&s.push(c),{sentences:s,rest:r?"":c}}function RC(e){if(/\n\s*$/.test(e))return!0;const t=e.trimEnd();if(!t)return!0;let n=t.length-1;for(;n>=0&&Bo.has(t[n]);)n--;if(n<0)return!0;const r=t[n];return ss.has(r)||r==="."||r===`
|
|
449
|
-
`?!0:CC.test(t)}function Wp(e,t,n,r,s){const a=r??e,o=a.top+a.height/2;return!s&&a.right+8+n<=t?{left:a.right+8,top:o,transform:"translate(0, -50%)"}:!s&&e.left-8-n>=0?{left:e.left-8,top:o,transform:"translate(-100%, -50%)"}:{left:Math.min(Math.max(e.left,0),Math.max(0,t-n)),top:a.bottom+8,transform:"translate(0, 0)"}}const fd="lookatstudy-tts-settings-changed";function hd(e){const t=n=>{const r=n.toLowerCase();return r==="zh-cn"||r==="zh_cn"||r==="zh"?0:r.startsWith("zh")?1:2};return[...e].sort((n,r)=>t(n.lang)-t(r.lang)||n.lang.localeCompare(r.lang)||n.name.localeCompare(r.name))}function md(e,t){if(e.length===0)return null;const n=t==null?void 0:t.trim();if(n){const i=e.find(a=>a.name===n);if(i)return i}const r=hd(e.filter(i=>i.default));return r.length>0&&LC(r[0].lang)?r[0]:hd(e)[0]??null}function LC(e){return e.toLowerCase().startsWith("zh")}function J4(e){return`${e.name} · ${e.lang}`}const MC=[["\\leq","小于等于"],["\\le","小于等于"],["\\geq","大于等于"],["\\ge","大于等于"],["\\neq","不等于"],["\\ne","不等于"],["\\approx","约等于"],["\\equiv","恒等于"],["\\pm","正负"],["\\times","乘以"],["\\cdot","点乘"],["\\div","除以"],["\\to","趋于"],["\\rightarrow","趋于"],["\\Rightarrow","推出"],["\\infty","无穷"],["\\sum","求和"],["\\prod","连乘"],["\\int","积分"],["\\lim","极限"],["\\log","对数"],["\\ln","自然对数"],["\\exp","指数"],["\\in","属于"],["\\subset","包含于"],["\\cup","并"],["\\cap","交"],["\\forall","任意"],["\\exists","存在"],["\\partial","偏导"],["\\nabla","梯度"],["\\angle","角"],["\\degree","度"],["\\cdots","点点点"],["\\ldots","点点点"]],PC={alpha:"阿尔法",beta:"贝塔",gamma:"伽马",delta:"德尔塔",epsilon:"艾普西隆",zeta:"泽塔",eta:"伊塔",theta:"西塔",iota:"约塔",kappa:"卡帕",lambda:"拉姆达",mu:"缪",nu:"纽",xi:"克西",pi:"派",rho:"柔",sigma:"西格马",tau:"陶",phi:"斐",chi:"凯",psi:"普西",omega:"欧米伽"};function DC(e,t){if(e[t]!=="{")return null;let n=0;for(let r=t;r<e.length;r++)if(e[r]==="{")n++;else if(e[r]==="}"&&(n--,n===0))return{body:e.slice(t+1,r),end:r+1};return null}function Br(e,t){const n=DC(e,t);return n||{body:e[t]??"",end:t+1}}function OC(e){let t=e;t=t.replace(/\\(?:left|right|displaystyle|limits)\b/g," "),t=t.replace(/\\[,;!\s]|\\quad|\\qquad|~/g," ");for(let n=0;n<12;n++){let r=t;r=r.replace(/\\[dt]?frac(?![A-Za-z])/g,"\\frac");{let s;for(;(s=r.indexOf("\\frac"))>=0;){const i=Br(r,s+5),a=Br(r,i.end);r=r.slice(0,s)+`${i.body} 分之 ${a.body} `+r.slice(a.end)}}{let s;for(;(s=r.indexOf("\\binom"))>=0;){const i=Br(r,s+6),a=Br(r,i.end);r=r.slice(0,s)+`${i.body} 取 ${a.body} `+r.slice(a.end)}}r=r.replace(/\\sqrt\s*\[( {[^{}]*} |[^\s\\]+)\s*\]\s*/g,(s,i)=>`${i.trim()} 次根号 `);{let s;for(;(s=r.indexOf("\\sqrt"))>=0;){const i=Br(r,s+5);r=r.slice(0,s)+`根号 ${i.body} `+r.slice(i.end)}}if(r=r.replace(/\\(?:mathbf|mathbb|mathrm|mathit|boldsymbol|text|operatorname)\s*/g,s=>s.startsWith("\\text")?"":" "),r===t){t=r;break}t=r}for(let n=0;n<8;n++){const r=t.replace(/(\\frac|[\w)\]}]|\s)\s*\^\s*(\{[^{}]*\}|[^\s])|(\\frac|[\w)\]}]| )\s*_\s*(\{[^{}]*\}|[^\s])/g,(s,i,a,o,u)=>a!==void 0?`${i} 的 ${a.replace(/[{}]/g,"")} 次方`:`${o} 下标 ${u.replace(/[{}]/g,"")}`);if(r===t)break;t=r}for(const[n,r]of MC)t=t.split(n).join(` ${r} `);return t=t.replace(/\\([A-Za-z]+)\b/g,(n,r)=>` ${PC[r]??r} `),t=t.replace(/[{}]/g," "),t.replace(/\s+/g," ").trim()}function FC(e){return e.replace(/\$\$([^$]+)\$\$|\$([^$]+)\$/g,(t,n,r)=>{const s=OC(n??r??"");return s?` ${s} `:""})}const pd=new WeakMap;let Yp=null;function Va(e){Yp=e}function BC(){return Yp}const Gp=1024;function Kp(e){let t=pd.get(e);return t||(t=e.createAnalyser(),t.fftSize=Gp,t.smoothingTimeConstant=.55,pd.set(e,t)),t}function jC(e,t){try{const n=Kp(e);t.connect(n),n.connect(e.destination)}catch{try{t.connect(e.destination)}catch{}}}const fr=1024,gd=512,HC=3500,UC=7500,zC=.3,VC=.16,qC=1400,$C=2800,qi=70,Xp=new Float64Array(fr);for(let e=0;e<fr;e++)Xp[e]=.5*(1-Math.cos(2*Math.PI*e/(fr-1)));function WC(e,t){const n=e.length;for(let r=1,s=0;r<n;r++){let i=n>>1;for(;s&i;i>>=1)s^=i;if(s|=i,r<s){const a=e[r];e[r]=e[s],e[s]=a;const o=t[r];t[r]=t[s],t[s]=o}}for(let r=2;r<=n;r<<=1){const s=-2*Math.PI/r,i=Math.cos(s),a=Math.sin(s),o=r>>1;for(let u=0;u<n;u+=r){let l=1,c=0;for(let f=0;f<o;f++){const h=e[u+f],d=t[u+f],m=e[u+f+o],p=t[u+f+o],g=m*l-p*c,y=m*c+p*l;e[u+f]=h+g,t[u+f]=d+y,e[u+f+o]=h-g,t[u+f+o]=d-y;const v=l*i-c*a;c=l*a+c*i,l=v}}}}function YC(e,t){const n=e.length;let r=0;const s=new Float64Array(n),i=new Float64Array(n);for(let p=0;p<n;p++){const g=e[p];r+=Math.abs(g),s[p]=g*Xp[p]}WC(s,i);const a=n>>1,o=t/n,u=new Float64Array(a);let l=0,c=0,f=0,h=0,d=0,m=0;for(let p=0;p<a;p++){const g=p*o;if(g>=t/2-o)break;const y=Math.hypot(s[p],i[p])/a;u[p]=y,l+=y,g>=HC&&g<UC&&(c+=y),g>=_l.lo&&g<_l.hi?(f+=y,h+=y*g):g>=Il.lo&&g<Il.hi&&(d+=y,m+=y*g)}return{level:n>0?Math.min(1,r/n/.22):0,f1:f>0?h/f:400,f2:d>0?m/d:800,hfRatio:l>0?c/l:0}}function GC(e,t){return e.level<=Zg?"closed":e.hfRatio>=zC?"SS":e.hfRatio>=VC&&e.level<.45?"FV":t==="closed"&&e.f2>=qC&&e.f2<=$C?"L":Jg(e.f1,e.f2,e.level)}function KC(e,t){const n=[],r=(c,f,h,d)=>{if(f<=0)return;const m=n[n.length-1];if(m&&m.viseme===h&&Math.abs(m.t+m.dur-c)<1e-9){m.dur+=f,m.level=Math.max(m.level,d);return}n.push({t:c,dur:f,viseme:h,level:d})};if(e.length<fr)return{cues:[{t:0,dur:Math.max(0,e.length/t),viseme:"closed",level:0}],duration:Math.max(0,e.length/t)};let s="closed";const i=gd/t;for(let c=0;c+fr<=e.length;c+=gd){const f=e.subarray(c,c+fr),h=YC(f,t),d=GC(h,s);r(c/t,i,d,h.level),s=d}const a=e.length/t,o=n.length>0?n[n.length-1].t+n[n.length-1].dur:0;o<a-1e-9&&r(o,a-o,"closed",0);const u=n[0];if(u&&u.viseme!=="closed")if(u.dur<=qi/1e3)u.viseme="closed";else{const c=Math.min(u.dur*.5,qi/1e3);u.dur-=c,u.t+=c,n.unshift({t:0,dur:c,viseme:"closed",level:0})}const l=n[n.length-1];if(l&&l.viseme!=="closed"){const c=Math.min(l.dur*.5,qi/1e3);l.dur-=c,n.push({t:l.t+l.dur,dur:c,viseme:"closed",level:0})}for(let c=n.length-1;c>=1;c--){const f=n[c];if(f.viseme!=="closed"&&f.dur<qi/1e3){const h=n[c-1];h.dur+=f.dur,n.splice(c,1)}}return{cues:n,duration:a}}function XC(e){const t=[...e].filter(s=>s.dur>0&&Number.isFinite(s.t)).sort((s,i)=>s.t-i.t),n=[];let r=0;for(const s of t){const i=Math.max(0,s.t/1e3),a=s.dur/1e3;i>r+1e-9&&n.push({t:r,dur:i-r,viseme:"closed",level:0});const o=n[n.length-1];o&&o.viseme===s.viseme&&Math.abs(o.t+o.dur-i)<1e-9?(o.dur+=a,o.level=Math.max(o.level,Math.min(1,Math.max(0,s.level)))):n.push({t:i,dur:a,viseme:s.viseme,level:Math.min(1,Math.max(0,s.level))}),r=i+a}return{cues:n,duration:r}}function QC(e,t){const n=e.cues;if(n.length===0||t<0)return null;let r=0,s=n.length-1;for(;r<s;){const a=r+s+1>>1;n[a].t<=t?r=a:s=a-1}const i=n[r];return t<=i.t+i.dur+1e-9?i:null}function Qp(){const[e,t]=w.useState(null),[n,r]=w.useState(null),[s,i]=w.useState(null),[a,o]=w.useState([]),u=w.useRef([]),[l,c]=w.useState(null),[f,h]=w.useState(!1),d=w.useRef(null),m=w.useRef(new Map),p=w.useRef(new Map),g=w.useRef(0),y=w.useRef(!1),v=w.useRef([]),T=w.useRef(0),C=w.useRef(0),E=w.useRef(!1),k=w.useRef(null),_=w.useRef(0),A=w.useRef(null),I=w.useRef(null),S=w.useRef(null);S.current||(S.current=()=>{const F=I.current,q=typeof window<"u"?window.speechSynthesis:void 0;if(!F||F.stopped||!q)return;if(F.i>=F.sentences.length){I.current=null,k.current=null,t(null),r(null),i(null);return}const R=F.i,$=FC(F.sentences[R]),W=new SpeechSynthesisUtterance($);F.voice&&(W.voice=F.voice,W.lang=F.voice.lang),W.rate=F.rate,W.onstart=()=>{!I.current||I.current.stopped||i({index:R,total:F.sentences.length,text:$})};const M=()=>{var ee;!I.current||I.current.stopped||(I.current.i+=1,(ee=S.current)==null||ee.call(S))};W.onend=M,W.onerror=M,q.speak(W)});const L=w.useCallback((F,q)=>{var M;if(typeof window>"u"||!("speechSynthesis"in window)){c("engine-unavailable");return}const R=IC(q);if(R.length===0){c("empty-text");return}u.current=R.slice(),o(R.slice()),_.current=R.length,r({index:0,total:R.length,text:R[0]??""});const $=A.current,W=md(window.speechSynthesis.getVoices(),($==null?void 0:$.systemVoice)??null);I.current={messageId:F,sentences:R,i:0,stopped:!1,voice:W,rate:xd($==null?void 0:$.speed)},window.speechSynthesis.cancel(),(M=S.current)==null||M.call(S)},[]),N=()=>{if(!d.current){const F=window.AudioContext??window.webkitAudioContext;d.current=new F}return d.current.resume(),d.current},j=w.useCallback(()=>{E.current&&C.current>=T.current&&!y.current&&(k.current=null,t(null),r(null),i(null))},[]),P=w.useCallback(()=>{const F=d.current;if(!F||y.current)return;const q=m.current.get(g.current);if(!q){j();return}const R=g.current;m.current.delete(R),y.current=!0,i({index:R,total:_.current,text:u.current[R]??""}),g.current+=1;const $=F.createBufferSource();$.buffer=q,jC(F,$),Va({ctx:F,timeline:p.current.get(R)??null,startedAtCtxTime:F.currentTime,analyser:Kp(F)}),$.onended=()=>{C.current+=1,y.current=!1,Va(null),P()},v.current.push($),$.start()},[j]),D=w.useCallback(()=>{for(const F of v.current)try{F.onended=null,F.stop()}catch{}v.current=[],m.current.clear(),p.current.clear(),Va(null),y.current=!1,T.current=0,C.current=0,E.current=!1,k.current=null,g.current=0,_.current=0,u.current=[],o([]),t(null),r(null),i(null),I.current&&(I.current.stopped=!0,I.current=null),typeof window<"u"&&"speechSynthesis"in window&&window.speechSynthesis.cancel()},[]),H=w.useCallback(()=>{D(),window.api.ttsStop().catch(()=>{})},[D]),z=w.useCallback((F,q)=>{var R;if(k.current===F){H();return}if(D(),window.dispatchEvent(new CustomEvent("lookatstudy-speech-start",{detail:F})),c(null),k.current=F,T.current=0,C.current=0,E.current=!1,g.current=0,_.current=0,t(F),r({index:0,total:0,text:""}),((R=A.current)==null?void 0:R.engine)==="system"){L(F,q);return}N(),window.api.ttsSpeak(q,F).then($=>{if($.ok){$.firstUse&&h(!0);return}D(),$.reason!=="empty-text"&&c($.reason)}).catch(()=>D())},[L,H,D]);return w.useEffect(()=>{const F=window.api.on("speech:ttsAudio",$=>{if($.messageId!==k.current)return;const W=N();T.current+=1,_.current=$.sentenceTotal,r({index:$.sentenceIndex,total:$.sentenceTotal,text:$.sentence??""}),$.sentence!=null&&(u.current[$.sentenceIndex]=$.sentence,o(u.current.slice())),W.decodeAudioData($.wavBytes).then(M=>{var ee;if($.messageId===k.current){m.current.set($.sentenceIndex,M);try{const oe=(ee=$.visemeCues)!=null&&ee.length?XC($.visemeCues):KC(ZC(M),M.sampleRate);oe&&p.current.set($.sentenceIndex,oe)}catch{}P()}},()=>{$.messageId===k.current&&(T.current-=1,P())})}),q=window.api.on("speech:ttsDone",$=>{$.messageId===k.current&&(E.current=!0,j())}),R=window.api.on("speech:ttsError",()=>D());return()=>{F(),q(),R()}},[j,P,D]),w.useEffect(()=>D,[D]),w.useEffect(()=>{const F=q=>{const R=q.detail;k.current&&R!==k.current&&D()};return window.addEventListener("lookatstudy-speech-start",F),()=>window.removeEventListener("lookatstudy-speech-start",F)},[D]),w.useEffect(()=>{let F=!0;const q=()=>{Promise.all([window.api.getSetting("tts_engine"),window.api.getSetting("tts_system_voice"),window.api.getSetting("tts_speed")]).then(([R,$,W])=>{F&&(A.current={engine:(R??"").trim(),systemVoice:$??null,speed:xd(W)})}).catch(()=>{})};return q(),window.addEventListener(fd,q),()=>{F=!1,window.removeEventListener(fd,q)}},[]),w.useEffect(()=>{if(typeof window>"u"||!("speechSynthesis"in window))return;const F=()=>{var R;const q=I.current;!q||q.voice||(q.voice=md(window.speechSynthesis.getVoices(),((R=A.current)==null?void 0:R.systemVoice)??null))};return window.speechSynthesis.addEventListener("voiceschanged",F),()=>window.speechSynthesis.removeEventListener("voiceschanged",F)},[]),w.useEffect(()=>{e1(e!==null)},[e]),{speakingMessageId:e,speakingSentence:n,playingSentence:s,streamTexts:a,failReason:l,clearFailReason:()=>c(null),onlineNotice:f,clearOnlineNotice:()=>h(!1),speak:z,stop:H}}function ZC(e){if(e.numberOfChannels===1)return e.getChannelData(0);const t=e.getChannelData(0),n=e.getChannelData(1),r=new Float32Array(t.length);for(let s=0;s<t.length;s++)r[s]=(t[s]+n[s])/2;return r}function xd(e){const t=typeof e=="number"?e:Number.parseFloat(e??"");return Number.isFinite(t)?Math.min(2,Math.max(.5,t)):1}const Zp=w.createContext(null);let JC=0;const e3={default:4e3,success:4e3,info:4e3,warning:5e3,error:6e3},t3={default:null,success:x.jsx(bu,{className:"w-4 h-4 text-brand shrink-0"}),error:x.jsx(P1,{className:"w-4 h-4 text-warning shrink-0"}),warning:x.jsx(Eu,{className:"w-4 h-4 text-review shrink-0"}),info:x.jsx(W1,{className:"w-4 h-4 text-accent shrink-0"})};function n3({children:e}){const[t,n]=w.useState([]),r=w.useCallback(a=>{n(o=>o.filter(u=>u.id!==a))},[]),s=w.useCallback(a=>{n(o=>o.map(u=>u.id===a?{...u,exiting:!0}:u))},[]),i=w.useCallback((a,o)=>{const u=++JC,l=(o==null?void 0:o.severity)??"default",c=(o==null?void 0:o.duration)??e3[l],f={id:u,message:a,action:o==null?void 0:o.action,duration:c,severity:l,exiting:!1};n(h=>[...h,f]),window.setTimeout(()=>s(u),c)},[s]);return x.jsxs(Zp.Provider,{value:{show:i},children:[e,x.jsx("div",{className:"fixed top-14 left-1/2 -translate-x-1/2 z-[100] flex flex-col items-center gap-2 pointer-events-none",role:"region","aria-live":"polite","aria-label":"Notifications",children:t.map(a=>x.jsx(r3,{item:a,onAction:()=>{a.action.onClick(),s(a.id)},onDismiss:()=>s(a.id),onExitDone:()=>r(a.id)},a.id))})]})}function r3({item:e,onAction:t,onDismiss:n,onExitDone:r}){const s=We(),i=t3[e.severity];return x.jsxs("div",{className:`pointer-events-auto flex items-center gap-2.5 pl-4 pr-2 py-2 rounded-full bg-surface-0 text-ink-strong text-body shadow-elevated max-w-md ${e.exiting?"toast-exit":"toast-enter"}`,"data-testid":`toast-${e.id}`,"data-severity":e.severity,onAnimationEnd:e.exiting?r:void 0,children:[i,x.jsx("span",{className:"flex-1",children:e.message}),e.action&&x.jsx("button",{onClick:t,className:"text-brand font-bold text-body hover:underline shrink-0 px-1.5 py-1 rounded transition-colors hover:bg-brand/10","data-testid":`toast-action-${e.id}`,children:e.action.label}),x.jsx("button",{onClick:n,className:"text-ink-muted hover:text-ink-strong shrink-0 w-6 h-6 flex items-center justify-center rounded transition-colors hover:bg-surface-3","aria-label":s("action.close"),children:x.jsx(hr,{className:"w-3.5 h-3.5"})})]})}function $u(){const e=w.useContext(Zp);return e||{show:()=>{}}}const Jp={typescript:()=>ve(()=>import("./typescript-BPQ3VLAy.js"),[],import.meta.url),tsx:()=>ve(()=>import("./tsx-COt5Ahok.js"),[],import.meta.url),javascript:()=>ve(()=>import("./javascript-wDzz0qaB.js"),[],import.meta.url),jsx:()=>ve(()=>import("./jsx-g9-lgVsj.js"),[],import.meta.url),python:()=>ve(()=>import("./python-B6aJPvgy.js"),[],import.meta.url),go:()=>ve(()=>import("./go-C27-OAKa.js"),[],import.meta.url),rust:()=>ve(()=>import("./rust-B1yitclQ.js"),[],import.meta.url),java:()=>ve(()=>import("./java-CylS5w8V.js"),[],import.meta.url),c:()=>ve(()=>import("./c-BIGW1oBm.js"),[],import.meta.url),cpp:()=>ve(()=>import("./cpp-DddhVWhK.js"),__vite__mapDeps([5,6]),import.meta.url),csharp:()=>ve(()=>import("./csharp-DSvCPggb.js"),[],import.meta.url),ruby:()=>ve(()=>import("./ruby-B6QtyW_S.js"),__vite__mapDeps([7,8,9,10,11,12,13,14,15,16,17,5,6,18,19,20]),import.meta.url),php:()=>ve(()=>import("./php-Csjmro_R.js"),__vite__mapDeps([21,8,9,10,11,12,13,22]),import.meta.url),swift:()=>ve(()=>import("./swift-C2oV4EkX.js"),[],import.meta.url),kotlin:()=>ve(()=>import("./kotlin-BdnUsdx6.js"),[],import.meta.url),lua:()=>ve(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([19,6]),import.meta.url),r:()=>ve(()=>import("./r-Cf5RLm7j.js"),[],import.meta.url),shellscript:()=>ve(()=>import("./shellscript-Yzrsuije.js"),[],import.meta.url),sql:()=>ve(()=>import("./sql-CRqJ_cUM.js"),[],import.meta.url),html:()=>ve(()=>import("./html-pp8916En.js"),__vite__mapDeps([8,9,10]),import.meta.url),css:()=>ve(()=>import("./css-CLj8gQPS.js"),[],import.meta.url),scss:()=>ve(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([23,10]),import.meta.url),xml:()=>ve(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([11,12]),import.meta.url),json:()=>ve(()=>import("./json-Cp-IABpG.js"),[],import.meta.url),yaml:()=>ve(()=>import("./yaml-Buea-lGh.js"),[],import.meta.url),toml:()=>ve(()=>import("./toml-vGWfd6FD.js"),[],import.meta.url),ini:()=>ve(()=>import("./ini-BEwlwnbL.js"),[],import.meta.url),markdown:()=>ve(()=>import("./markdown-Cvjx9yec.js"),[],import.meta.url),dockerfile:()=>ve(()=>import("./dockerfile-BcOcwvcX.js"),[],import.meta.url),makefile:()=>ve(()=>import("./makefile-CHLpvVh8.js"),[],import.meta.url),diff:()=>ve(()=>import("./diff-D97Zzqfu.js"),[],import.meta.url),graphql:()=>ve(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([14,9,15,16,17]),import.meta.url),latex:()=>ve(()=>import("./latex-B2nUCzCX.js"),__vite__mapDeps([24,25]),import.meta.url),vue:()=>ve(()=>import("./vue-CHlpWS_5.js"),__vite__mapDeps([26,10,9,15,22,8]),import.meta.url)},bd={js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",py:"python",python3:"python",rb:"ruby",golang:"go",rs:"rust",cs:"csharp",kt:"kotlin",sh:"shellscript",bash:"shellscript",zsh:"shellscript",shell:"shellscript",console:"shellscript",yml:"yaml",md:"markdown",gfm:"markdown",docker:"dockerfile",tex:"latex",plaintext:"",txt:"",text:""};function i3(e){const t=e.trim().toLowerCase();return t?t in bd?bd[t]||null:t in Jp?t:null:null}let jr=null;const yd=new Set;function Wu(){return jr||(jr=(async()=>{const[e,t,n,r]=await Promise.all([ve(()=>import("./core-DeLhdWdV.js"),__vite__mapDeps([27,1,2]),import.meta.url),ve(()=>import("./engine-javascript-DBd1bXLz.js"),[],import.meta.url),ve(()=>import("./github-dark-DHJKELXO.js"),[],import.meta.url),ve(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url)]);return e.createHighlighterCore({themes:[n.default,r.default],langs:[],engine:t.createJavaScriptRegexEngine({forgiving:!0})})})(),jr.catch(()=>{jr=null})),jr}async function e0(e){const t=i3(e);if(!t)return null;if(yd.has(t))return t;const n=Jp[t];if(!n)return null;const r=await Wu(),s=await n();return await r.loadLanguage(s),yd.add(t),t}async function s3(e,t){try{const n=await e0(t);return n?(await Wu()).codeToHtml(e,{lang:n,themes:{light:"github-light",dark:"github-dark"},defaultColor:"dark"}):null}catch{return null}}const a3=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");async function eR(e,t){try{const n=await e0(t);return n?(await Wu()).codeToTokens(e,{lang:n,theme:"github-dark"}).tokens.map(i=>i.map(a=>`<span style="color:${a.color}">${a3(a.content)}</span>`).join("")):null}catch{return null}}function o3(e){const t=Array.isArray(e)?e[0]:e,n=(t==null?void 0:t.props)??{},r=/language-(\w+)/.exec(n.className??""),s=n.children,i=typeof s=="string"?s:Array.isArray(s)?s.join(""):"";return{lang:(r==null?void 0:r[1])??"",text:i}}function t0({children:e,...t}){const n=We(),[r,s]=w.useState(!1),[i,a]=w.useState(null),{lang:o,text:u}=o3(e);w.useEffect(()=>{let c=!0;if(u)return s3(u.replace(/\n$/,""),o).then(f=>{c&&f&&a(f)}),()=>{c=!1}},[u]);const l=()=>{var c;(c=navigator.clipboard)==null||c.writeText(u).then(()=>{s(!0),setTimeout(()=>s(!1),1500)})};return x.jsxs("div",{className:"relative group my-3","data-testid":"md-codeblock",children:[x.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 bg-surface-1 border border-b-0 border-[var(--border-faint)] rounded-t-md",children:[x.jsx("span",{className:"text-caption font-mono text-ink-faint uppercase tracking-wider",children:o||"code"}),x.jsx("button",{onClick:l,"aria-label":n("chat.copy"),className:"text-caption text-ink-muted hover:text-brand transition-colors opacity-0 group-hover:opacity-100 pointer-coarse:opacity-100 inline-flex items-center gap-1","data-testid":"md-copy",children:r?x.jsxs(x.Fragment,{children:[x.jsx(vn,{className:"w-3 h-3 inline"}),n("chat.copied")]}):x.jsxs(x.Fragment,{children:[x.jsx(F1,{className:"w-3 h-3 inline"}),n("chat.copy")]})})]}),i?x.jsx("div",{className:"md-shiki","data-testid":"md-shiki",dangerouslySetInnerHTML:{__html:i}}):x.jsx("pre",{...t,className:"!mt-0 !rounded-t-none !border-t-0",children:e})]})}const u3=w.lazy(()=>ve(()=>import("./MindmapView-lDgBnVx4.js"),__vite__mapDeps([28,1,2,29]),import.meta.url).then(e=>({default:e.MindmapView}))),n0=w.lazy(()=>ve(()=>import("./index-C9AodbWN.js"),__vite__mapDeps([30,1,2,29,31,32]),import.meta.url).then(e=>({default:e.ArtifactRenderer}))),l3=w.lazy(()=>ve(()=>import("./CanvasStage-CoofMkz2.js").then(e=>e.a),__vite__mapDeps([29,1,2]),import.meta.url).then(e=>({default:e.CanvasStage}))),c3=w.lazy(()=>ve(()=>import("./ReviewPanel-KoEHhgh6.js"),__vite__mapDeps([33,1,2]),import.meta.url).then(e=>({default:e.SelfRatingCard}))),d3={concept_map:ph,quiz:ch,compare_table:dx,diagram:U1,code_walkthrough:O1},f3=new Set(["concept_map","quiz","compare_table","diagram","code_walkthrough"]);function h3(e,t){return f3.has(t)?e(`artifact.type.${t}`):e("artifact.type.unknown")}function m3({selectedNode:e,items:t,loading:n,forceTab:r,canvasArtifact:s,isReviewing:i,onReviewDone:a,onUserTabChange:o,onRemove:u,onTogglePin:l,onRecordQuizResult:c,onSaveContentNote:f,onUpdateNoteComment:h,onJumpToSource:d,onQuoteToChat:m,locale:p}){var _;const g=We(),[y,v]=w.useState("content"),T=r??y,C=A=>{v(A),o==null||o()},E=e?t.filter(A=>A.nodeId===e.id):[],k=w.useRef(null);return w.useEffect(()=>{var A;(A=k.current)==null||A.scrollTo({top:0})},[e==null?void 0:e.id]),x.jsxs("div",{className:"relative h-full flex flex-col bg-surface-2","data-testid":"notebook-panel",children:[x.jsx("div",{className:"px-3 pt-3 pb-1 shrink-0","data-testid":"notebook-tabs",children:x.jsxs("div",{className:"flex p-1 rounded-lg gap-1 bg-ink/[0.08]",role:"tablist","aria-label":"Notebook",children:[x.jsx(Ya,{label:g("notebook.tab.explain"),icon:kn,active:T==="content",onClick:()=>C("content"),testid:"tab-content"}),x.jsx(Ya,{label:g("notebook.tab.notes"),icon:Q1,active:T==="notes",onClick:()=>{C("notes"),rh()},testid:"tab-notes",badge:E.length>0?String(E.length):void 0}),x.jsx(Ya,{label:g("notebook.tab.board"),icon:fa,active:T==="board",onClick:()=>C("board"),testid:"tab-board"})]})}),x.jsx("div",{className:"flex-1 overflow-y-auto min-h-0 animate-tab-slide",ref:k,role:"tabpanel",children:T==="board"?x.jsx("div",{className:"h-full flex flex-col","data-testid":"board-tab-content",children:s?x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"px-4 pt-3 pb-2 shrink-0 flex items-center gap-2 min-w-0",children:[x.jsx(fa,{className:"w-4 h-4 text-ink-muted shrink-0"}),x.jsx("span",{className:"text-label font-bold text-ink truncate",children:((_=s.output)==null?void 0:_.title)??s.toolName})]}),x.jsx("div",{className:"flex-1 min-h-0 px-2 pb-2",children:x.jsx("div",{className:"h-full rounded-xl overflow-hidden bg-surface-0/60 border border-[var(--border-faint)]",children:x.jsx(w.Suspense,{fallback:null,children:x.jsx(l3,{testid:"board-canvas-stage",children:x.jsx(n0,{data:s.output,variant:"canvas"})})})})})]}):x.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center px-6",children:[x.jsx(fa,{className:"w-10 h-10 mb-3 text-ink-muted opacity-30"}),x.jsx("div",{className:"text-body text-ink-muted max-w-sm leading-relaxed",children:g("notebook.board.empty")})]})}):x.jsx(x.Fragment,{children:x.jsx("div",{className:"mx-auto w-full max-w-[960px] min-h-full flex flex-col",children:T==="content"?x.jsx(p3,{selectedNode:e,contentNotes:E.filter(A=>A.artifactType==="user_note"&&A.sourceAnchor),onQuoteToChat:m,onSaveContentNote:f,locale:p,isReviewing:i,onReviewDone:a}):x.jsx(g3,{items:E,loading:n,selectedNode:e,onRemove:u,onTogglePin:l,onRecordQuizResult:c,onUpdateNoteComment:h,onJumpToSource:d})})})},T)]})}function p3({selectedNode:e,contentNotes:t,onQuoteToChat:n,onSaveContentNote:r,locale:s,isReviewing:i,onReviewDone:a}){const o=We(),u=$u(),l=Qp();w.useEffect(()=>{if(l.failReason){const z=l.failReason==="engine-unavailable"?"chat.speech.engine_unavailable":l.failReason==="azure-key-missing"?"chat.speech.azure_key_missing":l.failReason==="azure-region-missing"?"chat.speech.azure_region_missing":l.failReason==="edge-failed"?"chat.speech.edge_failed":"chat.speech.model_missing";u.show(o(z),{severity:"warning"}),l.clearFailReason()}else l.onlineNotice&&(u.show(o("chat.speech.edge_disclosed"),{severity:"info"}),l.clearOnlineNotice())},[l.failReason,l.onlineNotice,u,o,l]);const c=w.useRef(l.stop);c.current=l.stop;const f=e?`content-${e.id}`:null;w.useEffect(()=>()=>{c.current()},[f]);const[h,d]=w.useState(null),m=Np(h??""),[p,g]=w.useState(!1),[y,v]=w.useState(!1),[T,C]=w.useState(!1),[E,k]=w.useState([]),[_,A]=w.useState(null),I=w.useRef(null),S=w.useRef(null),L=typeof matchMedia=="function"&&matchMedia("(pointer: coarse)").matches;w.useEffect(()=>{if(!e){d(null),v(!1);return}let z=!1;return g(!0),v(!1),ce.getNodeContent(e.id,s??void 0).then(F=>{z||d(F)}).catch(()=>{z||(d(null),v(!0))}).finally(()=>{z||g(!1)}),()=>{z=!0}},[e==null?void 0:e.id,s]),w.useEffect(()=>{if(!e){k([]);return}let z=!1;return ce.listAssetsByNode(e.id).then(F=>{z||k(F)}).catch(()=>{z||k([])}),()=>{z=!0}},[e==null?void 0:e.id]),w.useEffect(()=>{if(!h||!I.current)return;const z=[];for(const q of t)try{const R=JSON.parse(q.sourceAnchor);if(R.type==="content"){const $=JSON.parse(q.data).text??"";$&&z.push({noteId:q.id,text:$,surrounding:R.surroundingText})}}catch{}const F=setTimeout(()=>{S.current&&Dp(S.current,z)},80);return()=>clearTimeout(F)},[h,t]),w.useEffect(()=>{const z=F=>{var $;const q=F.detail;if(!q)return;const R=($=S.current)==null?void 0:$.querySelector(`mark[data-note-id="${q}"]`);R&&Vp(R)};return window.addEventListener("lookatstudy-jump-to-note",z),()=>window.removeEventListener("lookatstudy-jump-to-note",z)},[]);const N=l.speakingMessageId===f&&l.playingSentence!=null?l.playingSentence.index:null;w.useEffect(()=>{const z=S.current;if(!z)return;if(N==null){$n(z);return}const F=$p(l.streamTexts,N);if(!F)return;N===0&&Hp(z);const q=setTimeout(()=>{const R=Up(z,F);R&&zp(R,z.closest(".overflow-y-auto"))},30);return()=>clearTimeout(q)},[N,l.streamTexts,f]),w.useEffect(()=>{N==null&&S.current&&$n(S.current)},[N]);const j=w.useRef(!1);j.current=N!=null,w.useEffect(()=>()=>{j.current&&$n(document.body)},[]);const P=w.useCallback(()=>{var me;if(!n&&!r)return;const z=window.getSelection(),F=(z==null?void 0:z.toString().trim())??"";if(F.length<2||F.length>500){A(null);return}const q=z==null?void 0:z.getRangeAt(0);if(!q||!((me=I.current)!=null&&me.contains(q.commonAncestorContainer))){A(null);return}const R=q.getBoundingClientRect(),$=I.current.getBoundingClientRect(),W=S.current;let M=null;if(W&&W.contains(q.commonAncestorContainer)){const te=fi(W);M=Rp(q,te)}const ee=W?fi(W).text:F,oe=M?M.start:ee.indexOf(F),V=oe>=0?ee.slice(Math.max(0,oe-30),oe+F.length+30):F,X=q.getClientRects(),Z=X.length?X[X.length-1]:R,be=Wp({left:R.left-$.left,top:R.top-$.top,right:R.right-$.left,bottom:R.bottom-$.top,width:R.width,height:R.height},$.width,n?L?190:150:L?140:100,{left:Z.left-$.left,top:Z.top-$.top,right:Z.right-$.left,bottom:Z.bottom-$.top,width:Z.width,height:Z.height},L);A({x:be.left,y:be.top,transform:be.transform,text:F,surrounding:V,offsets:M??void 0})},[n,r,L]);w.useEffect(()=>{const z=L?600:250;let F=null,q=null,R=!1;const $=()=>{var oe;return(((oe=window.getSelection())==null?void 0:oe.toString().trim().length)??0)>=2},W=()=>{$()?(q&&(clearTimeout(q),q=null),A(oe=>oe&&null),F&&clearTimeout(F),F=setTimeout(()=>{F=null,!R&&$()&&P()},z)):q||(q=setTimeout(()=>A(oe=>oe&&null),250))},M=oe=>{var X;const V=oe.target;(X=V==null?void 0:V.closest)!=null&&X.call(V,"[data-selection-popover]")||(R=!0)},ee=()=>{R=!1,F&&(clearTimeout(F),F=null),!q&&$()&&P()};return document.addEventListener("selectionchange",W),window.addEventListener("pointerdown",M,!0),window.addEventListener("pointerup",ee,!0),window.addEventListener("pointercancel",ee,!0),()=>{document.removeEventListener("selectionchange",W),window.removeEventListener("pointerdown",M,!0),window.removeEventListener("pointerup",ee,!0),window.removeEventListener("pointercancel",ee,!0),F&&clearTimeout(F),q&&clearTimeout(q)}},[P]);const D=w.useCallback(()=>{var F;if(!_||!n)return;const z=_.text.length>200?_.text.slice(0,200)+"…":_.text;n(o("notebook.quote.template",{text:z})),A(null),(F=window.getSelection())==null||F.removeAllRanges()},[_,n,o]),H=w.useCallback(()=>{var F,q,R;if(!_||!r||!e)return;const z=_.text.length>200?_.text.slice(0,200)+"…":_.text;r(z,{type:"content",surroundingText:_.surrounding,startOffset:(F=_.offsets)==null?void 0:F.start,endOffset:(q=_.offsets)==null?void 0:q.end}),rh(),setTimeout(()=>{var M;const $=(M=S.current)==null?void 0:M.querySelectorAll("mark.lookatstudy-underline"),W=$&&$.length>0?$[$.length-1]:null;W&&vC(W)},200),A(null),(R=window.getSelection())==null||R.removeAllRanges()},[_,r,e]);return e?x.jsxs("div",{className:"p-5 relative","data-testid":"node-content",ref:I,children:[!p&&!y&&h&&x.jsxs("div",{className:"sticky top-0 z-20 flex justify-end gap-2 -mt-2 pointer-events-none",children:[x.jsx("button",{onClick:()=>C(z=>!z),"data-tooltip":o("notebook.mindmap.toggle"),"aria-label":o("notebook.mindmap.toggle"),"aria-pressed":T,"data-testid":"node-content-mindmap",className:`pointer-events-auto shrink-0 rounded-full p-2 bg-surface-2 shadow-elevated transition-colors ${T?"text-accent":"text-ink-muted hover:text-ink-strong"}`,children:x.jsx(sh,{className:"w-4 h-4"})}),x.jsx("button",{onClick:()=>l.speak(f??"content",h),"data-tooltip":l.speakingMessageId===f?o("chat.speech.stop"):o("chat.speech.read_aloud_node"),"aria-label":l.speakingMessageId===f?o("chat.speech.stop"):o("chat.speech.read_aloud_node"),"data-testid":l.speakingMessageId===f?"node-content-speak-active":"node-content-speak",className:`pointer-events-auto shrink-0 rounded-full p-2 bg-surface-2 shadow-elevated transition-colors ${l.speakingMessageId===f?"text-brand animate-pulse":"text-ink-muted hover:text-ink-strong"}`,children:l.speakingMessageId===f?x.jsx(yu,{className:"w-4 h-4"}):x.jsx(xh,{className:"w-4 h-4"})})]}),x.jsx("div",{className:"text-caption font-bold text-brand uppercase tracking-wider mb-1",children:e.type==="section"?o("notebook.node_type.section"):e.type==="concept"?o("notebook.node_type.concept"):o("notebook.node_type.lesson")}),x.jsx("div",{className:"flex items-start justify-between gap-3 mb-4",children:x.jsx("h2",{className:"text-title font-extrabold text-ink-strong tracking-tight","data-testid":"node-content-title",children:e.title})}),p?x.jsxs("div",{className:"text-body text-ink-muted flex items-center gap-2",children:[x.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),o("notebook.content.loading")]}):y?x.jsxs("div",{className:"text-body text-warning",children:[o("notebook.content.load_failed"),x.jsx("button",{className:"underline ml-1",onClick:()=>{v(!1),g(!0),ce.getNodeContent(e.id,s??void 0).then(d).catch(()=>v(!0)).finally(()=>g(!1))},children:o("notebook.content.retry")})]}):h?T?x.jsx(w.Suspense,{fallback:null,children:x.jsx(u3,{markdown:h})}):x.jsx(hC,{fallback:(z,F)=>x.jsxs("div",{className:"prose prose-sm max-w-[80ch] leading-relaxed [&_pre]:max-w-full [&_pre]:overflow-x-auto",children:[x.jsx("div",{className:"text-body text-warning mb-2",children:o("notebook.content.render_failed")}),x.jsxs("pre",{className:"text-caption text-ink-muted whitespace-pre-wrap break-words bg-surface-1 p-3 rounded",children:[h.slice(0,500),h.length>500?`
|
|
450
|
-
`+o("notebook.content.truncated"):""]}),x.jsx("div",{className:"flex gap-2 mt-2",children:x.jsx("button",{className:"text-caption underline text-accent",onClick:F,children:o("notebook.content.retry_render")})})]}),children:x.jsx("div",{ref:S,className:"prose prose-sm max-w-[80ch] leading-relaxed break-words overflow-x-auto [&_pre]:max-w-full [&_pre]:overflow-x-auto [&_img]:max-w-full [&_video]:max-w-full [&_iframe]:max-w-full select-text",children:x.jsx(xm,{remarkPlugins:m.remarkPlugins,rehypePlugins:m.rehypePlugins,urlTransform:z=>z,components:{pre({children:z,...F}){return x.jsx(t0,{...F,children:z})},a({children:z,...F}){return x.jsx("a",{...F,target:"_blank",rel:"noopener noreferrer",children:z})},img({src:z,alt:F,...q}){return x.jsx(x3,{src:z,alt:F,assets:E,...q})},table({children:z}){return x.jsx("div",{className:"overflow-x-auto my-4",children:x.jsx("table",{children:z})})}},children:qp(h)})})},`${e.id}-${s??"orig"}`):x.jsx("div",{className:"text-body text-ink-muted",children:o("notebook.content.empty")}),E.length>0&&x.jsxs("div",{className:"mt-6 pt-4 border-t border-[var(--border-faint)]",children:[x.jsxs("div",{className:"text-label font-bold text-ink-muted mb-2 flex items-center gap-1",children:[x.jsx($1,{className:"w-3.5 h-3.5"}),x.jsx("span",{children:o("notebook.images.heading",{n:E.length})})]}),x.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:E.map(z=>x.jsx(b3,{asset:z},z.id))})]}),_&&x.jsxs("div",{"data-selection-popover":!0,style:{left:_.x,top:_.y,transform:_.transform},className:"absolute z-20 flex items-center gap-0.5 msg-enter whitespace-nowrap",children:[n&&x.jsxs("button",{onClick:D,"data-testid":"quote-to-chat-btn","aria-label":o("notebook.quote.ask"),className:"px-2 py-1.5 rounded-lg bg-brand text-white text-label font-bold shadow-elevated flex items-center gap-1 hover:bg-brand-light transition-colors",children:[x.jsx(hh,{className:"w-3 h-3"}),o("notebook.quote.ask")]}),x.jsxs("button",{onClick:H,"data-testid":"save-note-btn","aria-label":o("notebook.quote.add_note"),className:"px-2 py-1.5 rounded-lg bg-accent text-white text-label font-bold shadow-elevated flex items-center gap-1 hover:brightness-110 transition",title:o("notebook.quote.save_note.title"),children:[x.jsx(ai,{className:"w-3.5 h-3.5"}),o("notebook.quote.add_note")]})]}),e.sourcePath&&x.jsx("div",{className:"mt-6 pt-3 border-t border-[var(--border-faint)] text-label text-ink-muted",children:o("notebook.source.label",{path:e.sourcePath})}),x.jsxs("div",{className:"mt-4 p-3 rounded-lg bg-accent/5 border border-accent/20 text-body text-ink-muted flex items-start gap-1.5",children:[x.jsx(G1,{className:"w-3.5 h-3.5 shrink-0 mt-0.5 text-accent"}),x.jsx("span",{children:o("notebook.quote.hint")})]}),i&&e&&x.jsx(w.Suspense,{fallback:null,children:x.jsx(c3,{nodeId:e.id,onRated:a})})]}):x.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center px-6",children:[x.jsx("div",{className:"text-4xl mb-3 opacity-30",children:"📖"}),x.jsx("div",{className:"text-body text-ink-muted max-w-xs",children:o("notebook.empty.select_node")})]})}function g3({items:e,loading:t,selectedNode:n,onRemove:r,onTogglePin:s,onRecordQuizResult:i,onUpdateNoteComment:a,onJumpToSource:o}){const u=We();if(!n)return x.jsx(Ed,{message:u("notebook.empty.notes.title"),icon:"📓"});if(t)return x.jsxs("div",{className:"flex-1 flex items-center justify-center gap-2 text-body text-ink-muted",children:[x.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),u("notebook.empty.notes.title")]});const l=e.filter(p=>["concept_map","compare_table","diagram","code_walkthrough"].includes(p.artifactType)),c=e.filter(p=>p.artifactType==="user_note"),f=e.filter(p=>p.artifactType==="quiz"),h=e.length,d=f.filter(p=>p.lastResult==="correct").length,m=f.filter(p=>p.lastResult==="wrong").length;return h===0?x.jsx(Ed,{message:u("notebook.empty.no_notes_message"),icon:"🧩"}):x.jsxs("div",{className:"p-4 space-y-3","data-testid":"notes-list",children:[x.jsx(qa,{title:u("notebook.zone.understand"),icon:x.jsx(ph,{className:"w-4 h-4"}),subtitle:u("notebook.zone.understand.subtitle"),count:l.length,testid:"zone-understand",defaultOpen:!1,children:l.length===0?x.jsx($a,{hint:u("notebook.zone.understand.empty_hint")}):l.map(p=>x.jsx(Wa,{item:p,onRemove:r,onTogglePin:s,onRecordQuizResult:i,onUpdateNoteComment:a,onJumpToSource:o},p.id))}),x.jsx(qa,{title:u("notebook.zone.note"),icon:x.jsx(ai,{className:"w-4 h-4"}),subtitle:u("notebook.zone.note.subtitle"),count:c.length,testid:"zone-note",defaultOpen:!1,children:c.length===0?x.jsx($a,{hint:u("notebook.zone.note.empty_hint")}):c.map(p=>x.jsx(Wa,{item:p,onRemove:r,onTogglePin:s,onRecordQuizResult:i,onUpdateNoteComment:a,onJumpToSource:o},p.id))}),x.jsx(qa,{title:u("notebook.zone.practice"),icon:x.jsx(ch,{className:"w-4 h-4"}),subtitle:f.length>0?u("notebook.zone.practice.subtitle_stats",{total:f.length,correct:d,wrong:m}):u("notebook.zone.practice.subtitle_empty"),count:f.length,testid:"zone-practice",defaultOpen:!1,children:f.length===0?x.jsx($a,{hint:u("notebook.zone.practice.empty_hint")}):f.map(p=>x.jsx(Wa,{item:p,onRemove:r,onTogglePin:s,onRecordQuizResult:i,onUpdateNoteComment:a,onJumpToSource:o},p.id))})]})}function qa({title:e,icon:t,subtitle:n,count:r,testid:s,defaultOpen:i=!0,children:a}){const[o,u]=w.useState(i),l=w.useRef(!0),c=w.useRef(r);return w.useEffect(()=>{if(l.current){l.current=!1,c.current=r;return}r>c.current&&u(!0),c.current=r},[r]),x.jsxs("section",{className:"rounded-xl bg-surface-1 overflow-hidden","data-testid":s,children:[x.jsxs("button",{onClick:()=>u(f=>!f),"aria-expanded":o,className:"w-full flex items-center gap-2 px-3 py-2.5 bg-surface-1/50 hover:bg-surface-3/60 transition-colors text-left","data-testid":`${s}-toggle`,children:[x.jsx(xu,{className:`w-4 h-4 text-ink-muted transition-transform duration-200 ease-out-back ${o?"":"-rotate-90"}`}),x.jsx("span",{className:"text-body text-ink-strong flex items-center",children:t}),x.jsx("span",{className:"text-body font-bold text-ink",children:e}),x.jsx("span",{className:"text-caption font-bold px-1.5 py-0.5 rounded-full bg-brand/15 text-brand",children:r}),x.jsx("span",{className:"text-label text-ink-muted ml-auto truncate",children:n})]}),x.jsx("div",{className:"grid transition-all duration-200 ease-out-expo",style:{gridTemplateRows:o?"1fr":"0fr"},children:x.jsx("div",{className:"overflow-hidden",children:x.jsx("div",{className:"p-3 space-y-3",children:a})})})]})}function $a({hint:e}){return x.jsx("div",{className:"text-center py-3 text-body text-ink-muted",children:e})}function Wa({item:e,onRemove:t,onTogglePin:n,onRecordQuizResult:r,onUpdateNoteComment:s,onJumpToSource:i}){const a=We(),[o,u]=w.useState(!1),[l,c]=w.useState(e.notes??""),f=w.useCallback((T,C,E)=>{e.nodeId&&ce.recordQuizAnswer(e.nodeId,E).catch(()=>{}),r(e.id,E)},[e.nodeId,e.id,r]),h=e.artifactType==="user_note";let d="",m=null;if(h){try{d=JSON.parse(e.data).text??""}catch{d=e.title??""}try{e.sourceAnchor&&(m=JSON.parse(e.sourceAnchor))}catch{m=null}}let p=null;if(!h)try{p=JSON.parse(e.data)}catch{p=null}const g=new Date(e.createdAt),y=`${g.getMonth()+1}/${g.getDate()} ${g.getHours().toString().padStart(2,"0")}:${g.getMinutes().toString().padStart(2,"0")}`;if(h){const T=e.notes&&e.notes.trim().length>0?e.notes:null,C=()=>{c(T??""),u(!0)},E=()=>{c(T??""),u(!1)},k=()=>{s==null||s(e.id,l),u(!1)};return x.jsx("div",{className:`bg-surface-2 rounded-lg p-3 relative ${e.pinned?"ring-1 ring-brand/40 bg-brand/5":""}`,"data-testid":`canvas-item-${e.id.slice(0,8)}`,children:x.jsxs("div",{className:"flex items-start gap-2",children:[x.jsx(rx,{className:"w-4 h-4 text-accent shrink-0 mt-0.5"}),x.jsxs("div",{className:"flex-1 min-w-0",children:[x.jsx("div",{className:"text-body text-ink leading-relaxed whitespace-pre-wrap",children:d}),s&&o?x.jsxs("div",{className:"mt-2 space-y-1.5","data-testid":`note-comment-edit-${e.id.slice(0,8)}`,children:[x.jsx("textarea",{value:l,onChange:_=>c(_.target.value),rows:2,placeholder:a(T?"notebook.note.comment.ph_edit":"notebook.note.comment.ph_new"),className:"w-full text-label leading-relaxed p-2 rounded-md border border-[var(--border-faint)] bg-surface-0 text-ink resize-none focus:outline-none focus:border-brand","data-testid":`note-comment-textarea-${e.id.slice(0,8)}`}),x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsxs("button",{onClick:k,className:"inline-flex items-center gap-1 text-caption font-bold text-white bg-brand hover:bg-brand/90 px-2 py-0.5 rounded","data-testid":`note-comment-save-${e.id.slice(0,8)}`,children:[x.jsx(vn,{className:"w-3 h-3"})," ",a("notebook.action.save")]}),x.jsxs("button",{onClick:E,className:"inline-flex items-center gap-1 text-caption text-ink-muted hover:text-ink","data-testid":`note-comment-cancel-${e.id.slice(0,8)}`,children:[x.jsx(hr,{className:"w-3 h-3"})," ",a("notebook.action.cancel")]})]})]}):T?x.jsxs("div",{className:"mt-2 px-2.5 py-1.5 rounded-lg bg-ink/5",children:[x.jsx("div",{className:"text-label text-ink-muted italic leading-relaxed whitespace-pre-wrap",children:T}),s&&x.jsxs("button",{onClick:C,className:"mt-1 inline-flex items-center gap-0.5 text-caption text-ink-muted hover:text-accent","data-testid":`note-comment-edit-btn-${e.id.slice(0,8)}`,title:a("notebook.note.edit_comment"),children:[x.jsx(ai,{className:"w-2.5 h-2.5"})," ",a("notebook.note.edit_comment")]})]}):s?x.jsxs("button",{onClick:C,className:"mt-2 inline-flex items-center gap-0.5 text-caption text-ink-muted hover:text-accent","data-testid":`note-comment-add-${e.id.slice(0,8)}`,title:a("notebook.note.add_comment"),children:[x.jsx(ai,{className:"w-2.5 h-2.5"})," ",a("notebook.note.add_comment")]}):null,m&&i&&x.jsx("button",{onClick:()=>i(m,d,e.id),className:"mt-2 inline-flex items-center gap-1 text-caption text-accent hover:underline font-bold","data-testid":`note-source-${e.id.slice(0,8)}`,children:m.type==="content"?x.jsxs(x.Fragment,{children:[x.jsx(kn,{className:"w-3 h-3"}),a("notebook.source.jump_content")]}):x.jsxs(x.Fragment,{children:[x.jsx(hh,{className:"w-3 h-3"}),a("notebook.source.jump_chat")]})}),x.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[x.jsx("span",{className:"text-caption text-ink-muted",children:y}),x.jsx("button",{onClick:()=>t(e.id),className:"text-caption text-ink-muted hover:text-warning","data-testid":`canvas-delete-${e.id.slice(0,8)}`,title:a("notebook.note.delete"),children:x.jsx(xo,{className:"w-3 h-3"})})]})]})]})})}const v=d3[e.artifactType]??nx;return x.jsxs("div",{className:`bg-surface-2 rounded-lg p-3 relative ${e.pinned?"ring-1 ring-brand/40 bg-brand/5":""}`,"data-testid":`canvas-item-${e.id.slice(0,8)}`,children:[x.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[x.jsx("span",{className:"text-body inline-flex items-center text-ink-strong",children:x.jsx(v,{className:"w-4 h-4"})}),x.jsx("span",{className:"text-label font-bold text-ink-muted flex-1 truncate",children:e.title??h3(a,e.artifactType)}),e.artifactType==="quiz"&&e.lastResult&&x.jsx("span",{className:`text-caption font-bold px-1.5 py-0.5 rounded-full ${e.lastResult==="correct"?"bg-brand/15 text-brand":"bg-warning/15 text-warning"}`,"data-testid":`quiz-result-${e.id.slice(0,8)}`,children:e.lastResult==="correct"?a("notebook.quiz.last_correct"):a("notebook.quiz.last_wrong")}),e.pinned?x.jsxs("span",{className:"text-caption text-brand font-bold flex items-center gap-0.5",children:[x.jsx(jl,{className:"w-2.5 h-2.5"}),a("notebook.note.pinned")]}):null,x.jsx("button",{onClick:()=>n(e.id),className:"text-caption text-ink-muted hover:text-brand","data-testid":`canvas-pin-${e.id.slice(0,8)}`,title:e.pinned?a("notebook.note.unpin"):a("notebook.note.pin"),children:x.jsx(jl,{className:"w-3 h-3"})}),x.jsx("button",{onClick:()=>t(e.id),className:"text-caption text-ink-muted hover:text-warning","data-testid":`canvas-delete-${e.id.slice(0,8)}`,title:a("notebook.note.delete"),children:x.jsx(xo,{className:"w-3 h-3"})})]}),x.jsx("div",{className:"text-label",children:p?x.jsx(w.Suspense,{fallback:null,children:x.jsx(n0,{data:p,onQuizAnswered:f})}):x.jsx("div",{className:"text-ink-muted",children:a("notebook.artifact.broken")})}),x.jsx("div",{className:"text-caption text-ink-muted mt-2",children:y})]})}function Ed({message:e,icon:t}){return x.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center px-6","data-testid":"empty-notebook",children:[x.jsx("div",{className:"text-4xl mb-3 opacity-30",children:t}),x.jsx("div",{className:"text-body text-ink-muted max-w-xs leading-relaxed",children:e})]})}function Ya({label:e,icon:t,active:n,onClick:r,testid:s,badge:i}){return x.jsxs("button",{onClick:r,"data-testid":s,role:"tab","aria-selected":n,className:`flex-1 flex items-center justify-center gap-1 py-1.5 rounded-md text-label font-bold transition-colors ${n?"bg-brand/20 text-brand":"text-ink-muted hover:text-ink-strong"}`,children:[x.jsx(t,{className:"w-3 h-3"}),x.jsx("span",{children:e}),i&&x.jsx("span",{className:`text-caption px-1.5 py-0.5 rounded-full font-bold ${n?"bg-brand/30 text-brand":"bg-ink/10 text-ink-faint"}`,children:i})]})}function x3({src:e,alt:t,assets:n,...r}){const[s,i]=w.useState(null),a=e??"",o=w.useMemo(()=>{if(!a||a.startsWith("http")||a.startsWith("data:"))return null;const l=a.split("/").pop()??a;return n.find(c=>{var f;return(f=c.sourcePath)==null?void 0:f.endsWith(l)})??n.find(c=>c.filename===l)??null},[a,n]);if(w.useEffect(()=>{if(!o){i(null);return}let l=!1;return ce.getAssetDataUrl(o.id).then(c=>{l||i(c)}),()=>{l=!0}},[o]),!a)return null;const u=s??a;return x.jsx("img",{src:u,alt:t??"","data-asset-id":o==null?void 0:o.id,className:"rounded-lg max-w-full h-auto my-3",loading:"lazy",...r})}function b3({asset:e}){const t=We(),[n,r]=w.useState(null),[s,i]=w.useState(!1);return w.useEffect(()=>{let a=!1;return ce.getAssetDataUrl(e.id).then(o=>{a||r(o)}),()=>{a=!0}},[e.id]),x.jsxs(x.Fragment,{children:[x.jsx("button",{onClick:()=>i(!0),className:"block rounded-lg overflow-hidden bg-ink/5 dark:bg-ink/10 hover:ring-2 hover:ring-accent transition-all",title:e.altText??e.filename,children:n?x.jsx("img",{src:n,alt:e.altText??e.filename,"data-asset-id":e.id,className:"w-full h-24 object-cover",loading:"lazy"}):x.jsx("div",{className:"w-full h-24 flex items-center justify-center text-ink-faint text-caption",children:t("notebook.asset.loading")})}),s&&n&&x.jsxs("div",{className:"fixed inset-0 z-50 bg-black/80 flex items-center justify-center p-8 cursor-pointer",onClick:()=>i(!1),children:[x.jsx("img",{src:n,alt:e.altText??e.filename,"data-asset-id":e.id,className:"max-w-[90vw] max-h-[90vh] object-contain rounded-lg"}),x.jsx("button",{className:"absolute top-4 right-4 text-white/70 hover:text-white","aria-label":t("action.close"),onClick:a=>{a.stopPropagation(),i(!1)},children:x.jsx(hr,{className:"w-6 h-6"})})]})]})}function y3(e){const[t,n]=w.useState([]),[r,s]=w.useState(!0),i=w.useCallback(async()=>{if(!e){n([]),s(!1);return}try{const m=await ce.canvasList(e);n(m)}catch{n([])}finally{s(!1)}},[e]);w.useEffect(()=>{i()},[i]);const a=w.useCallback(async m=>{if(!e)return null;try{const p=await ce.canvasSave({...m,courseId:e});return n(g=>g.some(y=>y.id===p.id)?g:[p,...g]),p}catch{return null}},[e]),o=w.useCallback(async m=>{if(!e)return null;try{const p=await ce.canvasSaveUserNote({...m,courseId:e});return n(g=>[p,...g]),p}catch{return null}},[e]),u=w.useCallback(async(m,p)=>{try{const g=await ce.canvasRecordQuizResult(m,p);return g&&n(y=>y.map(v=>v.id===m?g:v)),g}catch{return null}},[]),l=w.useCallback(async(m,p)=>{try{const g=await ce.canvasUpdateUserNoteComment(m,p);return g&&n(y=>y.map(v=>v.id===m?g:v)),g}catch{return null}},[]),c=w.useCallback(async m=>{try{await ce.canvasDelete(m),n(p=>p.filter(g=>g.id!==m))}catch{}},[]),f=w.useCallback(async m=>{try{const p=await ce.canvasTogglePin(m);p&&n(g=>g.map(v=>v.id===m?p:v).sort((v,T)=>T.pinned!==v.pinned?T.pinned-v.pinned:T.createdAt.localeCompare(v.createdAt)))}catch{}},[]),h=w.useCallback(m=>m===null?t:t.filter(p=>p.nodeId===m),[t]),d=w.useCallback((m,p)=>{const g=m===null?t:t.filter(y=>y.nodeId===m);return p==="note"?g.filter(y=>y.artifactType==="user_note"):p==="practice"?g.filter(y=>y.artifactType==="quiz"):g.filter(y=>["concept_map","compare_table","diagram","code_walkthrough"].includes(y.artifactType))},[t]);return{items:t,loading:r,reload:i,save:a,saveUserNote:o,recordQuizResult:u,updateUserNoteComment:l,remove:c,togglePin:f,byNode:h,byZone:d}}const Td={small:16,medium:17,large:18},vd="lookatstudy-font-size",E3="medium";function T3(){const[e,t]=w.useState(()=>{if(typeof localStorage<"u"){const r=localStorage.getItem(vd);if(r&&r in Td)return r}return E3});w.useEffect(()=>{document.documentElement.style.fontSize=`${Td[e]}px`,localStorage.setItem(vd,e)},[e]);const n=w.useCallback(r=>{t(s=>{const i=["small","medium","large"],a=i.indexOf(s),o=r==="up"?Math.min(a+1,i.length-1):Math.max(a-1,0);return i[o]})},[]);return{size:e,bump:n}}const Ga=new Map;function v3({ref_:e,onOpen:t}){const n=We(),[r,s]=w.useState(e.previewUrl??(e.file?Ga.get(e.file)??null:null));return w.useEffect(()=>{if(r||!e.file)return;let i=!1;return(async()=>{const a=Ga.get(e.file);if(a){i||s(a);return}const o=await ce.getAttachmentDataUrl(e.file);o&&!i&&(Ga.set(e.file,o),s(o))})(),()=>{i=!0}},[e.file,r]),r?x.jsx("button",{type:"button",onClick:()=>t(r),"aria-label":n("chat.attach.preview",{name:e.name}),className:"w-24 h-24 rounded-lg overflow-hidden border border-[var(--border)] hover:border-accent transition-colors shrink-0",children:x.jsx("img",{src:r,alt:e.name,className:"w-full h-full object-cover"})}):x.jsx("div",{className:"w-24 h-24 rounded-lg bg-ink/[0.06] flex items-center justify-center text-caption text-ink-faint",title:e.name,children:e.name.slice(0,8)})}function k3({src:e,name:t,onClose:n}){return w.useEffect(()=>{const r=s=>{s.key==="Escape"&&n()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[n]),x.jsxs("div",{role:"dialog","aria-label":t,className:"fixed inset-0 z-[70] bg-black/80 flex items-center justify-center p-8 cursor-zoom-out animate-[toast-enter_.15s_ease-out]",onClick:n,"data-testid":"attachment-lightbox",children:[x.jsx("img",{src:e,alt:t,className:"max-w-full max-h-full object-contain rounded-lg shadow-elevated"}),x.jsx("button",{type:"button","aria-label":"close",onClick:n,className:"absolute top-4 right-4 w-9 h-9 rounded-full bg-white/10 hover:bg-white/20 text-white flex items-center justify-center transition-colors",children:x.jsx(hr,{className:"w-4 h-4"})})]})}function w3({parts:e}){const t=We(),[n,r]=w.useState(null),s=e.filter(o=>o.type==="attachment").map(o=>o.attachment);if(s.length===0)return null;const i=s.filter(o=>o.kind==="image"),a=s.filter(o=>o.kind==="text");return x.jsxs("div",{className:"flex flex-col gap-1.5 mb-1","data-testid":"message-attachments",children:[i.length>0&&x.jsx("div",{className:"flex gap-1.5 flex-wrap",children:i.map((o,u)=>x.jsx(v3,{ref_:o,onOpen:l=>r({src:l,name:o.name})},o.file??o.previewUrl??`${o.name}:${u}`))}),a.length>0&&x.jsx("div",{className:"flex gap-1.5 flex-wrap",children:a.map((o,u)=>x.jsxs("span",{"data-tooltip":t("chat.attach.textChip"),className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-ink/[0.06] text-caption text-ink-muted",children:[x.jsx(Ds,{className:"w-3 h-3 shrink-0"}),x.jsx("span",{className:"truncate max-w-[12rem]",children:o.name})]},`${o.name}:${u}`))}),n&&x.jsx(k3,{src:n.src,name:n.name,onClose:()=>r(null)})]})}const S3=w.lazy(()=>ve(()=>import("./index-C9AodbWN.js"),__vite__mapDeps([30,1,2,29,31,32]),import.meta.url).then(e=>({default:e.ArtifactRenderer})));function A3({messages:e,streaming:t,onApplyProposal:n,onRejectProposal:r,summary:s,onStartLearning:i,agentReady:a=!0,onGotoSettings:o,hasNode:u=!0,selectedNodeId:l,threadId:c,onSaveChatNote:f,chatNotes:h,onPickQuizAction:d,onQuizCompleted:m,cardMode:p=!1}){const g=We(),y=$u(),v=Qp();w.useEffect(()=>{if(v.failReason){const F=v.failReason==="engine-unavailable"?"chat.speech.engine_unavailable":v.failReason==="azure-key-missing"?"chat.speech.azure_key_missing":v.failReason==="azure-region-missing"?"chat.speech.azure_region_missing":v.failReason==="edge-failed"?"chat.speech.edge_failed":v.failReason==="custom-provider-missing"?"chat.speech.custom_provider_missing":"chat.speech.model_missing";y.show(g(F),{severity:"warning"}),v.clearFailReason()}},[v.failReason,y,g,v]),w.useEffect(()=>{v.onlineNotice&&(y.show(g("chat.speech.edge_disclosed"),{severity:"info"}),v.clearOnlineNotice())},[v.onlineNotice,y,g,v]);const T=w.useCallback((F,q,R)=>{l&&ce.recordQuizAnswer(l,R,F.kc).catch(()=>{})},[l]),[C,E]=w.useState(null);w.useEffect(()=>{if(!l){E(null);return}let F=!1;const q=()=>ce.getProgress(l).then($=>{F||E(($==null?void 0:$.mastery)??null)}).catch(()=>{});q();const R=ce.on("state:changed",$=>{$==="mastery"&&q()});return()=>{F=!0,R()}},[l]);const k=w.useRef(null),_=w.useRef(!0),[A,I]=w.useState(!1);w.useEffect(()=>{const F=q=>{const R=q.detail;if(!(R!=null&&R.msgId))return;const $=document.querySelector(`[data-msg-id="${R.msgId}"]`);$&&($.scrollIntoView({behavior:"smooth",block:"center"}),$.classList.add("ring-2","ring-accent","rounded-lg"),setTimeout(()=>$.classList.remove("ring-2","ring-accent","rounded-lg"),2500))};return window.addEventListener("lookatstudy-highlight-message",F),()=>window.removeEventListener("lookatstudy-highlight-message",F)},[]),w.useEffect(()=>{if(t||!k.current||!h||h.length===0)return;const F=setTimeout(()=>{if(!k.current)return;const q=new Map;for(const R of h)try{const $=JSON.parse(R.sourceAnchor);if($.type==="chat"&&$.msgId){const W=JSON.parse(R.data).text??"";if(W){const M=q.get($.msgId)??[];M.push({noteId:R.id,text:W}),q.set($.msgId,M)}}}catch{}for(const[R,$]of q){const W=k.current.querySelector(`[data-msg-id="${R}"]`);W&&Dp(W,$)}},150);return()=>clearTimeout(F)},[e,h,t]),w.useEffect(()=>{const F=q=>{var W;const R=q.detail;if(!R)return;const $=(W=k.current)==null?void 0:W.querySelector(`mark[data-note-id="${R}"]`);$&&Vp($)};return window.addEventListener("lookatstudy-jump-to-chat-note",F),()=>window.removeEventListener("lookatstudy-jump-to-chat-note",F)},[]);const[S,L]=w.useState(null),N=typeof matchMedia=="function"&&matchMedia("(pointer: coarse)").matches,j=w.useCallback(()=>{if(!f||!c)return;const F=window.getSelection(),q=(F==null?void 0:F.toString().trim())??"";if(q.length<2||q.length>500){L(null);return}const R=F==null?void 0:F.getRangeAt(0);if(!R){L(null);return}const $=k.current;if(!($!=null&&$.contains(R.commonAncestorContainer))){L(null);return}let W=R.commonAncestorContainer,M=null;for(;W&&W!==$;){if(W instanceof HTMLElement&&W.dataset.msgId){M=W;break}W=W.parentNode}if(!M){L(null);return}const ee=M.dataset.msgId,oe=fi(M),V=Rp(R,oe),X=R.getBoundingClientRect(),Z=$.getBoundingClientRect(),be=R.getClientRects(),me=be.length?be[be.length-1]:X,te=Wp({left:X.left-Z.left,top:X.top-Z.top,right:X.right-Z.left,bottom:X.bottom-Z.top,width:X.width,height:X.height},Z.width,N?150:110,{left:me.left-Z.left,top:me.top-Z.top,right:me.right-Z.left,bottom:me.bottom-Z.top,width:me.width,height:me.height},N);L({x:te.left,y:te.top,transform:te.transform,text:q,msgId:ee,startOffset:V==null?void 0:V.start,endOffset:V==null?void 0:V.end})},[f,c,N]);w.useEffect(()=>{const F=N?600:250;let q=null,R=null,$=!1;const W=()=>{var V;return(((V=window.getSelection())==null?void 0:V.toString().trim().length)??0)>=2},M=()=>{W()?(R&&(clearTimeout(R),R=null),L(V=>V&&null),q&&clearTimeout(q),q=setTimeout(()=>{q=null,!$&&W()&&j()},F)):R||(R=setTimeout(()=>L(V=>V&&null),250))},ee=V=>{var Z;const X=V.target;(Z=X==null?void 0:X.closest)!=null&&Z.call(X,"[data-selection-popover]")||($=!0)},oe=()=>{$=!1,q&&(clearTimeout(q),q=null),!R&&W()&&j()};return document.addEventListener("selectionchange",M),window.addEventListener("pointerdown",ee,!0),window.addEventListener("pointerup",oe,!0),window.addEventListener("pointercancel",oe,!0),()=>{document.removeEventListener("selectionchange",M),window.removeEventListener("pointerdown",ee,!0),window.removeEventListener("pointerup",oe,!0),window.removeEventListener("pointercancel",oe,!0),q&&clearTimeout(q),R&&clearTimeout(R)}},[j]);const P=w.useCallback(()=>{var q;if(!S||!f)return;const F=S.text.length>200?S.text.slice(0,200)+"…":S.text;f(F,S.msgId,S.startOffset,S.endOffset),L(null),(q=window.getSelection())==null||q.removeAllRanges()},[S,f]),D=w.useCallback(()=>{const F=k.current;if(!F)return;const q=F.scrollHeight-F.scrollTop-F.clientHeight<80;_.current=q,I(R=>R===!q?R:!q)},[]);w.useEffect(()=>{if(!_.current)return;const F=k.current;F&&(F.scrollTop=F.scrollHeight)},[e,t]);const H=e.length>0&&e[e.length-1].role==="user";w.useEffect(()=>{if(!H)return;_.current=!0,I(!1);const F=k.current;F&&(F.scrollTop=F.scrollHeight)},[H]);const z=w.useCallback(()=>{const F=k.current;F&&(F.scrollTop=F.scrollHeight,_.current=!0,I(!1))},[]);return x.jsxs("div",{className:"relative flex-1 min-h-0",children:[x.jsxs("div",{ref:k,onScroll:D,className:`h-full overflow-y-auto px-3 py-4 space-y-2 relative ${p?"":"px-5 py-6 space-y-6"}`,"data-testid":"chat-stream",children:[e.length===0&&x.jsx("div",{className:"mt-10 mx-auto max-w-md","data-testid":"chat-empty-state",children:u?x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"text-center mb-4",children:[x.jsx("div",{className:"text-4xl mb-2 opacity-30",children:"📖"}),x.jsx("div",{className:"text-body font-bold text-ink-muted mb-1",children:g("chat.empty.greeting")}),x.jsx("div",{className:"text-ink-muted text-label",children:g("chat.empty.overview")})]}),s?x.jsxs("div",{className:"surface-card p-4 mb-4",children:[x.jsx("div",{className:"text-caption font-bold text-brand uppercase tracking-wider mb-2",children:g("chat.empty.summary.title")}),x.jsx("div",{className:"text-body text-ink-muted leading-relaxed whitespace-pre-wrap",children:s})]}):x.jsx("div",{className:"surface-card p-4 mb-4 text-center",children:x.jsx("div",{className:"text-body text-ink-muted",children:g("chat.empty.summary.none")})}),a?x.jsx(x.Fragment,{children:i&&x.jsxs("button",{onClick:i,disabled:t,"data-testid":"start-learning-btn",className:"btn-3d-brand w-full py-3 text-body font-bold flex items-center justify-center gap-2 disabled:opacity-40",children:[x.jsx(ix,{className:"w-4 h-4"}),x.jsx("span",{children:g("chat.empty.start")})]})}):x.jsxs("div",{className:"surface-card p-4 mb-2","data-testid":"keyless-card",children:[x.jsx("div",{className:"text-body font-bold text-ink-muted mb-1",children:g("chat.empty.keyless.title")}),x.jsx("div",{className:"text-label text-ink-muted mb-3",children:g("chat.empty.keyless.desc")}),x.jsxs("button",{onClick:o,className:"btn-3d-brand w-full py-2 text-body font-bold flex items-center justify-center gap-2",children:[x.jsx(ms,{className:"w-4 h-4"}),x.jsx("span",{children:g("chat.empty.keyless.btn")})]})]})]}):x.jsxs("div",{className:"text-center mt-16","data-testid":"no-node-selected",children:[x.jsx("div",{className:"text-5xl mb-3 opacity-25",children:"🗺️"}),x.jsx("div",{className:"text-body font-bold text-ink-muted mb-1",children:g("chat.empty.no_node.title")}),x.jsx("div",{className:"text-body text-ink-muted max-w-xs mx-auto",children:g("chat.empty.no_node.desc")})]})}),e.map(F=>x.jsx("div",{className:p?"":"contents",children:x.jsx("div",{className:p&&F.role==="assistant"?"surface-card p-4 rounded-2xl shadow-card":void 0,children:x.jsx(C3,{msg:F,onApplyProposal:n,onRejectProposal:r,onQuizAnswered:T,quizMastery:C,onPickAction:d,onQuizCompleted:m,speakingMessageId:v.speakingMessageId,speakingSentence:v.speakingSentence,playingSentence:v.playingSentence,streamTexts:v.streamTexts,onSpeak:v.speak})})},F.id)),t&&x.jsxs("div",{className:"flex items-center gap-1.5 text-body text-brand",children:[x.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),x.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),x.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"})]})]}),A&&e.length>0&&x.jsxs("button",{onClick:z,"data-testid":"scroll-to-bottom","aria-label":g("chat.scroll.bottom"),title:g("chat.scroll.bottom"),className:"absolute bottom-4 right-4 w-9 h-9 rounded-full bg-ink-strong text-surface-0 shadow-elevated flex items-center justify-center hover:scale-105 active:scale-95 transition-transform msg-enter",children:[x.jsx(xu,{className:"w-5 h-5"}),t&&x.jsx("span",{className:"absolute -top-0.5 -right-0.5 w-2.5 h-2.5 bg-brand rounded-full border-2 border-[var(--ink-strong)] animate-pulse"})]}),S&&x.jsxs("button",{onClick:P,"data-testid":"save-chat-note-btn","data-selection-popover":!0,style:{left:S.x,top:S.y,transform:S.transform},className:"absolute z-20 px-3 py-1.5 rounded-lg bg-brand text-white text-body font-bold shadow-elevated flex items-center gap-1 hover:bg-brand-light transition msg-enter whitespace-nowrap",title:g("chat.note.add.title"),children:[x.jsx(ai,{className:"w-3 h-3"})," ",g("chat.note.add")]})]})}function kd(e){const t=[];for(const n of e)if(n.role==="assistant")for(let r=0;r<n.parts.length;r++){const s=n.parts[r];s.type==="tool-call"&&s.state==="output-available"&&s.output&&typeof s.output=="object"&&"artifactType"in s.output&&t.push({id:`${n.id}-${r}`,toolName:s.toolName,output:s.output})}return t}function C3({msg:e,onApplyProposal:t,onRejectProposal:n,onQuizAnswered:r,quizMastery:s,onPickAction:i,onQuizCompleted:a,speakingMessageId:o,speakingSentence:u,playingSentence:l,streamTexts:c,onSpeak:f}){const h=We(),d=w.useRef(null),m=e.parts.map(v=>v.type==="text"?v.text:"").join("").trim(),p=o===e.id,g=p&&l!=null?l.index:null;w.useEffect(()=>{const v=d.current;if(!v)return;if(g==null){$n(v);return}const T=$p(c??[],g);if(!T)return;g===0&&Hp(v);const C=setTimeout(()=>{const E=Up(v,T,{within:'[data-testid="part-text"]'});E&&zp(E,v.closest(".overflow-y-auto"))},30);return()=>clearTimeout(C)},[g,c]),w.useEffect(()=>{g==null&&d.current&&$n(d.current)},[g]);const y=w.useRef(!1);return y.current=g!=null,w.useEffect(()=>()=>{y.current&&$n(document.body)},[]),e.role==="user"?x.jsx("div",{className:"msg-enter flex justify-end","data-testid":"msg-user","data-msg-id":e.id,children:x.jsxs("div",{className:"max-w-[85%] bg-ink/[0.04] rounded-2xl rounded-br-md px-4 py-2.5",children:[x.jsx(w3,{parts:e.parts}),x.jsx("div",{className:"font-medium text-ink-strong whitespace-pre-wrap select-text text-body",children:e.displayText??e.parts.map((v,T)=>v.type==="text"?x.jsx("span",{children:v.text},T):null)})]})}):x.jsxs("div",{className:"msg-enter",ref:d,"data-testid":"msg-assistant","data-msg-id":e.id,children:[x.jsx("div",{className:"min-w-0 space-y-2.5",children:e.parts.map((v,T)=>x.jsx(_3,{part:v,msgId:e.id,toolCallIdx:T,onApplyProposal:t,onRejectProposal:n,onQuizAnswered:r,quizMastery:s,onPickAction:i,onQuizCompleted:a},T))}),f&&m&&x.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[x.jsx("button",{onClick:()=>f(e.id,m),"data-testid":p?"speech-stop-btn":"speech-speak-btn","aria-label":h(p?"chat.speech.stop":"chat.speech.speak"),title:h(p?"chat.speech.stop":"chat.speech.speak"),className:`w-7 h-7 rounded-lg flex items-center justify-center transition ${p?"bg-brand/15 text-brand":"text-ink-muted hover:bg-ink/[0.06] hover:text-ink"}`,children:p?x.jsx(yu,{className:"w-3.5 h-3.5"}):x.jsx(xh,{className:"w-4 h-4"})}),p&&u&&u.total>0&&x.jsx("span",{className:"text-caption text-ink-muted",children:h("chat.speech.progress").replace("{n}",String(u.index+1)).replace("{total}",String(u.total))})]})]})}function _3({part:e,msgId:t,toolCallIdx:n,onApplyProposal:r,onRejectProposal:s,onQuizAnswered:i,quizMastery:a,onPickAction:o,onQuizCompleted:u}){const l=Np(e.type==="text"?e.text:"");if(e.type==="text")return x.jsx("div",{className:"prose prose-sm max-w-[80ch] leading-relaxed break-words [&_pre]:max-w-full [&_pre]:overflow-x-auto [&_img]:max-w-full [&_video]:max-w-full [&_iframe]:max-w-full select-text","data-testid":"part-text",children:x.jsx(xm,{remarkPlugins:l.remarkPlugins,rehypePlugins:l.rehypePlugins,urlTransform:m=>m,components:R3,children:qp(e.text)})});if(e.type==="reasoning")return x.jsx(I3,{text:e.text});if(e.type!=="tool-call")return null;const{toolName:c,state:f,output:h,error:d}=e;return x.jsx(N3,{toolName:c,state:f,output:h,error:d,msgId:t,toolCallIdx:n,onApplyProposal:r,onRejectProposal:s,onQuizAnswered:i,quizMastery:a,onPickAction:o,onQuizCompleted:u})}function I3({text:e}){const t=We(),[n,r]=w.useState(!1);return x.jsxs("div",{className:"rounded-lg bg-surface-1/60 border border-[var(--border-faint)]","data-testid":"part-reasoning",children:[x.jsxs("button",{onClick:()=>r(s=>!s),className:"w-full flex items-center justify-between px-3 py-1.5 text-label font-bold text-ink-muted hover:text-ink-strong transition-colors",children:[x.jsxs("span",{children:[n?"▾":"▸"," ",t("chat.reasoning.label")]}),x.jsx("span",{className:"text-ink-muted font-normal",children:t("chat.reasoning.chars",{n:e.length})})]}),n&&x.jsx("div",{className:"px-3 pb-2.5 text-label text-ink-muted whitespace-pre-wrap leading-relaxed border-t border-[var(--border-faint)]/60 pt-2",children:e})]})}function N3({toolName:e,state:t,output:n,error:r,msgId:s,toolCallIdx:i,onApplyProposal:a,onRejectProposal:o,onQuizAnswered:u,quizMastery:l,onPickAction:c,onQuizCompleted:f}){const h=We(),m=(e==="record_answer"||e==="mark_mastered")&&t==="output-available"&&typeof n=="object"&&n!==null?n:null;if(m!=null&&m.proposalId){const y=m.status;return y==="applied"?x.jsxs("div",{className:"proposal-card rounded-xl border border-gold/30 bg-gold/5 p-3 flex items-center gap-2","data-testid":"part-proposal",children:[x.jsx(bu,{className:"w-4 h-4 text-gold shrink-0"}),x.jsx("span",{className:"text-body font-bold text-ink",children:h("chat.proposal.applied")})]}):y==="rejected"?x.jsxs("div",{className:"proposal-card rounded-xl border border-ink/10 bg-ink/5 p-3 flex items-center gap-2","data-testid":"part-proposal",children:[x.jsx(D1,{className:"w-4 h-4 text-ink-muted shrink-0"}),x.jsx("span",{className:"text-body text-ink-muted",children:h("chat.proposal.rejected")})]}):x.jsxs("div",{className:"proposal-card relative rounded-xl border border-brand/30 bg-brand/5 overflow-hidden","data-testid":"part-proposal",children:[x.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-1 bg-brand"}),x.jsxs("div",{className:"pl-4 pr-3 py-3",children:[x.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[x.jsx("span",{className:"flex items-center justify-center w-7 h-7 rounded-lg bg-brand/15 text-brand shrink-0",children:x.jsx(V1,{className:"w-4 h-4"})}),x.jsx("span",{className:"text-lead font-bold text-ink",children:h("chat.proposal.mastered.title")})]}),m.message&&x.jsx("div",{className:"text-body text-ink mb-2 leading-relaxed",children:m.message}),x.jsx("div",{className:"text-caption text-ink-muted mb-3",children:h("chat.proposal.mastered.hint")}),x.jsxs("div",{className:"flex gap-2",children:[x.jsxs("button",{onClick:()=>a==null?void 0:a(m.proposalId,s,i),"data-testid":"proposal-apply",className:"btn-3d-brand px-4 py-1.5 text-body",children:[x.jsx(vn,{className:"w-3.5 h-3.5 inline"}),h("chat.proposal.confirm")]}),x.jsx("button",{onClick:()=>o==null?void 0:o(m.proposalId,s,i),"data-testid":"proposal-reject",className:"btn-3d-neutral px-4 py-1.5 text-body",children:h("chat.proposal.later")})]})]})]})}if(t==="output-available"&&n&&typeof n=="object"&&"artifactType"in n){const y=n.artifactType;return x.jsx("div",{className:"my-1 max-w-full","data-testid":`inline-artifact-${y}`,"data-tool":e,children:x.jsx(w.Suspense,{fallback:null,children:x.jsx(S3,{data:n,onQuizAnswered:u,quizMastery:l,onPickAction:c,onQuizCompleted:f})})})}const g=L3(e,h);return x.jsx("div",{className:"inline-flex items-center gap-1.5 text-label px-2.5 py-1 rounded-md bg-surface-1/60 border border-[var(--border-faint)]","data-testid":"part-tool","data-tool":e,"data-state":t,children:t==="input-available"?x.jsxs(x.Fragment,{children:[x.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),x.jsxs("span",{className:"text-ink-muted",children:[g,"…"]})]}):t==="output-error"?x.jsxs(x.Fragment,{children:[x.jsx(oh,{className:"w-3.5 h-3.5 text-warning shrink-0"}),x.jsxs("span",{className:"text-warning",children:[g,": ",r]})]}):x.jsxs(x.Fragment,{children:[x.jsx(bh,{className:"w-3.5 h-3.5 text-ink-faint shrink-0"}),x.jsx("span",{className:"text-ink-muted",children:g})]})})}const R3={pre({children:e,...t}){return x.jsx(t0,{...t,children:e})},a({children:e,...t}){return x.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",children:e})},table({children:e}){return x.jsx("div",{className:"overflow-x-auto my-4",children:x.jsx("table",{children:e})})}};function L3(e,t){return{get_node_info:t("chat.tool.get_node_info"),record_answer:t("chat.tool.record_answer"),mark_mastered:t("chat.tool.mark_mastered"),show_concept_map:t("chat.tool.show_concept_map"),generate_quiz:t("chat.tool.generate_quiz"),compare_table:t("chat.tool.compare_table"),draw_diagram:t("chat.tool.draw_diagram"),show_code_walkthrough:t("chat.tool.show_code_walkthrough")}[e]??e}const ti={maxPerMessage:4,maxImageBytes:5*1024*1024,maxTextBytes:256*1024},M3=new Set(["txt","md","markdown","rst","org","adoc","log","csv","tsv","json","yaml","yml","toml","ini","env","py","js","mjs","cjs","ts","tsx","jsx","go","rs","java","c","h","cpp","hpp","cs","rb","sh","bash","zsh","ps1","sql","html","htm","css","scss","vue","svelte","kt","swift","php","lua","r","dart","scala","clj","ex","exs","erl","hs","ml","jl","m","mm","pl","vb","bat","dockerfile"]);function wd(e){const t=e.lastIndexOf(".");return t<=0||t===e.length-1?"":e.slice(t+1).toLowerCase()}function P3(e,t,n){return t&&t.startsWith("image/")||["png","jpg","jpeg","webp","gif","bmp"].includes(wd(e))?n>ti.maxImageBytes?{ok:!1,reason:"tooLargeImage"}:{ok:!0,kind:"image"}:M3.has(wd(e))?n>ti.maxTextBytes?{ok:!1,reason:"tooLargeText"}:{ok:!0,kind:"text"}:{ok:!1,reason:"unsupported"}}function D3(e,t){const n=e.length,r=n*2,s=new ArrayBuffer(44+r),i=new DataView(s),a=(u,l)=>{for(let c=0;c<l.length;c++)i.setUint8(u+c,l.charCodeAt(c))};a(0,"RIFF"),i.setUint32(4,36+r,!0),a(8,"WAVE"),a(12,"fmt "),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,t,!0),i.setUint32(28,t*2,!0),i.setUint16(32,2,!0),i.setUint16(34,16,!0),a(36,"data"),i.setUint32(40,r,!0);let o=44;for(let u=0;u<n;u++){const l=e[u]<=-1?-1:e[u]>=1?1:e[u];i.setInt16(o,Math.round(l*32767),!0),o+=2}return s}function O3(e,t){const n=Math.floor(e.length/t),r=new Float32Array(n);for(let s=0;s<n;s++){const i=s*t,a=Math.floor(i),o=i-a,u=e[a]??0,l=e[a+1]??u;r[s]=u+(l-u)*o}return r}function F3(e,t,n={}){if(e.length===0||e.length!==t.length)return e;const r=n.threshold??.012;let s=0;for(;s<e.length-1&&t[s]<r;)s+=1;let i=e.length;for(;i>s+1&&t[i-1]<r;)i-=1;return e.slice(s,i)}function B3(e={}){const t=e.rmsThreshold??.015,n=e.minSpeechMs??300,r=e.silenceMs??1200,s=e.maxMs??6e4,i=e.autoStop!==!1;let a=null,o=0,u=null,l=null,c=!1;return{feed(f,h){a==null&&(a=h);const d=l==null?0:Math.max(0,h-l);if(l=h,f>=t)o+=d,o>=n&&(c=!0,u=h);else if(i&&c&&u!=null&&h-u>=r)return"auto-stop";return i&&h-a>=s?"auto-stop":"listening"},hadSpeech(){return c}}}const Ka=16e3;function j3(e,t={}){const[n,r]=w.useState(!1),[s,i]=w.useState(!1),[a,o]=w.useState(0),[u,l]=w.useState(null),[c,f]=w.useState(null),h=w.useRef(null),d=w.useRef(null),m=w.useRef(null),p=w.useRef([]),g=w.useRef([]),y=w.useRef(!1),v=w.useRef(null),T=w.useRef(0),C=w.useRef(e);C.current=e;const E=w.useRef(t);E.current=t;const k=w.useRef(!1),_=w.useRef(!1),A=w.useCallback(()=>{var j,P,D;y.current=!1,(j=m.current)==null||j.disconnect(),m.current=null,(P=d.current)==null||P.getTracks().forEach(H=>H.stop()),d.current=null,(D=h.current)==null||D.close().catch(()=>{}),h.current=null,p.current=[],g.current=[],v.current=null,o(0)},[]),I=w.useCallback(()=>{var W;const j=p.current,P=g.current,D=((W=v.current)==null?void 0:W.hadSpeech())??!1;p.current=[],g.current=[];let H=0;for(const M of j)H+=M.length;if(A(),r(!1),H===0)return;if(!D){f("no-speech");return}const z=F3(j,P);let F=0;for(const M of z)F+=M.length;const q=new Float32Array(F);let R=0;for(const M of z)q.set(M,R),R+=M.length;const $=D3(q,Ka);i(!0),f(null),window.api.asrTranscribe($,E.current.locale).then(M=>{M.ok?C.current(M.text):f(M.reason)}).catch(()=>f("asr-failed")).finally(()=>i(!1))},[A]),S=w.useCallback(()=>{y.current&&I()},[I]),L=w.useCallback(()=>{y.current||k.current||(l(null),k.current=!0,(async()=>{var j;try{if(((j=navigator.mediaDevices)==null?void 0:j.getUserMedia)==null){l(window.isSecureContext?"mic-unavailable":"mic-insecure-context");return}const P=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0}}),D=window.AudioContext??window.webkitAudioContext;let H;try{H=new D({sampleRate:Ka})}catch{H=new D}h.current=H,d.current=P,y.current=!0,v.current=B3({autoStop:E.current.autoStop!==!1});const z=H.createMediaStreamSource(P),F=H.createScriptProcessor(4096,1,1);m.current=F;const q=H.sampleRate/Ka;F.onaudioprocess=$=>{var X;if(!y.current)return;const W=$.inputBuffer.getChannelData(0),M=q===1?new Float32Array(W):O3(W,q);p.current.push(M);let ee=0;for(let Z=0;Z<M.length;Z++)ee+=M[Z]*M[Z];const oe=Math.sqrt(ee/M.length);g.current.push(oe),T.current=T.current*.7+oe*.3,o(Math.min(1,T.current*8)),t1(Math.min(1,T.current*8)),((X=v.current)==null?void 0:X.feed(oe,performance.now()))==="auto-stop"&&y.current&&I()},z.connect(F);const R=H.createGain();R.gain.value=0,F.connect(R),R.connect(H.destination),r(!0),_.current&&(_.current=!1,I())}catch(P){A(),r(!1),l(P instanceof Error?P.message:String(P))}finally{k.current=!1}})())},[A,I]),N=w.useCallback(()=>{y.current?S():k.current&&(_.current=!0)},[S]);return w.useEffect(()=>()=>{y.current&&A()},[A]),{listening:n,transcribing:s,level:a,startError:u,transcribeError:c,clearTranscribeError:()=>f(null),beginHold:L,endHold:N}}function H3({onGotoSettings:e}){var p;const t=We(),[n,r]=w.useState(!1),[s,i]=w.useState(null),[a,o]=w.useState(""),[u,l]=w.useState(""),c=w.useRef(null),f=w.useCallback(async()=>{var g,y;try{const[v,T,C,E]=await Promise.all([ce.getProviderPresets(),ce.listCustomProviders(),ce.getSetting("active_provider"),ce.getSetting("active_model")]),k=C??"glm",_=await Promise.all(v.map(async j=>await ce.getSetting(j.apiKeySetting)!=null)),A=new Set;v.forEach((j,P)=>{(_[P]||j.id===k)&&A.add(j.id)});const I=[],S=(j,P,D)=>{for(const H of D)I.push({providerId:j,providerLabel:P,modelId:H.id,modelLabel:H.label,vision:(H.capabilities??[]).includes("vision"),contextWindow:H.contextWindow})};for(const j of v)A.has(j.id)&&S(j.id,j.label,j.models);const L=T.filter(j=>j.kind==="llm");for(const j of L)S(j.id,j.label,j.models);const N=E??"";if(N&&!I.some(j=>j.providerId===k&&j.modelId===N)){const j=((g=v.find(P=>P.id===k))==null?void 0:g.label)??((y=L.find(P=>P.id===k))==null?void 0:y.label)??k;I.unshift({providerId:k,providerLabel:j,modelId:N,modelLabel:N,vision:!0,contextWindow:null})}i(I),o(k),l(N)}catch{i([])}},[]);w.useEffect(()=>{f();const g=()=>void f();return window.addEventListener("llm-config-changed",g),()=>window.removeEventListener("llm-config-changed",g)},[f]),w.useEffect(()=>{if(!n)return;const g=v=>{var T;v.target instanceof Node&&((T=c.current)==null?void 0:T.contains(v.target))!==!0&&r(!1)},y=v=>{v.key==="Escape"&&r(!1)};return document.addEventListener("pointerdown",g),document.addEventListener("keydown",y),()=>{document.removeEventListener("pointerdown",g),document.removeEventListener("keydown",y)}},[n]);const h=async g=>{if(r(!1),!(g.providerId===a&&g.modelId===u))try{await ce.setSetting("active_provider",g.providerId),await ce.setSetting("active_model",g.modelId),o(g.providerId),l(g.modelId),window.dispatchEvent(new Event("llm-config-changed"))}catch{}},d=((p=s==null?void 0:s.find(g=>g.providerId===a&&g.modelId===u))==null?void 0:p.modelLabel)??u??t("model.picker.label"),m=[];for(const g of s??[]){const y=m[m.length-1];y&&y.label===g.providerLabel?y.rows.push(g):m.push({label:g.providerLabel,rows:[g]})}return x.jsxs("div",{ref:c,className:"relative","data-testid":"composer-model",children:[x.jsxs("button",{type:"button",onClick:()=>r(!n),"aria-haspopup":"menu","aria-expanded":n,"data-tooltip":t("model.picker.label"),"data-testid":"composer-model-trigger",className:"flex items-center gap-1 max-w-[13rem] px-1.5 py-0.5 rounded-full text-caption font-medium text-ink-muted hover:text-ink-strong hover:bg-ink/[0.06] transition-colors",children:[x.jsx(L1,{className:"w-3 h-3 shrink-0 coarse-only","aria-hidden":!0}),x.jsx("span",{className:"truncate tb-label",children:d}),x.jsx(ah,{className:`w-3 h-3 shrink-0 tb-chevron transition-transform ${n?"":"rotate-180"}`})]}),n&&x.jsxs("div",{role:"menu","aria-label":t("model.picker.label"),"data-testid":"composer-model-menu",className:"absolute bottom-full right-0 mb-1.5 z-50 w-64 max-w-[calc(100vw-1.5rem)] max-h-72 overflow-y-auto bg-surface-0 rounded-xl shadow-elevated border border-[var(--border)] py-1.5",children:[m.length===0&&x.jsx("div",{className:"px-3 py-2 text-caption text-ink-faint",children:t("model.picker.noneConfigured")}),m.map(g=>x.jsxs("div",{role:"group","aria-label":g.label,children:[x.jsx("div",{className:"px-3 pt-1.5 pb-0.5 text-caption font-bold text-ink-faint",children:g.label}),g.rows.map(y=>{const v=y.providerId===a&&y.modelId===u;return x.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":v,onClick:()=>void h(y),className:`w-full flex items-center gap-1.5 px-3 py-1.5 text-left transition-colors ${v?"text-brand":"text-ink-strong hover:bg-ink/[0.06]"}`,children:[x.jsx(vn,{className:`w-3.5 h-3.5 shrink-0 ${v?"opacity-100":"opacity-0"}`}),x.jsx("span",{className:"flex-1 truncate text-label",children:y.modelLabel}),y.vision&&x.jsx(j1,{className:"w-3 h-3 shrink-0 text-ink-faint","aria-label":t("model.picker.vision")})]},`${y.providerId}:${y.modelId}`)})]},g.label)),x.jsx("div",{className:"border-t border-[var(--border)] mt-1 pt-1",children:x.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{r(!1),e()},className:"w-full flex items-center gap-1.5 px-3 py-1.5 text-left text-label text-ink-muted hover:text-ink-strong hover:bg-ink/[0.06] transition-colors",children:[x.jsx(ox,{className:"w-3.5 h-3.5"}),t("model.picker.manage")]})})]})]})}const jo=5.5,Sd=2*Math.PI*jo,rr=["system","node","learner","history","draft"],Ad={system:"bg-accent",node:"bg-brand",learner:"bg-gold",history:"bg-ink/50",draft:"bg-exam"};function U3({info:e,historyTokens:t,draftTokens:n}){const r=We(),[s,i]=w.useState(!1),a=w.useRef(null);if(w.useEffect(()=>{!(e!=null&&e.contextWindow)&&s&&i(!1)},[e==null?void 0:e.contextWindow,s]),w.useEffect(()=>{if(!s)return;const h=m=>{var p;m.target instanceof Node&&((p=a.current)==null?void 0:p.contains(m.target))!==!0&&i(!1)},d=m=>{m.key==="Escape"&&i(!1)};return document.addEventListener("pointerdown",h),document.addEventListener("keydown",d),()=>{document.removeEventListener("pointerdown",h),document.removeEventListener("keydown",d)}},[s]),!e)return null;const o={system:e.systemTokens,node:e.nodeTokens,learner:e.learnerTokens,history:t,draft:n},u=rr.reduce((h,d)=>h+o[d],0),l=px(u,e.contextWindow),c=l!==null&&l>=85,f=gx(rr.map(h=>o[h]),l??0);return x.jsxs("span",{ref:a,className:"relative inline-flex items-center","data-testid":"composer-context",children:[x.jsxs("button",{type:"button",onClick:()=>i(!s),disabled:e.contextWindow===null,"aria-label":r("context.aria",{p:l!==null?`${l}%`:er(u)}),"aria-haspopup":"dialog","aria-expanded":s,"data-testid":"composer-context-trigger","data-tooltip":e.contextWindow===null?`${r("context.label")} ~${er(u)} · ${r("context.unknownWindow")}`:r("context.aria",{p:`${l}%`}),className:`flex items-center gap-1 px-1.5 py-0.5 rounded-full text-caption font-medium transition-colors ${c?"text-warning":"text-ink-muted"} hover:bg-ink/[0.06] disabled:hover:bg-transparent`,children:[x.jsxs("svg",{viewBox:"0 0 14 14",width:"14",height:"14","aria-hidden":!0,className:"shrink-0",children:[x.jsx("circle",{cx:"7",cy:"7",r:jo,fill:"none",strokeWidth:"2",className:"stroke-ink/20"}),x.jsx("circle",{cx:"7",cy:"7",r:jo,fill:"none",strokeWidth:"2",stroke:"currentColor",strokeLinecap:"round",strokeDasharray:`${Sd*(l??100)/100} ${Sd}`,transform:"rotate(-90 7 7)"})]}),l!==null?x.jsxs("span",{className:"tb-label",children:[l,"%"]}):x.jsxs("span",{className:"tb-label",children:["~",er(u)]})]}),s&&e.contextWindow!==null&&x.jsxs("div",{role:"dialog","aria-label":r("context.label"),"data-testid":"composer-context-panel",className:"absolute bottom-full right-0 mb-1.5 z-50 w-64 max-w-[calc(100vw-1.5rem)] bg-surface-0 rounded-xl shadow-elevated border border-[var(--border)] p-3",children:[x.jsxs("div",{className:"flex items-baseline justify-between mb-2",children:[x.jsx("span",{className:"text-label font-bold text-ink-strong",children:r("context.label")}),x.jsxs("span",{className:`text-caption ${c?"text-warning":"text-ink-muted"}`,children:[r("context.approx")," ",er(u)," / ",er(e.contextWindow)]})]}),x.jsx("div",{className:"flex h-2 rounded-full overflow-hidden bg-ink/10 mb-2",role:"img","aria-label":`${l}%`,children:rr.map(h=>f[rr.indexOf(h)]>0?x.jsx("div",{className:Ad[h],style:{width:`${f[rr.indexOf(h)]}%`}},h):null)}),x.jsx("dl",{className:"space-y-1",children:rr.map(h=>x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsxs("dt",{className:"flex items-center gap-1.5 text-caption text-ink-muted",children:[x.jsx("span",{className:`w-2 h-2 rounded-sm ${Ad[h]}`,"aria-hidden":!0}),r(`context.${h}`)]}),x.jsxs("dd",{className:"text-caption text-ink-strong tabular-nums",children:["~",er(o[h])]})]},h))})]})]})}const Ho={glm:{fast:e=>{e.thinking={type:"disabled"},e.reasoning_effort="low"},deep:e=>{e.thinking={type:"enabled"}}},qwen:{fast:e=>{e.enable_thinking=!1},deep:e=>{e.enable_thinking=!0}},siliconcloud:{fast:e=>{e.enable_thinking=!1},deep:e=>{e.enable_thinking=!0}}};function z3(e,t,n){if(e==="openai"||e in Ho)return e;const r=(t??"").toLowerCase(),s=(n??"").toLowerCase();return r.includes("bigmodel.cn")||r.includes("z.ai")||s.startsWith("glm")?"glm":r.includes("dashscope")||s.startsWith("qwen")?"qwen":r.includes("siliconflow")?"siliconcloud":e}function V3(e,t,n){return t==="anthropic"||t==="google"||e==="openai"||e in Ho?!0:z3(e,n==null?void 0:n.baseUrl,n==null?void 0:n.model)in Ho}const Xa=[{value:"",labelKey:"effort.auto.label",descKey:"effort.auto.desc"},{value:"fast",labelKey:"effort.fast.label",descKey:"effort.fast.desc"},{value:"deep",labelKey:"effort.deep.label",descKey:"effort.deep.desc"}];function q3(){const e=We(),[t,n]=w.useState(!1),[r,s]=w.useState(""),[i,a]=w.useState(!0),o=w.useRef(null),u=w.useRef(null),[l,c]=w.useState("right"),[f,h]=w.useState(0),d=w.useRef(0),[m,p]=w.useState(0);w.useLayoutEffect(()=>{if(!t){p(0),d.current=0,h(0);return}const T=u.current;if(!T)return;const C=T.getBoundingClientRect(),E=C.left-d.current,k=C.right-d.current,_=window.innerWidth;if(m===0){if(E<8&&k<=_-8){c("left"),p(1);return}if(k>_-8&&E>=8){c("right"),p(1);return}p(1)}const A=Math.min(0,_-8-k)+Math.max(0,8-E);A!==d.current&&(d.current=A,h(A))},[t,m]);const g=w.useCallback(async()=>{var T;try{const[C,E,k,_,A]=await Promise.all([ce.getSetting("active_provider"),ce.getSetting("reasoning_effort"),ce.getProviderPresets(),ce.listCustomProviders(),ce.getSetting("active_model")]),I=C??"glm",S=_.find(j=>j.id===I),L=((T=k.find(j=>j.id===I))==null?void 0:T.protocol)??(S==null?void 0:S.protocol)??"openai-compatible";a(V3(I,L,{baseUrl:S==null?void 0:S.baseUrl,model:A??(S==null?void 0:S.defaultModel)}));const N=E??"";s(N==="fast"||N==="deep"?N:"")}catch{a(!1)}},[]);w.useEffect(()=>{g();const T=()=>void g();return window.addEventListener("llm-config-changed",T),()=>window.removeEventListener("llm-config-changed",T)},[g]),w.useEffect(()=>{if(!t)return;const T=E=>{var k;E.target instanceof Node&&((k=o.current)==null?void 0:k.contains(E.target))!==!0&&n(!1)},C=E=>{E.key==="Escape"&&n(!1)};return document.addEventListener("pointerdown",T),document.addEventListener("keydown",C),()=>{document.removeEventListener("pointerdown",T),document.removeEventListener("keydown",C)}},[t]);const y=async T=>{if(n(!1),T!==r){s(T);try{await ce.setSetting("reasoning_effort",T)}catch{s(r)}}},v=Xa.find(T=>T.value===r)??Xa[0];return x.jsxs("div",{ref:o,className:"relative","data-testid":"composer-effort",children:[x.jsxs("button",{type:"button",onClick:()=>!!i&&n(!t),disabled:!i,"aria-haspopup":"menu","aria-expanded":t,"data-testid":"composer-effort-trigger","data-tooltip":e(i?"effort.label":"effort.unsupported"),className:`flex items-center gap-1 px-1.5 py-0.5 rounded-full text-caption font-medium transition-colors ${r?"text-accent":"text-ink-muted"} ${i?"hover:text-ink-strong hover:bg-ink/[0.06]":"opacity-40 cursor-not-allowed"}`,children:[x.jsx(sh,{className:"w-3 h-3 shrink-0"}),x.jsx("span",{className:"truncate tb-label",children:e(v.labelKey)}),x.jsx(ah,{className:`w-3 h-3 shrink-0 tb-chevron transition-transform ${t?"":"rotate-180"}`})]}),t&&x.jsx("div",{ref:u,role:"menu","aria-label":e("effort.label"),"data-testid":"composer-effort-menu",style:{transform:f?`translateX(${f}px)`:void 0},className:`absolute bottom-full ${l==="right"?"right-0":"left-0"} mb-1.5 z-50 w-60 max-w-[calc(100vw-1.5rem)] bg-surface-0 rounded-xl shadow-elevated border border-[var(--border)] py-1.5`,children:Xa.map(T=>{const C=T.value===r;return x.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":C,onClick:()=>void y(T.value),className:`w-full flex items-start gap-1.5 px-3 py-1.5 text-left transition-colors ${C?"text-brand":"text-ink-strong hover:bg-ink/[0.06]"}`,children:[x.jsx(vn,{className:`w-3.5 h-3.5 shrink-0 mt-0.5 ${C?"opacity-100":"opacity-0"}`}),x.jsxs("span",{className:"flex-1",children:[x.jsx("span",{className:"block text-label font-bold",children:e(T.labelKey)}),x.jsx("span",{className:"block text-caption text-ink-faint",children:e(T.descKey)})]})]},T.value||"auto")})})]})}const $3=w.lazy(()=>ve(()=>import("./VoicePanel-ByLmSH6U.js"),__vite__mapDeps([34,1,2,32]),import.meta.url).then(e=>({default:e.VoicePanel}))),W3={direct:"soul.direct",guide:"soul.guide",practice:"soul.practice"},Y3={direct:kn,guide:uh,practice:q1},G3={direct:"soul.direct.desc",guide:"soul.guide.desc",practice:"soul.practice.desc"},K3=["image/png","image/jpeg","image/webp","image/gif",".txt",".md",".markdown",".rst",".org",".adoc",".log",".csv",".tsv",".json",".yaml",".yml",".toml",".ini",".py",".js",".mjs",".cjs",".ts",".tsx",".jsx",".go",".rs",".java",".c",".h",".cpp",".hpp",".cs",".rb",".sh",".sql",".html",".css",".scss",".vue",".svelte",".kt",".swift",".php"].join(",");let Cd=0;function X3({nodeId:e,agentReady:t,streaming:n,souls:r,activeSoul:s,starterPrompts:i,onPickSoul:a,onSend:o,onStop:u,onLogFriction:l,onGotoSettings:c,insertText:f,historyTokens:h}){const d=We(),m=kh(),[p,g]=w.useState(""),[y,v]=w.useState([]),[T,C]=w.useState(null),[E,k]=w.useState(null),[_,A]=w.useState(!1),I=w.useRef(null),S=w.useRef(0),[L,N]=w.useState(!0);w.useEffect(()=>{ce.getSetting("asr_auto_stop").then(re=>N(re!=="0"))},[]);const[j,P]=w.useState(!1);w.useEffect(()=>(Nl(j),()=>Nl(!1)),[j]);const[D,H]=w.useState(""),[z,F]=w.useState(!1),[q,R]=w.useState(null),$=j3(re=>{H(re),F(!0)},{locale:m,autoStop:L}),W=$.startError??$.transcribeError;w.useEffect(()=>{if(!W)return;R(d(W==="no-speech"?"chat.speech.no_speech":W==="model-missing"?"chat.speech.asr_model_missing":W==="engine-unavailable"?"chat.speech.engine_unavailable":W==="custom-provider-missing"?"chat.speech.custom_provider_missing":W==="groq-key-missing"?"chat.speech.groq_key_missing":W==="azure-key-missing"?"chat.speech.azure_stt_key_missing":W==="azure-region-missing"?"chat.speech.azure_stt_region_missing":W==="mic-insecure-context"?"chat.speech.asr_insecure_context":W==="mic-unavailable"?"chat.speech.asr_start_fail":"chat.speech.asr_failed")),$.clearTranscribeError()},[W,$,d]);const M=q?"error":$.listening?"recording":$.transcribing?"transcribing":z?"review":"idle",ee=(re,Ae,Ve)=>{n1(),o(re,Ae,Ve)},oe=w.useCallback(()=>{H(""),F(!1),R(null)},[]),V=w.useCallback(()=>{P(!1),oe()},[oe]),X=()=>{const re=D.trim();!re||n||!e||(ee(re),V())};w.useEffect(()=>{f&&g(re=>re.trim()?`${re}
|
|
451
|
-
|
|
452
|
-
${f}`:f)},[f]),w.useEffect(()=>{if(!e){k(null);return}let re=!1;(async()=>{try{const Ve=await ce.getContextUsage(e,m);re||k(Ve)}catch{re||k(null)}})();const Ae=()=>{ce.getContextUsage(e,m).then(Ve=>{re||k(Ve)}).catch(()=>{})};return window.addEventListener("llm-config-changed",Ae),()=>{re=!0,window.removeEventListener("llm-config-changed",Ae)}},[e,m]),w.useEffect(()=>{if(!T)return;const re=setTimeout(()=>C(null),3e3);return()=>clearTimeout(re)},[T]);const Z=w.useRef(new Set);w.useEffect(()=>()=>{for(const re of Z.current)URL.revokeObjectURL(re)},[]);const be=w.useCallback(re=>{v(Ae=>{const Ve=Ae.find(Ge=>Ge.id===re);return Ve!=null&&Ve.previewUrl&&(URL.revokeObjectURL(Ve.previewUrl),Z.current.delete(Ve.previewUrl)),Ae.filter(Ge=>Ge.id!==re)})},[]),me=w.useCallback(async re=>{if(re.length===0)return;const Ae=ti.maxPerMessage-y.length;if(Ae<=0){C(d("chat.attach.tooMany",{n:ti.maxPerMessage}));return}const Ve=re.length>Ae?re.slice(0,Ae):re;re.length>Ae&&C(d("chat.attach.tooMany",{n:ti.maxPerMessage}));const Ge=[],Xe=[];for(const Le of Ve){const He=P3(Le.name,Le.type,Le.size);if(!He.ok){C(He.reason==="unsupported"?d("chat.attach.unsupported",{name:Le.name}):He.reason==="tooLargeImage"?d("chat.attach.tooLargeImage",{name:Le.name}):d("chat.attach.tooLargeText",{name:Le.name}));continue}if(He.kind==="image"){if((E==null?void 0:E.visionCapable)===!1){C(d("chat.attach.visionUnsupported"));continue}const K=await new Promise(xe=>{const he=new FileReader;he.onload=()=>{const Ce=he.result;xe(typeof Ce=="string"?Ce.slice(Ce.indexOf(",")+1):null)},he.onerror=()=>xe(null),he.readAsDataURL(Le)});if(K===null)continue;const se=URL.createObjectURL(Le);Xe.push(se),Ge.push({id:++Cd,kind:"image",name:Le.name,mime:Le.type||"image/png",size:Le.size,previewUrl:se,base64:K})}else try{const K=await Le.text();Ge.push({id:++Cd,kind:"text",name:Le.name,mime:Le.type||"text/plain",size:Le.size,text:K})}catch{}}if(Ge.length>0){for(const Le of Xe)Z.current.add(Le);v(Le=>[...Le,...Ge])}else for(const Le of Xe)URL.revokeObjectURL(Le)},[y.length,E==null?void 0:E.visionCapable,d]),te=re=>{const Ae=re.trim();if(n||!e||!Ae&&y.length===0)return;const Ve=Ae||Tu("chat.attach.imageOnlyText"),Ge=y.map(Xe=>({kind:Xe.kind,name:Xe.name,mime:Xe.mime,size:Xe.size,data:Xe.kind==="image"?Xe.base64??"":Xe.text??"",...Xe.kind==="image"&&Xe.previewUrl?{previewUrl:Xe.previewUrl}:{}}));ee(Ve,void 0,Ge.length>0?Ge:void 0),g(""),v([])},ne=()=>te(p),de=re=>{n||(ee(re.message,re.label),re.frictionCategory&&(l==null||l(re.frictionCategory,null)))},ye=re=>{const Ae=Array.from(re.clipboardData.files??[]);Ae.length>0&&(re.preventDefault(),me(Ae))},Ne=re=>{re.dataTransfer.types.includes("Files")&&(re.preventDefault(),S.current+=1,A(!0))},tt=re=>{re.dataTransfer.types.includes("Files")&&(S.current=Math.max(0,S.current-1),S.current===0&&A(!1))},Ee=re=>{re.dataTransfer.types.includes("Files")&&(re.preventDefault(),S.current=0,A(!1),me(Array.from(re.dataTransfer.files??[])))},qe=w.useMemo(()=>yh(p),[p]);return t?x.jsxs("div",{className:"px-5 pb-4 pt-1 shrink-0","data-testid":"composer",children:[!j&&i.length>0&&e&&x.jsx("div",{className:"flex items-center gap-1.5 overflow-x-auto pb-2","data-testid":"starter-prompts",children:i.map((re,Ae)=>x.jsx("button",{onClick:()=>de(re),disabled:n,"data-testid":`starter-prompt-${Ae}`,"data-tooltip":re.hint??re.label,className:"shrink-0 whitespace-nowrap px-2.5 py-1 rounded-full text-caption font-medium text-ink-muted hover:text-ink-strong hover:bg-ink/[0.06] transition-colors disabled:opacity-30",children:re.label},Ae))}),x.jsx("div",{className:`composer-card relative rounded-2xl transition-colors px-3 pt-2 pb-1.5 ${_?"bg-accent/10 ring-1 ring-accent":"bg-ink/[0.05] focus-within:bg-ink/[0.07]"}`,onDragEnter:Ne,onDragOver:re=>{re.dataTransfer.types.includes("Files")&&re.preventDefault()},onDragLeave:tt,onDrop:Ee,"data-testid":"composer-card",children:j?x.jsxs(x.Fragment,{children:[M!=="idle"&&x.jsx(w.Suspense,{fallback:null,children:x.jsx($3,{view:M,level:$.level,text:D,onTextChange:H,onSend:X,onRerecord:oe,errorMessage:q,sendDisabled:n||!e||!D.trim()})}),x.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[x.jsxs("span",{className:"flex items-center gap-1.5 text-label text-ink-muted font-medium",children:[x.jsx(Ji,{className:"w-3.5 h-3.5 text-accent"}),d("chat.speech.dictation")]}),x.jsxs("button",{type:"button",onClick:V,"data-tooltip":d("chat.speech.back_to_keyboard"),"aria-label":d("chat.speech.back_to_keyboard"),"data-testid":"voice-keyboard-toggle",className:"touch-lift flex items-center gap-1 px-2 py-0.5 rounded-full text-caption font-medium text-ink-muted hover:text-ink-strong hover:bg-ink/[0.06] transition-colors",children:[x.jsx(Y1,{className:"w-3.5 h-3.5"}),x.jsx("span",{children:d("chat.speech.keyboard")})]})]}),x.jsxs("button",{type:"button",onPointerDown:re=>{re.preventDefault(),$.beginHold()},onPointerUp:$.endHold,onPointerLeave:$.endHold,onPointerCancel:$.endHold,onContextMenu:re=>re.preventDefault(),disabled:!e||M!=="idle","data-testid":$.listening?"voice-hold-btn-active":"voice-hold-btn",className:`w-full py-5 rounded-xl text-lead font-bold flex items-center justify-center gap-2 transition-all touch-none select-none disabled:opacity-40 ${$.listening?"bg-accent/25 text-accent scale-[0.99]":"bg-accent/10 text-accent hover:bg-accent/20 active:bg-accent/25 active:scale-[0.99]"}`,children:[x.jsx(Ji,{className:"w-5 h-5"}),$.listening?d("chat.speech.release_to_stop"):d("chat.speech.hold_to_talk")]})]}):x.jsxs(x.Fragment,{children:[r.length>0&&x.jsxs("div",{className:"flex items-center gap-1 overflow-x-auto mb-1","data-testid":"soul-picker",children:[x.jsx("span",{className:"text-body text-ink-faint shrink-0",children:d("chat.soul.label")}),r.map(re=>{const Ae=s===re.name,Ve=Y3[re.name]??uh,Ge=d(G3[re.name]??"soul.direct.desc");return x.jsxs("button",{onClick:()=>a(re.name),"data-testid":`soul-pill-${re.name}`,"data-tooltip":Ge,className:`shrink-0 flex items-center gap-1 px-2 py-0.5 rounded-full text-body font-medium transition-colors ${Ae?"bg-brand/15 text-brand":"text-ink-muted hover:text-ink-strong hover:bg-ink/5"}`,children:[x.jsx(Ve,{className:"w-3.5 h-3.5"}),x.jsx("span",{children:d(W3[re.name]??"soul.direct")})]},re.id)})]}),y.length>0&&x.jsxs("div",{className:"flex gap-1.5 flex-wrap mb-1.5","data-testid":"composer-attachments",children:[(E==null?void 0:E.visionBridgeModel)&&y.some(re=>re.kind==="image")&&x.jsxs("div",{className:"w-full flex items-center gap-1 text-caption text-ink-muted","data-testid":"vision-bridge-chip",children:[x.jsx(sx,{className:"w-3.5 h-3.5 shrink-0"}),x.jsx("span",{children:d("chat.attach.bridgeChip",{model:E.visionBridgeModel})})]}),y.map(re=>re.kind==="image"?x.jsxs("div",{className:"relative w-16 h-16 shrink-0",children:[x.jsx("img",{src:re.previewUrl,alt:re.name,className:"w-16 h-16 object-cover rounded-lg border border-[var(--border)]"}),x.jsx("button",{type:"button",onClick:()=>be(re.id),"aria-label":d("chat.attach.remove",{name:re.name}),className:"touch-target-sm absolute -top-1.5 -right-1.5 w-5 h-5 rounded-full bg-ink/70 hover:bg-warning text-white flex items-center justify-center transition-colors",children:x.jsx(hr,{className:"w-3 h-3"})})]},re.id):x.jsxs("span",{className:"inline-flex items-center gap-1 pl-2 pr-1 py-1 rounded-full bg-ink/[0.08] text-caption text-ink-strong",children:[x.jsx(Ds,{className:"w-3 h-3 shrink-0 text-ink-faint"}),x.jsx("span",{className:"truncate max-w-[10rem]",children:re.name}),x.jsx("button",{type:"button",onClick:()=>be(re.id),"aria-label":d("chat.attach.remove",{name:re.name}),className:"touch-target-sm w-4 h-4 rounded-full hover:bg-ink/20 flex items-center justify-center text-ink-muted hover:text-warning transition-colors",children:x.jsx(hr,{className:"w-2.5 h-2.5"})})]},re.id))]}),T&&x.jsx("div",{className:"text-caption text-warning pb-1",role:"status","data-testid":"composer-notice",children:T}),x.jsxs("div",{className:"flex gap-2 items-end",children:[x.jsx("textarea",{value:p,onChange:re=>g(re.target.value),onFocus:()=>Rl(!0),onBlur:()=>Rl(!1),onKeyDown:re=>{re.key==="Enter"&&!re.shiftKey&&(re.preventDefault(),ne())},onPaste:ye,placeholder:d(e?"chat.input.placeholder":"chat.input.no_node"),disabled:n||!e,rows:2,"data-testid":"chat-input",className:"flex-1 bg-transparent text-ink-strong text-body rounded-lg px-1 py-1 resize-none focus:outline-none disabled:opacity-40 placeholder:text-ink-faint"}),n?x.jsx("button",{onClick:u,"data-testid":"chat-stop",className:"btn-icon-3d-warning shrink-0 w-9 h-9",title:d("chat.stop"),"aria-label":d("chat.stop"),children:x.jsx(yu,{className:"w-3.5 h-3.5 fill-current"})}):x.jsx("button",{onClick:ne,disabled:n||!p.trim()&&y.length===0||!e,"data-testid":"chat-send",className:"btn-icon-3d-brand shrink-0 w-9 h-9",title:d("chat.send"),"aria-label":d("chat.send"),children:x.jsx(N1,{className:"w-4 h-4"})})]}),x.jsxs("div",{className:"composer-toolbar flex flex-wrap items-center justify-between gap-x-0.5 gap-y-1 mt-0.5",children:[x.jsx("button",{type:"button",onClick:()=>{oe(),P(!0)},disabled:!e,"data-tooltip":d("chat.speech.dictation"),"aria-label":d("chat.speech.dictation"),"data-testid":"composer-mic",className:"flex items-center gap-1 px-1.5 py-0.5 rounded-full text-caption font-medium text-ink-muted hover:text-ink-strong hover:bg-ink/[0.06] transition-colors disabled:opacity-50",children:x.jsx(Ji,{className:"w-3.5 h-3.5"})}),x.jsx("button",{type:"button",onClick:()=>{var re;return(re=I.current)==null?void 0:re.click()},"data-tooltip":d("chat.attach.add"),"aria-label":d("chat.attach.add"),"data-testid":"composer-attach",className:"flex items-center gap-1 px-1.5 py-0.5 rounded-full text-caption font-medium text-ink-muted hover:text-ink-strong hover:bg-ink/[0.06] transition-colors",children:x.jsx(ex,{className:"w-3 h-3"})}),x.jsx("input",{ref:I,type:"file",multiple:!0,accept:K3,className:"hidden",onChange:re=>{me(Array.from(re.target.files??[])),re.target.value=""}}),x.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-0.5",children:[x.jsx(q3,{}),x.jsx(U3,{info:E,historyTokens:h,draftTokens:qe}),x.jsx(H3,{onGotoSettings:c})]})]})]})})]}):x.jsx("div",{className:"px-5 pb-4 shrink-0","data-testid":"composer-nokey",children:x.jsxs("div",{className:"flex items-center justify-center gap-3 py-3 text-body text-ink-muted",children:[x.jsx("span",{children:d("chat.no_key.short")}),x.jsx("button",{onClick:c,className:"text-brand hover:underline font-bold",children:d("chat.no_key.cta")})]})})}const _d={viseme:"closed",open:0};function Q3(e){const[t,n]=w.useState(_d);return w.useEffect(()=>{if(!e){n(_d);return}const r=new Uint8Array(256),s=new Uint8Array(Gp/2);let i=0,a="",o=null,u=0;const l=()=>{const c=BC();if(c){let f,h;if(c.timeline&&c.timeline.cues.length>0){const p=Math.max(0,c.ctx.currentTime-c.startedAtCtxTime),g=QC(c.timeline,p);f=(g==null?void 0:g.viseme)??"closed",h=(g==null?void 0:g.level)??0}else if(c.analyser){const p=c.analyser;p.getByteTimeDomainData(r),p.getByteFrequencyData(s);const g=r1(r,s,p.context.sampleRate,p.fftSize);f=g.viseme,f!==a.split(":")[0]?(f==="closed"||f===o?f===o&&u++:(o=f,u=1),f!=="closed"&&!(f===o&&u>=2)&&(f=a.split(":")[0]||"closed")):(o=null,u=0),h=g.level}else f="closed",h=0;const d=i1(f,h),m=f+":"+d;m!==a&&(a=m,n({viseme:f,open:d}))}i=requestAnimationFrame(l)};return i=requestAnimationFrame(l),()=>cancelAnimationFrame(i)},[e]),t}const Z3=22,J3=35e-5,Id=.012,Nd=.12,Rd=.3,e_=16.667,Qa=12,t_=3.2,Ld=56,ir=.6;function n_(e,t,n,r,s=0,i=0){let a=0,o=0;for(const l of r){const c=e-l.x,f=t-l.y,h=Math.hypot(c,f),d=l.r+n,m=d+Ld;if(h>=m)continue;if(h<1e-4){o-=ir;continue}const p=c/h,g=f/h,y=Math.min(1.6,Math.max(0,1-(h-d)/Ld)),v=s*p+i*g,T=v<0?1+Math.min(1.6,-v/4):1;a+=p*ir*y*T,o+=g*ir*y*T}const u=Math.hypot(a,o);return u>ir*2&&(a=a/u*ir*2,o=o/u*ir*2),{x:a,y:o}}function r_(e,t,n,r=34){const s=n*.001;return{x:e.x+Math.sin(s*.31+t*2.1)*r,y:e.y+Math.sin(s*.47+t*4.7)*(r*.55)+Math.sin(s*1.7+t)*4}}function i_(e,t,n,r,s=e_){const i=Math.max(64,s*s),a=Uo((n.x-e.x)*Id-t.x*Nd,Rd),o=Uo((n.y-e.y)*Id-t.y*Nd,Rd);return{fx:a*r/i,fy:o*r/i-r*.001}}function Uo(e,t){return e>t?t:e<-t?-t:e}function s_(e,t,n,r,s,i,a,o,u,l){const c=e-i,f=t-a,h=Math.hypot(c,f),d=s+l;if(h>=d||h<1e-4)return null;const m=c/h,p=f/h,g=n-o,y=r-u,v=g*m+y*p,T=d-h,C=v<0?-v*.9:0;return{nx:m,ny:p,dvx:m*(T*.55+C*.85),dvy:p*(T*.55+C*.85),bfx:-m*C*.02,bfy:-p*C*.02,hitSpeed:-v}}function a_(e,t){return Math.hypot(e,t)<.35?0:Uo(e*.06,.5)}function o_(e,t,n,r=0){const s=[.14,.32,.5,.68,.86],i=[.38,.5,.62],a=(r%15+15)%15;let o={x:e*.5,y:t*.5},u=-1/0;for(let l=0;l<15;l++){const c=(a+l)%15,f=e*s[c%5],h=t*i[Math.floor(c/5)];let d=1/0;for(const m of n){const p=Math.hypot(f-m.x,h-m.y)-m.r;p<d&&(d=p)}d>u+1e-9&&(u=d,o={x:f,y:h})}return o}function u_(e,t,n=220){let r=null,s=n;for(const i of t){const a=Math.hypot(i.x-e.x,i.y-e.y);a<s&&(s=a,r={x:i.x,y:i.y})}return r}function l_(e){const t=e.radius??Z3,{Bodies:n,Body:r,Composite:s,Engine:i}=cn,a=i.create();a.gravity.y=1,a.positionIterations=4,a.velocityIterations=3;const o=n.circle(e.width*.7,120,t,{restitution:.55,friction:.02,frictionAir:.028,density:J3});s.add(a.world,o);const u=240;let l=[];const c=(d,m)=>{for(const g of l)s.remove(a.world,g);const p=(g,y,v,T)=>n.rectangle(g,y,v,T,{isStatic:!0,restitution:.5});l=[p(-u/2,m/2-160,u,m+640),p(d+u/2,m/2-160,u,m+640),p(d/2,m+u/2,d+u*2,u),p(d/2,-320-u/2,d+u*2,u)];for(const g of l)s.add(a.world,g)};c(e.width,e.height);let f=0,h=e.width;return{body:o,resize(d,m){h=d,c(d,m)},step(d,m,p,g,y){const v=g<f;i.update(a,Math.min(33,Math.max(8,d)));let T=!1;if(!v&&m){const j=y!=null&&y.settle?{x:m.x,y:m.y+Math.sin(g*.0012)*2}:r_(m,Math.floor(g/4200),g),P=Math.max(64,d*d),D=i_({x:o.position.x,y:o.position.y},{x:o.velocity.x,y:o.velocity.y},j,o.mass,d),H=n_(o.position.x,o.position.y,t,p,o.velocity.x,o.velocity.y);r.applyForce(o,o.position,{x:D.fx+H.x*o.mass/P,y:D.fy+H.y*o.mass/P}),r.setAngularVelocity(o,o.angularVelocity-o.angle*.06-o.angularVelocity*.08)}{const j=o.velocity,P=Math.hypot(j.x,j.y);P>Qa&&r.setVelocity(o,{x:j.x/P*Qa,y:j.y/P*Qa})}let C=0,E=0,k=0,_=0,A=0;for(const j of p){const P=s_(o.position.x,o.position.y,o.velocity.x,o.velocity.y,t,j.x,j.y,j.vx,j.vy,j.r);P&&(E+=P.nx*Math.min(4,P.dvx),k+=P.ny*Math.min(4,P.dvy),_+=P.dvx*.9,A+=P.dvy*.9,j.isStatic||j.push(P.bfx,P.bfy),P.hitSpeed>C&&(C=P.hitSpeed))}const I=Math.hypot(E,k);I>4&&(E=E/I*4,k=k/I*4);const S=Math.hypot(_,A);S>7&&(_=_/S*7,A=A/S*7),(I>0||S>0)&&(r.setPosition(o,{x:o.position.x+E,y:o.position.y+k}),r.setVelocity(o,{x:o.velocity.x+_,y:o.velocity.y+A})),C>=t_&&!v&&(f=g+900,T=!0);const L=o.position;L.x<t&&(r.setPosition(o,{x:t,y:L.y}),o.velocity.x<0&&r.setVelocity(o,{x:-o.velocity.x*.5,y:o.velocity.y})),L.x>h-t&&(r.setPosition(o,{x:h-t,y:L.y}),o.velocity.x>0&&r.setVelocity(o,{x:-o.velocity.x*.5,y:o.velocity.y}));const N=y==null?void 0:y.ceilY;return N!==void 0&&L.y<N+t&&(r.setPosition(o,{x:L.x,y:N+t}),o.velocity.y<0&&r.setVelocity(o,{x:o.velocity.x,y:-o.velocity.y*.5})),T},dizzyRemaining(d){return Math.max(0,f-d)},throwDizzy(d){f=d+900},dispose(){s.clear(a.world,!1),i.clear(a)}}}const Ft={rail:76,chat:96,notebook:120};function Md(){const t=document.querySelector('[data-testid="composer-card"]')??document.querySelector('[data-testid="composer"]')??document.querySelector('[data-testid="composer-nokey"]');if(!t)return null;const n=t.getBoundingClientRect();return{x:n.right-78,y:n.top-44}}function c_(){const e=document.querySelector('[data-testid="notebook-panel"]');if(!e)return null;const t=e.getBoundingClientRect();return{x:t.right-64,y:t.top+84}}function d_({courseId:e}){const t=w.useSyncExternalStore(s1,ua),n=Q3(t.state.talking),r=pu(),[s,i]=w.useState(!1),[a,o]=w.useState(null),[u,l]=w.useState("rail"),c=w.useRef("rail"),f=w.useRef(null),[h,d]=w.useState(!1),m=w.useRef(!1),p=w.useRef(null),g=w.useRef(null),y=w.useRef(null),v=w.useRef(null),T=w.useRef(t.state.zone),C=w.useRef(!1),E=w.useRef(0),k=w.useRef(null),[_,A]=w.useState(null),I=w.useRef(0),S=w.useRef(null),L=w.useRef(null),N=w.useRef(null),j=w.useRef(0),P=w.useRef(null),D=w.useRef(0),H=w.useRef({pane:"rail",bucket:-1}),z=w.useRef(null),F=w.useRef(null);w.useEffect(()=>{var M,ee,oe;if(u===T.current||(T.current=u,r))return;i(!0),(ee=(M=p.current)==null?void 0:M.animate)==null||ee.call(M,[{transform:"scale(1, 1)"},{transform:"scale(1.08, 0.86)",offset:.3},{transform:"scale(0.96, 1.1)",offset:.65},{transform:"scale(1, 1)"}],{duration:620,easing:"cubic-bezier(0.2, 1.4, 0.4, 1)",composite:"add"}),(oe=p.current)==null||oe.classList.add("cp-takeoff"),setTimeout(()=>{var V;return(V=p.current)==null?void 0:V.classList.remove("cp-takeoff")},650);const W=[setTimeout(()=>i(!1),950),setTimeout(()=>{var X;const V=p.current;!V||u==="rail"||(a1(),(X=V.animate)==null||X.call(V,[{transform:"scale(1, 1)"},{transform:"scale(1.07, 0.88)",offset:.42},{transform:"scale(0.98, 1.03)",offset:.72},{transform:"scale(1, 1)"}],{duration:280,easing:"ease-out",composite:"add"}))},940)];return()=>{for(const V of W)clearTimeout(V)}},[u,r]),w.useEffect(()=>{if(!e)return;let W=!0;return window.api.getDashboard(e).then(M=>{var X,Z;if(!W)return;const ee=(X=M==null?void 0:M.frictionByNode)==null?void 0:X[0];if(!(ee!=null&&ee.nodeId))return;F.current=ee.nodeId;const oe=la(),V=(Z=oe.nav)==null?void 0:Z.getBoundingClientRect();if(V)for(const{island:be,container:me}of oe.sections.values()){const te=be.ball(ee.nodeId);if(!te)continue;const ne=me.getBoundingClientRect(),de=ne.left-V.left+te.body.position.x,ye=ne.top-V.top+te.body.position.y;N.current={x:de,y:Math.max(40,ye-92)},j.current=performance.now()+8e3,setTimeout(()=>{W&&Ll()},1200);return}}).catch(()=>{}),()=>{W=!1}},[e]),w.useEffect(()=>{const W=M=>{const ee=M.detail,oe=F.current;ee!=="mastery"||!oe||!e||window.api.getDashboard(e).then(V=>{var Z;((Z=V==null?void 0:V.frictionByNode)==null?void 0:Z.some(be=>be.nodeId===oe))||(F.current=null,j.current=0,l1())}).catch(()=>{})};return window.addEventListener("companion-state-changed",W),()=>window.removeEventListener("companion-state-changed",W)},[e]),w.useEffect(()=>go(W=>{if(W.kind!=="correct"&&W.kind!=="unlock"||!W.origin||ua().state.examActive)return;const M=document.elementFromPoint(W.origin.x,W.origin.y);if(!M)return;const ee=M.closest('[data-testid="map-rail"]');L.current={x:W.origin.x,y:W.origin.y,until:performance.now()+3e3,pane:ee?"rail":"chat"}}),[]),w.useEffect(()=>{const W=ee=>{const oe=P.current;if(!oe)return;const V=performance.now(),X=Math.max(8,V-oe.t);P.current={x:ee.clientX,y:ee.clientY,vx:(ee.clientX-oe.x)/X*16.7,vy:(ee.clientY-oe.y)/X*16.7,t:V}},M=()=>{var X;const ee=P.current;if(!ee)return;P.current=null;const oe=Math.hypot(ee.vx,ee.vy),V=g.current;if(V){const Z=(X=la().nav)==null?void 0:X.getBoundingClientRect();Z&&cn.Body.setPosition(V.body,{x:Math.min(Z.width-24,Math.max(24,ee.x-Z.left)),y:Math.min(Z.height-24,Math.max(24,ee.y-Z.top))}),oe>=2.5&&(cn.Body.setVelocity(V.body,{x:ee.vx*.9,y:ee.vy*.9}),V.throwDizzy(performance.now()))}Ml(!1,oe)};return window.addEventListener("pointermove",W,{passive:!0}),window.addEventListener("pointerup",M,{passive:!0}),window.addEventListener("pointercancel",M,{passive:!0}),()=>{window.removeEventListener("pointermove",W),window.removeEventListener("pointerup",M),window.removeEventListener("pointercancel",M)}},[]),w.useEffect(()=>{if(!t.enabledLoaded||!t.enabled||t.petMode)return;const W=p.current;if(!W)return;let M=0,ee=performance.now(),oe=0,V=0,X=0,Z=-1e9,be=null,me=0,te=0;const ne=de=>{var Me,_i,Kt,Ii,Vt,Zn,Cr;M=requestAnimationFrame(ne);const ye=Math.min(50,de-ee);ee=de;const Ne=la(),tt=Ne.nav,Ee=(tt==null?void 0:tt.getBoundingClientRect())??null,qe=ua().state,re=!!P.current,Ae=!!Ee&&Ee.width>40&&(Ne.visible||qe.importing);de-Z>150&&(Z=de,be=((Me=document.querySelector('[data-testid="notebook-panel"]'))==null?void 0:Me.getBoundingClientRect())??null,me=((_i=document.querySelector("header.app-header"))==null?void 0:_i.getBoundingClientRect().bottom)??0,te=((Kt=document.querySelector('[data-testid="map-rail-topbar"]'))==null?void 0:Kt.getBoundingClientRect().bottom)??0);const Ve=be,Ge=()=>Math.max(me,te)-((Ee==null?void 0:Ee.top)??0),Xe=Math.floor(de/h1);if(H.current.bucket!==Xe&&(H.current={pane:c1(H.current.pane),bucket:Xe},Ae&&qe.zone==="roam")){const Re=document.querySelector('[data-testid="map-review-badge"]'),$e=!!Re&&Re.className.includes("bg-review/20");let it=null;for(const{island:Se,container:ze}of Ne.sections.values()){const Pe=Se.balls.find(lt=>!lt.body.isStatic);if(Pe){const lt=ze.getBoundingClientRect();it={x:lt.left+Pe.body.position.x,y:lt.top+Pe.body.position.y};break}}const nt=j.current>de?N.current:null,ft=m1(Xe,{hasReview:$e,hasNext:!!it,hasFriction:!!nt});if(ft==="review"&&Re){const Se=Re.getBoundingClientRect();z.current={kind:ft,until:de+ca,pos:{x:Se.right+44,y:Se.bottom+64},fired:!1},H.current.pane="rail"}else ft==="inspect"&&it?(z.current={kind:ft,until:de+ca,pos:{x:it.x+34,y:it.y-66},fired:!1},H.current.pane="rail"):ft==="friction"&&nt&&(z.current={kind:ft,until:de+ca,pos:{x:nt.x,y:nt.y},fired:!1},H.current.pane="rail")}const Le=z.current&&de<z.current.until?z.current:null;z.current&&!Le&&(z.current=null);const He=p1();if(He&&He.seq!==E.current&&!qe.examActive){E.current=He.seq;let Re=He.x,$e=He.y;if((Re==null||$e==null)&&Ae)for(const{island:it,container:nt}of Ne.sections.values()){const ft=it.ball(He.nodeId);if(ft){const Se=nt.getBoundingClientRect();Re=Se.left+ft.body.position.x,$e=Se.top+ft.body.position.y;break}}Ae&&Re!=null&&$e!=null?(k.current={nodeId:He.nodeId,x:Re,y:$e,until:de+2400,fired:!1,fly:!0},A({until:de+2400})):(k.current={nodeId:He.nodeId,x:0,y:0,until:de+1600,fired:!0,fly:!1},A({until:de+1600}))}const K=!!k.current&&de<k.current.until;if(k.current&&!K&&(k.current=null,A(null)),K&&k.current&&!k.current.fired){const Re=k.current;if(Re.fired=!0,Re.fly&&Ee)for(const{island:$e}of Ne.sections.values()){const it=$e.ball(Re.nodeId);if(it&&!it.body.isStatic){cn.Body.applyForce(it.body,it.body.position,{x:.0035,y:-.005});break}}}const se=g1();if(se&&se.seq!==I.current&&!qe.examActive&&(I.current=se.seq,Ae&&Ee)){const Re=Ge();S.current={x:Math.min(Ee.width-44,Math.max(44,se.x-Ee.left)),y:Math.min(Ee.height-44,Math.max(Re+52,se.y-Ee.top)),until:de+3200}}const xe=!!S.current&&de<S.current.until;S.current&&!xe&&(S.current=null);const he=!!L.current&&de<L.current.until;L.current&&!he&&(L.current=null);const Ce=TC(),_e=Ce?Ce.startContainer.parentElement??null:null;let le=null,Te=H.current.pane;const Be=qe.examActive?(Ii=document.querySelector('[data-testid="exam-timer"]'))==null?void 0:Ii.getBoundingClientRect():void 0;if(Be){g.current=null,P.current=null,Te="chat";const Re={x:Math.min(Be.right+64,window.innerWidth-70),y:Math.min(Be.bottom+56,window.innerHeight-90)},$e=y.current??Re;le=Zt($e,Re,ye,In),X=Math.max(-.15,Math.min(.15,(le.x-$e.x)*.008))}else if(re){const Re=P.current;g.current=null,le={x:Re.x,y:Re.y},X=Math.max(-.5,Math.min(.5,Re.vx*.04)),Te=c.current}else if(_e&&Ce){const Re=_e.closest('[data-testid="notebook-panel"], [data-testid="chat-stream"]'),$e=Re==null?void 0:Re.getBoundingClientRect(),it=Ce.getClientRects(),nt=[];for(let Ye=0;Ye<it.length;Ye++){const st=it[Ye];st.width>1&&st.height>1&&nt.push({left:st.left,right:st.right,top:st.top,bottom:st.bottom})}const ft=nt.length?nt[nt.length-1]:null,Se=nt.length?nt[0]:null,ze=Ce.getBoundingClientRect(),Pe=!!(Re!=null&&Re.closest('[data-testid="chat-stream"]')),lt=Pe?Ft.chat:Ft.notebook;if(Te=Pe?"chat":"notebook",$e&&(ft||ze.width>0)){const Ye=Pl({left:ze.left,right:ze.right,top:ze.top,bottom:ze.bottom},$e,lt,{first:Se??void 0,last:ft??void 0},nt),st={dir:Ye.dir,pane:Te};if((((Vt=f.current)==null?void 0:Vt.dir)!==st.dir||((Zn=f.current)==null?void 0:Zn.pane)!==st.pane)&&(f.current=st,o(st)),m.current!==Ye.occluding&&(m.current=Ye.occluding,d(Ye.occluding)),r)le=Ye,X=0;else{const At=y.current??{x:Ye.x,y:Ye.y};le=Zt(At,Ye,ye,x1,110),X=Ye.dir==="left"?-.07:Ye.dir==="right"?.07:0}}else{f.current!==null&&(f.current=null,o(null)),m.current&&(m.current=!1,d(!1));const Ye=$e?{x:$e.right-70,y:Math.max($e.top+96,me+lt*.8)}:Ol(window.innerHeight,lt,me),st=y.current??{x:Ye.x,y:Ye.y};le=Zt(st,Ye,ye,In),X=Math.max(-.25,Math.min(.25,(le.x-st.x)*.01))}}else{f.current!==null&&(f.current=null,o(null)),m.current&&(m.current=!1,d(!1));const Re=qe.pose==="writing"?kC():null,$e=qe.zone,it=Re?Re.closest('[data-testid="notebook-panel"], [data-testid="chat-stream"]'):null,nt=Re==null?void 0:Re.getBoundingClientRect(),ft=!!(it&&nt&&nt.width>0);if(Re&&ft){const Se=it,ze=Se.getBoundingClientRect(),Pe=nt,lt=!!Se.closest('[data-testid="chat-stream"]');Te=lt?"chat":"notebook";{const Ye=Pl(Pe,ze,lt?Ft.chat:Ft.notebook);if(g.current=null,r)le=Ye,X=0;else{const st=y.current??{x:Ye.x,y:Ye.y};le=Zt(st,Ye,ye,In),X=.08}}}else if(he&&L.current&&L.current.pane!=="rail"){g.current=null;const Se=L.current;Te=Se.pane==="notebook"?"notebook":"chat";const ze=Te==="notebook"?Ft.notebook:Ft.chat,Pe=d1({x:Se.x,y:Se.y},ze,window.innerWidth,Math.max(me,te));if(r)le=Pe,X=0;else{const lt=y.current??{x:Pe.x,y:Pe.y};le=Zt(lt,Pe,ye,In),X=Math.max(-.2,Math.min(.2,(le.x-lt.x)*.01))}}else if($e==="chat"&&Md()){g.current=null,Te="chat";const Se=Md();if(r)le=Se,X=0;else{const ze=da("chat",de),Pe=y.current??{x:Se.x,y:Se.y};le=Zt(Pe,{x:Se.x+ze.x,y:Se.y+ze.y},ye,In),X=Math.max(-.35,Math.min(.35,(le.x-Pe.x)*.014))}}else if($e==="notebook"&&Ve){g.current=null,Te="notebook";const Se=c_()??{x:Ve.right-70,y:Ve.top+96};if(r)le=Se,X=0;else{const ze=da("notebook",de),Pe=y.current??{x:Se.x,y:Se.y};le=Zt(Pe,{x:Se.x+ze.x,y:Se.y+ze.y},ye,In),X=Math.max(-.3,Math.min(.3,(le.x-Pe.x)*.012))}}else if(Ae&&(K||xe||$e==="rail"||$e==="roam")){const Se=Ee.width,ze=Ee.height;if(Te="rail",r)le={x:Ee.left+Se*.5,y:Ee.top+ze*.5},X=0;else{if((Se!==oe||ze!==V)&&(oe=Se,V=ze,(Cr=g.current)==null||Cr.resize(Se,ze),N.current=null),!g.current){g.current=l_({width:Se,height:ze});const Fe=y.current;Fe&&cn.Body.setPosition(g.current.body,{x:Math.min(Se-30,Math.max(30,Fe.x-Ee.left)),y:Math.min(ze-30,Math.max(30,Fe.y-Ee.top))})}const Pe=g.current,lt=[],Ye=[];for(const{island:Fe,container:_r}of Ne.sections.values()){const mn=_r.getBoundingClientRect();if(mn.bottom<Ee.top-120||mn.top>Ee.bottom+120)continue;const Jn=mn.left-Ee.left,Ir=mn.top-Ee.top;for(const Ct of Fe.balls)lt.push({x:Jn+Ct.body.position.x,y:Ir+Ct.body.position.y,vx:Ct.body.velocity.x,vy:Ct.body.velocity.y,r:Bt,isStatic:Ct.body.isStatic,push:(Qt,Mi)=>cn.Body.applyForce(Ct.body,Ct.body.position,{x:Qt,y:Mi})}),Ye.push({x:Jn+Ct.body.position.x,y:Ir+Ct.body.position.y-Bt-20});for(const Ct of Fe.links)for(const Qt of Ct.particles)Ye.push({x:Jn+Qt.position.x,y:Ir+Qt.position.y-8})}const st=$e==="roam";let At=N.current,Xt=!1;if(xe&&S.current)At={x:S.current.x+28,y:S.current.y-52},Xt=!1;else if(K&&k.current&&k.current.fly)At={x:k.current.x-Ee.left+34,y:k.current.y-Ee.top-46},Xt=!1;else if(he&&L.current&&L.current.pane==="rail")At={x:L.current.x-Ee.left+34,y:L.current.y-Ee.top-46},Xt=!1;else if(Le)At={x:Le.pos.x-Ee.left,y:Le.pos.y-Ee.top},Le.fired||(Le.fired=!0,Ll());else if(st){const Fe=Dl(Ee,Ft.rail,de);At={x:Fe.x-Ee.left,y:Fe.y-Ee.top}}else{if(qe.mode==="veil"){const Fe=u_({x:Pe.body.position.x,y:Pe.body.position.y},Ye,220);Fe&&(At=Fe,Xt=!0)}(!At||de>j.current)&&(N.current=o_(Se,ze,lt,Math.floor(de/1e3)),j.current=de+3e3,At=N.current)}const Ni=Pe.step(ye,At,qe.mode==="veil"&&!st?[]:lt,de,{settle:Xt,ceilY:Ge()});if(Ni&&!C.current&&f1(),C.current=Ni||Pe.dizzyRemaining(de)>0,Pe.dizzyRemaining(de)===0){const Fe=_h(Ne.weather);if(Fe.wind>=.3){const _r=Pe.body.mass;cn.Body.applyForce(Pe.body,Pe.body.position,{x:Ch(Pe.body.position.x,Pe.body.position.y,de)*Fe.wind*Ah*_r*2.2,y:0})}(Ne.weather==="rain"||Ne.weather==="storm")&&qe.mode!=="veil"&&de>D.current&&(D.current=de+6e3+Math.random()*4e3,W.classList.add("cp-shiver"),setTimeout(()=>W.classList.remove("cp-shiver"),460))}const Ri=Pe.body.position,bt={x:Ee.left+Ri.x,y:Ee.top+Ri.y},Li=y.current??bt;le=Zt(Li,bt,ye,In),X=Pe.body.angle+a_(Pe.body.velocity.x,Pe.body.velocity.y)}}else if(g.current=null,Te="rail",Ae&&Ee){const Se=Dl(Ee,Ft.rail,de),ze=y.current??{x:Se.x,y:Se.y};le=Zt(ze,Se,ye,b1,140),X=Math.max(-.25,Math.min(.25,(le.x-ze.x)*.01))}else{const Se=Ol(window.innerHeight,Ft.rail,Math.max(me,te));if(r)le=Se,X=0;else{const ze=da("notebook",de),Pe=y.current??{x:Se.x,y:Se.y};le=Zt(Pe,{x:Se.x+ze.x*.5,y:Se.y+ze.y*.5},ye,y1),X=Math.max(-.2,Math.min(.2,(le.x-Pe.x)*.01))}}}if(c.current!==Te&&(c.current=Te,l(Te)),!le){W.style.opacity="0",y.current=null,v.current=null;return}y.current=le;const Ue=W.offsetWidth||Ft[Te],ut=Te==="rail"?Math.max(me,te):me;le.y<ut+Ue/2+10&&(le.y=ut+Ue/2+10),W.style.transform=`translate3d(${(le.x-Ue/2).toFixed(1)}px, ${(le.y-Ue/2).toFixed(1)}px, 0) rotate(${(X*57.2958).toFixed(1)}deg)`;const St=v.current;if(St){const Re=le.x-St.x,$e=le.y-St.y,nt=Math.hypot(Re,$e)/Math.max(1,ye);if(W.style.setProperty("--cp-speed",Math.min(1,nt/.45).toFixed(3)),nt>.02){const ft=(Math.atan2($e,Re)*57.2958+90+360)%360;W.style.setProperty("--cp-thrust-deg",ft.toFixed(1)+"deg")}}v.current={x:le.x,y:le.y}};return M=requestAnimationFrame(ne),()=>{var de;cancelAnimationFrame(M),(de=g.current)==null||de.dispose(),g.current=null}},[t.enabledLoaded,t.enabled,t.petMode,r]);const q=w.useRef(0);if(w.useEffect(()=>{const W=p.current;if(!W||t.state.keySeq===q.current||t.state.examActive)return;q.current=t.state.keySeq,W.classList.remove("cp-keypress"),W.offsetWidth,W.classList.add("cp-keypress");const M=setTimeout(()=>W.classList.remove("cp-keypress"),160);return()=>clearTimeout(M)},[t.state.keySeq]),!t.enabledLoaded||!t.enabled||t.petMode)return null;const R=s?"flying":t.state.typing?"typing":_||(a==null?void 0:a.dir)==="left"?"point":(a==null?void 0:a.dir)==="right"?"pointr":(a==null?void 0:a.dir)==="up"?"pointu":(a==null?void 0:a.dir)==="down"?"pointd":t.state.pose,$=a?Ft[a.pane]:Ft[u];return x.jsx("div",{ref:p,className:`cp-creature fixed left-0 top-0 z-40 will-change-transform ${t.state.mode==="veil"?"cp-veil":""} ${h?"cp-occluding":""} ${t.state.grabbed?"cp-grabbed":""}`,"data-testid":"companion-creature","data-zone":t.state.zone==="roam"?u:t.state.zone,"data-mode":t.state.mode,children:x.jsx(o1,{form:t.form,expression:t.state.expression,screenKey:t.state.typing?t.state.lastKey??(t.state.lastKeyKind==="enter"?"→":t.state.lastKeyKind==="back"?"⌫":null):null,keyFlash:t.state.typing&&t.state.lastKey==null&&(t.state.lastKeyKind==="enter"||t.state.lastKeyKind==="back"),coreLit:t.state.correctStreak>=3,noteTick:Date.now()<t.state.noteTickUntil,pose:R,viseme:n.viseme,openScale:n.open,energyRatio:t.energyRatio,streakLit:t.streakLit,size:$,interactive:!0,ariaLabel:"companion",onPoke:u1,onGrab:(W,M)=>{P.current||(P.current={x:W,y:M,vx:0,vy:0,t:performance.now()},Ml(!0))},haloBadge:t.halo,testid:"companion-mascot",keySeq:t.state.keySeq,keySide:t.state.keySide})})}function f_(e,t){if(t.type==="text"){const n=e[e.length-1];return n&&n.type==="text"?[...e.slice(0,-1),{type:"text",text:n.text+t.text}]:[...e,{type:"text",text:t.text}]}if(t.type==="reasoning"){const n=e[e.length-1];return n&&n.type==="reasoning"?[...e.slice(0,-1),{type:"reasoning",text:n.text+t.text}]:[...e,{type:"reasoning",text:t.text}]}if(t.type==="tool-start")return[...e,{type:"tool-call",toolName:t.toolName,state:"input-available"}];if(t.type==="tool-result"){let n=-1;for(let r=e.length-1;r>=0;r--){const s=e[r];if(s.type==="tool-call"&&s.toolName===t.toolName&&s.state==="input-available"){n=r;break}}return n<0?e:e.map((r,s)=>s===n?{...r,state:"output-available",output:t.output}:r)}if(t.type==="tool-error"){let n=-1;for(let r=e.length-1;r>=0;r--){const s=e[r];if(s.type==="tool-call"&&s.toolName===t.toolName&&s.state==="input-available"){n=r;break}}return n<0?e:e.map((r,s)=>s===n?{...r,state:"output-error",error:t.error}:r)}return e}function zo(e){return{messages:[],streaming:!1,streamingMsgId:null,loaded:!1,focusNodeId:null,touched:e}}function Yu(e,t,n){if(e.has(t))return e;const r=new Map(e);return r.set(t,zo(n)),r}function Pd(e,t,n){const r=e.get(t);if(!r||r.touched===n)return e;const s=new Map(e);return s.set(t,{...r,touched:n}),s}function h_(e,t,n,r,s,i){const a=Yu(e,t,s),o=a.get(t);let u=o.streamingMsgId,l=o.messages;if(!(u&&l.some(h=>h.id===u))){const h=l[l.length-1];o.streaming&&h&&h.role==="assistant"?u=h.id:(u=r(),l=[...l,{id:u,role:"assistant",parts:[]}])}const f=new Map(a);return f.set(t,{...o,messages:l.map(h=>h.id===u?{...h,parts:f_(h.parts,n)}:h),streamingMsgId:u,focusNodeId:i??o.focusNodeId,touched:s}),f}function m_(e,t,n,r){const s=e.get(t);if(!s)return e;let i=-1,a=-1;for(let l=s.messages.length-1;l>=0&&(s.messages[l].role==="user"&&i===-1&&(i=l),s.messages[l].role==="assistant"&&a===-1&&(a=l),!(i!==-1&&a!==-1));l--);const o=s.messages.map((l,c)=>c===i&&(n!=null&&n.userMessageId)?{...l,id:n.userMessageId}:c===a&&(n!=null&&n.assistantMessageId)?{...l,id:n.assistantMessageId}:l),u=new Map(e);return u.set(t,{...s,messages:o,streaming:!1,streamingMsgId:null,touched:r}),u}function r0(e,t,n,r,s){const i=Yu(e,t,s),a=i.get(t),o=new Map(i);return o.set(t,{...a,messages:[...a.messages,{id:r(),role:"assistant",parts:[{type:"text",text:`⚠️ ${n}`}]}],streaming:!1,streamingMsgId:null,touched:s}),o}function p_(e,t,n,r){const s=Yu(e,t,r),i=s.get(t);if(i.streaming)return{buckets:e,accepted:!1};const a=new Map(s);return a.set(t,{...i,messages:[...i.messages,n],streaming:!0,streamingMsgId:null,touched:r}),{buckets:a,accepted:!0}}function g_(e,t,n,r,s){return r0(e,t,n,r,s)}function Dd(e,t){if(e.size<=t)return e;const n=Array.from(e.entries()).filter(([,a])=>!a.streaming),r=e.size-n.length,s=Math.max(0,t-r);if(n.length<=s)return e;n.sort((a,o)=>a[1].touched-o[1].touched);const i=new Map(e);for(let a=0;a<n.length-s;a++)i.delete(n[a][0]);return i}let x_=0;const $i=()=>`msg-v2-${++x_}`,Od=8;function b_(e){if(!e)return null;try{const t=JSON.parse(e);return!Array.isArray(t)||t.length===0?null:t.every(r=>typeof r=="object"&&r!==null&&typeof r.type=="string")?t:null}catch{return null}}function y_(e,t){const[n,r]=w.useState(()=>new Map),s=w.useRef(n);s.current=n;const i=w.useRef(e??"");i.current=e??"",w.useEffect(()=>{if(!e)return;let g=!1;return(async()=>{const y=s.current.get(e);if(y&&(y.loaded||y.messages.length>0)){r(v=>Pd(v,e,Date.now()));return}try{const v=await ce.threadGetMessages(e);if(g)return;r(T=>{const C=T.get(e);if(C&&(C.loaded||C.messages.length>0))return Pd(T,e,Date.now());const E=v.map(_=>{const A=b_(_.partsJson);return{id:_.id,role:_.role,parts:A??[{type:"text",text:_.content}],..._.displayText?{displayText:_.displayText}:{}}}),k=new Map(T);return k.set(e,{...C??zo(Date.now()),messages:E,loaded:!0,touched:Date.now()}),Dd(k,Od)})}catch{}})(),()=>{g=!0}},[e]),w.useEffect(()=>{const g=ce.on("chat:part",(T,C,E)=>{const k=C??i.current;r(_=>Dd(h_(_,k,T,$i,Date.now(),E),Od))}),y=ce.on("chat:done",(T,C,E)=>{const k=E??i.current;r(_=>m_(_,k,C,Date.now()))}),v=ce.on("chat:error",(T,C)=>{const E=C??i.current;r(k=>r0(k,E,T,$i,Date.now()))});return()=>{g(),y(),v()}},[]);const a=w.useCallback(async(g,y,v,T)=>{var A;const C=y??e;if(!C||!g.trim()||(A=s.current.get(C))!=null&&A.streaming)return;const E=g.trim(),k={id:$i(),role:"user",parts:[...(T??[]).map(I=>({type:"attachment",attachment:{kind:I.kind,name:I.name,mime:I.mime,size:I.size,...I.previewUrl?{previewUrl:I.previewUrl}:{}}})),{type:"text",text:E}],...v?{displayText:v}:{}},_=p_(s.current,C,k,Date.now());if(_.accepted){r(_.buckets);try{await ce.agentChatThread(C,E,v,t??null,T)}catch(I){const S=I instanceof Error?I.message:String(I);r(L=>g_(L,C,S,$i,Date.now()))}}},[e,t]),o=w.useCallback(async()=>{if(e){try{await ce.abortAgentChatThread(e)}catch{}r(g=>{const y=g.get(e);if(!(y!=null&&y.streaming))return g;const v=new Map(g);return v.set(e,{...y,streaming:!1,streamingMsgId:null,touched:Date.now()}),v})}},[e]),u=w.useCallback(()=>{e&&r(g=>{const y=g.get(e);if(!y)return g;const v=new Map(g);return v.set(e,{...y,messages:[],streamingMsgId:null,loaded:!0,touched:Date.now()}),v})},[e]);w.useEffect(()=>{const g=y=>{const v=y.detail;if(typeof v!="string")return;const C={explain_simple:{msg:"用大白话给我讲讲这一节的核心概念",labelKey:"command.explain_simple"},quiz_3:{msg:"出 3 道练习题考考我",labelKey:"command.quiz_3"},compare_prev:{msg:"把这一节和上一节做个对比表",labelKey:"command.compare_prev"},concept_map:{msg:"画个概念图帮我理清这一节的知识结构",labelKey:"command.concept_map"},socratic:{msg:"切换到苏格拉底模式,用提问引导我思考",labelKey:"command.socratic"},exam_mode:{msg:"切换到考试冲刺模式,出有难度的题",labelKey:"command.exam_mode"}}[v];C&&a(C.msg,void 0,Tu(C.labelKey))};return window.addEventListener("lookatstudy-command",g),()=>window.removeEventListener("lookatstudy-command",g)},[a]);const l=w.useCallback((g,y,v)=>{e&&r(T=>{const C=T.get(e);if(!C)return T;const E=new Map(T);return E.set(e,{...C,messages:C.messages.map(k=>{if(k.id!==g)return k;const _=[...k.parts],A=_[y];return A&&A.type==="tool-call"&&(_[y]={...A,output:{...typeof A.output=="object"&&A.output?A.output:{},status:v?"applied":"rejected"}}),{...k,parts:_}})}),E})},[e]),c=w.useCallback(g=>{e&&r(y=>{const v=y.get(e)??zo(Date.now()),T=new Map(y);return T.set(e,{...v,messages:g,loaded:!0,touched:Date.now()}),T})},[e]),f=e?n.get(e):void 0,h=w.useMemo(()=>(f==null?void 0:f.messages)??[],[f]),d=(f==null?void 0:f.streaming)??!1,m=w.useMemo(()=>Array.from(n.entries()).filter(([,g])=>g.streaming).map(([g])=>g),[n]),p=w.useMemo(()=>Array.from(n.values()).filter(g=>g.streaming&&g.focusNodeId).map(g=>g.focusNodeId).filter((g,y,v)=>v.indexOf(g)===y),[n]);return{messages:h,streaming:d,streamingThreadIds:m,streamingNodeIds:p,send:a,stop:o,clear:u,markProposalStatus:l,setMessagesForNode:c}}const Wi=(e,t=60)=>e.length>t?e.slice(0,t)+"…":e;function E_(e,t){return t("quiz.hook.label",{correct:e.correct,total:e.total})}function T_(e,t){const n=e.detail.map((s,i)=>s.correct?t("quiz.hook.lineOk",{n:i+1,prompt:Wi(s.prompt)}):t("quiz.hook.lineWrong",{n:i+1,prompt:Wi(s.prompt),chosen:Wi(s.chosen,30),answer:Wi(s.answerText,30)})),r=e.title?`《${e.title}》`:"";return t("quiz.hook.message",{title:r,correct:e.correct,total:e.total})+(n.length?`
|
|
453
|
-
`+n.join(`
|
|
454
|
-
`):"")}function v_(e,t){const[n,r]=w.useState([]),[s,i]=w.useState(null),a=w.useCallback(async()=>{if(!e||!t){r([]),i(null);return}try{const p=(await ce.threadList(e,"active")).filter(g=>g.focusNodeId===t);r(p),p.length>0?i(p[0].id):i(null)}catch{r([]),i(null)}},[e,t]);w.useEffect(()=>{a()},[a]);const o=w.useCallback(async m=>{if(!e||!t)return null;try{const p=await ce.threadCreate({...m,courseId:e,focusNodeId:t});return r(g=>[p,...g]),i(p.id),p}catch{return null}},[e,t]),u=w.useCallback(async(m,p)=>{try{const g=await ce.threadUpdate(m,p);return g&&(g.status==="archived"?(r(y=>y.filter(v=>v.id!==m)),i(y=>{var T;return y!==m?y:((T=n.filter(C=>C.id!==m)[0])==null?void 0:T.id)??null})):r(y=>y.map(v=>v.id===m?g:v))),g}catch{return null}},[n]),l=w.useCallback(async m=>{try{await ce.threadDelete(m),r(p=>p.filter(g=>g.id!==m)),i(p=>{var y;return p!==m?p:((y=n.filter(v=>v.id!==m)[0])==null?void 0:y.id)??null})}catch{}},[n]),c=w.useCallback(m=>{const p=n.find(g=>g.id===m)??null;return p?(r(g=>g.filter(y=>y.id!==m)),i(g=>{var v;return g!==m?g:((v=n.filter(T=>T.id!==m)[0])==null?void 0:v.id)??null}),p):null},[n]),f=w.useCallback(m=>{r(p=>[m,...p.filter(g=>g.id!==m.id)]),i(m.id)},[]),h=w.useCallback(async(m,p)=>{if(!e||!t)return null;if(s)return s;const g=await o({title:(p??m).trim()});return(g==null?void 0:g.id)??null},[e,t,s,o]),d=n.find(m=>m.id===s)??null;return{threads:n,activeId:s,activeThread:d,setActiveId:i,reload:a,create:o,update:u,remove:l,removeWithUndo:c,restore:f,ensureThreadForSend:h}}function k_({threads:e,activeThread:t,focusNodeTitle:n,streamingThreadIds:r,onPickThread:s,onCreate:i,onRename:a,onArchive:o,onDelete:u}){const l=We(),[c,f]=w.useState(null),[h,d]=w.useState(null),[m,p]=w.useState(null),[g,y]=w.useState(""),[v,T]=w.useState(null),C=w.useRef(null);w.useEffect(()=>{const A=I=>{C.current&&!C.current.contains(I.target)&&(f(null),d(null))};return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[]);const E=(A,I)=>{A.stopPropagation();const S=A.currentTarget.getBoundingClientRect(),L=Math.max(8,S.right-128),N=S.bottom+4;d({top:N,left:L}),f(c===I?null:I)},k=A=>{p(A.id),y(A.title??""),f(null),d(null)},_=()=>{m&&g.trim()&&a(m,g.trim()),p(null)};return e.length===0?x.jsxs("div",{className:"px-4 py-2 shrink-0 flex items-center gap-2 text-label bg-surface-1 opacity-60","data-testid":"thread-switcher-empty",children:[x.jsx("span",{className:"w-1 h-1 rounded-full bg-brand shrink-0"}),x.jsx("span",{className:"text-ink-muted truncate flex-1",children:n??l("thread.empty.no_node")}),x.jsx("span",{className:"text-caption text-ink-muted shrink-0",children:l("thread.empty.hint")})]}):x.jsxs("div",{className:"shrink-0 bg-surface-1","data-testid":"thread-switcher",children:[x.jsxs("div",{className:"flex items-center gap-1 overflow-x-auto scrollbar-thin px-3 py-1.5 opacity-70 hover:opacity-100 transition-opacity",children:[e.map(A=>{const I=A.id===(t==null?void 0:t.id),S=m===A.id,L=r.includes(A.id);return x.jsxs("div",{className:`group relative flex items-center gap-1.5 px-2 py-0.5 cursor-pointer whitespace-nowrap transition-colors shrink-0 rounded ${I?"text-ink-strong":"text-ink-muted hover:text-ink-strong"}`,onClick:()=>!S&&s(A.id),"data-testid":`thread-tab-${A.id.slice(0,8)}`,children:[L?x.jsx(dh,{className:"w-3 h-3 shrink-0 text-accent animate-spin","aria-label":l("thread.streamingBadge"),"data-testid":`thread-streaming-${A.id.slice(0,8)}`}):x.jsx("span",{className:`w-1 h-1 rounded-full shrink-0 transition-opacity ${I?"bg-brand opacity-100":"bg-[var(--border)] opacity-0 group-hover:opacity-60"}`}),S?x.jsx("input",{value:g,onChange:N=>y(N.target.value),onKeyDown:N=>{N.key==="Enter"&&_(),N.key==="Escape"&&p(null)},onBlur:_,onClick:N=>N.stopPropagation(),autoFocus:!0,className:"bg-surface-0 text-ink-strong text-label rounded px-1.5 py-0.5 border border-brand focus:outline-none focus:ring-2 focus:ring-brand/20 w-28","data-testid":"thread-rename-input"}):x.jsx("span",{className:`text-label max-w-[120px] truncate ${I?"font-semibold":"font-normal"}`,"data-tooltip":A.title||l("toast.threadDefault"),children:A.title||l("toast.threadDefault")}),!S&&x.jsx("button",{onClick:N=>E(N,A.id),className:"flex items-center justify-center w-4 h-4 rounded text-ink-muted hover:text-ink-strong hover:bg-ink/5 opacity-0 group-hover:opacity-100 pointer-coarse:opacity-100 transition-all","data-testid":`thread-gear-${A.id.slice(0,8)}`,title:l("thread.actions.label"),"aria-label":l("thread.actions.label"),children:x.jsx(ms,{className:"w-3 h-3"})})]},A.id)}),x.jsx("button",{onClick:i,className:"flex items-center justify-center w-6 h-6 ml-1 rounded text-ink-muted hover:text-brand hover:bg-ink/5 transition-colors shrink-0","data-testid":"thread-new",title:l("thread.new.label"),"aria-label":l("thread.new.label"),children:x.jsx(mh,{className:"w-3.5 h-3.5"})})]}),c&&h&&(()=>{const A=e.find(I=>I.id===c);return A?x.jsxs("div",{ref:C,style:{position:"fixed",top:h.top,left:h.left},className:"z-50 w-32 bg-surface-0 rounded-lg shadow-pop py-1 border border-[var(--border-faint)]","data-testid":`thread-menu-${A.id.slice(0,8)}`,onClick:I=>I.stopPropagation(),children:[x.jsxs("button",{onClick:()=>k(A),className:"w-full flex items-center gap-1.5 px-2.5 py-1.5 text-label text-ink-muted hover:bg-surface-1 hover:bg-surface-3 hover:text-ink-strong transition-colors",children:[x.jsx(cx,{className:"w-3 h-3"}),l("thread.menu.rename")]}),x.jsxs("button",{onClick:()=>{o(A.id),f(null),d(null)},className:"w-full flex items-center gap-1.5 px-2.5 py-1.5 text-label text-ink-muted hover:bg-surface-1 hover:bg-surface-3 hover:text-ink-strong transition-colors",children:[x.jsx(I1,{className:"w-3 h-3"}),l("thread.menu.archive")]}),x.jsxs("button",{onClick:I=>{const S=I.currentTarget.getBoundingClientRect();T({id:A.id,title:A.title??l("toast.threadDefault"),rect:S}),f(null),d(null)},className:"w-full flex items-center gap-1.5 px-2.5 py-1.5 text-label text-warning hover:bg-warning/10 transition-colors",children:[x.jsx(xo,{className:"w-3 h-3"}),l("action.delete")]})]}):null})(),v&&x.jsx(wh,{anchorRect:v.rect,message:l("thread.delete.confirm",{name:v.title}),danger:!0,confirmLabel:l("action.delete"),testid:"thread-delete-confirm",onConfirm:()=>{u(v.id),T(null)},onCancel:()=>T(null)})]})}const w_=1240,S_=920;function A_(e){return e>=w_?1:e>=S_?2:3}function C_(e){return e==="rail"?"rail":"notebook"}function __(e,t,n){if(Math.abs(t)<60||Math.abs(t)<Math.abs(n)*1.6)return null;const r=["rail","chat","notebook"],s=r.indexOf(e)+(t<0?1:-1);return s>=0&&s<r.length?r[s]:null}function I_(e){return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}function N_(){return A_(typeof window>"u"?R_:window.innerWidth)}const R_=99999;function L_(){return w.useSyncExternalStore(I_,N_,()=>1)}const Gu=w.createContext({});function Ku(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}const M_=typeof window<"u",ws=M_?w.useLayoutEffect:w.useEffect,Zs=w.createContext(null);function Xu(e,t){e.indexOf(t)===-1&&e.push(t)}function Ss(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const sn=(e,t,n)=>n>t?t:n<e?e:n;let Js=()=>{};const wn={},i0=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),s0=e=>typeof e=="object"&&e!==null,a0=e=>/^0[^.\s]+$/u.test(e);function o0(e){let t;return()=>(t===void 0&&(t=e()),t)}const zt=e=>e,wi=(...e)=>e.reduce((t,n)=>r=>n(t(r))),hi=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1};class Qu{constructor(){this.subscriptions=[]}add(t){return Xu(this.subscriptions,t),()=>Ss(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i<s;i++){const a=this.subscriptions[i];a&&a(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Pt=e=>e*1e3,Ut=e=>e/1e3,u0=(e,t)=>t?e*(1e3/t):0,l0=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,P_=1e-7,D_=12;function O_(e,t,n,r,s){let i,a,o=0;do a=t+(n-t)/2,i=l0(a,r,s)-e,i>0?n=a:t=a;while(Math.abs(i)>P_&&++o<D_);return a}function Si(e,t,n,r){if(e===t&&n===r)return zt;const s=i=>O_(i,0,1,e,n);return i=>i===0||i===1?i:l0(s(i),t,r)}const c0=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,d0=e=>t=>1-e(1-t),f0=Si(.33,1.53,.69,.99),Zu=d0(f0),h0=c0(Zu),m0=e=>e>=1?1:(e*=2)<1?.5*Zu(e):.5*(2-Math.pow(2,-10*(e-1))),Ju=e=>1-Math.sin(Math.acos(e)),p0=d0(Ju),g0=c0(Ju),F_=Si(.42,0,1,1),B_=Si(0,0,.58,1),x0=Si(.42,0,.58,1),j_=e=>Array.isArray(e)&&typeof e[0]!="number",b0=e=>Array.isArray(e)&&typeof e[0]=="number",H_={linear:zt,easeIn:F_,easeInOut:x0,easeOut:B_,circIn:Ju,circInOut:g0,circOut:p0,backIn:Zu,backInOut:h0,backOut:f0,anticipate:m0},U_=e=>typeof e=="string",Fd=e=>{if(b0(e)){Js(e.length===4);const[t,n,r,s]=e;return Si(t,n,r,s)}else if(U_(e))return H_[e];return e},Yi=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function z_(e){let t=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(l){i.has(l)&&(u.schedule(l),e()),l(a)}const u={schedule:(l,c=!1,f=!1)=>{const d=f&&r?t:n;return c&&i.add(l),d.add(l),l},cancel:l=>{n.delete(l),i.delete(l)},process:l=>{if(a=l,r){s=!0;return}r=!0;const c=t;t=n,n=c,t.forEach(o),t.clear(),r=!1,s&&(s=!1,u.process(l))}};return u}const V_=40;function y0(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=Yi.reduce((T,C)=>(T[C]=z_(i),T),{}),{setup:o,read:u,resolveKeyframes:l,preUpdate:c,update:f,preRender:h,render:d,postRender:m}=a,p=()=>{const T=wn.useManualTiming,C=T?s.timestamp:performance.now();n=!1,T||(s.delta=r?1e3/60:Math.max(Math.min(C-s.timestamp,V_),1)),s.timestamp=C,s.isProcessing=!0,o.process(s),u.process(s),l.process(s),c.process(s),f.process(s),h.process(s),d.process(s),m.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(p))},g=()=>{n=!0,r=!0,s.isProcessing||e(p)};return{schedule:Yi.reduce((T,C)=>{const E=a[C];return T[C]=(k,_=!1,A=!1)=>(n||g(),E.schedule(k,_,A)),T},{}),cancel:T=>{for(let C=0;C<Yi.length;C++)a[Yi[C]].cancel(T)},state:s,steps:a}}const{schedule:Je,cancel:Sn,state:gt,steps:Za}=y0(typeof requestAnimationFrame<"u"?requestAnimationFrame:zt,!0);let as;function q_(){as=void 0}const kt={now:()=>(as===void 0&&kt.set(gt.isProcessing||wn.useManualTiming?gt.timestamp:performance.now()),as),set:e=>{as=e,queueMicrotask(q_)}},E0=e=>t=>typeof t=="string"&&t.startsWith(e),T0=E0("--"),$_=E0("var(--"),el=e=>$_(e)?W_.test(e.split("/*")[0].trim()):!1,W_=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Bd(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const wr={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},mi={...wr,transform:e=>sn(0,1,e)},Gi={...wr,default:1},ni=e=>Math.round(e*1e5)/1e5,tl=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Y_(e){return e==null}const G_=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,nl=(e,t)=>n=>!!(typeof n=="string"&&G_.test(n)&&n.startsWith(e)||t&&!Y_(n)&&Object.prototype.hasOwnProperty.call(n,t)),v0=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,a,o]=r.match(tl);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(a),alpha:o!==void 0?parseFloat(o):1}},K_=e=>sn(0,255,e),Ja={...wr,transform:e=>Math.round(K_(e))},jn={test:nl("rgb","red"),parse:v0("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Ja.transform(e)+", "+Ja.transform(t)+", "+Ja.transform(n)+", "+ni(mi.transform(r))+")"};function X_(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Vo={test:nl("#"),parse:X_,transform:jn.transform},Ai=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ln=Ai("deg"),rn=Ai("%"),ge=Ai("px"),Q_=Ai("vh"),Z_=Ai("vw"),jd={...rn,parse:e=>rn.parse(e)/100,transform:e=>rn.transform(e*100)},lr={test:nl("hsl","hue"),parse:v0("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+rn.transform(ni(t))+", "+rn.transform(ni(n))+", "+ni(mi.transform(r))+")"},dt={test:e=>jn.test(e)||Vo.test(e)||lr.test(e),parse:e=>jn.test(e)?jn.parse(e):lr.test(e)?lr.parse(e):Vo.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?jn.transform(e):lr.transform(e),getAnimatableNone:e=>{const t=dt.parse(e);return t.alpha=0,dt.transform(t)}},J_=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function eI(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(tl))==null?void 0:t.length)||0)+(((n=e.match(J_))==null?void 0:n.length)||0)>0}const k0="number",w0="color",tI="var",nI="var(",Hd="${}",rI=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function xr(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const o=t.replace(rI,u=>(dt.test(u)?(r.color.push(i),s.push(w0),n.push(dt.parse(u))):u.startsWith(nI)?(r.var.push(i),s.push(tI),n.push(u)):(r.number.push(i),s.push(k0),n.push(parseFloat(u))),++i,Hd)).split(Hd);return{values:n,split:o,indexes:r,types:s}}function iI(e){return xr(e).values}function S0({split:e,types:t}){const n=e.length;return r=>{let s="";for(let i=0;i<n;i++)if(s+=e[i],r[i]!==void 0){const a=t[i];a===k0?s+=ni(r[i]):a===w0?s+=dt.transform(r[i]):s+=r[i]}return s}}function sI(e){return S0(xr(e))}const aI=e=>typeof e=="number"?0:dt.test(e)?dt.getAnimatableNone(e):e,oI=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:aI(e);function uI(e){const t=xr(e);return S0(t)(t.values.map((r,s)=>oI(r,t.split[s])))}const Yt={test:eI,parse:iI,createTransformer:sI,getAnimatableNone:uI};function eo(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function lI({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,a=0;if(!t)s=i=a=n;else{const o=n<.5?n*(1+t):n+t-n*t,u=2*n-o;s=eo(u,o,e+1/3),i=eo(u,o,e),a=eo(u,o,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function As(e,t){return n=>n>0?t:e}const Ze=(e,t,n)=>e+(t-e)*n,to=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},cI=[Vo,jn,lr],dI=e=>cI.find(t=>t.test(e));function Ud(e){const t=dI(e);if(!t)return!1;let n=t.parse(e);return t===lr&&(n=lI(n)),n}const zd=(e,t)=>{const n=Ud(e),r=Ud(t);if(!n||!r)return As(e,t);const s={...n};return i=>(s.red=to(n.red,r.red,i),s.green=to(n.green,r.green,i),s.blue=to(n.blue,r.blue,i),s.alpha=Ze(n.alpha,r.alpha,i),jn.transform(s))},qo=new Set(["none","hidden"]);function fI(e,t){return qo.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function hI(e,t){return n=>Ze(e,t,n)}function rl(e){return typeof e=="number"?hI:typeof e=="string"?el(e)?As:dt.test(e)?zd:gI:Array.isArray(e)?A0:typeof e=="object"?dt.test(e)?zd:mI:As}function A0(e,t){const n=[...e],r=n.length,s=e.map((i,a)=>rl(i)(i,t[a]));return i=>{for(let a=0;a<r;a++)n[a]=s[a](i);return n}}function mI(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=rl(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function pI(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const i=t.types[s],a=e.indexes[i][r[i]],o=e.values[a]??0;n[s]=o,r[i]++}return n}const gI=(e,t)=>{const n=Yt.createTransformer(t),r=xr(e),s=xr(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?qo.has(e)&&!s.values.length||qo.has(t)&&!r.values.length?fI(e,t):wi(A0(pI(r,s),s.values),n):As(e,t)};function C0(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Ze(e,t,n):rl(e)(e,t)}const xI=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Je.update(t,n),stop:()=>Sn(t),now:()=>gt.isProcessing?gt.timestamp:kt.now()}},_0=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=Math.round(e(i/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Cs=2e4;function il(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Cs;)t+=n,r=e.next(t);return t>=Cs?1/0:t}function bI(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(il(r),Cs);return{type:"keyframes",ease:i=>r.next(s*i).value/t,duration:Ut(s)}}const at={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function $o(e,t){return e*Math.sqrt(1-t*t)}const yI=12;function EI(e,t,n){let r=n;for(let s=1;s<yI;s++)r=r-e(r)/t(r);return r}const no=.001;function TI({duration:e=at.duration,bounce:t=at.bounce,velocity:n=at.velocity,mass:r=at.mass}){let s,i,a=1-t;a=sn(at.minDamping,at.maxDamping,a),e=sn(at.minDuration,at.maxDuration,Ut(e)),a<1?(s=l=>{const c=l*a,f=c*e,h=c-n,d=$o(l,a),m=Math.exp(-f);return no-h/d*m},i=l=>{const f=l*a*e,h=f*n+n,d=Math.pow(a,2)*Math.pow(l,2)*e,m=Math.exp(-f),p=$o(Math.pow(l,2),a);return(-s(l)+no>0?-1:1)*((h-d)*m)/p}):(s=l=>{const c=Math.exp(-l*e),f=(l-n)*e+1;return-no+c*f},i=l=>{const c=Math.exp(-l*e),f=(n-l)*(e*e);return c*f});const o=5/e,u=EI(s,i,o);if(e=Pt(e),isNaN(u))return{stiffness:at.stiffness,damping:at.damping,duration:e};{const l=Math.pow(u,2)*r;return{stiffness:l,damping:a*2*Math.sqrt(r*l),duration:e}}}const vI=["duration","bounce"],kI=["stiffness","damping","mass"];function Vd(e,t){return t.some(n=>e[n]!==void 0)}function wI(e){let t={velocity:at.velocity,stiffness:at.stiffness,damping:at.damping,mass:at.mass,isResolvedFromDuration:!1,...e};if(!Vd(e,kI)&&Vd(e,vI))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*sn(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:at.mass,stiffness:s,damping:i}}else{const n=TI({...e,velocity:0});t={...t,...n,mass:at.mass},t.isResolvedFromDuration=!0}return t}function _s(e=at.visualDuration,t=at.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],o={done:!1,value:i},{stiffness:u,damping:l,mass:c,duration:f,velocity:h,isResolvedFromDuration:d}=wI({...n,velocity:-Ut(n.velocity||0)}),m=h||0,p=l/(2*Math.sqrt(u*c)),g=a-i,y=Ut(Math.sqrt(u/c)),v=Math.abs(g)<5;r||(r=v?at.restSpeed.granular:at.restSpeed.default),s||(s=v?at.restDelta.granular:at.restDelta.default);let T,C,E,k,_,A;if(p<1)E=$o(y,p),k=(m+p*y*g)/E,T=S=>{const L=Math.exp(-p*y*S);return a-L*(k*Math.sin(E*S)+g*Math.cos(E*S))},_=p*y*k+g*E,A=p*y*g-k*E,C=S=>Math.exp(-p*y*S)*(_*Math.sin(E*S)+A*Math.cos(E*S));else if(p===1){T=L=>a-Math.exp(-y*L)*(g+(m+y*g)*L);const S=m+y*g;C=L=>Math.exp(-y*L)*(y*S*L-m)}else{const S=y*Math.sqrt(p*p-1);T=P=>{const D=Math.exp(-p*y*P),H=Math.min(S*P,300);return a-D*((m+p*y*g)*Math.sinh(H)+S*g*Math.cosh(H))/S};const L=(m+p*y*g)/S,N=p*y*L-g*S,j=p*y*g-L*S;C=P=>{const D=Math.exp(-p*y*P),H=Math.min(S*P,300);return D*(N*Math.sinh(H)+j*Math.cosh(H))}}const I={calculatedDuration:d&&f||null,velocity:S=>Pt(C(S)),next:S=>{if(!d&&p<1){const N=Math.exp(-p*y*S),j=Math.sin(E*S),P=Math.cos(E*S),D=a-N*(k*j+g*P),H=Pt(N*(_*j+A*P));return o.done=Math.abs(H)<=r&&Math.abs(a-D)<=s,o.value=o.done?a:D,o}const L=T(S);if(d)o.done=S>=f;else{const N=Pt(C(S));o.done=Math.abs(N)<=r&&Math.abs(a-L)<=s}return o.value=o.done?a:L,o},toString:()=>{const S=Math.min(il(I),Cs),L=_0(N=>I.next(S*N).value,S,30);return S+"ms "+L},toTransition:()=>{}};return I}_s.applyToOptions=e=>{const t=bI(e,100,_s);return e.ease=t.ease,e.duration=Pt(t.duration),e.type="keyframes",e};const SI=5;function I0(e,t,n){const r=Math.max(t-SI,0);return u0(n-e(r),t-r)}function Wo({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:a,min:o,max:u,restDelta:l=.5,restSpeed:c}){const f=e[0],h={done:!1,value:f},d=A=>o!==void 0&&A<o||u!==void 0&&A>u,m=A=>o===void 0?u:u===void 0||Math.abs(o-A)<Math.abs(u-A)?o:u;let p=n*t;const g=f+p,y=a===void 0?g:a(g);y!==g&&(p=y-f);const v=A=>-p*Math.exp(-A/r),T=A=>y+v(A),C=A=>{const I=v(A),S=T(A);h.done=Math.abs(I)<=l,h.value=h.done?y:S};let E,k;const _=A=>{d(h.value)&&(E=A,k=_s({keyframes:[h.value,m(h.value)],velocity:I0(T,A,h.value),damping:s,stiffness:i,restDelta:l,restSpeed:c}))};return _(0),{calculatedDuration:null,next:A=>{let I=!1;return!k&&E===void 0&&(I=!0,C(A),_(A)),E!==void 0&&A>=E?k.next(A-E):(!I&&C(A),h)}}}function AI(e,t,n){const r=[],s=n||wn.mix||C0,i=e.length-1;for(let a=0;a<i;a++){let o=s(e[a],e[a+1]);if(t){const u=Array.isArray(t)?t[a]||zt:t;o=wi(u,o)}r.push(o)}return r}function CI(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(Js(i===t.length),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=AI(t,r,s),u=o.length,l=c=>{if(a&&c<e[0])return t[0];let f=0;if(u>1)for(;f<e.length-2&&!(c<e[f+1]);f++);const h=hi(e[f],e[f+1],c);return o[f](h)};return n?c=>l(sn(e[0],e[i-1],c)):l}function _I(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=hi(0,t,r);e.push(Ze(n,1,s))}}function II(e){const t=[0];return _I(t,e.length-1),t}function NI(e,t){return e.map(n=>n*t)}function RI(e,t){return e.map(()=>t||x0).splice(0,e.length-1)}function ri({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=j_(r)?r.map(Fd):Fd(r),i={done:!1,value:t[0]},a=NI(n&&n.length===t.length?n:II(t),e),o=CI(a,t,{ease:Array.isArray(s)?s:RI(t,s)});return{calculatedDuration:e,next:u=>(i.value=o(u),i.done=u>=e,i)}}const LI=e=>e!==null;function ea(e,{repeat:t,repeatType:n="loop"},r,s=1){const i=e.filter(LI),o=s<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!o||r===void 0?i[o]:r}const MI={decay:Wo,inertia:Wo,tween:ri,keyframes:ri,spring:_s};function N0(e){typeof e.type=="string"&&(e.type=MI[e.type])}class sl{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const PI=e=>e/100;class Is extends sl{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==kt.now()&&this.tick(kt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;N0(t);const{type:n=ri,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:a=0}=t;let{keyframes:o}=t;const u=n||ri;u!==ri&&typeof o[0]!="number"&&(this.mixKeyframes=wi(PI,C0(o[0],o[1])),o=[0,100]);const l=u({...t,keyframes:o});i==="mirror"&&(this.mirroredGenerator=u({...t,keyframes:[...o].reverse(),velocity:-a})),l.calculatedDuration===null&&(l.calculatedDuration=il(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=l}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:u}=this;if(this.startTime===null)return r.next(0);const{delay:l=0,keyframes:c,repeat:f,repeatType:h,repeatDelay:d,type:m,onUpdate:p,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const y=this.currentTime-l*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>s;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let T=this.currentTime,C=r;if(f){const A=Math.min(this.currentTime,s)/o;let I=Math.floor(A),S=A%1;!S&&A>=1&&(S=1),S===1&&I--,I=Math.min(I,f+1),!!(I%2)&&(h==="reverse"?(S=1-S,d&&(S-=d/o)):h==="mirror"&&(C=a)),T=sn(0,1,S)*o}let E;v?(this.delayState.value=c[0],E=this.delayState):E=C.next(T),i&&!v&&(E.value=i(E.value));let{done:k}=E;!v&&u!==null&&(k=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return _&&m!==Wo&&(E.value=ea(c,this.options,g,this.speed)),p&&p(E.value),_&&this.finish(),E}then(t,n){return this.finished.then(t,n)}get duration(){return Ut(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Ut(t)}get time(){return Ut(this.currentTime)}set time(t){t=Pt(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return I0(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(kt.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Ut(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:t=xI,startTime:n}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),(i=(s=this.options).onPlay)==null||i.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(kt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function DI(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Hn=e=>e*180/Math.PI,Yo=e=>{const t=Hn(Math.atan2(e[1],e[0]));return Go(t)},OI={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Yo,rotateZ:Yo,skewX:e=>Hn(Math.atan(e[1])),skewY:e=>Hn(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Go=e=>(e=e%360,e<0&&(e+=360),e),qd=Yo,$d=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Wd=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),FI={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:$d,scaleY:Wd,scale:e=>($d(e)+Wd(e))/2,rotateX:e=>Go(Hn(Math.atan2(e[6],e[5]))),rotateY:e=>Go(Hn(Math.atan2(-e[2],e[0]))),rotateZ:qd,rotate:qd,skewX:e=>Hn(Math.atan(e[4])),skewY:e=>Hn(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Ko(e){return e.includes("scale")?1:0}function Xo(e,t){if(!e||e==="none")return Ko(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=FI,s=n;else{const o=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=OI,s=o}if(!s)return Ko(t);const i=r[t],a=s[1].split(",").map(jI);return typeof i=="function"?i(a):a[i]}const BI=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Xo(n,t)};function jI(e){return parseFloat(e.trim())}const Sr=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ar=new Set([...Sr,"pathRotation"]),Yd=e=>e===wr||e===ge,HI=new Set(["x","y","z"]),UI=Sr.filter(e=>!HI.has(e));function zI(e){const t=[];return UI.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Tn={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Xo(t,"x"),y:(e,{transform:t})=>Xo(t,"y")};Tn.translateX=Tn.x;Tn.translateY=Tn.y;const Wn=new Set;let Qo=!1,Zo=!1,Jo=!1;function R0(){if(Zo){const e=Array.from(Wn).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=zI(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,a])=>{var o;(o=r.getValue(i))==null||o.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Zo=!1,Qo=!1,Wn.forEach(e=>e.complete(Jo)),Wn.clear()}function L0(){Wn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Zo=!0)})}function VI(){Jo=!0,L0(),R0(),Jo=!1}class al{constructor(t,n,r,s,i,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(Wn.add(this),Qo||(Qo=!0,Je.read(L0),Je.resolveKeyframes(R0))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const i=s==null?void 0:s.get(),a=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const o=r.readValue(n,a);o!=null&&(t[0]=o)}t[0]===void 0&&(t[0]=a),s&&i===void 0&&s.set(t[0])}DI(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Wn.delete(this)}cancel(){this.state==="scheduled"&&(Wn.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const qI=e=>e.startsWith("--");function M0(e,t,n){qI(t)?e.style.setProperty(t,n):e.style[t]=n}const $I={};function P0(e,t){const n=o0(e);return()=>$I[t]??n()}const WI=P0(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),D0=P0(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),$r=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Gd={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:$r([0,.65,.55,1]),circOut:$r([.55,0,1,.45]),backIn:$r([.31,.01,.66,-.59]),backOut:$r([.33,1.53,.69,.99])};function O0(e,t){if(e)return typeof e=="function"?D0()?_0(e,t):"ease-out":b0(e)?$r(e):Array.isArray(e)?e.map(n=>O0(n,t)||Gd.easeOut):Gd[e]}function YI(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:a="loop",ease:o="easeOut",times:u}={},l=void 0){const c={[t]:n};u&&(c.offset=u);const f=O0(o,s);Array.isArray(f)&&(c.easing=f);const h={delay:r,duration:s,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:a==="reverse"?"alternate":"normal"};return l&&(h.pseudoElement=l),e.animate(c,h)}function F0(e){return typeof e=="function"&&"applyToOptions"in e}function GI({type:e,...t}){return F0(e)&&D0()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class B0 extends sl{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:u}=t;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=t,Js(typeof t.type!="string");const l=GI(t);this.animation=YI(n,r,s,l,i),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const c=ea(s,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(c),M0(n,r,c),this.animation.cancel()}u==null||u(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return Ut(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Ut(t)}get time(){return Ut(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Pt(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:s}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&WI()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),zt):s(this)}}const j0={anticipate:m0,backInOut:h0,circInOut:g0};function KI(e){return e in j0}function XI(e){typeof e.ease=="string"&&KI(e.ease)&&(e.ease=j0[e.ease])}const ro=10;class QI extends B0{constructor(t){XI(t),N0(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...a}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const o=new Is({...a,autoplay:!1}),u=Math.max(ro,kt.now()-this.startTime),l=sn(0,ro,u-ro),c=o.sample(u).value,{name:f}=this.options;i&&f&&M0(i,f,c),n.setWithVelocity(o.sample(Math.max(0,u-l)).value,c,l),o.stop()}}const Kd=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Yt.test(e)||e==="0")&&!e.startsWith("url("));function ZI(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function JI(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],a=Kd(s,t),o=Kd(i,t);return!a||!o?!1:ZI(e)||(n==="spring"||F0(n))&&r}function eu(e){e.duration=0,e.type="keyframes"}const H0=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),eN=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function tN(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&eN.test(e[t]))return!0;return!1}const nN=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),rN=o0(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function iN(e){var f;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:i,type:a,keyframes:o}=e,u=(f=t==null?void 0:t.owner)==null?void 0:f.current;if(!(u instanceof HTMLElement)&&!(u instanceof SVGElement))return!1;const{onUpdate:l,transformTemplate:c}=t.owner.getProps();return rN()&&n&&(H0.has(n)||nN.has(n)&&tN(o))&&(n!=="transform"||!c)&&!l&&!r&&s!=="mirror"&&i!==0&&a!=="inertia"}const sN=40;class aN extends sl{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:a="loop",keyframes:o,name:u,motionValue:l,element:c,...f}){var m;super(),this.stop=()=>{var p,g;this._animation&&(this._animation.stop(),(p=this.stopTimeline)==null||p.call(this)),(g=this.keyframeResolver)==null||g.cancel()},this.createdAt=kt.now();const h={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:a,name:u,motionValue:l,element:c,...f},d=(c==null?void 0:c.KeyframeResolver)||al;this.keyframeResolver=new d(o,(p,g,y)=>this.onKeyframesResolved(p,g,h,!y),u,l,c),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(t,n,r,s){var y,v;this.keyframeResolver=void 0;const{name:i,type:a,velocity:o,delay:u,isHandoff:l,onUpdate:c}=r;this.resolvedAt=kt.now();let f=!0;JI(t,i,a,o)||(f=!1,(wn.instantAnimations||!u)&&(c==null||c(ea(t,r,n))),t[0]=t[t.length-1],eu(r),r.repeat=0);const d={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>sN?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},m=f&&!l&&iN(d),p=(v=(y=d.motionValue)==null?void 0:y.owner)==null?void 0:v.current;let g;if(m)try{g=new QI({...d,element:p})}catch{g=new Is(d)}else g=new Is(d);g.finished.then(()=>{this.notifyFinished()}).catch(zt),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),VI()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function U0(e,t,n,r=0,s=1){const i=Array.from(e).sort((l,c)=>l.sortNodePosition(c)).indexOf(t),a=e.size,o=(a-1)*r;return typeof n=="function"?n(i,a):s===1?i*r:o-i*r}const Xd=30,oN=e=>!isNaN(parseFloat(e));class uN{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=kt.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=kt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=oN(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Qu);const r=this.events[t].add(n);return t==="change"?()=>{r(),Je.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=kt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Xd)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Xd);return u0(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function br(e,t){return new uN(e,t)}function z0(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function ol(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?z0(n,e):n}const lN={type:"spring",stiffness:500,damping:25,restSpeed:10},cN=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),dN={type:"keyframes",duration:.8},fN={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},hN=(e,{keyframes:t})=>t.length>2?dN:Ar.has(e)?e.startsWith("scale")?cN(t[1]):lN:fN,mN=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function pN(e){for(const t in e)if(!mN.has(t))return!0;return!1}const ul=(e,t,n,r={},s,i)=>a=>{const o=ol(r,e)||{},u=o.delay||r.delay||0;let{elapsed:l=0}=r;l=l-Pt(u);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...o,delay:-l,onUpdate:h=>{t.set(h),o.onUpdate&&o.onUpdate(h)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:e,motionValue:t,element:i?void 0:s};pN(o)||Object.assign(c,hN(e,c)),c.duration&&(c.duration=Pt(c.duration)),c.repeatDelay&&(c.repeatDelay=Pt(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let f=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(eu(c),c.delay===0&&(f=!0)),(wn.instantAnimations||wn.skipAnimations||s!=null&&s.shouldSkipAnimations||o.skipAnimations)&&(f=!0,eu(c),c.delay=0),c.allowFlatten=!o.type&&!o.ease,f&&!i&&t.get()!==void 0){const h=ea(c.keyframes,o);if(h!==void 0){Je.update(()=>{c.onUpdate(h),c.onComplete()});return}}return o.isSync?new Is(c):new aN(c)},gN=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function xN(e){const t=gN.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function V0(e,t,n=1){const[r,s]=xN(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const a=i.trim();return i0(a)?parseFloat(a):a}return el(s)?V0(s,t,n+1):s}function Qd(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function ll(e,t,n,r){if(typeof t=="function"){const[s,i]=Qd(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=Qd(r);t=t(n!==void 0?n:e.custom,s,i)}return t}function Yn(e,t,n){const r=e.getProps();return ll(r,t,n!==void 0?n:r.custom,e)}const q0=new Set(["width","height","top","left","right","bottom",...Sr]),tu=e=>Array.isArray(e);function bN(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,br(n))}function yN(e){return tu(e)?e[e.length-1]||0:e}function EN(e,t){const n=Yn(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const a in i){const o=yN(i[a]);bN(e,a,o)}}const xt=e=>!!(e&&e.getVelocity);function TN(e){return!!(xt(e)&&e.add)}function nu(e,t){const n=e.getValue("willChange");if(TN(n))return n.add(t);if(!n&&wn.WillChange){const r=new wn.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function cl(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const vN="framerAppearId",$0="data-"+cl(vN);function W0(e){return e.props[$0]}function kN({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Y0(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:a,...o}=t;const u=e.getDefaultTransition();i=i?z0(i,u):u;const l=i==null?void 0:i.reduceMotion,c=i==null?void 0:i.skipAnimations;r&&(i=r);const f=[],h=s&&e.animationState&&e.animationState.getState()[s],d=i==null?void 0:i.path;d&&d.animateVisualElement(e,o,i,n,f);for(const m in o){const p=e.getValue(m,e.latestValues[m]??null),g=o[m];if(g===void 0||h&&kN(h,m))continue;const y={delay:n,...ol(i||{},m)};c&&(y.skipAnimations=!0);const v=p.get();if(v!==void 0&&!p.isAnimating()&&!Array.isArray(g)&&g===v&&!y.velocity){Je.update(()=>p.set(g));continue}let T=!1;if(window.MotionHandoffAnimation){const k=W0(e);if(k){const _=window.MotionHandoffAnimation(k,m,Je);_!==null&&(y.startTime=_,T=!0)}}nu(e,m);const C=l??e.shouldReduceMotion;p.start(ul(m,p,g,C&&q0.has(m)?{type:!1}:y,e,T));const E=p.animation;E&&f.push(E)}if(a){const m=()=>Je.update(()=>{a&&EN(e,a)});f.length?Promise.all(f).then(m):m()}return f}function ru(e,t,n={}){var u;const r=Yn(e,t,n.type==="exit"?(u=e.presenceContext)==null?void 0:u.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(Y0(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:f,staggerDirection:h}=s;return wN(e,t,l,c,f,h,n)}:()=>Promise.resolve(),{when:o}=s;if(o){const[l,c]=o==="beforeChildren"?[i,a]:[a,i];return l().then(()=>c())}else return Promise.all([i(),a(n.delay)])}function wN(e,t,n=0,r=0,s=0,i=1,a){const o=[];for(const u of e.variantChildren)u.notify("AnimationStart",t),o.push(ru(u,t,{...a,delay:n+(typeof r=="function"?0:r)+U0(e.variantChildren,u,r,s,i)}).then(()=>u.notify("AnimationComplete",t)));return Promise.all(o)}function SN(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>ru(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=ru(e,t,n);else{const s=typeof t=="function"?Yn(e,t,n.custom):t;r=Promise.all(Y0(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const AN={test:e=>e==="auto",parse:e=>e},G0=e=>t=>t.test(e),K0=[wr,ge,rn,ln,Z_,Q_,AN],Zd=e=>K0.find(G0(e));function CN(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||a0(e):!0}const _N=new Set(["brightness","contrast","saturate","opacity"]);function IN(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(tl)||[];if(!r)return e;const s=n.replace(r,"");let i=_N.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const NN=/\b([a-z-]*)\(.*?\)/gu,iu={...Yt,getAnimatableNone:e=>{const t=e.match(NN);return t?t.map(IN).join(" "):e}},su={...Yt,getAnimatableNone:e=>{const t=Yt.parse(e);return Yt.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},Jd={...wr,transform:Math.round},RN={rotate:ln,pathRotation:ln,rotateX:ln,rotateY:ln,rotateZ:ln,scale:Gi,scaleX:Gi,scaleY:Gi,scaleZ:Gi,skew:ln,skewX:ln,skewY:ln,distance:ge,translateX:ge,translateY:ge,translateZ:ge,x:ge,y:ge,z:ge,perspective:ge,transformPerspective:ge,opacity:mi,originX:jd,originY:jd,originZ:ge},Ns={borderWidth:ge,borderTopWidth:ge,borderRightWidth:ge,borderBottomWidth:ge,borderLeftWidth:ge,borderRadius:ge,borderTopLeftRadius:ge,borderTopRightRadius:ge,borderBottomRightRadius:ge,borderBottomLeftRadius:ge,width:ge,maxWidth:ge,height:ge,maxHeight:ge,top:ge,right:ge,bottom:ge,left:ge,inset:ge,insetBlock:ge,insetBlockStart:ge,insetBlockEnd:ge,insetInline:ge,insetInlineStart:ge,insetInlineEnd:ge,padding:ge,paddingTop:ge,paddingRight:ge,paddingBottom:ge,paddingLeft:ge,paddingBlock:ge,paddingBlockStart:ge,paddingBlockEnd:ge,paddingInline:ge,paddingInlineStart:ge,paddingInlineEnd:ge,margin:ge,marginTop:ge,marginRight:ge,marginBottom:ge,marginLeft:ge,marginBlock:ge,marginBlockStart:ge,marginBlockEnd:ge,marginInline:ge,marginInlineStart:ge,marginInlineEnd:ge,fontSize:ge,backgroundPositionX:ge,backgroundPositionY:ge,...RN,zIndex:Jd,fillOpacity:mi,strokeOpacity:mi,numOctaves:Jd},LN={...Ns,color:dt,backgroundColor:dt,outlineColor:dt,fill:dt,stroke:dt,borderColor:dt,borderTopColor:dt,borderRightColor:dt,borderBottomColor:dt,borderLeftColor:dt,filter:iu,WebkitFilter:iu,mask:su,WebkitMask:su},X0=e=>LN[e],MN=new Set([iu,su]);function Q0(e,t){let n=X0(e);return MN.has(n)||(n=Yt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const PN=new Set(["auto","none","0"]);function DN(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!PN.has(i)&&xr(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=Q0(n,s)}class ON extends al{constructor(t,n,r,s,i){super(t,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let f=t[c];if(typeof f=="string"&&(f=f.trim(),el(f))){const h=V0(f,n.current);h!==void 0&&(t[c]=h),c===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!q0.has(r)||t.length!==2)return;const[s,i]=t,a=Zd(s),o=Zd(i),u=Bd(s),l=Bd(i);if(u!==l&&Tn[r]){this.needsMeasurement=!0;return}if(a!==o)if(Yd(a)&&Yd(o))for(let c=0;c<t.length;c++){const f=t[c];typeof f=="string"&&(t[c]=parseFloat(f))}else Tn[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||CN(t[s]))&&r.push(s);r.length&&DN(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Tn[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var o;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const i=r.length-1,a=r[i];r[i]=Tn[n](t.measureViewportBox(),window.getComputedStyle(t.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),(o=this.removedTransforms)!=null&&o.length&&this.removedTransforms.forEach(([u,l])=>{t.getValue(u).set(l)}),this.resolveNoneKeyframes()}}const dl=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Z0(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const s=(n==null?void 0:n[e])??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(r=>r!=null)}const au=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function os(e){return s0(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:fl}=y0(queueMicrotask,!1),$t={x:!1,y:!1};function J0(){return $t.x||$t.y}function FN(e){return e==="x"||e==="y"?$t[e]?null:($t[e]=!0,()=>{$t[e]=!1}):$t.x||$t.y?null:($t.x=$t.y=!0,()=>{$t.x=$t.y=!1})}function eg(e,t){const n=Z0(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function BN(e){return!(e.pointerType==="touch"||J0())}function jN(e,t,n={}){const[r,s,i]=eg(e,n);return r.forEach(a=>{let o=!1,u=!1,l;const c=()=>{a.removeEventListener("pointerleave",m)},f=g=>{l&&(l(g),l=void 0),c()},h=g=>{o=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),u&&(u=!1,f(g))},d=()=>{o=!0,window.addEventListener("pointerup",h,s),window.addEventListener("pointercancel",h,s)},m=g=>{if(g.pointerType!=="touch"){if(o){u=!0;return}f(g)}},p=g=>{if(!BN(g))return;u=!1;const y=t(a,g);typeof y=="function"&&(l=y,a.addEventListener("pointerleave",m,s))};a.addEventListener("pointerenter",p,s),a.addEventListener("pointerdown",d,s)}),i}const tg=(e,t)=>t?e===t?!0:tg(e,t.parentElement):!1,hl=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,HN=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function UN(e){return HN.has(e.tagName)||e.isContentEditable===!0}const zN=new Set(["INPUT","SELECT","TEXTAREA"]);function VN(e){return zN.has(e.tagName)||e.isContentEditable===!0}const us=new WeakSet;function ef(e){return t=>{t.key==="Enter"&&e(t)}}function io(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const qN=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=ef(()=>{if(us.has(n))return;io(n,"down");const s=ef(()=>{io(n,"up")}),i=()=>io(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function tf(e){return hl(e)&&!J0()}const nf=new WeakSet;function $N(e,t,n={}){const[r,s,i]=eg(e,n),a=o=>{const u=o.currentTarget;if(!tf(o)||nf.has(o))return;us.add(u),n.stopPropagation&&nf.add(o);const l=t(u,o),c={...s,capture:!0},f=(m,p)=>{window.removeEventListener("pointerup",h,c),window.removeEventListener("pointercancel",d,c),us.has(u)&&us.delete(u),tf(m)&&typeof l=="function"&&l(m,{success:p})},h=m=>{f(m,u===window||u===document||n.useGlobalTarget||tg(u,m.target))},d=m=>{f(m,!1)};window.addEventListener("pointerup",h,c),window.addEventListener("pointercancel",d,c)};return r.forEach(o=>{(n.useGlobalTarget?window:o).addEventListener("pointerdown",a,s),os(o)&&(o.addEventListener("focus",l=>qN(l,s)),!UN(o)&&!o.hasAttribute("tabindex")&&(o.tabIndex=0))}),i}function ml(e){return s0(e)&&"ownerSVGElement"in e}const ls=new WeakMap;let bn;const ng=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:ml(r)&&"getBBox"in r?r.getBBox()[t]:r[n],WN=ng("inline","width","offsetWidth"),YN=ng("block","height","offsetHeight");function GN({target:e,borderBoxSize:t}){var n;(n=ls.get(e))==null||n.forEach(r=>{r(e,{get width(){return WN(e,t)},get height(){return YN(e,t)}})})}function KN(e){e.forEach(GN)}function XN(){typeof ResizeObserver>"u"||(bn=new ResizeObserver(KN))}function QN(e,t){bn||XN();const n=Z0(e);return n.forEach(r=>{let s=ls.get(r);s||(s=new Set,ls.set(r,s)),s.add(t),bn==null||bn.observe(r)}),()=>{n.forEach(r=>{const s=ls.get(r);s==null||s.delete(t),s!=null&&s.size||bn==null||bn.unobserve(r)})}}const cs=new Set;let cr;function ZN(){cr=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};cs.forEach(t=>t(e))},window.addEventListener("resize",cr)}function JN(e){return cs.add(e),cr||ZN(),()=>{cs.delete(e),!cs.size&&typeof cr=="function"&&(window.removeEventListener("resize",cr),cr=void 0)}}function rf(e,t){return typeof e=="function"?JN(e):QN(e,t)}function e5(e){return ml(e)&&e.tagName==="svg"}const t5=[...K0,dt,Yt],n5=e=>t5.find(G0(e)),sf=()=>({translate:0,scale:1,origin:0,originPoint:0}),dr=()=>({x:sf(),y:sf()}),af=()=>({min:0,max:0}),ht=()=>({x:af(),y:af()}),r5=new WeakMap;function ta(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function pi(e){return typeof e=="string"||Array.isArray(e)}const pl=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],gl=["initial",...pl];function na(e){return ta(e.animate)||gl.some(t=>pi(e[t]))}function rg(e){return!!(na(e)||e.variants)}function i5(e,t,n){for(const r in t){const s=t[r],i=n[r];if(xt(s))e.addValue(r,s);else if(xt(i))e.addValue(r,br(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const a=e.getValue(r);a.liveStyle===!0?a.jump(s):a.hasAnimated||a.set(s)}else{const a=e.getStaticValue(r);e.addValue(r,br(a!==void 0?a:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const ou={current:null},ig={current:!1},s5=typeof window<"u";function a5(){if(ig.current=!0,!!s5)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ou.current=e.matches;e.addEventListener("change",t),t()}else ou.current=!1}const of=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Rs={};function sg(e){Rs=e}function o5(){return Rs}class u5{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:a,visualState:o},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=al,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const d=kt.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,Je.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=u,this.blockInitialAnimation=!!a,this.isControllingVariants=na(n),this.isVariantNode=rg(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in h){const m=h[d];l[d]!==void 0&&xt(m)&&m.set(l[d])}}mount(t){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=t,r5.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,i)=>this.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(ig.current||a5(),this.shouldReduceMotion=ou.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),Sn(this.notifyUpdate),Sn(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&H0.has(t)&&this.current instanceof HTMLElement){const{factory:a,keyframes:o,times:u,ease:l,duration:c}=n.accelerate,f=new B0({element:this.current,name:t,keyframes:o,times:u,ease:l,duration:Pt(c)}),h=a(f);this.valueSubscriptions.set(t,()=>{h(),f.cancel()});return}const r=Ar.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Je.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i&&i()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Rs){const n=Rs[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ht()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<of.length;r++){const s=of[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,a=t[i];a&&(this.propEventSubscriptions[s]=this.on(s,a))}this.prevMotionValues=i5(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=br(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(i0(r)||a0(r))?r=parseFloat(r):!n5(r)&&Yt.test(n)&&(r=Q0(t,n)),this.setBaseTarget(t,xt(r)?r.get():r)),xt(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const a=ll(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);a&&(r=a[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!xt(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Qu),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){fl.render(this.render)}}class ag extends u5{constructor(){super(...arguments),this.KeyframeResolver=ON}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;xt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class _n{constructor(t){this.isMounted=!1,this.node=t}update(){}}function og({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function l5({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function c5(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function so(e){return e===void 0||e===1}function uu({scale:e,scaleX:t,scaleY:n}){return!so(e)||!so(t)||!so(n)}function Fn(e){return uu(e)||ug(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ug(e){return uf(e.x)||uf(e.y)}function uf(e){return e&&e!=="0%"}function Ls(e,t,n){const r=e-n,s=t*r;return n+s}function lf(e,t,n,r,s){return s!==void 0&&(e=Ls(e,s,r)),Ls(e,n,r)+t}function lu(e,t=0,n=1,r,s){e.min=lf(e.min,t,n,r,s),e.max=lf(e.max,t,n,r,s)}function lg(e,{x:t,y:n}){lu(e.x,t.translate,t.scale,t.originPoint),lu(e.y,n.translate,n.scale,n.originPoint)}const cf=.999999999999,df=1.0000000000001;function d5(e,t,n,r=!1){var o;const s=n.length;if(!s)return;t.x=t.y=1;let i,a;for(let u=0;u<s;u++){i=n[u],a=i.projectionDelta;const{visualElement:l}=i.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(nn(e.x,-i.scroll.offset.x),nn(e.y,-i.scroll.offset.y)),a&&(t.x*=a.x.scale,t.y*=a.y.scale,lg(e,a)),r&&Fn(i.latestValues)&&ds(e,i.latestValues,(o=i.layout)==null?void 0:o.layoutBox))}t.x<df&&t.x>cf&&(t.x=1),t.y<df&&t.y>cf&&(t.y=1)}function nn(e,t){e.min+=t,e.max+=t}function ff(e,t,n,r,s=.5){const i=Ze(e.min,e.max,s);lu(e,t,n,i,r)}function hf(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function ds(e,t,n){const r=n??e;ff(e.x,hf(t.x,r.x),t.scaleX,t.scale,t.originX),ff(e.y,hf(t.y,r.y),t.scaleY,t.scale,t.originY)}function cg(e,t){return og(c5(e.getBoundingClientRect(),t))}function f5(e,t,n){const r=cg(e,n),{scroll:s}=t;return s&&(nn(r.x,s.offset.x),nn(r.y,s.offset.y)),r}const h5={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},m5=Sr.length;function p5(e,t,n){let r="",s=!0;for(let a=0;a<m5;a++){const o=Sr[a],u=e[o];if(u===void 0)continue;let l=!0;if(typeof u=="number")l=u===(o.startsWith("scale")?1:0);else{const c=parseFloat(u);l=o.startsWith("scale")?c===1:c===0}if(!l||n){const c=au(u,Ns[o]);if(!l){s=!1;const f=h5[o]||o;r+=`${f}(${c}) `}n&&(t[o]=c)}}const i=e.pathRotation;return i&&(s=!1,r+=`rotate(${au(i,Ns.pathRotation)}) `),r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function xl(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let a=!1,o=!1;for(const u in t){const l=t[u];if(Ar.has(u)){a=!0;continue}else if(T0(u)){s[u]=l;continue}else{const c=au(l,Ns[u]);u.startsWith("origin")?(o=!0,i[u]=c):r[u]=c}}if(t.transform||(a||n?r.transform=p5(t,e.transform,n):r.transform&&(r.transform="none")),o){const{originX:u="50%",originY:l="50%",originZ:c=0}=i;r.transformOrigin=`${u} ${l} ${c}`}}function dg(e,{style:t,vars:n},r,s){const i=e.style;let a;for(a in t)i[a]=t[a];s==null||s.applyProjectionStyles(i,r);for(a in n)i.setProperty(a,n[a])}function mf(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Hr={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ge.test(e))e=parseFloat(e);else return e;const n=mf(e,t.target.x),r=mf(e,t.target.y);return`${n}% ${r}%`}},g5={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Yt.parse(e);if(s.length>5)return r;const i=Yt.createTransformer(e),a=typeof s[0]!="number"?1:0,o=n.x.scale*t.x,u=n.y.scale*t.y;s[0+a]/=o,s[1+a]/=u;const l=Ze(o,u,.5);return typeof s[2+a]=="number"&&(s[2+a]/=l),typeof s[3+a]=="number"&&(s[3+a]/=l),i(s)}},cu={borderRadius:{...Hr,applyTo:[...dl]},borderTopLeftRadius:Hr,borderTopRightRadius:Hr,borderBottomLeftRadius:Hr,borderBottomRightRadius:Hr,boxShadow:g5};function fg(e,{layout:t,layoutId:n}){return Ar.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!cu[e]||e==="opacity")}function bl(e,t,n){var a;const r=e.style,s=t==null?void 0:t.style,i={};if(!r)return i;for(const o in r)(xt(r[o])||s&&xt(s[o])||fg(o,e)||((a=n==null?void 0:n.getValue(o))==null?void 0:a.liveStyle)!==void 0)&&(i[o]=r[o]);return i}function x5(e){return window.getComputedStyle(e)}class b5 extends ag{constructor(){super(...arguments),this.type="html",this.renderInstance=dg}mount(t){Js(!!t.style),super.mount(t)}readValueFromInstance(t,n){var r;if(Ar.has(n))return(r=this.projection)!=null&&r.isProjecting?Ko(n):BI(t,n);{const s=x5(t),i=(T0(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return cg(t,n)}build(t,n,r){xl(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return bl(t,n,r)}}const y5={offset:"stroke-dashoffset",array:"stroke-dasharray"},E5={offset:"strokeDashoffset",array:"strokeDasharray"};function T5(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?y5:E5;e[i.offset]=`${-r}`,e[i.array]=`${t} ${n}`}const hg=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function mg(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:a=0,...o},u,l,c){if(xl(e,o,l),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:h}=e;for(const d of hg)f[d]!==void 0&&(h[d]=f[d],delete f[d]);(h.transform||f.transformOrigin)&&(h.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),h.transform&&(h.transformBox=(c==null?void 0:c.transformBox)??"fill-box",delete f.transformBox),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),s!==void 0&&T5(f,s,i,a,!1)}const pg=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),gg=e=>typeof e=="string"&&e.toLowerCase()==="svg";function v5(e,t,n,r){dg(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(pg.has(s)?s:cl(s),t.attrs[s])}function xg(e,t,n){const r=bl(e,t,n);for(const s in e)if(xt(e[s])||xt(t[s])){const i=Sr.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}class k5 extends ag{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ht}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ar.has(n)){const r=X0(n);return r&&r.default||0}if(hg.includes(n)){const s=getComputedStyle(t)[n];if(typeof s=="string"&&s)return s.trim()}return n=pg.has(n)?n:cl(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return xg(t,n,r)}build(t,n,r){mg(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){v5(t,n,r,s)}mount(t){this.isSVGTag=gg(t.tagName),super.mount(t)}}const w5=gl.length;function bg(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?bg(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<w5;n++){const r=gl[n],s=e.props[r];(pi(s)||s===!1)&&(t[r]=s)}return t}function yg(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const S5=[...pl].reverse(),A5=pl.length;function C5(e){return t=>Promise.all(t.map(({animation:n,options:r})=>SN(e,n,r)))}function _5(e){let t=C5(e),n=pf(),r=!0,s=!1;const i=l=>(c,f)=>{var d;const h=Yn(e,f,l==="exit"?(d=e.presenceContext)==null?void 0:d.custom:void 0);if(h){const{transition:m,transitionEnd:p,...g}=h;c={...c,...g,...p}}return c};function a(l){t=l(e)}function o(l){const{props:c}=e,f=bg(e.parent)||{},h=[],d=new Set;let m={},p=1/0;for(let y=0;y<A5;y++){const v=S5[y],T=n[v],C=c[v]!==void 0?c[v]:f[v],E=pi(C),k=v===l?T.isActive:null;k===!1&&(p=y);let _=C===f[v]&&C!==c[v]&&E;if(_&&(r||s)&&e.manuallyAnimateOnMount&&(_=!1),T.protectedKeys={...m},!T.isActive&&k===null||!C&&!T.prevProp||ta(C)||typeof C=="boolean")continue;if(v==="exit"&&T.isActive&&k!==!0){T.prevResolvedValues&&(m={...m,...T.prevResolvedValues});continue}const A=I5(T.prevProp,C);let I=A||v===l&&T.isActive&&!_&&E||y>p&&E,S=!1;const L=Array.isArray(C)?C:[C];let N=L.reduce(i(v),{});k===!1&&(N={});const{prevResolvedValues:j={}}=T,P={...j,...N},D=F=>{I=!0,d.has(F)&&(S=!0,d.delete(F)),T.needsAnimating[F]=!0;const q=e.getValue(F);q&&(q.liveStyle=!1)};for(const F in P){const q=N[F],R=j[F];if(m.hasOwnProperty(F))continue;let $=!1;tu(q)&&tu(R)?$=!yg(q,R)||A:$=q!==R,$?q!=null?D(F):d.add(F):q!==void 0&&d.has(F)?D(F):T.protectedKeys[F]=!0}T.prevProp=C,T.prevResolvedValues=N,T.isActive&&(m={...m,...N}),(r||s)&&e.blockInitialAnimation&&(I=!1);const H=_&&A;I&&(!H||S)&&h.push(...L.map(F=>{const q={type:v};if(typeof F=="string"&&(r||s)&&!H&&e.manuallyAnimateOnMount&&e.parent){const{parent:R}=e,$=Yn(R,F);if(R.enteringChildren&&$){const{delayChildren:W}=$.transition||{};q.delay=U0(R.enteringChildren,e,W)}}return{animation:F,options:q}}))}if(d.size){const y={};if(typeof c.initial!="boolean"){const v=Yn(e,Array.isArray(c.initial)?c.initial[0]:c.initial);v&&v.transition&&(y.transition=v.transition)}d.forEach(v=>{const T=e.getBaseTarget(v),C=e.getValue(v);C&&(C.liveStyle=!0),y[v]=T??null}),h.push({animation:y})}let g=!!h.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(g=!1),r=!1,s=!1,g?t(h):Promise.resolve()}function u(l,c){var h;if(n[l].isActive===c)return Promise.resolve();(h=e.variantChildren)==null||h.forEach(d=>{var m;return(m=d.animationState)==null?void 0:m.setActive(l,c)}),n[l].isActive=c;const f=o(l);for(const d in n)n[d].protectedKeys={};return f}return{animateChanges:o,setActive:u,setAnimateFunction:a,getState:()=>n,reset:()=>{n=pf(),s=!0}}}function I5(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!yg(t,e):!1}function Mn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function pf(){return{animate:Mn(!0),whileInView:Mn(),whileHover:Mn(),whileTap:Mn(),whileDrag:Mn(),whileFocus:Mn(),exit:Mn()}}function du(e,t){e.min=t.min,e.max=t.max}function qt(e,t){du(e.x,t.x),du(e.y,t.y)}function gf(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Eg=1e-4,N5=1-Eg,R5=1+Eg,Tg=.01,L5=0-Tg,M5=0+Tg;function wt(e){return e.max-e.min}function P5(e,t,n){return Math.abs(e-t)<=n}function xf(e,t,n,r=.5){e.origin=r,e.originPoint=Ze(t.min,t.max,e.origin),e.scale=wt(n)/wt(t),e.translate=Ze(n.min,n.max,e.origin)-e.originPoint,(e.scale>=N5&&e.scale<=R5||isNaN(e.scale))&&(e.scale=1),(e.translate>=L5&&e.translate<=M5||isNaN(e.translate))&&(e.translate=0)}function ii(e,t,n,r){xf(e.x,t.x,n.x,r?r.originX:void 0),xf(e.y,t.y,n.y,r?r.originY:void 0)}function bf(e,t,n,r=0){const s=r?Ze(n.min,n.max,r):n.min;e.min=s+t.min,e.max=e.min+wt(t)}function D5(e,t,n,r){bf(e.x,t.x,n.x,r==null?void 0:r.x),bf(e.y,t.y,n.y,r==null?void 0:r.y)}function yf(e,t,n,r=0){const s=r?Ze(n.min,n.max,r):n.min;e.min=t.min-s,e.max=e.min+wt(t)}function Ms(e,t,n,r){yf(e.x,t.x,n.x,r==null?void 0:r.x),yf(e.y,t.y,n.y,r==null?void 0:r.y)}function Ef(e,t,n,r,s){return e-=t,e=Ls(e,1/n,r),s!==void 0&&(e=Ls(e,1/s,r)),e}function O5(e,t=0,n=1,r=.5,s,i=e,a=e){if(rn.test(t)&&(t=parseFloat(t),t=Ze(a.min,a.max,t/100)-a.min),typeof t!="number")return;let o=Ze(i.min,i.max,r);e===i&&(o-=t),e.min=Ef(e.min,t,n,o,s),e.max=Ef(e.max,t,n,o,s)}function Tf(e,t,[n,r,s],i,a){O5(e,t[n],t[r],t[s],t.scale,i,a)}const F5=["x","scaleX","originX"],B5=["y","scaleY","originY"];function vf(e,t,n,r){Tf(e.x,t,F5,n?n.x:void 0,r?r.x:void 0),Tf(e.y,t,B5,n?n.y:void 0,r?r.y:void 0)}function kf(e){return e.translate===0&&e.scale===1}function vg(e){return kf(e.x)&&kf(e.y)}function wf(e,t){return e.min===t.min&&e.max===t.max}function j5(e,t){return wf(e.x,t.x)&&wf(e.y,t.y)}function Sf(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function kg(e,t){return Sf(e.x,t.x)&&Sf(e.y,t.y)}function Af(e){return wt(e.x)/wt(e.y)}function Cf(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function en(e){return[e("x"),e("y")]}function H5(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,a=(n==null?void 0:n.z)||0;if((s||i||a)&&(r=`translate3d(${s}px, ${i}px, ${a}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:l,rotate:c,pathRotation:f,rotateX:h,rotateY:d,skewX:m,skewY:p}=n;l&&(r=`perspective(${l}px) ${r}`),c&&(r+=`rotate(${c}deg) `),f&&(r+=`rotate(${f}deg) `),h&&(r+=`rotateX(${h}deg) `),d&&(r+=`rotateY(${d}deg) `),m&&(r+=`skewX(${m}deg) `),p&&(r+=`skewY(${p}deg) `)}const o=e.x.scale*t.x,u=e.y.scale*t.y;return(o!==1||u!==1)&&(r+=`scale(${o}, ${u})`),r||"none"}const U5=dl.length,_f=e=>typeof e=="string"?parseFloat(e):e,If=e=>typeof e=="number"||ge.test(e);function z5(e,t,n,r,s,i){s?(e.opacity=Ze(0,n.opacity??1,V5(r)),e.opacityExit=Ze(t.opacity??1,0,q5(r))):i&&(e.opacity=Ze(t.opacity??1,n.opacity??1,r));for(let a=0;a<U5;a++){const o=dl[a];let u=Nf(t,o),l=Nf(n,o);if(u===void 0&&l===void 0)continue;u||(u=0),l||(l=0),u===0||l===0||If(u)===If(l)?(e[o]=Math.max(Ze(_f(u),_f(l),r),0),(rn.test(l)||rn.test(u))&&(e[o]+="%")):e[o]=l}(t.rotate||n.rotate)&&(e.rotate=Ze(t.rotate||0,n.rotate||0,r))}function Nf(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const V5=wg(0,.5,p0),q5=wg(.5,.95,zt);function wg(e,t,n){return r=>r<e?0:r>t?1:n(hi(e,t,r))}function $5(e,t,n){const r=xt(e)?e:br(e);return r.start(ul("",r,t,n)),r.animation}function gi(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}const W5=(e,t)=>e.depth-t.depth;class Y5{constructor(){this.children=[],this.isDirty=!1}add(t){Xu(this.children,t),this.isDirty=!0}remove(t){Ss(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(W5),this.isDirty=!1,this.children.forEach(t)}}function G5(e,t){const n=kt.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Sn(r),e(i-t))};return Je.setup(r,!0),()=>Sn(r)}function fs(e){return xt(e)?e.get():e}class K5{constructor(){this.members=[]}add(t){Xu(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(Ss(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Ss(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){var n;for(let r=this.members.indexOf(t)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(t,n){var s;const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:a}=t.options;(i===void 0||i!==a)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(s=t.root)!=null&&s.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,s,i,a;(r=(n=t.options).onExitComplete)==null||r.call(n),(a=(s=t.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||a.call(i)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const hs={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ao=["","X","Y","Z"],X5=1e3;let Q5=0;function oo(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Sg(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=W0(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Je,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Sg(r)}function Ag({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},o=t==null?void 0:t()){this.id=Q5++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(e6),this.nodes.forEach(a6),this.nodes.forEach(o6),this.nodes.forEach(t6)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new Y5)}addEventListener(a,o){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new Qu),this.eventHandlers.get(a).add(o)}notifyListeners(a,...o){const u=this.eventHandlers.get(a);u&&u.notify(...o)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=ml(a)&&!e5(a),this.instance=a;const{layoutId:o,layout:u,visualElement:l}=this.options;if(l&&!l.current&&l.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(u||o)&&(this.isLayoutDirty=!0),e){let c,f=0;const h=()=>this.root.updateBlockedByResize=!1;Je.read(()=>{f=window.innerWidth}),e(a,()=>{const d=window.innerWidth;d!==f&&(f=d,this.root.updateBlockedByResize=!0,c&&c(),c=G5(h,250),hs.hasAnimatedSinceResize&&(hs.hasAnimatedSinceResize=!1,this.nodes.forEach(Mf)))})}o&&this.root.registerSharedNode(o,this),this.options.animate!==!1&&l&&(o||u)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||l.getDefaultTransition()||f6,{onLayoutAnimationStart:p,onLayoutAnimationComplete:g}=l.getProps(),y=!this.targetLayout||!kg(this.targetLayout,d),v=!f&&h;if(this.options.layoutRoot||this.resumeFrom||v||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...ol(m,"layout"),onPlay:p,onComplete:g};(l.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(c,v,T.path)}else f||Mf(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Sn(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(u6),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Sg(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const f=this.path[c];f.shouldResetTransform=!0,(typeof f.latestValues.x=="string"||typeof f.latestValues.y=="string")&&(f.isLayoutDirty=!0),f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:o,layout:u}=this.options;if(o===void 0&&!u)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const u=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),u&&this.nodes.forEach(r6),this.nodes.forEach(Rf);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Lf);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(i6),this.nodes.forEach(s6),this.nodes.forEach(Z5),this.nodes.forEach(J5)):this.nodes.forEach(Lf),this.clearAllSnapshots();const o=kt.now();gt.delta=sn(0,1e3/60,o-gt.timestamp),gt.timestamp=o,gt.isProcessing=!0,Za.update.process(gt),Za.preRender.process(gt),Za.render.process(gt),gt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,fl.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(n6),this.sharedNodes.forEach(l6)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Je.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Je.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!wt(this.snapshot.measuredBox.x)&&!wt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let u=0;u<this.path.length;u++)this.path[u].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=ht()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:o}=this.options;o&&o.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let o=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(o=!1),o&&this.instance){const u=r(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:u,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!s)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,o=this.projectionDelta&&!vg(this.projectionDelta),u=this.getTransformTemplate(),l=u?u(this.latestValues,""):void 0,c=l!==this.prevTransformTemplateValue;a&&this.instance&&(o||Fn(this.latestValues)||c)&&(s(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const o=this.measurePageBox();let u=this.removeElementScroll(o);return a&&(u=this.removeTransform(u)),h6(u),{animationId:this.root.animationId,measuredBox:o,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){var l;const{visualElement:a}=this.options;if(!a)return ht();const o=a.measureViewportBox();if(!(((l=this.scroll)==null?void 0:l.wasRoot)||this.path.some(m6))){const{scroll:c}=this.root;c&&(nn(o.x,c.offset.x),nn(o.y,c.offset.y))}return o}removeElementScroll(a){var u;const o=ht();if(qt(o,a),(u=this.scroll)!=null&&u.wasRoot)return o;for(let l=0;l<this.path.length;l++){const c=this.path[l],{scroll:f,options:h}=c;c!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&qt(o,a),nn(o.x,f.offset.x),nn(o.y,f.offset.y))}return o}applyTransform(a,o=!1,u){var c,f;const l=u||ht();qt(l,a);for(let h=0;h<this.path.length;h++){const d=this.path[h];!o&&d.options.layoutScroll&&d.scroll&&d!==d.root&&(nn(l.x,-d.scroll.offset.x),nn(l.y,-d.scroll.offset.y)),Fn(d.latestValues)&&ds(l,d.latestValues,(c=d.layout)==null?void 0:c.layoutBox)}return Fn(this.latestValues)&&ds(l,this.latestValues,(f=this.layout)==null?void 0:f.layoutBox),l}removeTransform(a){var u;const o=ht();qt(o,a);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!Fn(c.latestValues))continue;let f;c.instance&&(uu(c.latestValues)&&c.updateSnapshot(),f=ht(),qt(f,c.measurePageBox())),vf(o,c.latestValues,(u=c.snapshot)==null?void 0:u.layoutBox,f)}return Fn(this.latestValues)&&vf(o,this.latestValues),o}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==gt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var d;const o=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=o.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=o.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=o.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==o;if(!(a||u&&this.isSharedProjectionDirty||this.isProjectionDirty||(d=this.parent)!=null&&d.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:f}=this.options;if(!this.layout||!(c||f))return;this.resolvedRelativeTargetAt=gt.timestamp;const h=this.getClosestProjectingParent();h&&this.linkedParentVersion!==h.layoutVersion&&!h.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&h&&h.layout?this.createRelativeTarget(h,this.layout.layoutBox,h.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ht(),this.targetWithTransforms=ht()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),D5(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):qt(this.target,this.layout.layoutBox),lg(this.target,this.targetDelta)):qt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?this.createRelativeTarget(h,this.target,h.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||uu(this.parent.latestValues)||ug(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(a,o,u){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ht(),this.relativeTargetOrigin=ht(),Ms(this.relativeTargetOrigin,o,u,this.options.layoutAnchor||void 0),qt(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var m;const a=this.getLead(),o=!!this.resumingFrom||this!==a;let u=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&(u=!1),o&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===gt.timestamp&&(u=!1),u)return;const{layout:l,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||c))return;qt(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;d5(this.layoutCorrected,this.treeScale,this.path,o),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=ht());const{target:d}=a;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(gf(this.prevProjectionDelta.x,this.projectionDelta.x),gf(this.prevProjectionDelta.y,this.projectionDelta.y)),ii(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!Cf(this.projectionDelta.x,this.prevProjectionDelta.x)||!Cf(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var o;if((o=this.options.visualElement)==null||o.scheduleRender(),a){const u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=dr(),this.projectionDelta=dr(),this.projectionDeltaWithTransform=dr()}setAnimationOrigin(a,o=!1,u){const l=this.snapshot,c=l?l.latestValues:{},f={...this.latestValues},h=dr();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!o;const d=ht(),m=l?l.source:void 0,p=this.layout?this.layout.source:void 0,g=m!==p,y=this.getStack(),v=!y||y.members.length<=1,T=!!(g&&!v&&this.options.crossfade===!0&&!this.path.some(d6));this.animationProgress=0;let C;const E=u==null?void 0:u.interpolateProjection(a);this.mixTargetDelta=k=>{const _=k/1e3,A=E==null?void 0:E(_);A?(h.x.translate=A.x,h.x.scale=Ze(a.x.scale,1,_),h.x.origin=a.x.origin,h.x.originPoint=a.x.originPoint,h.y.translate=A.y,h.y.scale=Ze(a.y.scale,1,_),h.y.origin=a.y.origin,h.y.originPoint=a.y.originPoint):(Pf(h.x,a.x,_),Pf(h.y,a.y,_)),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ms(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),c6(this.relativeTarget,this.relativeTargetOrigin,d,_),C&&j5(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=ht()),qt(C,this.relativeTarget)),g&&(this.animationValues=f,z5(f,c,this.latestValues,_,T,v)),A&&A.rotate!==void 0&&(this.animationValues||(this.animationValues=f),this.animationValues.pathRotation=A.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=_},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){var o,u,l;this.notifyListeners("animationStart"),(o=this.currentAnimation)==null||o.stop(),(l=(u=this.resumingFrom)==null?void 0:u.currentAnimation)==null||l.stop(),this.pendingAnimation&&(Sn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Je.update(()=>{hs.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=br(0)),this.motionValue.jump(0,!1),this.currentAnimation=$5(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),a.onUpdate&&a.onUpdate(c)},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(X5),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:o,target:u,layout:l,latestValues:c}=a;if(!(!o||!u||!l)){if(this!==a&&this.layout&&l&&Cg(this.options.animationType,this.layout.layoutBox,l.layoutBox)){u=this.target||ht();const f=wt(this.layout.layoutBox.x);u.x.min=a.target.x.min,u.x.max=u.x.min+f;const h=wt(this.layout.layoutBox.y);u.y.min=a.target.y.min,u.y.max=u.y.min+h}qt(o,u),ds(o,c),ii(this.projectionDeltaWithTransform,this.layoutCorrected,o,c)}}registerSharedNode(a,o){this.sharedNodes.has(a)||this.sharedNodes.set(a,new K5),this.sharedNodes.get(a).add(o);const l=o.options.initialPromotionConfig;o.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(o):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())==null?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())==null?void 0:o.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:o,preserveFollowOpacity:u}={}){const l=this.getStack();l&&l.promote(this,u),a&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let o=!1;const{latestValues:u}=a;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(o=!0),!o)return;const l={};u.z&&oo("z",a,l,this.animationValues);for(let c=0;c<ao.length;c++)oo(`rotate${ao[c]}`,a,l,this.animationValues),oo(`skew${ao[c]}`,a,l,this.animationValues);a.render();for(const c in l)a.setStaticValue(c,l[c]),this.animationValues&&(this.animationValues[c]=l[c]);a.scheduleRender()}applyProjectionStyles(a,o){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=fs(o==null?void 0:o.pointerEvents)||"",a.transform=u?u(this.latestValues,""):"none";return}const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=fs(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Fn(this.latestValues)&&(a.transform=u?u({},""):"none",this.hasProjected=!1);return}a.visibility="";const c=l.animationValues||l.latestValues;this.applyTransformsToTarget();let f=H5(this.projectionDeltaWithTransform,this.treeScale,c);u&&(f=u(c,f)),a.transform=f;const{x:h,y:d}=this.projectionDelta;a.transformOrigin=`${h.origin*100}% ${d.origin*100}% 0`,l.animationValues?a.opacity=l===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:a.opacity=l===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const m in cu){if(c[m]===void 0)continue;const{correct:p,applyTo:g,isCSSVariable:y}=cu[m],v=f==="none"?c[m]:p(c[m],l);if(g){const T=g.length;for(let C=0;C<T;C++)a[g[C]]=v}else y?this.options.visualElement.renderState.vars[m]=v:a[m]=v}this.options.layoutId&&(a.pointerEvents=l===this?fs(o==null?void 0:o.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var o;return(o=a.currentAnimation)==null?void 0:o.stop()}),this.root.nodes.forEach(Rf),this.root.sharedNodes.clear()}}}function Z5(e){e.updateLayout()}function J5(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i==="size")en(f=>{const h=a?t.measuredBox[f]:t.layoutBox[f],d=wt(h);h.min=r[f].min,h.max=h.min+d});else if(i==="x"||i==="y"){const f=i==="x"?"y":"x";du(a?t.measuredBox[f]:t.layoutBox[f],r[f])}else Cg(i,t.layoutBox,r)&&en(f=>{const h=a?t.measuredBox[f]:t.layoutBox[f],d=wt(r[f]);h.max=h.min+d,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+d)});const o=dr();ii(o,r,t.layoutBox);const u=dr();a?ii(u,e.applyTransform(s,!0),t.measuredBox):ii(u,r,t.layoutBox);const l=!vg(o);let c=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:d}=f;if(h&&d){const m=e.options.layoutAnchor||void 0,p=ht();Ms(p,t.layoutBox,h.layoutBox,m);const g=ht();Ms(g,r,d.layoutBox,m),kg(p,g)||(c=!0),f.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=p,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:u,layoutDelta:o,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function e6(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function t6(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function n6(e){e.clearSnapshot()}function Rf(e){e.clearMeasurements()}function r6(e){e.isLayoutDirty=!0,e.updateLayout()}function Lf(e){e.isLayoutDirty=!1}function i6(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function s6(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Mf(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function a6(e){e.resolveTargetDelta()}function o6(e){e.calcProjection()}function u6(e){e.resetSkewAndRotation()}function l6(e){e.removeLeadSnapshot()}function Pf(e,t,n){e.translate=Ze(t.translate,0,n),e.scale=Ze(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Df(e,t,n,r){e.min=Ze(t.min,n.min,r),e.max=Ze(t.max,n.max,r)}function c6(e,t,n,r){Df(e.x,t.x,n.x,r),Df(e.y,t.y,n.y,r)}function d6(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const f6={duration:.45,ease:[.4,0,.1,1]},Of=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Ff=Of("applewebkit/")&&!Of("chrome/")?Math.round:zt;function Bf(e){e.min=Ff(e.min),e.max=Ff(e.max)}function h6(e){Bf(e.x),Bf(e.y)}function Cg(e,t,n){return e==="position"||e==="preserve-aspect"&&!P5(Af(t),Af(n),.2)}function m6(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const p6=Ag({attachResizeListener:(e,t)=>gi(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),uo={current:void 0},_g=Ag({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!uo.current){const e=new p6({});e.mount(window),e.setOptions({layoutScroll:!0}),uo.current=e}return uo.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),yl=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function jf(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function g6(...e){return t=>{let n=!1;const r=e.map(s=>{const i=jf(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():jf(e[s],null)}}}}function x6(...e){return w.useCallback(g6(...e),e)}class b6 extends w.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(os(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=os(r)&&r.offsetWidth||0,i=os(r)&&r.offsetHeight||0,a=getComputedStyle(n),o=this.props.sizeRef.current;o.height=parseFloat(a.height),o.width=parseFloat(a.width),o.top=n.offsetTop,o.left=n.offsetLeft,o.right=s-o.width-o.left,o.bottom=i-o.height-o.top,o.direction=a.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function y6({children:e,isPresent:t,anchorX:n,anchorY:r,root:s,pop:i}){var h;const a=w.useId(),o=w.useRef(null),u=w.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:l}=w.useContext(yl),c=i!==!1?((h=e.props)==null?void 0:h.ref)??(e==null?void 0:e.ref):void 0,f=x6(o,c);return w.useInsertionEffect(()=>{const{width:d,height:m,top:p,left:g,right:y,bottom:v,direction:T}=u.current;if(t||i===!1||!o.current||!d||!m)return;const C=T==="rtl",E=n==="left"?C?`right: ${y}`:`left: ${g}`:C?`left: ${g}`:`right: ${y}`,k=r==="bottom"?`bottom: ${v}`:`top: ${p}`;o.current.dataset.motionPopId=a;const _=document.createElement("style");l&&(_.nonce=l);const A=s??document.head;return A.appendChild(_),_.sheet&&_.sheet.insertRule(`
|
|
455
|
-
[data-motion-pop-id="${a}"] {
|
|
456
|
-
position: absolute !important;
|
|
457
|
-
width: ${d}px !important;
|
|
458
|
-
height: ${m}px !important;
|
|
459
|
-
${E}px !important;
|
|
460
|
-
${k}px !important;
|
|
461
|
-
}
|
|
462
|
-
`),()=>{var I;(I=o.current)==null||I.removeAttribute("data-motion-pop-id"),A.contains(_)&&A.removeChild(_)}},[t]),x.jsx(b6,{isPresent:t,childRef:o,sizeRef:u,pop:i,children:i===!1?e:w.cloneElement(e,{ref:f})})}const E6=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:a,anchorX:o,anchorY:u,root:l})=>{const c=Ku(T6),f=w.useId(),h=w.useRef(n),d=w.useRef(r);ws(()=>{h.current=n,d.current=r});let m=!0,p=w.useMemo(()=>(m=!1,{id:f,initial:t,isPresent:n,custom:s,onExitComplete:g=>{c.set(g,!0);for(const y of c.values())if(!y)return;r&&r()},register:g=>(c.set(g,!1),()=>{var y;c.delete(g),!h.current&&!c.size&&((y=d.current)==null||y.call(d))})}),[n,c,r]);return i&&m&&(p={...p}),w.useMemo(()=>{c.forEach((g,y)=>c.set(y,!1))},[n]),w.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),e=x.jsx(y6,{pop:a==="popLayout",isPresent:n,anchorX:o,anchorY:u,root:l,children:e}),x.jsx(Zs.Provider,{value:p,children:e})};function T6(){return new Map}function Ig(e=!0){const t=w.useContext(Zs);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=w.useId();w.useEffect(()=>{if(e)return s(i)},[e]);const a=w.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,a]:[!0]}const Ki=e=>e.key||"";function Hf(e){const t=[];return w.Children.forEach(e,n=>{w.isValidElement(n)&&t.push(n)}),t}const v6=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:a=!1,anchorX:o="left",anchorY:u="top",root:l})=>{const[c,f]=Ig(a),h=w.useMemo(()=>Hf(e),[e]),d=a&&!c?[]:h.map(Ki),m=w.useRef(!0),p=w.useRef(h),g=Ku(()=>new Map),y=w.useRef(new Set),[v,T]=w.useState(h),[C,E]=w.useState(h);ws(()=>{a&&!c&&!C.length&&(f==null||f())},[c,a,C.length,f]),ws(()=>{m.current=!1,p.current=h;for(let A=0;A<C.length;A++){const I=Ki(C[A]);d.includes(I)?(g.delete(I),y.current.delete(I)):g.get(I)!==!0&&g.set(I,!1)}},[C,d.length,d.join("-")]);const k=[];if(h!==v){let A=[...h];for(let I=0;I<C.length;I++){const S=C[I],L=Ki(S);d.includes(L)||(A.splice(I,0,S),k.push(S))}return i==="wait"&&k.length&&(A=k),E(Hf(A)),T(h),null}const{forceRender:_}=w.useContext(Gu);return x.jsx(x.Fragment,{children:C.map(A=>{const I=Ki(A),S=a&&!c?!1:h===C||d.includes(I),L=()=>{if(y.current.has(I))return;if(g.has(I))y.current.add(I),g.set(I,!0);else return;let N=!0;g.forEach(j=>{j||(N=!1)}),N&&(_==null||_(),E(p.current),a&&(f==null||f()),r&&r())};return x.jsx(E6,{isPresent:S,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,root:l,onExitComplete:S?void 0:L,anchorX:o,anchorY:u,children:A},I)})})},Ng=w.createContext({strict:!1}),Uf={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let zf=!1;function k6(){if(zf)return;const e={};for(const t in Uf)e[t]={isEnabled:n=>Uf[t].some(r=>!!n[r])};sg(e),zf=!0}function Rg(){return k6(),o5()}function w6(e){const t=Rg();for(const n in e)t[n]={...t[n],...e[n]};sg(t)}const ra=w.createContext({});function S6(e,t){if(na(e)){const{initial:n,animate:r}=e;return{initial:n===!1||pi(n)?n:void 0,animate:pi(r)?r:void 0}}return e.inherit!==!1?t:{}}function A6(e){const{initial:t,animate:n}=S6(e,w.useContext(ra));return w.useMemo(()=>({initial:t,animate:n}),[Vf(t),Vf(n)])}function Vf(e){return Array.isArray(e)?e.join(" "):e}const El=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Lg(e,t,n){for(const r in t)!xt(t[r])&&!fg(r,n)&&(e[r]=t[r])}function C6({transformTemplate:e},t){return w.useMemo(()=>{const n=El();return xl(n,t,e),Object.assign({},n.vars,n.style)},[t])}function _6(e,t){const n=e.style||{},r={};return Lg(r,n,e),Object.assign(r,C6(e,t)),r}function I6(e,t){const n={},r=_6(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Mg=()=>({...El(),attrs:{}});function N6(e,t,n,r){const s=w.useMemo(()=>{const i=Mg();return mg(i,t,gg(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};Lg(i,e.style,e),s.style={...i,...s.style}}return s}const R6=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Ps(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||R6.has(e)}function L6(e,t){return e.startsWith("on")?!Ps(e):(t==null?void 0:t(e))??!Ps(e)}function M6(e,t,n,r){const s={};for(const i in e)i==="values"&&typeof e.values=="object"||xt(e[i])||(L6(i,r)||n===!0&&Ps(i)||!t&&!Ps(i)||e.draggable&&i.startsWith("onDrag"))&&(s[i]=e[i]);return s}const P6=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Tl(e){return typeof e!="string"||e.includes("-")?!1:!!(P6.indexOf(e)>-1||/[A-Z]/u.test(e))}function D6(e,t,n,{latestValues:r},s,i=!1,a,o){const l=(a??Tl(e)?N6:I6)(t,r,s,e),c=M6(t,typeof e=="string",i,o),f=e!==w.Fragment?{...c,...l,ref:n}:{},{children:h}=t,d=w.useMemo(()=>xt(h)?h.get():h,[h]);return w.createElement(e,{...f,children:d})}function O6({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:F6(n,r,s,e),renderState:t()}}function F6(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=fs(i[h]);let{initial:a,animate:o}=e;const u=na(e),l=rg(e);t&&l&&!u&&e.inherit!==!1&&(a===void 0&&(a=t.initial),o===void 0&&(o=t.animate));let c=n?n.initial===!1:!1;c=c||a===!1;const f=c?o:a;if(f&&typeof f!="boolean"&&!ta(f)){const h=Array.isArray(f)?f:[f];for(let d=0;d<h.length;d++){const m=ll(e,h[d]);if(m){const{transitionEnd:p,transition:g,...y}=m;for(const v in y){let T=y[v];if(Array.isArray(T)){const C=c?T.length-1:0;T=T[C]}T!==null&&(s[v]=T)}for(const v in p)s[v]=p[v]}}}return s}const Pg=e=>(t,n)=>{const r=w.useContext(ra),s=w.useContext(Zs),i=()=>O6(e,t,r,s);return n?i():Ku(i)},B6=Pg({scrapeMotionValuesFromProps:bl,createRenderState:El}),j6=Pg({scrapeMotionValuesFromProps:xg,createRenderState:Mg}),H6=Symbol.for("motionComponentSymbol");function U6(e,t,n){const r=w.useRef(n);w.useInsertionEffect(()=>{r.current=n});const s=w.useRef(null);return w.useCallback(i=>{var o;i&&((o=e.onMount)==null||o.call(e,i)),t&&(i?t.mount(i):t.unmount());const a=r.current;if(typeof a=="function")if(i){const u=a(i);typeof u=="function"&&(s.current=u)}else s.current?(s.current(),s.current=null):a(i);else a&&(a.current=i)},[t])}const Dg=w.createContext({});function or(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function z6(e,t,n,r,s,i){var T,C;const{visualElement:a}=w.useContext(ra),o=w.useContext(Ng),u=w.useContext(Zs),l=w.useContext(yl),c=l.reducedMotion,f=l.skipAnimations,h=w.useRef(null),d=w.useRef(!1);r=r||o.renderer,!h.current&&r&&(h.current=r(e,{visualState:t,parent:a,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:c,skipAnimations:f,isSVG:i}),d.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const m=h.current,p=w.useContext(Dg);m&&!m.projection&&s&&(m.type==="html"||m.type==="svg")&&V6(h.current,n,s,p);const g=w.useRef(!1);w.useInsertionEffect(()=>{m&&g.current&&m.update(n,u)});const y=n[$0],v=w.useRef(!!y&&typeof window<"u"&&!((T=window.MotionHandoffIsComplete)!=null&&T.call(window,y))&&((C=window.MotionHasOptimisedAnimation)==null?void 0:C.call(window,y)));return ws(()=>{d.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),w.useEffect(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var E;(E=window.MotionHandoffMarkAsComplete)==null||E.call(window,y)}),v.current=!1),m.enteringChildren=void 0)}),m}function V6(e,t,n,r){const{layoutId:s,layout:i,drag:a,dragConstraints:o,layoutScroll:u,layoutRoot:l,layoutAnchor:c,layoutCrossfade:f}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Og(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!a||o&&or(o),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:f,layoutScroll:u,layoutRoot:l,layoutAnchor:c})}function Og(e){if(e)return e.options.allowProjection!==!1?e.projection:Og(e.parent)}function lo(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&w6(r);const i=n?n==="svg":Tl(e),a=i?j6:B6;function o(l,c){let f;const h={...w.useContext(yl),...l,layoutId:q6(l)},{isStatic:d,isValidProp:m}=h,p=A6(l),g=a(l,d);if(!d&&typeof window<"u"){$6();const y=W6(h);f=y.MeasureLayout,p.visualElement=z6(e,g,h,s,y.ProjectionNode,i)}return x.jsxs(ra.Provider,{value:p,children:[f&&p.visualElement?x.jsx(f,{visualElement:p.visualElement,...h}):null,D6(e,l,U6(g,p.visualElement,c),g,d,t,i,m)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const u=w.forwardRef(o);return u[H6]=e,u}function q6({layoutId:e}){const t=w.useContext(Gu).id;return t&&e!==void 0?t+"-"+e:e}function $6(e,t){w.useContext(Ng).strict}function W6(e){const t=Rg(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function Y6(e,t){if(typeof Proxy>"u")return lo;const n=new Map,r=(i,a)=>lo(i,a,e,t),s=(i,a)=>r(i,a);return new Proxy(s,{get:(i,a)=>a==="create"?r:(n.has(a)||n.set(a,lo(a,void 0,e,t)),n.get(a))})}const G6=(e,t)=>t.isSVG??Tl(e)?new k5(t):new b5(t,{allowProjection:e!==w.Fragment});class K6 extends _n{constructor(t){super(t),t.animationState||(t.animationState=_5(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();ta(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let X6=0;class Q6 extends _n{constructor(){super(...arguments),this.id=X6++,this.isExitComplete=!1}update(){var i;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:a,custom:o}=this.node.getProps();if(typeof a=="string"||typeof a=="object"&&a!==null&&!Array.isArray(a)){const u=Yn(this.node,a,o);if(u){const{transition:l,transitionEnd:c,...f}=u;for(const h in f)(i=this.node.getValue(h))==null||i.jump(f[h])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Z6={animation:{Feature:K6},exit:{Feature:Q6}};function Ci(e){return{point:{x:e.pageX,y:e.pageY}}}const J6=e=>t=>hl(t)&&e(t,Ci(t));function si(e,t,n,r){return gi(e,t,J6(n),r)}const Fg=({current:e})=>e?e.ownerDocument.defaultView:null,qf=(e,t)=>Math.abs(e-t);function e4(e,t){const n=qf(e.x,t.x),r=qf(e.y,t.y);return Math.sqrt(n**2+r**2)}const $f=new Set(["auto","scroll"]);class Bg{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=m=>{this.handleScroll(m.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Xi(this.lastRawMoveEventInfo,this.transformPagePoint));const m=co(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,g=e4(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!g)return;const{point:y}=m,{timestamp:v}=gt;this.history.push({...y,timestamp:v});const{onStart:T,onMove:C}=this.handlers;p||(T&&T(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,m)},this.handlePointerMove=(m,p)=>{this.lastMoveEvent=m,this.lastRawMoveEventInfo=p,this.lastMoveEventInfo=Xi(p,this.transformPagePoint),Je.update(this.updatePoint,!0)},this.handlePointerUp=(m,p)=>{this.end();const{onEnd:g,onSessionEnd:y,resumeAnimation:v}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=co(m.type==="pointercancel"?this.lastMoveEventInfo:Xi(p,this.transformPagePoint),this.history);this.startEvent&&g&&g(m,T),y&&y(m,T)},!hl(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=s||window;const u=Ci(t),l=Xi(u,this.transformPagePoint),{point:c}=l,{timestamp:f}=gt;this.history=[{...c,timestamp:f}];const{onSessionStart:h}=n;h&&h(t,co(l,this.history));const d={passive:!0,capture:!0};this.removeListeners=wi(si(this.contextWindow,"pointermove",this.handlePointerMove,d),si(this.contextWindow,"pointerup",this.handlePointerUp,d),si(this.contextWindow,"pointercancel",this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);($f.has(r.overflowX)||$f.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},i={x:s.x-n.x,y:s.y-n.y};i.x===0&&i.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(t,s),Je.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Sn(this.updatePoint)}}function Xi(e,t){return t?{point:t(e.point)}:e}function Wf(e,t){return{x:e.x-t.x,y:e.y-t.y}}function co({point:e},t){return{point:e,delta:Wf(e,jg(t)),offset:Wf(e,t4(t)),velocity:n4(t,.1)}}function t4(e){return e[0]}function jg(e){return e[e.length-1]}function n4(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=jg(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Pt(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>Pt(t)*2&&(r=e[1]);const i=Ut(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const a={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function r4(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Ze(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Ze(n,e,r.max):Math.min(e,n)),e}function Yf(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function i4(e,{top:t,left:n,bottom:r,right:s}){return{x:Yf(e.x,n,s),y:Yf(e.y,t,r)}}function Gf(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function s4(e,t){return{x:Gf(e.x,t.x),y:Gf(e.y,t.y)}}function a4(e,t){let n=.5;const r=wt(e),s=wt(t);return s>r?n=hi(t.min,t.max-r,e.min):r>s&&(n=hi(e.min,e.max-s,t.min)),sn(0,1,n)}function o4(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const fu=.35;function u4(e=fu){return e===!1?e=0:e===!0&&(e=fu),{x:Kf(e,"left","right"),y:Kf(e,"top","bottom")}}function Kf(e,t,n){return{min:Xf(e,t),max:Xf(e,n)}}function Xf(e,t){return typeof e=="number"?e:e[t]||0}const l4=new WeakMap;class c4{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ht(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=f=>{n&&this.snapToCursor(Ci(f).point),this.stopAnimation()},a=(f,h)=>{const{drag:d,dragPropagation:m,onDragStart:p}=this.getProps();if(d&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=FN(d),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),en(y=>{let v=this.getAxisMotionValue(y).get()||0;if(rn.test(v)){const{projection:T}=this.visualElement;if(T&&T.layout){const C=T.layout.layoutBox[y];C&&(v=wt(C)*(parseFloat(v)/100))}}this.originPoint[y]=v}),p&&Je.update(()=>p(f,h),!1,!0),nu(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},o=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:d,dragDirectionLock:m,onDirectionLock:p,onDrag:g}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:y}=h;if(m&&this.currentDirection===null){this.currentDirection=f4(y),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",h.point,y),this.updateAxis("y",h.point,y),this.visualElement.render(),g&&Je.update(()=>g(f,h),!1,!0)},u=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>{const{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:c}=this.getProps();this.panSession=new Bg(t,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:u,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:r,contextWindow:Fg(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:a}=s;this.startAnimation(a);const{onDragEnd:o}=this.getProps();o&&Je.postRender(()=>o(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!Qi(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=r4(a,this.constraints[t],this.elastic[t])),i.set(a)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;t&&or(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=i4(r.layoutBox,t):this.constraints=!1,this.elastic=u4(n),s!==this.constraints&&!or(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&en(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=o4(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!or(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const i=f5(r,s.root,this.visualElement.getTransformPagePoint());let a=s4(s.layout.layoutBox,i);if(n){const o=n(l5(a));this.hasMutatedConstraints=!!o,o&&(a=og(o))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),u=this.constraints||{},l=en(c=>{if(!Qi(c,n,this.currentDirection))return;let f=u&&u[c]||{};(a===!0||a===c)&&(f={min:0,max:0});const h=s?200:1e6,d=s?40:1e7,m={type:"inertia",velocity:r?t[c]:0,bounceStiffness:h,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(c,m)});return Promise.all(l).then(o)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return nu(this.visualElement,t),r.start(ul(t,r,0,n,this.visualElement,!1))}stopAnimation(){en(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps()[n];return s||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){en(n=>{const{drag:r}=this.getProps();if(!Qi(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:o}=s.layout.layoutBox[n],u=i.get()||0;i.set(t[n]-Ze(a,o,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!or(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};en(a=>{const o=this.getAxisMotionValue(a);if(o&&this.constraints!==!1){const u=o.get();s[a]=a4({min:u,max:u},this.constraints[a])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),en(a=>{if(!Qi(a,t,null))return;const o=this.getAxisMotionValue(a),{min:u,max:l}=this.constraints[a];o.set(Ze(u,l,s[a]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;l4.set(this.visualElement,this);const t=this.visualElement.current,n=si(t,"pointerdown",l=>{const{drag:c,dragListener:f=!0}=this.getProps(),h=l.target,d=h!==t&&VN(h);c&&f&&!d&&this.start(l)});let r;const s=()=>{const{dragConstraints:l}=this.getProps();or(l)&&l.current&&(this.constraints=this.resolveRefConstraints(),r||(r=d4(t,l.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,a=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Je.read(s);const o=gi(window,"resize",()=>this.scalePositionWithinConstraints()),u=i.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(en(f=>{const h=this.getAxisMotionValue(f);h&&(this.originPoint[f]+=l[f].translate,h.set(h.get()+l[f].translate))}),this.visualElement.render())}));return()=>{o(),n(),a(),u&&u(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:a=fu,dragMomentum:o=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:o}}}function Qf(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function d4(e,t,n){const r=rf(e,Qf(n)),s=rf(t,Qf(n));return()=>{r(),s()}}function Qi(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function f4(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class h4 extends _n{constructor(t){super(t),this.removeGroupControls=zt,this.removeListeners=zt,this.controls=new c4(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||zt}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const fo=e=>(t,n)=>{e&&Je.update(()=>e(t,n),!1,!0)};class m4 extends _n{constructor(){super(...arguments),this.removePointerDownListener=zt}onPointerDown(t){this.session=new Bg(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Fg(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:fo(t),onStart:fo(n),onMove:fo(r),onEnd:(i,a)=>{delete this.session,s&&Je.postRender(()=>s(i,a))}}}mount(){this.removePointerDownListener=si(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let ho=!1;class p4 extends w.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),ho&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),hs.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:a}=r;return a&&(a.isPresent=i,t.layoutDependency!==n&&a.setOptions({...a.options,layoutDependency:n}),ho=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==i?a.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?a.promote():a.relegate()||Je.postRender(()=>{const o=a.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),fl.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;ho=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Hg(e){const[t,n]=Ig(),r=w.useContext(Gu);return x.jsx(p4,{...e,layoutGroup:r,switchLayoutGroup:w.useContext(Dg),isPresent:t,safeToRemove:n})}const g4={pan:{Feature:m4},drag:{Feature:h4,ProjectionNode:_g,MeasureLayout:Hg}};function Zf(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&Je.postRender(()=>i(t,Ci(t)))}class x4 extends _n{mount(){const{current:t}=this.node;t&&(this.unmount=jN(t,(n,r)=>(Zf(this.node,r,"Start"),s=>Zf(this.node,s,"End"))))}unmount(){}}class b4 extends _n{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=wi(gi(this.node.current,"focus",()=>this.onFocus()),gi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Jf(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&Je.postRender(()=>i(t,Ci(t)))}class y4 extends _n{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=$N(t,(s,i)=>(Jf(this.node,i,"Start"),(a,{success:o})=>Jf(this.node,a,o?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const hu=new WeakMap,mo=new WeakMap,E4=e=>{const t=hu.get(e.target);t&&t(e)},T4=e=>{e.forEach(E4)};function v4({root:e,...t}){const n=e||document;mo.has(n)||mo.set(n,{});const r=mo.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(T4,{root:e,...t})),r[s]}function k4(e,t,n){const r=v4(t);return hu.set(e,n),r.observe(e),()=>{hu.delete(e),r.unobserve(e)}}const w4={some:0,all:1};class S4 extends _n{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var u;(u=this.stopObserver)==null||u.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:w4[s]},o=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,i&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:f,onViewportLeave:h}=this.node.getProps(),d=c?f:h;d&&d(l)};this.stopObserver=k4(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(A4(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function A4({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const C4={inView:{Feature:S4},tap:{Feature:y4},focus:{Feature:b4},hover:{Feature:x4}},_4={layout:{ProjectionNode:_g,MeasureLayout:Hg}},I4={...Z6,...C4,...g4,..._4},N4=Y6(I4,G6),R4=N4;function L4(e){switch(e){case"correct":return{Icon:bu,color:"var(--brand)"};case"wrong":return{Icon:oh,color:"var(--warning)"};case"mastery":case"level-up":return{Icon:B1,color:"var(--gold)"};case"unlock":return{Icon:Hl,color:"var(--brand)"};case"streak":return{Icon:lh,color:"var(--review)"};case"energy-full":return{Icon:bo,color:"var(--brand)"};case"exam-pass":return{Icon:R1,color:"var(--exam)"};case"lesson-complete":return{Icon:hx,color:"var(--gold)"};default:return{Icon:Hl,color:"var(--brand)"}}}function M4(){const e=pu(),t=w.useRef(null),n=w.useRef([]),r=w.useRef(0),[s,i]=w.useState(null);return w.useEffect(()=>{if(e)return;const a=t.current;if(!a)return;const o=a.getContext("2d");if(!o)return;const u=()=>{const h=Math.min(window.devicePixelRatio||1,2);a.width=window.innerWidth*h,a.height=window.innerHeight*h,a.style.width=window.innerWidth+"px",a.style.height=window.innerHeight+"px",o.setTransform(h,0,0,h,0,0)};u(),window.addEventListener("resize",u);const l=()=>{o.clearRect(0,0,window.innerWidth,window.innerHeight);const h=n.current;for(let d=h.length-1;d>=0;d--){const m=h[d];if(m.x+=m.vx,m.y+=m.vy,m.vy+=.25,m.vx*=.99,m.rot+=m.vr,m.life--,m.life<=0){h.splice(d,1);continue}const p=Math.min(1,m.life/m.maxLife);o.save(),o.globalAlpha=p,o.translate(m.x,m.y),o.rotate(m.rot),o.fillStyle=m.color,m.shape==="circle"?(o.beginPath(),o.arc(0,0,m.size,0,Math.PI*2),o.fill()):o.fillRect(-m.size/2,-m.size/2,m.size,m.size*.6),o.restore()}r.current=h.length>0?requestAnimationFrame(l):0},f=go(h=>{var y,v;const d=E1(h.kind),m=Math.round(d.particles*(h.intensity??1)),p=((y=h.origin)==null?void 0:y.x)??window.innerWidth/2,g=((v=h.origin)==null?void 0:v.y)??window.innerHeight/2;for(let T=0;T<m;T++){const C=Math.PI*2*T/m+Math.random()*.3,E=3+Math.random()*6,k=d.durationMs/16*(.7+Math.random()*.5);n.current.push({x:p,y:g,vx:Math.cos(C)*E,vy:Math.sin(C)*E-2,life:k,maxLife:k,color:d.colors[T%d.colors.length],size:4+Math.random()*5,rot:Math.random()*Math.PI,vr:(Math.random()-.5)*.3,shape:Math.random()<.5?"rect":"circle"})}r.current===0&&(r.current=requestAnimationFrame(l))});return()=>{f(),window.removeEventListener("resize",u),r.current&&cancelAnimationFrame(r.current),r.current=0,n.current=[]}},[e]),w.useEffect(()=>{if(!e)return;let a=0;return go(u=>{const l=++a;i({kind:u.kind,id:l}),setTimeout(()=>{l===a&&i(null)},600)})},[e]),e?x.jsx(v6,{children:s&&(()=>{const{Icon:a,color:o}=L4(s.kind);return x.jsx(R4.div,{className:"fixed inset-0 pointer-events-none z-[60] flex items-center justify-center","aria-hidden":"true",initial:{opacity:0},animate:{opacity:.45},exit:{opacity:0},transition:{duration:.2},children:x.jsx(a,{className:"w-24 h-24",color:o,strokeWidth:1.5})},s.id)})()}):x.jsx("canvas",{ref:t,className:"fixed inset-0 pointer-events-none z-[60]","aria-hidden":"true"})}const P4=w.lazy(()=>ve(()=>import("./SettingsView-Bp35Wqa-.js"),__vite__mapDeps([35,1,2]),import.meta.url).then(e=>({default:e.SettingsView}))),D4=w.lazy(()=>ve(()=>import("./ExamView-ERfD2XYG.js"),__vite__mapDeps([36,1,2,32,31]),import.meta.url).then(e=>({default:e.ExamView}))),O4=w.lazy(()=>ve(()=>import("./CommandPalette-CdwG7gxb.js"),__vite__mapDeps([37,1,2]),import.meta.url).then(e=>({default:e.CommandPalette}))),eh=["direct","guide","practice"];function F4(){const e=We(),[t,n]=w.useState([]),[r,s]=w.useState([]),[i,a]=w.useState({}),[o,u]=w.useState(null),[l,c]=w.useState(null),[f,h]=w.useState(null),[d,m]=w.useState(null),p=w.useCallback(Y=>{m(Y instanceof Error?Y.message:String(Y)),console.error(Y)},[]),[g,y]=w.useState([]),[v,T]=w.useState(null),[C,E]=w.useState([]),[k,_]=w.useState(null),[A,I]=w.useState("map"),[S,L]=w.useState(null),[N,j]=w.useState(new Set),[P,D]=w.useState(null),H=w.useRef({active:!1,terminate:null}),[z,F]=w.useState({open:!1,pendingAction:null}),q=w.useRef(null),[R,$]=w.useState(null),[W,M]=w.useState(!1),[ee,oe]=w.useState(!0),[V,X]=w.useState(!0),Z=L_(),[be,me]=w.useState("notebook"),[te,ne]=w.useState("chat"),de=w.useRef(te);de.current=te;const ye=w.useRef(Z);w.useEffect(()=>{ye.current!==Z&&(Z===1?(oe(!0),X(!0)):Z===2&&ye.current===3&&me(C_(de.current)),ye.current=Z)},[Z]);const Ne=Z===3?te==="rail":Z===2?be==="rail":ee,tt=Z===3?te==="notebook":Z===2?be==="notebook":V,Ee=Z!==3||te==="chat",qe=()=>{Z===1?oe(Y=>!Y):Z===2?me(Y=>Y==="rail"?"notebook":"rail"):ne(Y=>Y==="rail"?"chat":"rail")},re=()=>{Z===1?X(Y=>!Y):Z===2?me(Y=>Y==="notebook"?"rail":"notebook"):ne(Y=>Y==="notebook"?"chat":"notebook")},Ae=w.useRef(null),Ve=Y=>{var fe,ke;if(Z!==3)return;const J=Y.touches[0];Ae.current={x:J.clientX,y:J.clientY,multi:Y.touches.length>1,noswipe:!!((ke=(fe=Y.target).closest)!=null&&ke.call(fe,"[data-noswipe]"))}},Ge=Y=>{const J=Ae.current;if(Ae.current=null,!J||J.multi||J.noswipe||Z!==3)return;const fe=Y.changedTouches[0],ke=__(de.current,fe.clientX-J.x,fe.clientY-J.y);ke&&ne(ke)},[Xe,Le]=w.useState(!1),[He,K]=w.useState(null),[se,xe]=w.useState([]),he=v_(f,P),Ce=kh(),_e=y_(he.activeId,Ce);w.useEffect(()=>{T1(_e.streaming)},[_e.streaming]);const[le,Te]=w.useState(""),Be=w.useCallback(Y=>{Te(Y)},[]),Ue=w.useCallback((Y,J,fe)=>{if(Y.type==="content"){if($("content"),fe){const ke=Ke=>{document.querySelector(`mark[data-note-id="${fe}"]`)?window.dispatchEvent(new CustomEvent("lookatstudy-jump-to-note",{detail:fe})):Ke>0&&setTimeout(()=>ke(Ke-1),150)};setTimeout(()=>ke(10),100)}}else if(Y.threadId!==he.activeId&&he.setActiveId(Y.threadId),fe){const ke=Ke=>{document.querySelector(`mark[data-note-id="${fe}"]`)?window.dispatchEvent(new CustomEvent("lookatstudy-jump-to-chat-note",{detail:fe})):Ke>0&&setTimeout(()=>ke(Ke-1),150)};setTimeout(()=>ke(10),120)}},[he]),[ut,St]=w.useState(null);w.useEffect(()=>{if(!P){St(null);return}let Y=!1;return ce.getNodeSummary(P,Ce).then(J=>{Y||St(J)}).catch(()=>{Y||St(null)}),()=>{Y=!0}},[P,Ce]);const Me=w.useMemo(()=>r.find(Y=>Y.id===P)??null,[r,P]),_i=w.useMemo(()=>se.map(Y=>({...Y,label:e(`starter.${Y.key}.label`),hint:e(`starter.${Y.key}.hint`),message:e(`starter.${Y.key}.message`,{title:(Me==null?void 0:Me.title)??""})})),[se,Me,e]),Kt=w.useRef(null),Ii=w.useCallback(()=>{var Y;Me&&((Y=Kt.current)==null||Y.call(Kt,e("chat.action.startLearningPrompt",{title:Me.title}),e("chat.action.startLearning",{title:Me.title})))},[Me,e]),Vt=w.useCallback(async()=>{try{const[Y,J,fe,ke,Ke,Rt]=await Promise.all([ce.listCourses(),ce.getStreak(),ce.listSouls(),ce.getActiveSoul(),ce.getXpStatus(),ce.getDueReviews()]);n(Y),u(J),E(fe),c(Ke),_(ke),j(new Set(Rt)),f&&!Y.some(qg=>qg.id===f)&&(h(null),D(null),s([]),a({}),L(null),y([]),T(null))}catch(Y){m(Y instanceof Error?Y.message:String(Y))}},[f]);w.useEffect(()=>{Vt()},[Vt]);const Zn=w.useCallback(async()=>{try{K(await ce.isAgentReady())}catch{K({ready:!1,missing:e("error.checkReadyFailed")})}},[e]);w.useEffect(()=>{Zn();const Y=()=>Zn();return window.addEventListener("llm-config-changed",Y),()=>window.removeEventListener("llm-config-changed",Y)},[Zn]);const Cr=w.useRef(0),Re=w.useRef(0);w.useEffect(()=>{Cr.current=(l==null?void 0:l.todayXp)??0},[l]),w.useEffect(()=>{Re.current=(o==null?void 0:o.currentStreak)??0},[o]);const $e=w.useCallback(async()=>{const Y=r.filter(ke=>ke.type==="lesson"||ke.type==="exam"),J=await Promise.all(Y.map(async ke=>{const Ke=await ce.getProgress(ke.id);return[ke.id,Ke]})),fe={};for(const[ke,Ke]of J)Ke&&(fe[ke]=Ke);a(fe)},[r]);w.useEffect(()=>ce.on("state:changed",J=>{J==="xp"?ce.getXpStatus().then(fe=>{c(fe),Cr.current<100&&fe.todayXp>=100&&Zi("energy-full")}).catch(()=>{}):J==="streak"?ce.getStreak().then(fe=>{u(fe),fe.currentStreak>Re.current&&Zi("streak")}).catch(()=>{}):J==="mastery"&&(Zi("mastery"),Vt(),$e())}),[Vt,$e]),w.useEffect(()=>{f&&(ce.getCourseLanguages(f).then(y).catch(()=>y([])),ce.getCourseLanguage(f).then(T).catch(()=>T(null)))},[f]),w.useEffect(()=>{f&&(ce.getCourseTree(f,v??void 0).then(async Y=>{s(Y);const J=Y.filter(Ke=>Ke.type==="lesson"||Ke.type==="exam"),fe=await Promise.all(J.map(async Ke=>{const Rt=await ce.getProgress(Ke.id);return[Ke.id,Rt]})),ke={};for(const[Ke,Rt]of fe)Rt&&(ke[Ke]=Rt);a(ke)}).catch(p),ce.getDashboard(f).then(L).catch(p))},[f,v,p]),w.useEffect(()=>{if(!P){xe([]);return}ce.getStarterPrompts(P).then(xe).catch(()=>xe([]))},[P]),w.useEffect(()=>{const Y=J=>{if(J.key==="Escape"&&he.activeId&&(ce.abortAgentChatThread(he.activeId).catch(()=>{}),M(!1),Le(!1)),(J.ctrlKey||J.metaKey)&&J.key==="k"&&(J.preventDefault(),Le(fe=>!fe)),(J.ctrlKey||J.metaKey)&&J.key==="b"&&(J.preventDefault(),qe()),(J.ctrlKey||J.metaKey)&&J.key==="Tab"){if(J.preventDefault(),H.current.active)return;const fe=he.threads;if(fe.length>1){const ke=fe.findIndex(Rt=>Rt.id===he.activeId),Ke=J.shiftKey?(ke-1+fe.length)%fe.length:(ke+1)%fe.length;he.setActiveId(fe[Ke].id)}}(!J.target||!J.target.matches("input, textarea, select"))&&(J.key==="1"&&I("map"),J.key==="2"&&I("import"),J.key==="s"&&(J.ctrlKey||J.metaKey)&&(J.preventDefault(),M(!0)))};return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[P]);const it=w.useCallback(async Y=>{var J;try{if(Y.type==="exam"){D(Y.id),$("content");return}if(((J=i[Y.id])==null?void 0:J.status)==="locked"){D(null);return}await ce.markNodeAttempted(Y.id);const fe=await ce.getStreak();await $e(),u(fe),D(Y.id),$("content"),aa(!1)}catch(fe){p(fe)}},[i,$e,p]),nt=w.useCallback(Y=>{if(H.current.active){F({open:!0,pendingAction:Y});return}Y()},[]),ft=w.useCallback(Y=>{if(H.current.active&&Y.id!==P){F({open:!0,pendingAction:()=>void it(Y)});return}it(Y)},[it,P]),Se=w.useCallback(Y=>{H.current=Y},[]),ze=w.useCallback(async()=>{const Y=z.pendingAction;F({open:!1,pendingAction:null});const J=H.current;if(H.current={active:!1,terminate:null},J.active&&J.terminate)try{await J.terminate()}catch{}Y==null||Y()},[z.pendingAction]);Os(q,z.open),w.useEffect(()=>{if(!z.open)return;const Y=J=>{J.key==="Escape"&&F({open:!1,pendingAction:null})};return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[z.open]);const Pe=async Y=>{try{await ce.setActiveSoul(Y),_(Y)}catch(J){p(J)}},lt=w.useCallback(async(Y,J,fe)=>{try{await ce.applyProposal(Y),_e.markProposalStatus(J,fe,!0)}catch(ke){p(ke)}},[_e,p]),Ye=w.useCallback(async(Y,J,fe)=>{try{await ce.rejectProposal(Y),_e.markProposalStatus(J,fe,!1)}catch(ke){p(ke)}},[_e,p]),st=t.find(Y=>Y.id===f),At=w.useMemo(()=>{const Y=new Set(r.map(J=>J.id));return new Set([...N].filter(J=>Y.has(J)))},[N,r]),Xt=At.size,Ni=w.useMemo(()=>r.filter(Y=>Y.type==="section").sort((Y,J)=>Y.orderIdx-J.orderIdx),[r]),Ri=w.useMemo(()=>{const Y=eh.map(fe=>C.find(ke=>ke.name===fe)).filter(fe=>!!fe),J=C.filter(fe=>!eh.includes(fe.name));return[...Y,...J]},[C]),bt=y3(f),Li=T3(),Fe=$u();w.useEffect(()=>ce.on("exam:status",J=>{if(J.status!=="ready"||J.nodeId===P)return;const fe=r.find(ke=>ke.id===J.nodeId);fe&&Fe.show(e("exam.ready.toast",{title:fe.title}),{duration:4e3})}),[P,r,Fe,e]);const _r=w.useCallback(async Y=>{const J=t.find(fe=>fe.id===Y);try{await ce.deleteCourse(Y),Fe.show(e("import.deleted",{title:(J==null?void 0:J.title)??Y}),{duration:3e3}),Vt()}catch(fe){p(fe)}},[t,Vt,p,Fe,e]),mn=w.useCallback(async(Y,J,fe)=>{if(!Y.trim()||_e.streaming)return;if(!he.activeId){const Ke=await he.ensureThreadForSend(Y,J);if(Ke){_e.send(Y,Ke,J,fe);return}Fe.show(e("toast.threadCreateFailed"));return}const ke=he.activeThread;ke&&!ke.title&&he.update(ke.id,{title:(J??Y).trim()}),_e.send(Y,void 0,J,fe)},[_e,he,Fe,e]),Jn=w.useRef(_e.streaming);Jn.current=_e.streaming;const Ir=w.useCallback(Y=>{const J=T_(Y,e),fe=E_(Y,e),ke=Ke=>{var Rt;if(!Jn.current){(Rt=Kt.current)==null||Rt.call(Kt,J,fe);return}Ke>0&&setTimeout(()=>ke(Ke-1),2e3)};ke(10)},[e]);Kt.current=mn;const Ct=new Set(["concept_map","diagram","compare_table","code_walkthrough"]),Qt=w.useMemo(()=>{const Y=kd(_e.messages).filter(fe=>{var ke;return Ct.has(((ke=fe.output)==null?void 0:ke.artifactType)??"")});if(Y.length)return Y[Y.length-1];const J=bt.items.filter(fe=>Ct.has(fe.artifactType)).map(fe=>{try{return{id:fe.id,toolName:fe.artifactType,output:JSON.parse(fe.data)}}catch{return null}}).filter(fe=>fe!==null);return J.length?J[J.length-1]:null},[_e.messages,bt.items]),Mi=w.useRef(new Set);w.useEffect(()=>{!Qt||Mi.current.has(Qt.id)||(Mi.current.add(Qt.id),_e.streaming&&$("board"))},[Qt,_e.streaming]);const zg=w.useMemo(()=>_e.messages.reduce((Y,J)=>Y+J.parts.reduce((fe,ke)=>ke.type==="text"?fe+yh(ke.text):fe,0),0),[_e.messages]),vl=w.useRef(!1);w.useEffect(()=>{Xt>0&&!vl.current&&(vl.current=!0,Fe.show(e("review.nudge",{n:Xt}),{duration:4e3}))},[Xt,Fe,e]);const kl=w.useMemo(()=>kd(_e.messages),[_e.messages]),wl=w.useRef(new Set);w.useEffect(()=>{for(const Y of kl){const J=Y.output;if(!J||!J.artifactType)continue;const fe=`${J.artifactType}:${JSON.stringify(J)}`;wl.current.has(fe)||(wl.current.add(fe),bt.save({nodeId:P,artifactType:J.artifactType,title:J.title??null,data:J}),Fe.show(e("toast.artifactSaved"),{duration:3e3}))}},[kl,bt,P,Fe,e]),w.useEffect(()=>{A!=="map"&&$(null)},[A]);const[Vg,ia]=w.useState(!1),[sa,aa]=w.useState(!1),Sl=(Me==null?void 0:Me.type)==="exam";return w.useEffect(()=>{Sl&&window.dispatchEvent(new CustomEvent("companion-exam-enter"))},[Sl]),w.useEffect(()=>{v1(sa)},[sa]),x.jsxs("div",{className:"h-[var(--app-height,100vh)] flex flex-col bg-surface-1 text-neutral-900 dark:text-neutral-100 overflow-hidden",children:[x.jsx(j4,{streak:o,xp:l,fontSize:Li.size,onFontBump:Li.bump,onOpenSettings:()=>M(!0),leftVisible:Ne,rightVisible:tt,onToggleLeft:qe,onToggleRight:re,tier:Z,bottomBar:Z===3?x.jsx("nav",{className:"inline-flex items-center gap-0.5 p-0.5 rounded-lg bg-ink/5 ring-1 ring-inset ring-[var(--border)]","data-testid":"t3-pane-switcher",role:"tablist","aria-label":e("pane.switcher"),children:[{k:"rail",icon:fh,label:e("pane.map"),testid:"t3-btn-rail"},{k:"chat",icon:X1,label:e("pane.chat"),testid:"t3-btn-chat"},{k:"notebook",icon:tx,label:e("pane.notes"),testid:"t3-btn-notebook"}].map(({k:Y,icon:J,label:fe,testid:ke})=>x.jsx("button",{role:"tab","aria-selected":te===Y,"aria-label":fe,"data-testid":ke,"data-tooltip":fe,onClick:()=>ne(Y),className:`w-8 h-7 flex items-center justify-center rounded-md transition-colors ${te===Y?"bg-brand/20 text-brand":"text-ink-muted active:bg-ink/10"}`,children:x.jsx(J,{className:"w-4 h-4"})},Y))}):void 0}),d&&x.jsx(z4,{message:d,onClose:()=>m(null)}),x.jsxs("div",{className:"flex-1 flex min-h-0 min-w-0",onTouchStart:Ve,onTouchEnd:Ge,children:[Ne&&x.jsx(mb,{fullWidth:Z===3,view:A,onViewChange:I,courseTitle:(st==null?void 0:st.title)??null,courseId:f,courses:t,sections:Ni,tree:r,progressMap:i,selectedNodeId:P,dueCount:Xt,dueNodeIds:At,overallMastery:(S==null?void 0:S.overallMastery)??0,streak:(o==null?void 0:o.currentStreak)??0,streaming:_e.streamingThreadIds.length>0,streamingNodeIds:_e.streamingNodeIds,onJumpNode:Y=>{const J=r.find(fe=>fe.id===Y);J&&ft(J),Z===3&&ne("chat")},onOpenReview:()=>ia(!0),onSelectCourse:Y=>nt(()=>{h(Y),Vt()}),onDeleteCourse:Y=>nt(()=>{_r(Y)}),onCoursesChanged:()=>{Vt()},availableLanguages:g,currentLocale:v,onLocaleChange:async Y=>{f&&(await ce.setCourseLanguage(f,Y),T(Y))}}),x.jsxs(x.Fragment,{children:[Ee&&x.jsx("div",{className:"relative flex flex-col h-full bg-surface-1 shrink-0 min-w-0 motion-safe:transition-[width] motion-safe:duration-200",style:Z===3?{flex:1}:tt?{width:"clamp(480px, 36vw, 800px)"}:{flex:1},"data-testid":"chat-panel",children:f?(Me==null?void 0:Me.type)==="exam"?x.jsx(w.Suspense,{fallback:null,children:x.jsx(D4,{examNode:Me,locale:Ce,onSessionChange:Se,paused:z.open,onExamCompleted:()=>{ce.getProgress(Me.id).then(Y=>{Y&&a(J=>({...J,[Me.id]:Y}))})}})}):x.jsxs(x.Fragment,{children:[x.jsx(k_,{threads:he.threads,activeThread:he.activeThread,focusNodeTitle:(Me==null?void 0:Me.title)??null,streamingThreadIds:_e.streamingThreadIds,onPickThread:Y=>{he.setActiveId(Y)},onCreate:()=>{he.create({title:null}),Fe.show(e("toast.threadCreated"))},onRename:(Y,J)=>{he.update(Y,{title:J}),Fe.show(e("toast.threadRenamed"))},onArchive:Y=>{he.update(Y,{status:"archived"}),Fe.show(e("toast.threadArchived"),{duration:5e3,action:{label:e("action.undo"),onClick:()=>he.update(Y,{status:"active"})}})},onDelete:Y=>{const J=he.removeWithUndo(Y);J&&(Fe.show(`${e("toast.threadDeleted")}${J.title?`「${J.title}」`:""}`,{duration:5e3,action:{label:e("action.undo"),onClick:()=>{he.restore(J),Fe.show(e("toast.restored"))}}}),setTimeout(()=>{ce.threadDelete(J.id).catch(()=>{})},5500))}}),x.jsx(A3,{messages:_e.messages,streaming:_e.streaming,onApplyProposal:lt,onRejectProposal:Ye,summary:ut,onStartLearning:He!=null&&He.ready?Ii:void 0,agentReady:(He==null?void 0:He.ready)??!1,onGotoSettings:()=>M(!0),hasNode:!!Me,selectedNodeId:P,threadId:he.activeId,onPickQuizAction:Y=>{mn(Y)},onQuizCompleted:Ir,cardMode:Z===3,chatNotes:bt.items.filter(Y=>Y.artifactType==="user_note"&&Y.sourceAnchor),onSaveChatNote:(Y,J,fe,ke)=>{!Me||!he.activeId||(bt.saveUserNote({nodeId:Me.id,text:Y,sourceType:"chat",sourceAnchor:{type:"chat",threadId:he.activeId,msgId:J,startOffset:fe,endOffset:ke}}),Fe.show(e("toast.noteSaved"),{duration:2e3}))}}),x.jsx(X3,{nodeId:P,agentReady:(He==null?void 0:He.ready)??!1,streaming:_e.streaming,souls:Ri,activeSoul:k,starterPrompts:_e.messages.length>0?_i:[],onPickSoul:Pe,onSend:mn,onStop:_e.stop,onLogFriction:P?(Y,J)=>{ce.logFriction(P,Y,J),Fe.show(e("chat.friction.saved"),{duration:2500})}:void 0,onGotoSettings:()=>M(!0),insertText:le,historyTokens:zg})]}):x.jsx("div",{className:"flex-1 flex items-center justify-center px-6","data-testid":"chat-no-course",children:x.jsxs("div",{className:"text-center max-w-sm",children:[x.jsx("div",{className:"text-5xl mb-4 opacity-30",children:"📚"}),x.jsx("div",{className:"text-title font-bold text-ink mb-2",children:e("course.empty.title")}),x.jsx("div",{className:"text-body text-ink-muted leading-relaxed",children:e("course.empty.desc")})]})})}),tt&&x.jsx("main",{className:Z===3?"flex-1 min-w-0 bg-surface-2":"flex-1 min-w-[440px] bg-surface-2","data-testid":Z===3?"notebook-pane-full":void 0,children:x.jsx(m3,{selectedNode:Me,items:bt.items,loading:bt.loading,forceTab:R,canvasArtifact:Qt,onUserTabChange:()=>$(null),onRemove:Y=>{bt.remove(Y),Fe.show(e("toast.noteDeleted"))},onTogglePin:Y=>{bt.togglePin(Y)},onRecordQuizResult:(Y,J)=>{bt.recordQuizResult(Y,J)},onUpdateNoteComment:(Y,J)=>{bt.updateUserNoteComment(Y,J)},onSaveContentNote:(Y,J)=>{Me&&(bt.saveUserNote({nodeId:Me.id,text:Y,sourceType:"content",sourceAnchor:J}),Fe.show(e("toast.noteSaved"),{duration:2e3}))},onJumpToSource:Ue,onQuoteToChat:Be,locale:v,isReviewing:sa,onReviewDone:()=>aa(!1)})})]})]}),W&&x.jsx(H4,{onClose:()=>M(!1)}),Vg&&x.jsx(U4,{onClose:()=>ia(!1),tree:r,dashboard:S,progressMap:i,onPickNode:Y=>{nt(()=>{D(Y),$("content"),ia(!1),aa(!0)})}}),z.open&&x.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50","data-testid":"exam-leave-modal",children:x.jsxs("div",{ref:q,className:"w-[min(400px,90vw)] rounded-2xl bg-surface-0 p-6 shadow-elevated border border-warning/40",role:"dialog","aria-modal":"true","aria-label":e("exam.leave.title"),children:[x.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[x.jsx(Eu,{className:"w-5 h-5 text-warning shrink-0"}),x.jsx("span",{className:"text-title font-bold text-ink",children:e("exam.leave.title")})]}),x.jsx("div",{className:"text-body text-ink-muted mb-5 leading-relaxed",children:e("exam.leave.message")}),x.jsxs("div",{className:"flex justify-end gap-2",children:[x.jsx("button",{className:"btn-3d-neutral px-4 py-1.5 text-body",onClick:()=>F({open:!1,pendingAction:null}),"data-testid":"exam-leave-cancel",children:e("exam.leave.cancel")}),x.jsx("button",{className:"btn-3d-brand px-4 py-1.5 text-body",style:{background:"var(--warning)",boxShadow:"0 3px 0 0 var(--warning-dark)"},onClick:()=>void ze(),"data-testid":"exam-leave-confirm",children:e("exam.leave.confirm")})]})]})}),Xe&&x.jsx(w.Suspense,{fallback:null,children:x.jsx(O4,{onClose:()=>Le(!1),onPick:Y=>{Le(!1),B4(Y)},hasNode:!!P})}),x.jsx(Sb,{}),x.jsx(M4,{}),x.jsx(d_,{courseId:f})]})}function B4(e){window.dispatchEvent(new CustomEvent("lookatstudy-command",{detail:e}))}function j4({streak:e,xp:t,fontSize:n,onFontBump:r,onOpenSettings:s,leftVisible:i,rightVisible:a,onToggleLeft:o,onToggleRight:u,tier:l,bottomBar:c}){const f=We();return c?x.jsx("header",{className:"app-header shrink-0",children:x.jsxs("div",{className:"flex items-center h-12 px-4",children:[x.jsx("div",{className:"flex-1 flex items-center min-w-0",children:t&&x.jsxs("div",{className:"flex items-center gap-1 shrink-0","data-testid":"xp-bar",title:f("header.energy"),children:[x.jsx(bo,{className:`w-3.5 h-3.5 text-brand ${t.todayXp>=100?"energy-breathe":""}`,fill:t.todayXp>=100?"currentColor":"none","aria-hidden":"true"}),x.jsx("span",{className:"text-label font-bold tabular-nums text-brand",children:t.todayXp})]})}),c,x.jsx("div",{className:"flex-1 flex items-center justify-end",children:x.jsx("button",{onClick:s,"data-testid":"header-settings","aria-label":f("header.settings"),className:"text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-300 w-8 h-8 flex items-center justify-center rounded-lg hover:bg-neutral-200 dark:hover:bg-neutral-800/50 transition-colors",title:f("header.settings"),children:x.jsx(ms,{className:"w-4 h-4"})})})]})}):x.jsx("header",{className:"app-header shrink-0 flex flex-col",children:x.jsxs("div",{className:"flex items-center pt-2.5 pb-3 px-6 justify-between",children:[x.jsx("div",{className:"flex items-center gap-2 min-w-0",children:x.jsxs("h1",{className:"text-body font-extrabold tracking-tight text-neutral-900 dark:text-neutral-100 select-none min-w-0 truncate",children:["Lookat",x.jsx("span",{className:"text-brand",children:"Study"})]})}),x.jsxs("div",{className:"flex items-center gap-3",children:[l!==3&&x.jsxs("div",{className:"flex items-center gap-0.5",children:[x.jsx("button",{onClick:o,"data-testid":"layout-toggle-left",className:`w-7 h-7 flex items-center justify-center rounded-md transition-colors ${i?"text-neutral-500 hover:bg-neutral-200 dark:text-neutral-300 dark:hover:bg-neutral-800":"text-neutral-600 bg-neutral-200 dark:bg-neutral-800"}`,title:f("header.toggleLeft"),children:x.jsx(Z1,{className:"w-4 h-4"})}),x.jsx("button",{onClick:u,"data-testid":"layout-toggle-right",className:`w-7 h-7 flex items-center justify-center rounded-md transition-colors ${a?"text-neutral-500 hover:bg-neutral-200 dark:text-neutral-300 dark:hover:bg-neutral-800":"text-neutral-600 bg-neutral-200 dark:bg-neutral-800"}`,title:f("header.toggleRight"),children:x.jsx(J1,{className:"w-4 h-4"})})]}),l!==3&&x.jsxs("div",{className:"flex items-center gap-0.5","data-testid":"font-size-control",children:[x.jsx("button",{onClick:()=>r("down"),disabled:n==="small","data-testid":"font-smaller",className:"text-label w-7 h-7 flex items-center justify-center rounded-md text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200 hover:bg-ink/5 disabled:opacity-20 disabled:cursor-not-allowed transition-colors",title:f("header.font.smaller"),children:"A-"}),x.jsx("button",{onClick:()=>r("up"),disabled:n==="large","data-testid":"font-larger",className:"text-body w-7 h-7 flex items-center justify-center rounded-md text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200 hover:bg-ink/5 disabled:opacity-20 disabled:cursor-not-allowed transition-colors",title:f("header.font.larger"),children:"A+"})]}),t&&x.jsxs("div",{className:"flex items-center gap-1.5","data-testid":"xp-bar",title:f("header.energy"),children:[x.jsx(bo,{className:`w-3.5 h-3.5 text-brand ${t.todayXp>=100?"energy-breathe":""}`,fill:t.todayXp>=100?"currentColor":"none","aria-hidden":"true"}),x.jsx("div",{className:"w-16 h-2 bg-neutral-200 dark:bg-neutral-800 rounded-full overflow-hidden",children:x.jsx("div",{className:"h-full rounded-full bg-brand transition-all duration-500",style:{width:`${Math.min(100,Math.max(3,t.todayXp))}%`}})}),x.jsx("span",{className:"text-label font-bold tabular-nums text-brand",children:t.todayXp})]}),t&&x.jsx("div",{className:"flex items-center gap-1 px-2 py-0.5 rounded-full bg-brand/10","data-testid":"level-badge",title:f("header.level.title"),children:x.jsxs("span",{className:"text-label font-bold text-brand",children:["Lv.",t.level]})}),e&&x.jsx(V4,{streak:e}),x.jsx("button",{onClick:s,"data-testid":"header-settings",className:"text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-300 w-8 h-8 flex items-center justify-center rounded-lg hover:bg-neutral-200 dark:hover:bg-neutral-800/50 transition-colors",title:f("header.settings"),children:x.jsx(ms,{className:"w-4 h-4"})})]})]})})}function H4({onClose:e}){const t=We(),n=w.useRef(null);return Os(n,!0),x.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end","data-testid":"settings-drawer",children:[x.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:e}),x.jsxs("div",{ref:n,role:"dialog","aria-modal":"true","aria-label":t("settings.title"),className:"relative w-full max-w-lg h-full bg-surface-0 border-l border-[var(--border)] shadow-elevated flex flex-col",children:[x.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)] shrink-0",children:[x.jsx("h2",{className:"text-body font-bold",children:t("settings.title")}),x.jsx("button",{onClick:e,"data-testid":"settings-close","aria-label":t("action.close"),className:"text-ink-muted hover:text-ink-strong w-8 h-8 flex items-center justify-center rounded-lg hover:bg-surface-3",children:"✕"})]}),x.jsx("div",{className:"flex-1 overflow-y-auto",children:x.jsx(w.Suspense,{fallback:null,children:x.jsx(P4,{})})})]})]})}function U4({onClose:e,tree:t,onPickNode:n,dashboard:r,progressMap:s}){const i=We(),a=w.useRef(null);Os(a,!0);const[o,u]=w.useState([]);w.useEffect(()=>{ce.getAllSrsItems().then(T=>u(T)).catch(()=>u([]))},[]);const l=w.useMemo(()=>new Map(o.map(T=>[T.nodeId,T])),[o]),c=w.useMemo(()=>{const T=new Map(t.map(E=>[E.id,E])),C=o.filter(E=>T.has(E.nodeId));return{overdue:C.filter(E=>E.overdue),short:C.filter(E=>!E.overdue&&E.intervalDays>0&&E.intervalDays<=7),long:C.filter(E=>!E.overdue&&E.intervalDays>7),inactive:C.filter(E=>E.repetitions===0&&!E.overdue)}},[o,t]),f=w.useMemo(()=>t.filter(C=>C.type==="section"&&(C.world??"study")==="study").sort((C,E)=>C.orderIdx-E.orderIdx).map(C=>({section:C,lessons:t.filter(E=>E.parentId===C.id&&E.type==="lesson").sort((E,k)=>E.orderIdx-k.orderIdx)})),[t]),h=w.useMemo(()=>{const T=new Map;for(const C of(r==null?void 0:r.sections)??[])T.set(C.sectionId,C.avgMastery);return T},[r]),d=w.useMemo(()=>t.filter(T=>{var E;const C=(E=s[T.id])==null?void 0:E.status;return T.type==="lesson"&&(T.world??"study")==="study"&&(C==="in_progress"||C==="mastered")}),[t,s]),[m,p]=w.useState(new Set),g=T=>p(C=>{const E=new Set(C);return E.has(T)?E.delete(T):E.add(T),E}),y=T=>{const C=l.get(T);return C?C.overdue?{color:"bg-review",title:i("review.quadrant.overdue")}:C.intervalDays>0&&C.intervalDays<=7?{color:"bg-gold",title:i("review.quadrant.short")}:C.intervalDays>7?{color:"bg-brand",title:i("review.quadrant.long")}:null:null},v=c.overdue.length>0;return x.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end","data-testid":"review-drawer",children:[x.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:e}),x.jsxs("div",{ref:a,role:"dialog","aria-modal":"true","aria-label":i("review.title"),className:"relative w-full max-w-md h-full bg-surface-0 border-l border-[var(--border)] shadow-elevated flex flex-col",children:[x.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)] shrink-0",children:[x.jsxs("h2",{className:"text-body font-bold flex items-center gap-1.5",children:[x.jsx(kn,{className:"w-4 h-4","aria-hidden":"true"})," ",i("review.title")]}),x.jsx("button",{onClick:e,"data-testid":"review-close","aria-label":i("action.close"),className:"text-ink-muted hover:text-ink-strong w-8 h-8 flex items-center justify-center rounded-lg hover:bg-surface-3",children:"✕"})]}),x.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-5","data-testid":"review-panel",children:[d.length>0&&x.jsxs("button",{onClick:()=>{const T=d[Math.floor(Math.random()*d.length)];T&&n(T.id)},"data-testid":"review-interleave",className:"btn-3d-neutral w-full py-2.5 text-body flex items-center justify-center gap-1.5",children:[x.jsx(lx,{className:"w-4 h-4"}),i("review.interleave")]}),o.length>0&&x.jsxs("div",{children:[x.jsx("div",{className:"text-caption font-bold text-ink-muted uppercase tracking-wider mb-2",children:i("review.srsHint")}),x.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:[{items:c.overdue,label:i("review.quadrant.overdue"),dot:"bg-review"},{items:c.short,label:i("review.quadrant.short"),dot:"bg-gold"},{items:c.long,label:i("review.quadrant.long"),dot:"bg-brand"},{items:c.inactive,label:i("review.quadrant.inactive"),dot:"bg-ink-faint"}].filter(T=>T.items.length>0).map(T=>x.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 rounded-full bg-surface-3",children:[x.jsx("span",{className:`w-2 h-2 rounded-full ${T.dot}`}),x.jsx("span",{className:"text-label text-ink-muted",children:T.label}),x.jsx("span",{className:"text-label font-extrabold text-ink-strong tabular-nums",children:T.items.length})]},T.label))}),v&&x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"text-label text-ink-faint mb-1.5",children:i("review.overdueQuickHint")}),x.jsx("div",{className:"flex flex-wrap gap-1.5",children:c.overdue.slice(0,8).map(T=>{const C=t.find(E=>E.id===T.nodeId);return C?x.jsx("button",{onClick:()=>n(T.nodeId),"data-testid":`review-overdue-${T.nodeId.slice(0,8)}`,className:"px-2 py-1 rounded-full bg-review/10 ring-1 ring-review/20 text-label text-review font-bold hover:bg-review/20 transition-colors truncate max-w-[140px]",children:C.title},T.nodeId):null})})]})]}),f.length>0&&x.jsxs("div",{children:[x.jsx("div",{className:"text-caption font-bold text-ink-muted uppercase tracking-wider mb-2",children:i("review.myProgress")}),x.jsx("div",{className:"space-y-1",children:f.map(({section:T,lessons:C})=>{const E=Math.round((h.get(T.id)??0)*100),k=m.has(T.id),_=C.filter(A=>{var S;const I=(S=s[A.id])==null?void 0:S.status;return I==="in_progress"||I==="mastered"});return x.jsxs("div",{children:[x.jsxs("button",{onClick:()=>g(T.id),className:"w-full flex items-center gap-2 p-2 rounded-lg hover:bg-surface-3 transition-colors",children:[k?x.jsx(xu,{className:"w-3.5 h-3.5 text-ink-muted shrink-0"}):x.jsx(M1,{className:"w-3.5 h-3.5 text-ink-muted shrink-0"}),x.jsx("span",{className:"text-body text-ink-strong font-bold truncate flex-1 text-left",children:T.title}),_.length>0&&x.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[x.jsx("div",{className:"w-16 h-1.5 bg-surface-3 rounded-full overflow-hidden",children:x.jsx("div",{className:`h-full rounded-full ${E>=100?"bg-gold":"bg-brand"}`,style:{width:`${Math.max(3,E)}%`}})}),x.jsxs("span",{className:"text-label tabular-nums text-ink-muted w-8 text-right",children:[E,"%"]})]})]}),k&&x.jsx("div",{className:"ml-5 mt-0.5 mb-1 space-y-0.5","data-testid":"review-lesson-list",children:C.length===0?x.jsx("div",{className:"text-label text-ink-faint py-1.5 pl-1",children:"—"}):C.map(A=>{const I=s[A.id],S=I?Math.round((I.mastery??0)*100):null,L=y(A.id),N=(I==null?void 0:I.status)==="in_progress"||(I==null?void 0:I.status)==="mastered";return x.jsxs("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded-lg transition-colors ${(L==null?void 0:L.color)==="bg-review"?"bg-review/8":"hover:bg-surface-3"}`,children:[L?x.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${L.color} shrink-0`,title:L.title}):x.jsx("span",{className:"w-1.5 h-1.5 shrink-0"}),x.jsx("span",{className:`text-label truncate flex-1 ${N?"text-ink-strong":"text-ink-faint"}`,children:A.title}),S!==null&&x.jsxs("span",{className:"text-label tabular-nums text-ink-muted shrink-0 w-8 text-right",children:[S,"%"]}),N&&x.jsx("button",{onClick:()=>n(A.id),"data-testid":`review-lesson-${A.id.slice(0,8)}`,className:"shrink-0 px-2 py-0.5 rounded-md bg-brand/15 text-brand text-caption font-bold hover:bg-brand/25 transition-colors",children:i("review.reviewLesson")})]},A.id)})})]},T.id)})})]}),r&&r.frictionByNode.length>0&&x.jsxs("div",{children:[x.jsx("div",{className:"text-caption font-bold text-review uppercase tracking-wider mb-1.5",children:i("dashboard.mini.struggle")}),r.frictionByNode.map(T=>x.jsxs("button",{onClick:()=>n(T.nodeId),className:"flex items-center gap-2 py-0.5 w-full text-left hover:bg-surface-3 rounded px-1",children:[x.jsxs("span",{className:"text-label text-review font-bold tabular-nums",children:[T.count,"×"]}),x.jsx("span",{className:"text-label text-ink-strong truncate flex-1",children:T.title})]},T.nodeId))]}),d.length===0&&o.length===0&&f.length===0&&x.jsxs("div",{className:"text-center py-16","data-testid":"review-empty",children:[x.jsx("div",{className:"text-4xl mb-3 opacity-30",children:"📖"}),x.jsx("div",{className:"text-body text-ink-muted",children:i("review.empty.title")}),x.jsx("div",{className:"text-label text-ink-faint mt-1",children:i("review.empty.desc")})]})]})]})]})}function z4({message:e,onClose:t}){const n=We();return x.jsxs("div",{role:"alert","data-testid":"error-banner",className:"px-4 py-2 border-b border-warning-tint-border text-warning text-body flex items-center justify-between",style:{backgroundColor:"var(--warning-tint)"},children:[x.jsxs("span",{children:["⚠️ ",e]}),x.jsx("button",{className:"ml-3 underline text-warning-light",onClick:t,children:n("action.close")})]})}function V4({streak:e}){const t=We();return x.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-full border border-review/20",style:{backgroundColor:"var(--review-tint)"},"data-testid":"streak-badge",title:t("streak.title",{n:e.currentStreak,m:e.longestStreak}),children:[x.jsx(lh,{className:"w-4 h-4 text-review flame-flicker"}),x.jsx("span",{className:"text-body font-extrabold text-review",children:e.currentStreak}),e.freezeCount>0&&x.jsxs("span",{className:"flex items-center gap-0.5 ml-0.5","data-testid":"freeze-badge",title:t("streak.freeze.title",{n:e.freezeCount}),children:[x.jsx(ux,{className:"w-3 h-3 text-review/80","aria-hidden":"true"}),x.jsx("span",{className:"text-label font-bold text-review/80",children:e.freezeCount})]})]})}window.addEventListener("error",e=>{var t;console.error("[FATAL renderer error]",((t=e.error)==null?void 0:t.stack)||e.message)});window.addEventListener("unhandledrejection",e=>{var t;console.error("[FATAL unhandled rejection]",((t=e.reason)==null?void 0:t.stack)||e.reason)});function q4({rejected:e}){const t=navigator.language.startsWith("zh"),[n,r]=gu.useState(""),s=i=>{i.preventDefault();const a=n.trim();if(!a)return;const o=a.includes("token=")?new URL(a).searchParams.get("token")??"":a;o&&ve(async()=>{const{setWebToken:u}=await import("./api-web-DeJFZI02.js");return{setWebToken:u}},[],import.meta.url).then(({setWebToken:u})=>u(o))};return x.jsx("div",{className:"min-h-[var(--app-height,100vh)] bg-[#0e2a12] flex items-center justify-center p-6",children:x.jsxs("form",{onSubmit:s,className:"w-full max-w-sm text-center",children:[x.jsx("div",{className:"text-4xl mb-3",children:"🎈"}),x.jsx("h1",{className:"text-title font-bold text-white mb-1",children:"LookatStudy"}),x.jsx("p",{className:"text-label text-white/55 leading-relaxed mb-5",children:t?"连接本机学习服务:粘贴启动时打印的令牌或整条链接":"Connect to your study server — paste the token or the full link printed at startup"}),e&&x.jsx("p",{className:"text-label text-warning-light mb-3",children:t?"上次的令牌被拒绝了,请重新输入":"Previous token was rejected, please re-enter"}),x.jsx("input",{type:"text",value:n,onChange:i=>r(i.target.value),placeholder:t?"访问令牌":"access token",autoFocus:!0,className:"w-full bg-black/30 text-white placeholder:text-white/30 text-body font-mono rounded-lg px-3 py-2.5 border border-white/20 focus:border-brand focus:outline-none transition-colors mb-3"}),x.jsx("button",{type:"submit",disabled:!n.trim(),className:"btn-3d-brand w-full px-3 py-2.5 text-body disabled:opacity-40",children:t?"连接":"Connect"}),x.jsx("p",{className:"text-caption text-white/40 leading-relaxed mt-5",children:t?"令牌在服务启动日志里,形如 http://127.0.0.1:17890/?token=…,也可以直接打开那个链接。":"The token is in the server startup log, like http://127.0.0.1:17890/?token=… — opening that link directly works too."})]})})}const Ug=k1.createRoot(document.getElementById("root"));function $4(){Ug.render(x.jsx(gu.StrictMode,{children:x.jsx(n3,{children:x.jsx(F4,{})})}))}function th(e){Ug.render(x.jsx(gu.StrictMode,{children:x.jsx(q4,{rejected:e})}))}async function W4(){const{installAppHeight:e}=await ve(async()=>{const{installAppHeight:t}=await import("./app-height-D5bf5z0g.js");return{installAppHeight:t}},[],import.meta.url);if(e(),!window.api){const t=await ve(()=>import("./api-web-DeJFZI02.js"),[],import.meta.url);if(window.addEventListener(t.TOKEN_REJECTED_EVENT,()=>th(!0)),!t.hasWebToken()){th(!1);return}try{await t.installWebApi()}catch(n){console.error("[boot] web api 安装失败:",n)}}$4()}W4();export{An as $,pm as A,sh as B,B1 as C,ZE as D,Eh as E,Ds as F,V1 as G,ph as H,Eu as I,K4 as J,Hl as K,G1 as L,fh as M,X4 as N,ch as O,mh as P,dx as Q,eR as R,lx as S,fx as T,xx as U,O1 as V,bh as W,hr as X,nx as Y,Nb as Z,ve as _,ce as a,Hs as a0,Mh as a1,Uh as a2,Dc as a3,vm as a4,bi as a5,fw as a6,Os as b,pe as c,ax as d,Ji as e,dh as f,kn as g,wh as h,P1 as i,vn as j,bu as k,oh as l,gs as m,J4 as n,hd as o,fd as p,Z4 as q,vv as r,Q4 as s,je as t,We as u,we as v,Bn as w,Xk as x,Kk as y,$s as z};
|