lookatstudy-mobile 0.18.0 → 0.19.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/server.cjs +160 -1
- package/web/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/web/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/web/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/web/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/web/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/web/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/web/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/web/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/web/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/web/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/web/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/web/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/web/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/web/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/web/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/web/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/web/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/web/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/web/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/web/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/web/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/web/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/web/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/web/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/web/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/web/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/web/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/web/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/web/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/web/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/web/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/web/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/web/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/web/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/web/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/web/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/web/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/web/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/web/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/web/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/web/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/web/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/web/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/web/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/web/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/web/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/web/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/web/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/web/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/web/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/web/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/web/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/web/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/web/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/web/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/web/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/web/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/web/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/web/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/web/assets/{abnfDiagram-N423BO3Z-CU2Rg7X-.js → abnfDiagram-N423BO3Z-DRLqlsQe.js} +1 -1
- package/web/assets/{arc-CVHcrwtq.js → arc-DX37qc14.js} +1 -1
- package/web/assets/{architectureDiagram-T3A2C74G-CbOpSoqA.js → architectureDiagram-T3A2C74G-4mH-M23W.js} +1 -1
- package/web/assets/{blockDiagram-VBNYF7ZC-DkENfYJJ.js → blockDiagram-VBNYF7ZC-CfFl91r9.js} +1 -1
- package/web/assets/{c4Diagram-5PPSVZJV-D2nKbUxh.js → c4Diagram-5PPSVZJV-CoYqbpkG.js} +1 -1
- package/web/assets/channel-DwTlw7UU.js +1 -0
- package/web/assets/{chunk-2GRJ4B5K-B2LBmawX.js → chunk-2GRJ4B5K-DdZFJzXx.js} +1 -1
- package/web/assets/{chunk-2Q5K7J3B-ByZtx99c.js → chunk-2Q5K7J3B-CjvT22rq.js} +1 -1
- package/web/assets/{chunk-5RXB4S5H-b6PGx0ql.js → chunk-5RXB4S5H-BO3dLHxP.js} +1 -1
- package/web/assets/{chunk-5VM5RSS4-wmKKoEHl.js → chunk-5VM5RSS4-BRWuBMF-.js} +1 -1
- package/web/assets/{chunk-6Q2QTUOP-CZ89fwLd.js → chunk-6Q2QTUOP-BBL9yZr5.js} +1 -1
- package/web/assets/{chunk-GF5L2VYU-3EIIkl6Y.js → chunk-GF5L2VYU-BzgRNoMK.js} +1 -1
- package/web/assets/{chunk-JWPE2WC7-CdCWYrp8.js → chunk-JWPE2WC7-Rx7velok.js} +1 -1
- package/web/assets/{chunk-KBJHAD2P-CmZTgHqr.js → chunk-KBJHAD2P-BUmqDQFS.js} +1 -1
- package/web/assets/{chunk-RYQCIY6F-DfyARx_z.js → chunk-RYQCIY6F-DiWSKlNj.js} +1 -1
- package/web/assets/{chunk-XXDRQBXY-DIoEGjYu.js → chunk-XXDRQBXY-BaIS0itG.js} +1 -1
- package/web/assets/classDiagram-JCYQIIEL-CoMu7USw.js +1 -0
- package/web/assets/classDiagram-v2-OCEON4UE-CoMu7USw.js +1 -0
- package/web/assets/{cose-bilkent-JH36ORCC-BktEcSRI.js → cose-bilkent-JH36ORCC-BbQclxlG.js} +1 -1
- package/web/assets/{cynefin-VYW2F7L2-sXHUKhTr.js → cynefin-VYW2F7L2-BoAEtYBt.js} +1 -1
- package/web/assets/{cynefinDiagram-MW4NZA55-CQvZqGMF.js → cynefinDiagram-MW4NZA55-1NTeoXpW.js} +1 -1
- package/web/assets/{dagre-VZM6K2ZE-BgVOc66g.js → dagre-VZM6K2ZE-D1IJUP3L.js} +1 -1
- package/web/assets/{diagram-7IWD3JNH-CqXnEFCF.js → diagram-7IWD3JNH-Bq4zahZs.js} +1 -1
- package/web/assets/{diagram-B4RE2ZJO-CbG6ewsb.js → diagram-B4RE2ZJO-DwR-n08L.js} +1 -1
- package/web/assets/{diagram-LBJQPF4R-qCVZtiwb.js → diagram-LBJQPF4R-x8ddz6fv.js} +1 -1
- package/web/assets/{diagram-Q27KOJAE-fRbvC_4J.js → diagram-Q27KOJAE-BQvPuANj.js} +1 -1
- package/web/assets/{diagram-UB23O5K3-DYruB-zm.js → diagram-UB23O5K3-2HRRnPaM.js} +1 -1
- package/web/assets/{ebnfDiagram-BXEA7PRR-BKbJqSDg.js → ebnfDiagram-BXEA7PRR-C6w-Hol8.js} +1 -1
- package/web/assets/{erDiagram-JOGREHBK-anDPN9Fg.js → erDiagram-JOGREHBK-D0B9HX21.js} +1 -1
- package/web/assets/{flowDiagram-UKHOOZJN-DlMRxaQ8.js → flowDiagram-UKHOOZJN-BAFPos1j.js} +1 -1
- package/web/assets/{ganttDiagram-PKOTCBZU-BoCCJylo.js → ganttDiagram-PKOTCBZU-cEfBlMbu.js} +1 -1
- package/web/assets/{gitGraphDiagram-DS77QQ5N-D37HEJEv.js → gitGraphDiagram-DS77QQ5N-kEgMAveq.js} +1 -1
- package/web/assets/{index-CeFnA9sR.js → index-DFfbtrtQ.js} +10 -10
- package/web/assets/{infoDiagram-6WML65LV-Cp2uwsRp.js → infoDiagram-6WML65LV-B3O-sBT9.js} +1 -1
- package/web/assets/{ishikawaDiagram-WSZJBQD7-IDCvF8oq.js → ishikawaDiagram-WSZJBQD7-Lltvy9NV.js} +1 -1
- package/web/assets/{journeyDiagram-NVQOT4AX-CqJjuMRj.js → journeyDiagram-NVQOT4AX-CoTpdbQG.js} +1 -1
- package/web/assets/{kanban-definition-27J2QSJJ-Bzy4l8Im.js → kanban-definition-27J2QSJJ-C6MlEhKf.js} +1 -1
- package/web/assets/{linear-BYt2jke2.js → linear-BOCC78Hx.js} +1 -1
- package/web/assets/main-BXa7WYYr.css +1 -0
- package/web/assets/main-_hK--hbF.js +792 -0
- package/web/assets/{mermaid.core-ChBcV6rX.js → mermaid.core-BnzH2M4g.js} +4 -4
- package/web/assets/{mindmap-definition-FAOFIHXS-BiQCF2qx.js → mindmap-definition-FAOFIHXS-2aXmimCX.js} +1 -1
- package/web/assets/{pegDiagram-VL7TDLO6-JrAhM2Rh.js → pegDiagram-VL7TDLO6-BUgOGs18.js} +1 -1
- package/web/assets/{pet-f5Q8AEiU.js → pet-a4xGZJ4o.js} +1 -1
- package/web/assets/{pieDiagram-7S7Q4E2Y-DNB9KI82.js → pieDiagram-7S7Q4E2Y-QH3MSwJC.js} +1 -1
- package/web/assets/{quadrantDiagram-CIZ2JOQS-D9CQH6qH.js → quadrantDiagram-CIZ2JOQS-BHgzjRDJ.js} +1 -1
- package/web/assets/{railroadDiagram-AXF67PYL-GRAK-BbS.js → railroadDiagram-AXF67PYL-eT-6KI97.js} +1 -1
- package/web/assets/{requirementDiagram-LRYGKXZP-CTFmkmvv.js → requirementDiagram-LRYGKXZP-SCqCciaJ.js} +1 -1
- package/web/assets/{sankeyDiagram-W5VNT64P-ocFhBtMa.js → sankeyDiagram-W5VNT64P-X7ftmy-X.js} +1 -1
- package/web/assets/{sequenceDiagram-SI44F4Z6-itHtrU2O.js → sequenceDiagram-SI44F4Z6-CJiMe-ST.js} +1 -1
- package/web/assets/{sizeCapture-X5ZJPWSS-Bj_0p16L.js → sizeCapture-X5ZJPWSS-D0BOwnXt.js} +1 -1
- package/web/assets/{stateDiagram-OKZ733FA-BZ3FXzdZ.js → stateDiagram-OKZ733FA-BiPOcNEG.js} +1 -1
- package/web/assets/stateDiagram-v2-UEYNNEHI-URZ9UNRl.js +1 -0
- package/web/assets/swimlanes-SLNWSIFB-CtLG2CHX.js +2 -0
- package/web/assets/swimlanesDiagram-ULZ7WXOC-CdA8x7iG.js +8 -0
- package/web/assets/{timeline-definition-Z64GVDOM-B-IqLhkR.js → timeline-definition-Z64GVDOM-NOUkxoIk.js} +1 -1
- package/web/assets/{vennDiagram-T6HMQDX7-Dr1sgkuO.js → vennDiagram-T6HMQDX7-jIX0UihP.js} +1 -1
- package/web/assets/{wardleyDiagram-T6FBY63Y-BOOJsnbk.js → wardleyDiagram-T6FBY63Y-BWfUG4_t.js} +1 -1
- package/web/assets/{xychartDiagram-ELKLHX3M-Bb3lgEh4.js → xychartDiagram-ELKLHX3M-CVZ-lb3j.js} +1 -1
- package/web/index.html +3 -2
- package/web/pet.html +2 -2
- package/web/assets/channel-AThd-Hly.js +0 -1
- package/web/assets/classDiagram-JCYQIIEL-Ccd6qf2i.js +0 -1
- package/web/assets/classDiagram-v2-OCEON4UE-Ccd6qf2i.js +0 -1
- package/web/assets/main-BaffLdJi.js +0 -528
- package/web/assets/stateDiagram-v2-UEYNNEHI-DacbF0mj.js +0 -1
- package/web/assets/swimlanes-SLNWSIFB-nlxlUqVN.js +0 -2
- package/web/assets/swimlanesDiagram-ULZ7WXOC-Bk858mY5.js +0 -8
|
@@ -0,0 +1,792 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./mermaid.core-BnzH2M4g.js","./index-DFfbtrtQ.js","./index-D8iAKGNi.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var R3=Object.defineProperty;var L3=(e,t,n)=>t in e?R3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Fl=(e,t,n)=>L3(e,typeof t!="symbol"?t+"":t,n);import{r as w,d as D3,j as f,e as mh,b as O0,u as j0,h as ph,k as ha,l as P3,m as dc,n as O3,o as j3,p as In,q as B3,V as F3,v as z3,F as gh,s as xh,t as H3,w as jp,x as U3,y as bh,z as yh,A as q3,B as V3,C as $3,D as Bp,E as hc,G as W3,M as Fp,H as G3,I as vh,J as Y3,K as K3,g as zn,L as wh,N as Zr,R as X3,O as Q3,P as kh,Q as Th,S as zl,T as xi,U as Z3,W as bi,X as J3,Y as ey,Z as ty,_ as ny,$ as Eh,a0 as ry,a1 as Sh,a2 as ay,a3 as iy,a4 as sy,a5 as oy,a6 as B0}from"./index-DFfbtrtQ.js";const ly="modulepreload",uy=function(e,t){return new URL(e,t).href},Ah={},Ao=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let s=function(c){return Promise.all(c.map(h=>Promise.resolve(h).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};const o=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));a=s(n.map(c=>{if(c=uy(c,r),c in Ah)return;Ah[c]=!0;const h=c.endsWith(".css"),m=h?'[rel="stylesheet"]':"";if(!!r)for(let g=o.length-1;g>=0;g--){const x=o[g];if(x.href===c&&(!h||x.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${m}`))return;const p=document.createElement("link");if(p.rel=h?"stylesheet":ly,h||(p.as="script"),p.crossOrigin="",p.href=c,u&&p.setAttribute("nonce",u),document.head.appendChild(p),h)return new Promise((g,x)=>{p.addEventListener("load",g),p.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return a.then(s=>{for(const o of s||[])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 cy=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),zp=(...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 dy={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 hy=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:s,...o},l)=>w.createElement("svg",{ref:l,...dy,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:zp("lucide",a),...o},[...s.map(([u,c])=>w.createElement(u,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 Me=(e,t)=>{const n=w.forwardRef(({className:r,...a},i)=>w.createElement(hy,{ref:i,iconNode:t,className:zp(`lucide-${cy(e)}`,r),...a}));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 fy=Me("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 fc=Me("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
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 my=Me("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
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 py=Me("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"}]]);/**
|
|
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 sr=Me("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"}]]);/**
|
|
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 gy=Me("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"}]]);/**
|
|
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 xy=Me("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"}]]);/**
|
|
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 by=Me("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
|
|
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 Tn=Me("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
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 F0=Me("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
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 yy=Me("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
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 Hp=Me("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
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 mc=Me("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"}]]);/**
|
|
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 Wn=Me("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
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 vy=Me("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
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 wy=Me("CircleSlash",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]]);/**
|
|
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 va=Me("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"}]]);/**
|
|
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 Up=Me("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"}]]);/**
|
|
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 qp=Me("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"}]]);/**
|
|
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 ky=Me("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"}]]);/**
|
|
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 Vp=Me("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"}]]);/**
|
|
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 Ty=Me("Dices",[["rect",{width:"12",height:"12",x:"2",y:"10",rx:"2",ry:"2",key:"6agr2n"}],["path",{d:"m17.92 14 3.5-3.5a2.24 2.24 0 0 0 0-3l-5-4.92a2.24 2.24 0 0 0-3 0L10 6",key:"1o487t"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 14h.01",key:"ssrbsk"}],["path",{d:"M15 6h.01",key:"cblpky"}],["path",{d:"M18 9h.01",key:"2061c0"}]]);/**
|
|
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 Ey=Me("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"}]]);/**
|
|
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 hs=Me("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"}]]);/**
|
|
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 $p=Me("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"}]]);/**
|
|
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 Sy=Me("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"}]]);/**
|
|
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 Ay=Me("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"}]]);/**
|
|
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 Cy=Me("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"}]]);/**
|
|
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 Wp=Me("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"}]]);/**
|
|
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 Ny=Me("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"}]]);/**
|
|
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 My=Me("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"}]]);/**
|
|
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 Iy=Me("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
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 _y=Me("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"}]]);/**
|
|
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 Co=Me("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"}]]);/**
|
|
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 Ry=Me("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"}]]);/**
|
|
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 z0=Me("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"}]]);/**
|
|
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 Ly=Me("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
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 Dy=Me("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
|
|
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 H0=Me("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"}]]);/**
|
|
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 fs=Me("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
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 Gp=Me("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
|
|
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 Py=Me("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"}]]);/**
|
|
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 Oi=Me("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"}]]);/**
|
|
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 Oy=Me("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
|
|
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 jy=Me("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"}]]);/**
|
|
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 Ch=Me("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"}]]);/**
|
|
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 By=Me("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
|
|
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 Fy=Me("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
|
|
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 zy=Me("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"}]]);/**
|
|
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 Hy=Me("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"}]]);/**
|
|
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 Ji=Me("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"}]]);/**
|
|
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 Nh=Me("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"}]]);/**
|
|
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 el=Me("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
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 Hl=Me("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"}]]);/**
|
|
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 Yp=Me("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"}]]);/**
|
|
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 Uy=Me("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"}]]);/**
|
|
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 qy=Me("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"}]]);/**
|
|
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 ji=Me("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
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 Vy=Me("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
|
|
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 $y=Me("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"}]]);/**
|
|
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 U0=Me("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
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 Wy=Me("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
|
|
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 Gy=Me("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"}]]);/**
|
|
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 No=Me("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"}]]);/**
|
|
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 q0=Me("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"}]]);/**
|
|
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 Yy=Me("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"}]]);/**
|
|
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 Ky=Me("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"}]]);/**
|
|
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 pc=Me("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"}]]);/**
|
|
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 Xy=Me("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"}]]);/**
|
|
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 V0=Me("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
373
|
+
* @license lucide-react v0.468.0 - ISC
|
|
374
|
+
*
|
|
375
|
+
* This source code is licensed under the ISC license.
|
|
376
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
377
|
+
*/const Qy=Me("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
|
|
378
|
+
* @license lucide-react v0.468.0 - ISC
|
|
379
|
+
*
|
|
380
|
+
* This source code is licensed under the ISC license.
|
|
381
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
382
|
+
*/const Kp=Me("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"}]]);/**
|
|
383
|
+
* @license lucide-react v0.468.0 - ISC
|
|
384
|
+
*
|
|
385
|
+
* This source code is licensed under the ISC license.
|
|
386
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
387
|
+
*/const qa=Me("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"}]]);/**
|
|
388
|
+
* @license lucide-react v0.468.0 - ISC
|
|
389
|
+
*
|
|
390
|
+
* This source code is licensed under the ISC license.
|
|
391
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
392
|
+
*/const Zy=Me("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
|
|
393
|
+
* @license lucide-react v0.468.0 - ISC
|
|
394
|
+
*
|
|
395
|
+
* This source code is licensed under the ISC license.
|
|
396
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
397
|
+
*/const Xp=Me("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"}]]);/**
|
|
398
|
+
* @license lucide-react v0.468.0 - ISC
|
|
399
|
+
*
|
|
400
|
+
* This source code is licensed under the ISC license.
|
|
401
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
402
|
+
*/const gc=Me("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"}]]);/**
|
|
403
|
+
* @license lucide-react v0.468.0 - ISC
|
|
404
|
+
*
|
|
405
|
+
* This source code is licensed under the ISC license.
|
|
406
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
407
|
+
*/const vr=Me("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"}]]);/**
|
|
408
|
+
* @license lucide-react v0.468.0 - ISC
|
|
409
|
+
*
|
|
410
|
+
* This source code is licensed under the ISC license.
|
|
411
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
412
|
+
*/const Jy=Me("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"}]]);/**
|
|
413
|
+
* @license lucide-react v0.468.0 - ISC
|
|
414
|
+
*
|
|
415
|
+
* This source code is licensed under the ISC license.
|
|
416
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
417
|
+
*/const Qp=Me("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"}]]);/**
|
|
418
|
+
* @license lucide-react v0.468.0 - ISC
|
|
419
|
+
*
|
|
420
|
+
* This source code is licensed under the ISC license.
|
|
421
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
422
|
+
*/const e5=Me("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);/**
|
|
423
|
+
* @license lucide-react v0.468.0 - ISC
|
|
424
|
+
*
|
|
425
|
+
* This source code is licensed under the ISC license.
|
|
426
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
427
|
+
*/const ms=Me("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"}]]);/**
|
|
428
|
+
* @license lucide-react v0.468.0 - ISC
|
|
429
|
+
*
|
|
430
|
+
* This source code is licensed under the ISC license.
|
|
431
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
432
|
+
*/const Bn=Me("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
433
|
+
* @license lucide-react v0.468.0 - ISC
|
|
434
|
+
*
|
|
435
|
+
* This source code is licensed under the ISC license.
|
|
436
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
437
|
+
*/const xc=Me("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"}]]),ae=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}}),fr=typeof navigator<"u"&&navigator.userAgent.includes("Electron"),t5=/[\u2E80-\u9FFF\uF900-\uFAFF\u3000-\u303F\uFF00-\uFFEF]/g;function Zp(e){if(!e)return 0;const t=(e.match(t5)??[]).length,n=e.length-t;return Math.ceil(t*11/10+n/4)}function n5(e,t){return!t||t<=0?null:e<=0?0:Math.min(100,Math.round(e/t*100))}function r5(e,t){const n=e.reduce((r,a)=>r+a,0);return n<=0||t<=0?e.map(()=>0):e.map(r=>t*r/n)}function Ma(e){return e<1e3?String(Math.round(e)):e<1e4?`${(e/1e3).toFixed(1)}k`:`${Math.round(e/1e3)}k`}const Jp=.5,a5=.9,i5=.85;var $0=D3();const eg="lookatstudy-lang";let Mo=typeof localStorage>"u"?"zh-CN":localStorage.getItem(eg)||"zh-CN";const bc=new Set;function tg(e){return bc.add(e),()=>{bc.delete(e)}}const Mh={"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}」。但我现在没什么劲——别直接讲概念,也别出计分题考我。请这样开场:
|
|
438
|
+
1. 先用一两句散文抛个钩子(反直觉的、或跟我日常有关的,让我产生好奇);
|
|
439
|
+
2. 然后调用 pose_guess 工具,给我一个二选一的小猜测(就是玩,不是考试);
|
|
440
|
+
3. 我会点选项猜,你【下一回合】再揭晓,顺带把这课最核心的一点讲清楚。
|
|
441
|
+
铁律:起手不要讲座、不要用 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":`
|
|
442
|
+
|
|
443
|
+
网络受限或私有仓库请改用「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.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.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.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.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.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}}。下面是逐题情况:
|
|
444
|
+
请根据我的表现决定下一步:答错的题讲清为什么错和正确思路;全对的话判断我是否可以进入下一部分。不要重新出同一组题,也不要只说一句做得好。`,"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:
|
|
445
|
+
1. First hook me with a sentence or two of prose (counter-intuitive, or tied to daily life — make me curious);
|
|
446
|
+
2. Then call the pose_guess tool with a small two-option guess (just for fun, not a test);
|
|
447
|
+
3. I'll pick an option and guess; in your NEXT turn, reveal the answer and teach the one core idea of this lesson.
|
|
448
|
+
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. Switch nodes after it finishes.","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":`
|
|
449
|
+
|
|
450
|
+
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.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.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.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.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.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:
|
|
451
|
+
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 Ga(){return Mo}function s5(e){e!==Mo&&(Mo=e,typeof localStorage<"u"&&localStorage.setItem(eg,e),bc.forEach(t=>t()))}function W0(e,t=Mo,n){var a,i;let r=((a=Mh[t])==null?void 0:a[e])??((i=Mh["zh-CN"])==null?void 0:i[e])??e;if(n)for(const[s,o]of Object.entries(n))r=r.replaceAll(`{${s}}`,String(o));return r}function $e(){const e=w.useSyncExternalStore(tg,Ga,Ga);return w.useCallback((t,n)=>W0(t,e,n),[e])}function ng(){return w.useSyncExternalStore(tg,Ga,Ga)}const o5=["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 Ih(e){return Array.from(e.querySelectorAll(o5)).filter(t=>t.offsetParent!==null||t===document.activeElement)}function ni(e,t){w.useEffect(()=>{if(!t)return;const n=e.current;if(!n)return;const r=document.activeElement,i=Ih(n)[0]??n,s=window.setTimeout(()=>i.focus(),0),o=l=>{if(l.key!=="Tab")return;const u=Ih(n);if(u.length===0){l.preventDefault(),n.focus();return}const c=u[0],h=u[u.length-1];l.shiftKey?(document.activeElement===c||!n.contains(document.activeElement))&&(l.preventDefault(),h.focus()):document.activeElement===h&&(l.preventDefault(),c.focus())};return n.addEventListener("keydown",o),()=>{if(window.clearTimeout(s),n.removeEventListener("keydown",o),r&&document.body.contains(r))try{r.focus()}catch{}}},[e,t])}const _s=220;function tl({anchorRect:e,message:t,onConfirm:n,onCancel:r,confirmLabel:a,cancelLabel:i,danger:s=!1,testid:o="confirm-card"}){const l=$e(),u=w.useRef(null);ni(u,!0);const c=a??l("action.confirm"),h=i??l("action.cancel");w.useEffect(()=>{const b=T=>{u.current&&!u.current.contains(T.target)&&r()},v=T=>{T.key==="Escape"&&r(),T.key==="Enter"&&(T.preventDefault(),n())};return document.addEventListener("mousedown",b),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",b),document.removeEventListener("keydown",v)}},[r,n]);const m=window.innerWidth,d=window.innerHeight,p=e.right-_s,g=Math.max(8,Math.min(p,m-_s-8)),x=e.bottom+4+_s>d?Math.max(8,e.top-4-_s):e.bottom+4;return $0.createPortal(f.jsxs("div",{ref:u,className:`confirm-card fixed z-[60] w-[220px] bg-surface-0 rounded-xl shadow-elevated border p-3 ${s?"border-warning/50":"border-[var(--border)]"}`,style:{left:g,top:x},role:"alertdialog","aria-modal":"false","data-testid":o,onClick:b=>b.stopPropagation(),children:[f.jsx("p",{className:"text-body text-ink-muted leading-relaxed mb-3",children:t}),f.jsxs("div",{className:"flex gap-2 justify-end",children:[f.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:h}),f.jsx("button",{onClick:n,"data-testid":`${o}-confirm`,className:"btn-3d-brand px-2.5 py-1 text-label",style:s?{background:"var(--warning)",boxShadow:"0 3px 0 0 var(--warning-dark)"}:void 0,children:c})]})]}),document.body)}function l5(e,t,n){return[...e].sort((r,a)=>r.orderIdx-a.orderIdx).map(r=>{const a=t.filter(o=>o.parentId===r.id).sort((o,l)=>o.orderIdx-l.orderIdx),i=a.filter(o=>o.type==="lesson"),s=i.length>0&&i.every(o=>{var l;return(((l=n[o.id])==null?void 0:l.mastery)??0)>=Jp});return{section:r,lessons:a,chapterLessonsMastered:s}})}function yc(e,t,n){var r;return e.type==="exam"?!n:(((r=t[e.id])==null?void 0:r.status)??"locked")==="locked"}function u5(e,t){const n=t.trim().toLowerCase().split(/\s+/).filter(Boolean);if(n.length===0)return e;const r=a=>{const i=a.toLowerCase();return n.every(s=>i.includes(s))};return e.map(a=>{if(r(a.section.title))return a;const i=a.lessons.filter(s=>r(s.title));return i.length>0?{...a,lessons:i}:null}).filter(a=>a!==null)}function c5(e,t){const n=t.trim().split(/\s+/).filter(Boolean)[0];if(!n)return null;const r=e.toLowerCase().indexOf(n.toLowerCase());return r>=0?[r,r+n.length]:null}function d5(e){const t=$e(),[n,r]=w.useState(""),[a,i]=w.useState([]),s=w.useRef(null);w.useEffect(()=>{var g;(g=s.current)==null||g.focus()},[]);const o=w.useMemo(()=>l5(e.sections,e.tree,e.progressMap),[e.sections,e.tree,e.progressMap]),l=w.useMemo(()=>u5(o,n),[o,n]),u=w.useMemo(()=>new Set(e.tree.map(g=>g.id)),[e.tree]),c=w.useMemo(()=>new Set(l.flatMap(g=>g.lessons.map(x=>x.id))),[l]),h=w.useMemo(()=>new Map(e.tree.map(g=>[g.id,g])),[e.tree]),m=w.useMemo(()=>new Map(o.map(g=>[g.section.id,g.chapterLessonsMastered])),[o]);w.useEffect(()=>{const g=n.trim();if(g.length<2){i([]);return}const x=setTimeout(()=>{ae.searchContent(g).then(b=>{i(b.filter(v=>u.has(v.nodeId)&&!c.has(v.nodeId)).slice(0,8))}).catch(()=>i([]))},250);return()=>clearTimeout(x)},[n,u,c]);const d=w.useMemo(()=>{for(const g of l){const x=g.lessons.find(b=>!yc(b,e.progressMap,g.chapterLessonsMastered));if(x)return x}return null},[l,e.progressMap]),p=l.length>0||a.length>0;return f.jsxs("div",{"data-testid":"course-search-panel",className:"absolute inset-0 z-50 flex flex-col",style:{background:"rgb(var(--surface-rail-rgb) / 0.96)",backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)"},onKeyDown:g=>{g.key==="Escape"&&e.onClose()},children:[f.jsxs("div",{className:"flex items-center gap-1.5 m-2 p-1.5 rounded-lg bg-black/40 ring-1 ring-white/15 focus-within:ring-brand/60 transition-colors",children:[f.jsx(U0,{className:"w-4 h-4 text-white/50 shrink-0"}),f.jsx("input",{ref:s,value:n,onChange:g=>r(g.target.value),onKeyDown:g=>{g.key==="Enter"&&d&&e.onJump(d)},placeholder:t("map.search.placeholder"),"data-testid":"course-search-input",className:"flex-1 bg-transparent text-body text-white placeholder:text-white/35 outline-none min-w-0"}),n&&f.jsx("button",{onClick:()=>{var g;r(""),(g=s.current)==null||g.focus()},"aria-label":t("map.search.clear"),className:"shrink-0 flex items-center justify-center w-5 h-5 rounded-md text-white/50 hover:text-white hover:bg-white/10 transition-colors",children:f.jsx(Bn,{className:"w-3.5 h-3.5"})}),f.jsx("button",{onClick:e.onClose,"data-testid":"course-search-close","aria-label":t("map.search.close"),className:"shrink-0 flex items-center justify-center w-5 h-5 rounded-md text-white/50 hover:text-white hover:bg-white/10 transition-colors",children:f.jsx(Bn,{className:"w-3.5 h-3.5"})})]}),f.jsxs("div",{className:"flex-1 overflow-y-auto px-2 pb-3 space-y-2",children:[!p&&f.jsx("div",{"data-testid":"course-search-empty",className:"text-center text-label text-white/60 mt-8 px-4",children:t("map.search.noResults")}),l.map((g,x)=>f.jsx(h5,{row:g,sectionIndex:x,query:n,progressMap:e.progressMap,selectedNodeId:e.selectedNodeId,onPick:e.onJump},g.section.id)),a.length>0&&f.jsxs("div",{"data-testid":"course-search-content-group",className:"pt-1",children:[f.jsx("div",{className:"px-1.5 py-1 text-caption font-bold text-white/50 uppercase tracking-wider",children:t("map.search.contentGroup")}),a.map(g=>{const x=h.get(g.nodeId);if(!x)return null;const b=yc(x,e.progressMap,m.get(x.parentId??"")??!1);return f.jsxs("button",{disabled:b,"data-testid":`search-content-row-${x.id.slice(0,8)}`,onClick:()=>!b&&e.onJump(x),className:`w-full text-left px-2 py-1.5 rounded-lg transition-colors ${b?"opacity-45 cursor-not-allowed":"hover:bg-white/10 cursor-pointer"} ${x.id===e.selectedNodeId?"bg-accent/15 ring-1 ring-accent/40":""}`,children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(sr,{className:"w-3.5 h-3.5 text-white/70 shrink-0"}),f.jsx("span",{className:"flex-1 text-label font-bold text-white truncate",children:f.jsx(vc,{text:g.title,query:n})})]}),f.jsx("div",{className:"text-caption text-white/55 line-clamp-2 leading-snug pl-5.5",children:g.snippet})]},g.nodeId)})]})]})]})}function h5({row:e,sectionIndex:t,query:n,progressMap:r,selectedNodeId:a,onPick:i}){const s=$e(),o=(e.section.world??"study")==="practice";return f.jsxs("div",{"data-testid":`search-section-${e.section.id.slice(0,8)}`,children:[f.jsxs("div",{className:"flex items-center gap-2 px-1.5 py-1",children:[f.jsx("span",{className:"w-5 h-5 rounded-full bg-gold text-neutral-900 text-caption font-extrabold flex items-center justify-center shrink-0 ring-2 ring-gold/40",children:t+1}),f.jsx("span",{className:"text-label font-bold text-white truncate flex-1",children:f.jsx(vc,{text:e.section.title,query:n})}),o&&f.jsx("span",{className:"shrink-0 px-1.5 py-0.5 rounded-full bg-accent/20 text-accent text-caption font-bold",children:s("map.world.practice")})]}),e.lessons.map(l=>{var m;const u=yc(l,r,e.chapterLessonsMastered),c=((m=r[l.id])==null?void 0:m.status)??"locked",h=l.type==="exam";return f.jsxs("button",{disabled:u,"data-testid":`search-row-${l.id.slice(0,8)}`,onClick:()=>!u&&i(l),className:`w-full flex items-center gap-2 px-2 py-1.5 rounded-lg text-left transition-colors ${u?"opacity-45 cursor-not-allowed":"hover:bg-white/10 cursor-pointer"} ${l.id===a?"bg-accent/15 ring-1 ring-accent/40":""}`,children:[u?f.jsx(Dy,{className:"w-3.5 h-3.5 text-white/50 shrink-0"}):h?f.jsx(qa,{className:"w-3.5 h-3.5 text-accent shrink-0"}):c==="mastered"?f.jsx(Vp,{className:"w-3.5 h-3.5 text-gold shrink-0"}):f.jsx(sr,{className:"w-3.5 h-3.5 text-white/70 shrink-0"}),f.jsx("span",{className:"flex-1 text-label text-white truncate",children:f.jsx(vc,{text:l.title,query:n})})]},l.id)})]})}function vc({text:e,query:t}){const n=c5(e,t);return n?f.jsxs(f.Fragment,{children:[e.slice(0,n[0]),f.jsx("span",{className:"text-brand font-extrabold",children:e.slice(n[0],n[1])}),e.slice(n[1])]}):f.jsx(f.Fragment,{children:e})}const f5=268,G0=28,m5=20,rg=G0*2+m5,p5=rg+8,g5=104,x5=18,Ul=G0+6,b5=26,y5=22;function wc(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 v5(e,t=f5,n=""){const r=[],a=t/2,i=t/2-x5-G0;for(let l=0;l<e;l++){const u=Ul+l*g5,h=wc(`${n}:${l}`)/4294967295*2-1,m=a+h*i,p=wc(`${n}:${l}:y`)/4294967295*2-1,g=u+p*b5;r.push({x:m,y:g,index:l})}if(r.length>0){r[0].y<Ul&&(r[0].y=Ul);for(let l=1;l<r.length;l++){const u=r[l-1].y+p5;r[l].y<u&&(r[l].y=u)}}const s=[];for(let l=0;l<r.length-1;l++)s.push({from:r[l],to:r[l+1],index:l});const o=r.length===0?40:r[r.length-1].y+rg/2+10;return{nodes:r,segments:s,height:o}}function w5(e){const{from:t,to:n}=e,r=(t.y+n.y)/2+y5;return`M ${t.x} ${t.y} C ${t.x} ${r}, ${n.x} ${r}, ${n.x} ${n.y}`}var lo={exports:{}};/*!
|
|
452
|
+
* matter-js 0.19.0 by @liabru
|
|
453
|
+
* http://brm.io/matter-js/
|
|
454
|
+
* License MIT
|
|
455
|
+
*
|
|
456
|
+
* The MIT License (MIT)
|
|
457
|
+
*
|
|
458
|
+
* Copyright (c) Liam Brummitt and contributors.
|
|
459
|
+
*
|
|
460
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
461
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
462
|
+
* in the Software without restriction, including without limitation the rights
|
|
463
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
464
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
465
|
+
* furnished to do so, subject to the following conditions:
|
|
466
|
+
*
|
|
467
|
+
* The above copyright notice and this permission notice shall be included in
|
|
468
|
+
* all copies or substantial portions of the Software.
|
|
469
|
+
*
|
|
470
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
471
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
472
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
473
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
474
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
475
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
476
|
+
* THE SOFTWARE.
|
|
477
|
+
*/var k5=lo.exports,_h;function T5(){return _h||(_h=1,(function(e,t){(function(r,a){e.exports=a()})(k5,function(){return(function(n){var r={};function a(i){if(r[i])return r[i].exports;var s=r[i]={i,l:!1,exports:{}};return n[i].call(s.exports,s,s.exports,a),s.l=!0,s.exports}return a.m=n,a.c=r,a.d=function(i,s,o){a.o(i,s)||Object.defineProperty(i,s,{enumerable:!0,get:o})},a.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},a.t=function(i,s){if(s&1&&(i=a(i)),s&8||s&4&&typeof i=="object"&&i&&i.__esModule)return i;var o=Object.create(null);if(a.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:i}),s&2&&typeof i!="string")for(var l in i)a.d(o,l,(function(u){return i[u]}).bind(null,l));return o},a.n=function(i){var s=i&&i.__esModule?function(){return i.default}:function(){return i};return a.d(s,"a",s),s},a.o=function(i,s){return Object.prototype.hasOwnProperty.call(i,s)},a.p="",a(a.s=20)})([(function(n,r){var a={};n.exports=a,(function(){a._baseDelta=1e3/60,a._nextId=0,a._seed=0,a._nowStartTime=+new Date,a._warnedOnce={},a._decomp=null,a.extend=function(s,o){var l,u;typeof o=="boolean"?(l=2,u=o):(l=1,u=!0);for(var c=l;c<arguments.length;c++){var h=arguments[c];if(h)for(var m in h)u&&h[m]&&h[m].constructor===Object&&(!s[m]||s[m].constructor===Object)?(s[m]=s[m]||{},a.extend(s[m],u,h[m])):s[m]=h[m]}return s},a.clone=function(s,o){return a.extend({},o,s)},a.keys=function(s){if(Object.keys)return Object.keys(s);var o=[];for(var l in s)o.push(l);return o},a.values=function(s){var o=[];if(Object.keys){for(var l=Object.keys(s),u=0;u<l.length;u++)o.push(s[l[u]]);return o}for(var c in s)o.push(s[c]);return o},a.get=function(s,o,l,u){o=o.split(".").slice(l,u);for(var c=0;c<o.length;c+=1)s=s[o[c]];return s},a.set=function(s,o,l,u,c){var h=o.split(".").slice(u,c);return a.get(s,o,0,-1)[h[h.length-1]]=l,l},a.shuffle=function(s){for(var o=s.length-1;o>0;o--){var l=Math.floor(a.random()*(o+1)),u=s[o];s[o]=s[l],s[l]=u}return s},a.choose=function(s){return s[Math.floor(a.random()*s.length)]},a.isElement=function(s){return typeof HTMLElement<"u"?s instanceof HTMLElement:!!(s&&s.nodeType&&s.nodeName)},a.isArray=function(s){return Object.prototype.toString.call(s)==="[object Array]"},a.isFunction=function(s){return typeof s=="function"},a.isPlainObject=function(s){return typeof s=="object"&&s.constructor===Object},a.isString=function(s){return toString.call(s)==="[object String]"},a.clamp=function(s,o,l){return s<o?o:s>l?l:s},a.sign=function(s){return s<0?-1:1},a.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-a._nowStartTime},a.random=function(s,o){return s=typeof s<"u"?s:0,o=typeof o<"u"?o:1,s+i()*(o-s)};var i=function(){return a._seed=(a._seed*9301+49297)%233280,a._seed/233280};a.colorToNumber=function(s){return s=s.replace("#",""),s.length==3&&(s=s.charAt(0)+s.charAt(0)+s.charAt(1)+s.charAt(1)+s.charAt(2)+s.charAt(2)),parseInt(s,16)},a.logLevel=1,a.log=function(){console&&a.logLevel>0&&a.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},a.info=function(){console&&a.logLevel>0&&a.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},a.warn=function(){console&&a.logLevel>0&&a.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},a.warnOnce=function(){var s=Array.prototype.slice.call(arguments).join(" ");a._warnedOnce[s]||(a.warn(s),a._warnedOnce[s]=!0)},a.deprecated=function(s,o,l){s[o]=a.chain(function(){a.warnOnce("🔅 deprecated 🔅",l)},s[o])},a.nextId=function(){return a._nextId++},a.indexOf=function(s,o){if(s.indexOf)return s.indexOf(o);for(var l=0;l<s.length;l++)if(s[l]===o)return l;return-1},a.map=function(s,o){if(s.map)return s.map(o);for(var l=[],u=0;u<s.length;u+=1)l.push(o(s[u]));return l},a.topologicalSort=function(s){var o=[],l=[],u=[];for(var c in s)!l[c]&&!u[c]&&a._topologicalSort(c,l,u,s,o);return o},a._topologicalSort=function(s,o,l,u,c){var h=u[s]||[];l[s]=!0;for(var m=0;m<h.length;m+=1){var d=h[m];l[d]||o[d]||a._topologicalSort(d,o,l,u,c)}l[s]=!1,o[s]=!0,c.push(s)},a.chain=function(){for(var s=[],o=0;o<arguments.length;o+=1){var l=arguments[o];l._chained?s.push.apply(s,l._chained):s.push(l)}var u=function(){for(var c,h=new Array(arguments.length),m=0,d=arguments.length;m<d;m++)h[m]=arguments[m];for(m=0;m<s.length;m+=1){var p=s[m].apply(c,h);typeof p<"u"&&(c=p)}return c};return u._chained=s,u},a.chainPathBefore=function(s,o,l){return a.set(s,o,a.chain(l,a.get(s,o)))},a.chainPathAfter=function(s,o,l){return a.set(s,o,a.chain(a.get(s,o),l))},a.setDecomp=function(s){a._decomp=s},a.getDecomp=function(){var s=a._decomp;try{!s&&typeof window<"u"&&(s=window.decomp),!s&&typeof mh<"u"&&(s=mh.decomp)}catch{s=null}return s}})()}),(function(n,r){var a={};n.exports=a,(function(){a.create=function(i){var s={min:{x:0,y:0},max:{x:0,y:0}};return i&&a.update(s,i),s},a.update=function(i,s,o){i.min.x=1/0,i.max.x=-1/0,i.min.y=1/0,i.max.y=-1/0;for(var l=0;l<s.length;l++){var u=s[l];u.x>i.max.x&&(i.max.x=u.x),u.x<i.min.x&&(i.min.x=u.x),u.y>i.max.y&&(i.max.y=u.y),u.y<i.min.y&&(i.min.y=u.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)},a.contains=function(i,s){return s.x>=i.min.x&&s.x<=i.max.x&&s.y>=i.min.y&&s.y<=i.max.y},a.overlaps=function(i,s){return i.min.x<=s.max.x&&i.max.x>=s.min.x&&i.max.y>=s.min.y&&i.min.y<=s.max.y},a.translate=function(i,s){i.min.x+=s.x,i.max.x+=s.x,i.min.y+=s.y,i.max.y+=s.y},a.shift=function(i,s){var o=i.max.x-i.min.x,l=i.max.y-i.min.y;i.min.x=s.x,i.max.x=s.x+o,i.min.y=s.y,i.max.y=s.y+l}})()}),(function(n,r){var a={};n.exports=a,(function(){a.create=function(i,s){return{x:i||0,y:s||0}},a.clone=function(i){return{x:i.x,y:i.y}},a.magnitude=function(i){return Math.sqrt(i.x*i.x+i.y*i.y)},a.magnitudeSquared=function(i){return i.x*i.x+i.y*i.y},a.rotate=function(i,s,o){var l=Math.cos(s),u=Math.sin(s);o||(o={});var c=i.x*l-i.y*u;return o.y=i.x*u+i.y*l,o.x=c,o},a.rotateAbout=function(i,s,o,l){var u=Math.cos(s),c=Math.sin(s);l||(l={});var h=o.x+((i.x-o.x)*u-(i.y-o.y)*c);return l.y=o.y+((i.x-o.x)*c+(i.y-o.y)*u),l.x=h,l},a.normalise=function(i){var s=a.magnitude(i);return s===0?{x:0,y:0}:{x:i.x/s,y:i.y/s}},a.dot=function(i,s){return i.x*s.x+i.y*s.y},a.cross=function(i,s){return i.x*s.y-i.y*s.x},a.cross3=function(i,s,o){return(s.x-i.x)*(o.y-i.y)-(s.y-i.y)*(o.x-i.x)},a.add=function(i,s,o){return o||(o={}),o.x=i.x+s.x,o.y=i.y+s.y,o},a.sub=function(i,s,o){return o||(o={}),o.x=i.x-s.x,o.y=i.y-s.y,o},a.mult=function(i,s){return{x:i.x*s,y:i.y*s}},a.div=function(i,s){return{x:i.x/s,y:i.y/s}},a.perp=function(i,s){return s=s===!0?-1:1,{x:s*-i.y,y:s*i.x}},a.neg=function(i){return{x:-i.x,y:-i.y}},a.angle=function(i,s){return Math.atan2(s.y-i.y,s.x-i.x)},a._temp=[a.create(),a.create(),a.create(),a.create(),a.create(),a.create()]})()}),(function(n,r,a){var i={};n.exports=i;var s=a(2),o=a(0);(function(){i.create=function(l,u){for(var c=[],h=0;h<l.length;h++){var m=l[h],d={x:m.x,y:m.y,index:h,body:u,isInternal:!1};c.push(d)}return c},i.fromPath=function(l,u){var c=/L?\s*([-\d.e]+)[\s,]*([-\d.e]+)*/ig,h=[];return l.replace(c,function(m,d,p){h.push({x:parseFloat(d),y:parseFloat(p)})}),i.create(h,u)},i.centre=function(l){for(var u=i.area(l,!0),c={x:0,y:0},h,m,d,p=0;p<l.length;p++)d=(p+1)%l.length,h=s.cross(l[p],l[d]),m=s.mult(s.add(l[p],l[d]),h),c=s.add(c,m);return s.div(c,6*u)},i.mean=function(l){for(var u={x:0,y:0},c=0;c<l.length;c++)u.x+=l[c].x,u.y+=l[c].y;return s.div(u,l.length)},i.area=function(l,u){for(var c=0,h=l.length-1,m=0;m<l.length;m++)c+=(l[h].x-l[m].x)*(l[h].y+l[m].y),h=m;return u?c/2:Math.abs(c)/2},i.inertia=function(l,u){for(var c=0,h=0,m=l,d,p,g=0;g<m.length;g++)p=(g+1)%m.length,d=Math.abs(s.cross(m[p],m[g])),c+=d*(s.dot(m[p],m[p])+s.dot(m[p],m[g])+s.dot(m[g],m[g])),h+=d;return u/6*(c/h)},i.translate=function(l,u,c){c=typeof c<"u"?c:1;var h=l.length,m=u.x*c,d=u.y*c,p;for(p=0;p<h;p++)l[p].x+=m,l[p].y+=d;return l},i.rotate=function(l,u,c){if(u!==0){var h=Math.cos(u),m=Math.sin(u),d=c.x,p=c.y,g=l.length,x,b,v,T;for(T=0;T<g;T++)x=l[T],b=x.x-d,v=x.y-p,x.x=d+(b*h-v*m),x.y=p+(b*m+v*h);return l}},i.contains=function(l,u){for(var c=u.x,h=u.y,m=l.length,d=l[m-1],p,g=0;g<m;g++){if(p=l[g],(c-d.x)*(p.y-d.y)+(h-d.y)*(d.x-p.x)>0)return!1;d=p}return!0},i.scale=function(l,u,c,h){if(u===1&&c===1)return l;h=h||i.centre(l);for(var m,d,p=0;p<l.length;p++)m=l[p],d=s.sub(m,h),l[p].x=h.x+d.x*u,l[p].y=h.y+d.y*c;return l},i.chamfer=function(l,u,c,h,m){typeof u=="number"?u=[u]:u=u||[8],c=typeof c<"u"?c:-1,h=h||2,m=m||14;for(var d=[],p=0;p<l.length;p++){var g=l[p-1>=0?p-1:l.length-1],x=l[p],b=l[(p+1)%l.length],v=u[p<u.length?p:u.length-1];if(v===0){d.push(x);continue}var T=s.normalise({x:x.y-g.y,y:g.x-x.x}),N=s.normalise({x:b.y-x.y,y:x.x-b.x}),k=Math.sqrt(2*Math.pow(v,2)),A=s.mult(o.clone(T),v),_=s.normalise(s.mult(s.add(T,N),.5)),S=s.sub(x,s.mult(_,k)),I=c;c===-1&&(I=Math.pow(v,.32)*1.75),I=o.clamp(I,h,m),I%2===1&&(I+=1);for(var C=Math.acos(s.dot(T,N)),D=C/I,L=0;L<I;L++)d.push(s.add(s.rotate(A,D*L),S))}return d},i.clockwiseSort=function(l){var u=i.mean(l);return l.sort(function(c,h){return s.angle(u,c)-s.angle(u,h)}),l},i.isConvex=function(l){var u=0,c=l.length,h,m,d,p;if(c<3)return null;for(h=0;h<c;h++)if(m=(h+1)%c,d=(h+2)%c,p=(l[m].x-l[h].x)*(l[d].y-l[m].y),p-=(l[m].y-l[h].y)*(l[d].x-l[m].x),p<0?u|=1:p>0&&(u|=2),u===3)return!1;return u!==0?!0:null},i.hull=function(l){var u=[],c=[],h,m;for(l=l.slice(0),l.sort(function(d,p){var g=d.x-p.x;return g!==0?g:d.y-p.y}),m=0;m<l.length;m+=1){for(h=l[m];c.length>=2&&s.cross3(c[c.length-2],c[c.length-1],h)<=0;)c.pop();c.push(h)}for(m=l.length-1;m>=0;m-=1){for(h=l[m];u.length>=2&&s.cross3(u[u.length-2],u[u.length-1],h)<=0;)u.pop();u.push(h)}return u.pop(),c.pop(),u.concat(c)}})()}),(function(n,r,a){var i={};n.exports=i;var s=a(3),o=a(2),l=a(7),u=a(0),c=a(1),h=a(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 p={id:u.nextId(),type:"body",label:"Body",parts:[],plugin:{},angle:0,vertices:s.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},g=u.extend(p,d);return m(g,d),g},i.nextGroup=function(d){return d?i._nextNonCollidingGroupId--:i._nextCollidingGroupId++},i.nextCategory=function(){return i._nextCategory=i._nextCategory<<1,i._nextCategory};var m=function(d,p){p=p||{},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}),s.rotate(d.vertices,d.angle,d.position),h.rotate(d.axes,d.angle),c.update(d.bounds,d.vertices,d.velocity),i.set(d,{axes:p.axes||d.axes,area:p.area||d.area,mass:p.mass||d.mass,inertia:p.inertia||d.inertia});var g=d.isStatic?"#14151f":u.choose(["#f19648","#f5d259","#f55a3c","#063e7b","#ececd1"]),x=d.isStatic?"#555":"#ccc",b=d.isStatic&&d.render.fillStyle===null?1:0;d.render.fillStyle=d.render.fillStyle||g,d.render.strokeStyle=d.render.strokeStyle||x,d.render.lineWidth=d.render.lineWidth||b,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,p,g){var x;typeof p=="string"&&(x=p,p={},p[x]=g);for(x in p)if(Object.prototype.hasOwnProperty.call(p,x))switch(g=p[x],x){case"isStatic":i.setStatic(d,g);break;case"isSleeping":l.set(d,g);break;case"mass":i.setMass(d,g);break;case"density":i.setDensity(d,g);break;case"inertia":i.setInertia(d,g);break;case"vertices":i.setVertices(d,g);break;case"position":i.setPosition(d,g);break;case"angle":i.setAngle(d,g);break;case"velocity":i.setVelocity(d,g);break;case"angularVelocity":i.setAngularVelocity(d,g);break;case"speed":i.setSpeed(d,g);break;case"angularSpeed":i.setAngularSpeed(d,g);break;case"parts":i.setParts(d,g);break;case"centre":i.setCentre(d,g);break;default:d[x]=g}},i.setStatic=function(d,p){for(var g=0;g<d.parts.length;g++){var x=d.parts[g];x.isStatic=p,p?(x._original={restitution:x.restitution,friction:x.friction,mass:x.mass,inertia:x.inertia,density:x.density,inverseMass:x.inverseMass,inverseInertia:x.inverseInertia},x.restitution=0,x.friction=1,x.mass=x.inertia=x.density=1/0,x.inverseMass=x.inverseInertia=0,x.positionPrev.x=x.position.x,x.positionPrev.y=x.position.y,x.anglePrev=x.angle,x.angularVelocity=0,x.speed=0,x.angularSpeed=0,x.motion=0):x._original&&(x.restitution=x._original.restitution,x.friction=x._original.friction,x.mass=x._original.mass,x.inertia=x._original.inertia,x.density=x._original.density,x.inverseMass=x._original.inverseMass,x.inverseInertia=x._original.inverseInertia,x._original=null)}},i.setMass=function(d,p){var g=d.inertia/(d.mass/6);d.inertia=g*(p/6),d.inverseInertia=1/d.inertia,d.mass=p,d.inverseMass=1/d.mass,d.density=d.mass/d.area},i.setDensity=function(d,p){i.setMass(d,p*d.area),d.density=p},i.setInertia=function(d,p){d.inertia=p,d.inverseInertia=1/d.inertia},i.setVertices=function(d,p){p[0].body===d?d.vertices=p:d.vertices=s.create(p,d),d.axes=h.fromVertices(d.vertices),d.area=s.area(d.vertices),i.setMass(d,d.density*d.area);var g=s.centre(d.vertices);s.translate(d.vertices,g,-1),i.setInertia(d,i._inertiaScale*s.inertia(d.vertices,d.mass)),s.translate(d.vertices,d.position),c.update(d.bounds,d.vertices,d.velocity)},i.setParts=function(d,p,g){var x;for(p=p.slice(0),d.parts.length=0,d.parts.push(d),d.parent=d,x=0;x<p.length;x++){var b=p[x];b!==d&&(b.parent=d,d.parts.push(b))}if(d.parts.length!==1){if(g=typeof g<"u"?g:!0,g){var v=[];for(x=0;x<p.length;x++)v=v.concat(p[x].vertices);s.clockwiseSort(v);var T=s.hull(v),N=s.centre(T);i.setVertices(d,T),s.translate(d.vertices,N)}var k=i._totalProperties(d);d.area=k.area,d.parent=d,d.position.x=k.centre.x,d.position.y=k.centre.y,d.positionPrev.x=k.centre.x,d.positionPrev.y=k.centre.y,i.setMass(d,k.mass),i.setInertia(d,k.inertia),i.setPosition(d,k.centre)}},i.setCentre=function(d,p,g){g?(d.positionPrev.x+=p.x,d.positionPrev.y+=p.y,d.position.x+=p.x,d.position.y+=p.y):(d.positionPrev.x=p.x-(d.position.x-d.positionPrev.x),d.positionPrev.y=p.y-(d.position.y-d.positionPrev.y),d.position.x=p.x,d.position.y=p.y)},i.setPosition=function(d,p,g){var x=o.sub(p,d.position);g?(d.positionPrev.x=d.position.x,d.positionPrev.y=d.position.y,d.velocity.x=x.x,d.velocity.y=x.y,d.speed=o.magnitude(x)):(d.positionPrev.x+=x.x,d.positionPrev.y+=x.y);for(var b=0;b<d.parts.length;b++){var v=d.parts[b];v.position.x+=x.x,v.position.y+=x.y,s.translate(v.vertices,x),c.update(v.bounds,v.vertices,d.velocity)}},i.setAngle=function(d,p,g){var x=p-d.angle;g?(d.anglePrev=d.angle,d.angularVelocity=x,d.angularSpeed=Math.abs(x)):d.anglePrev+=x;for(var b=0;b<d.parts.length;b++){var v=d.parts[b];v.angle+=x,s.rotate(v.vertices,x,d.position),h.rotate(v.axes,x),c.update(v.bounds,v.vertices,d.velocity),b>0&&o.rotateAbout(v.position,x,d.position,v.position)}},i.setVelocity=function(d,p){var g=d.deltaTime/i._baseDelta;d.positionPrev.x=d.position.x-p.x*g,d.positionPrev.y=d.position.y-p.y*g,d.velocity.x=(d.position.x-d.positionPrev.x)/g,d.velocity.y=(d.position.y-d.positionPrev.y)/g,d.speed=o.magnitude(d.velocity)},i.getVelocity=function(d){var p=i._baseDelta/d.deltaTime;return{x:(d.position.x-d.positionPrev.x)*p,y:(d.position.y-d.positionPrev.y)*p}},i.getSpeed=function(d){return o.magnitude(i.getVelocity(d))},i.setSpeed=function(d,p){i.setVelocity(d,o.mult(o.normalise(i.getVelocity(d)),p))},i.setAngularVelocity=function(d,p){var g=d.deltaTime/i._baseDelta;d.anglePrev=d.angle-p*g,d.angularVelocity=(d.angle-d.anglePrev)/g,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,p){i.setAngularVelocity(d,u.sign(i.getAngularVelocity(d))*p)},i.translate=function(d,p,g){i.setPosition(d,o.add(d.position,p),g)},i.rotate=function(d,p,g,x){if(!g)i.setAngle(d,d.angle+p,x);else{var b=Math.cos(p),v=Math.sin(p),T=d.position.x-g.x,N=d.position.y-g.y;i.setPosition(d,{x:g.x+(T*b-N*v),y:g.y+(T*v+N*b)},x),i.setAngle(d,d.angle+p,x)}},i.scale=function(d,p,g,x){var b=0,v=0;x=x||d.position;for(var T=0;T<d.parts.length;T++){var N=d.parts[T];s.scale(N.vertices,p,g,x),N.axes=h.fromVertices(N.vertices),N.area=s.area(N.vertices),i.setMass(N,d.density*N.area),s.translate(N.vertices,{x:-N.position.x,y:-N.position.y}),i.setInertia(N,i._inertiaScale*s.inertia(N.vertices,N.mass)),s.translate(N.vertices,{x:N.position.x,y:N.position.y}),T>0&&(b+=N.area,v+=N.inertia),N.position.x=x.x+(N.position.x-x.x)*p,N.position.y=x.y+(N.position.y-x.y)*g,c.update(N.bounds,N.vertices,d.velocity)}d.parts.length>1&&(d.area=b,d.isStatic||(i.setMass(d,d.density*b),i.setInertia(d,v))),d.circleRadius&&(p===g?d.circleRadius*=p:d.circleRadius=null)},i.update=function(d,p){p=(typeof p<"u"?p:1e3/60)*d.timeScale;var g=p*p,x=i._timeCorrection?p/(d.deltaTime||p):1,b=1-d.frictionAir*(p/u._baseDelta),v=(d.position.x-d.positionPrev.x)*x,T=(d.position.y-d.positionPrev.y)*x;d.velocity.x=v*b+d.force.x/d.mass*g,d.velocity.y=T*b+d.force.y/d.mass*g,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=p,d.angularVelocity=(d.angle-d.anglePrev)*b*x+d.torque/d.inertia*g,d.anglePrev=d.angle,d.angle+=d.angularVelocity;for(var N=0;N<d.parts.length;N++){var k=d.parts[N];s.translate(k.vertices,d.velocity),N>0&&(k.position.x+=d.velocity.x,k.position.y+=d.velocity.y),d.angularVelocity!==0&&(s.rotate(k.vertices,d.angularVelocity,d.position),h.rotate(k.axes,d.angularVelocity),N>0&&o.rotateAbout(k.position,d.angularVelocity,d.position,k.position)),c.update(k.bounds,k.vertices,d.velocity)}},i.updateVelocities=function(d){var p=i._baseDelta/d.deltaTime,g=d.velocity;g.x=(d.position.x-d.positionPrev.x)*p,g.y=(d.position.y-d.positionPrev.y)*p,d.speed=Math.sqrt(g.x*g.x+g.y*g.y),d.angularVelocity=(d.angle-d.anglePrev)*p,d.angularSpeed=Math.abs(d.angularVelocity)},i.applyForce=function(d,p,g){var x={x:p.x-d.position.x,y:p.y-d.position.y};d.force.x+=g.x,d.force.y+=g.y,d.torque+=x.x*g.y-x.y*g.x},i._totalProperties=function(d){for(var p={mass:0,area:0,inertia:0,centre:{x:0,y:0}},g=d.parts.length===1?0:1;g<d.parts.length;g++){var x=d.parts[g],b=x.mass!==1/0?x.mass:1;p.mass+=b,p.area+=x.area,p.inertia+=x.inertia,p.centre=o.add(p.centre,o.mult(x.position,b))}return p.centre=o.div(p.centre,p.mass),p}})()}),(function(n,r,a){var i={};n.exports=i;var s=a(0);(function(){i.on=function(o,l,u){for(var c=l.split(" "),h,m=0;m<c.length;m++)h=c[m],o.events=o.events||{},o.events[h]=o.events[h]||[],o.events[h].push(u);return u},i.off=function(o,l,u){if(!l){o.events={};return}typeof l=="function"&&(u=l,l=s.keys(o.events).join(" "));for(var c=l.split(" "),h=0;h<c.length;h++){var m=o.events[c[h]],d=[];if(u&&m)for(var p=0;p<m.length;p++)m[p]!==u&&d.push(m[p]);o.events[c[h]]=d}},i.trigger=function(o,l,u){var c,h,m,d,p=o.events;if(p&&s.keys(p).length>0){u||(u={}),c=l.split(" ");for(var g=0;g<c.length;g++)if(h=c[g],m=p[h],m){d=s.clone(u,!1),d.name=h,d.source=o;for(var x=0;x<m.length;x++)m[x].apply(o,[d])}}}})()}),(function(n,r,a){var i={};n.exports=i;var s=a(5),o=a(0),l=a(1),u=a(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,h,m,d){if(c.isModified=h,h&&c.cache&&(c.cache.allBodies=null,c.cache.allConstraints=null,c.cache.allComposites=null),m&&c.parent&&i.setModified(c.parent,h,m,d),d)for(var p=0;p<c.composites.length;p++){var g=c.composites[p];i.setModified(g,h,m,d)}},i.add=function(c,h){var m=[].concat(h);s.trigger(c,"beforeAdd",{object:h});for(var d=0;d<m.length;d++){var p=m[d];switch(p.type){case"body":if(p.parent!==p){o.warn("Composite.add: skipped adding a compound body part (you must add its parent instead)");break}i.addBody(c,p);break;case"constraint":i.addConstraint(c,p);break;case"composite":i.addComposite(c,p);break;case"mouseConstraint":i.addConstraint(c,p.constraint);break}}return s.trigger(c,"afterAdd",{object:h}),c},i.remove=function(c,h,m){var d=[].concat(h);s.trigger(c,"beforeRemove",{object:h});for(var p=0;p<d.length;p++){var g=d[p];switch(g.type){case"body":i.removeBody(c,g,m);break;case"constraint":i.removeConstraint(c,g,m);break;case"composite":i.removeComposite(c,g,m);break;case"mouseConstraint":i.removeConstraint(c,g.constraint);break}}return s.trigger(c,"afterRemove",{object:h}),c},i.addComposite=function(c,h){return c.composites.push(h),h.parent=c,i.setModified(c,!0,!0,!1),c},i.removeComposite=function(c,h,m){var d=o.indexOf(c.composites,h);if(d!==-1&&i.removeCompositeAt(c,d),m)for(var p=0;p<c.composites.length;p++)i.removeComposite(c.composites[p],h,!0);return c},i.removeCompositeAt=function(c,h){return c.composites.splice(h,1),i.setModified(c,!0,!0,!1),c},i.addBody=function(c,h){return c.bodies.push(h),i.setModified(c,!0,!0,!1),c},i.removeBody=function(c,h,m){var d=o.indexOf(c.bodies,h);if(d!==-1&&i.removeBodyAt(c,d),m)for(var p=0;p<c.composites.length;p++)i.removeBody(c.composites[p],h,!0);return c},i.removeBodyAt=function(c,h){return c.bodies.splice(h,1),i.setModified(c,!0,!0,!1),c},i.addConstraint=function(c,h){return c.constraints.push(h),i.setModified(c,!0,!0,!1),c},i.removeConstraint=function(c,h,m){var d=o.indexOf(c.constraints,h);if(d!==-1&&i.removeConstraintAt(c,d),m)for(var p=0;p<c.composites.length;p++)i.removeConstraint(c.composites[p],h,!0);return c},i.removeConstraintAt=function(c,h){return c.constraints.splice(h,1),i.setModified(c,!0,!0,!1),c},i.clear=function(c,h,m){if(m)for(var d=0;d<c.composites.length;d++)i.clear(c.composites[d],h,!0);return h?c.bodies=c.bodies.filter(function(p){return p.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 h=[].concat(c.bodies),m=0;m<c.composites.length;m++)h=h.concat(i.allBodies(c.composites[m]));return c.cache&&(c.cache.allBodies=h),h},i.allConstraints=function(c){if(c.cache&&c.cache.allConstraints)return c.cache.allConstraints;for(var h=[].concat(c.constraints),m=0;m<c.composites.length;m++)h=h.concat(i.allConstraints(c.composites[m]));return c.cache&&(c.cache.allConstraints=h),h},i.allComposites=function(c){if(c.cache&&c.cache.allComposites)return c.cache.allComposites;for(var h=[].concat(c.composites),m=0;m<c.composites.length;m++)h=h.concat(i.allComposites(c.composites[m]));return c.cache&&(c.cache.allComposites=h),h},i.get=function(c,h,m){var d,p;switch(m){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?(p=d.filter(function(g){return g.id.toString()===h.toString()}),p.length===0?null:p[0]):null},i.move=function(c,h,m){return i.remove(c,h),i.add(m,h),c},i.rebase=function(c){for(var h=i.allBodies(c).concat(i.allConstraints(c)).concat(i.allComposites(c)),m=0;m<h.length;m++)h[m].id=o.nextId();return c},i.translate=function(c,h,m){for(var d=m?i.allBodies(c):c.bodies,p=0;p<d.length;p++)u.translate(d[p],h);return c},i.rotate=function(c,h,m,d){for(var p=Math.cos(h),g=Math.sin(h),x=d?i.allBodies(c):c.bodies,b=0;b<x.length;b++){var v=x[b],T=v.position.x-m.x,N=v.position.y-m.y;u.setPosition(v,{x:m.x+(T*p-N*g),y:m.y+(T*g+N*p)}),u.rotate(v,h)}return c},i.scale=function(c,h,m,d,p){for(var g=p?i.allBodies(c):c.bodies,x=0;x<g.length;x++){var b=g[x],v=b.position.x-d.x,T=b.position.y-d.y;u.setPosition(b,{x:d.x+v*h,y:d.y+T*m}),u.scale(b,h,m)}return c},i.bounds=function(c){for(var h=i.allBodies(c),m=[],d=0;d<h.length;d+=1){var p=h[d];m.push(p.bounds.min,p.bounds.max)}return l.create(m)}})()}),(function(n,r,a){var i={};n.exports=i;var s=a(4),o=a(5),l=a(0);(function(){i._motionWakeThreshold=.18,i._motionSleepThreshold=.08,i._minBias=.9,i.update=function(u,c){for(var h=c/l._baseDelta,m=i._motionSleepThreshold,d=0;d<u.length;d++){var p=u[d],g=s.getSpeed(p),x=s.getAngularSpeed(p),b=g*g+x*x;if(p.force.x!==0||p.force.y!==0){i.set(p,!1);continue}var v=Math.min(p.motion,b),T=Math.max(p.motion,b);p.motion=i._minBias*v+(1-i._minBias)*T,p.sleepThreshold>0&&p.motion<m?(p.sleepCounter+=1,p.sleepCounter>=p.sleepThreshold/h&&i.set(p,!0)):p.sleepCounter>0&&(p.sleepCounter-=1)}},i.afterCollisions=function(u){for(var c=i._motionSleepThreshold,h=0;h<u.length;h++){var m=u[h];if(m.isActive){var d=m.collision,p=d.bodyA.parent,g=d.bodyB.parent;if(!(p.isSleeping&&g.isSleeping||p.isStatic||g.isStatic)&&(p.isSleeping||g.isSleeping)){var x=p.isSleeping&&!p.isStatic?p:g,b=x===p?g:p;!x.isStatic&&b.motion>c&&i.set(x,!1)}}}},i.set=function(u,c){var h=u.isSleeping;c?(u.isSleeping=!0,u.sleepCounter=u.sleepThreshold,u.positionImpulse.x=0,u.positionImpulse.y=0,u.positionPrev.x=u.position.x,u.positionPrev.y=u.position.y,u.anglePrev=u.angle,u.speed=0,u.angularSpeed=0,u.motion=0,h||o.trigger(u,"sleepStart")):(u.isSleeping=!1,u.sleepCounter=0,h&&o.trigger(u,"sleepEnd"))}})()}),(function(n,r,a){var i={};n.exports=i;var s=a(3),o=a(9);(function(){var l=[],u={overlap:0,axis:null},c={overlap:0,axis:null};i.create=function(h,m){return{pair:null,collided:!1,bodyA:h,bodyB:m,parentA:h.parent,parentB:m.parent,depth:0,normal:{x:0,y:0},tangent:{x:0,y:0},penetration:{x:0,y:0},supports:[]}},i.collides=function(h,m,d){if(i._overlapAxes(u,h.vertices,m.vertices,h.axes),u.overlap<=0||(i._overlapAxes(c,m.vertices,h.vertices,m.axes),c.overlap<=0))return null;var p=d&&d.table[o.id(h,m)],g;p?g=p.collision:(g=i.create(h,m),g.collided=!0,g.bodyA=h.id<m.id?h:m,g.bodyB=h.id<m.id?m:h,g.parentA=g.bodyA.parent,g.parentB=g.bodyB.parent),h=g.bodyA,m=g.bodyB;var x;u.overlap<c.overlap?x=u:x=c;var b=g.normal,v=g.supports,T=x.axis,N=T.x,k=T.y;N*(m.position.x-h.position.x)+k*(m.position.y-h.position.y)<0?(b.x=N,b.y=k):(b.x=-N,b.y=-k),g.tangent.x=-b.y,g.tangent.y=b.x,g.depth=x.overlap,g.penetration.x=b.x*g.depth,g.penetration.y=b.y*g.depth;var A=i._findSupports(h,m,b,1),_=0;if(s.contains(h.vertices,A[0])&&(v[_++]=A[0]),s.contains(h.vertices,A[1])&&(v[_++]=A[1]),_<2){var S=i._findSupports(m,h,b,-1);s.contains(m.vertices,S[0])&&(v[_++]=S[0]),_<2&&s.contains(m.vertices,S[1])&&(v[_++]=S[1])}return _===0&&(v[_++]=A[0]),v.length=_,g},i._overlapAxes=function(h,m,d,p){var g=m.length,x=d.length,b=m[0].x,v=m[0].y,T=d[0].x,N=d[0].y,k=p.length,A=Number.MAX_VALUE,_=0,S,I,C,D,L,F;for(L=0;L<k;L++){var O=p[L],R=O.x,H=O.y,V=b*R+v*H,q=T*R+N*H,Z=V,B=q;for(F=1;F<g;F+=1)D=m[F].x*R+m[F].y*H,D>Z?Z=D:D<V&&(V=D);for(F=1;F<x;F+=1)D=d[F].x*R+d[F].y*H,D>B?B=D:D<q&&(q=D);if(I=Z-q,C=B-V,S=I<C?I:C,S<A&&(A=S,_=L,S<=0))break}h.axis=p[_],h.overlap=A},i._projectToAxis=function(h,m,d){for(var p=m[0].x*d.x+m[0].y*d.y,g=p,x=1;x<m.length;x+=1){var b=m[x].x*d.x+m[x].y*d.y;b>g?g=b:b<p&&(p=b)}h.min=p,h.max=g},i._findSupports=function(h,m,d,p){var g=m.vertices,x=g.length,b=h.position.x,v=h.position.y,T=d.x*p,N=d.y*p,k=Number.MAX_VALUE,A,_,S,I,C;for(C=0;C<x;C+=1)_=g[C],I=T*(b-_.x)+N*(v-_.y),I<k&&(k=I,A=_);return S=g[(x+A.index-1)%x],k=T*(b-S.x)+N*(v-S.y),_=g[(A.index+1)%x],T*(b-_.x)+N*(v-_.y)<k?(l[0]=A,l[1]=_,l):(l[0]=A,l[1]=S,l)}})()}),(function(n,r,a){var i={};n.exports=i;var s=a(16);(function(){i.create=function(o,l){var u=o.bodyA,c=o.bodyB,h={id:i.id(u,c),bodyA:u,bodyB:c,collision:o,contacts:[],activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:u.isSensor||c.isSensor,timeCreated:l,timeUpdated:l,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return i.update(h,o,l),h},i.update=function(o,l,u){var c=o.contacts,h=l.supports,m=o.activeContacts,d=l.parentA,p=l.parentB,g=d.vertices.length;o.isActive=!0,o.timeUpdated=u,o.collision=l,o.separation=l.depth,o.inverseMass=d.inverseMass+p.inverseMass,o.friction=d.friction<p.friction?d.friction:p.friction,o.frictionStatic=d.frictionStatic>p.frictionStatic?d.frictionStatic:p.frictionStatic,o.restitution=d.restitution>p.restitution?d.restitution:p.restitution,o.slop=d.slop>p.slop?d.slop:p.slop,l.pair=o,m.length=0;for(var x=0;x<h.length;x++){var b=h[x],v=b.body===d?b.index:g+b.index,T=c[v];T?m.push(T):m.push(c[v]=s.create(b))}},i.setActive=function(o,l,u){l?(o.isActive=!0,o.timeUpdated=u):(o.isActive=!1,o.activeContacts.length=0)},i.id=function(o,l){return o.id<l.id?"A"+o.id+"B"+l.id:"A"+l.id+"B"+o.id}})()}),(function(n,r,a){var i={};n.exports=i;var s=a(3),o=a(2),l=a(7),u=a(1),c=a(11),h=a(0);(function(){i._warming=.4,i._torqueDampen=1,i._minLength=1e-6,i.create=function(m){var d=m;d.bodyA&&!d.pointA&&(d.pointA={x:0,y:0}),d.bodyB&&!d.pointB&&(d.pointB={x:0,y:0});var p=d.bodyA?o.add(d.bodyA.position,d.pointA):d.pointA,g=d.bodyB?o.add(d.bodyB.position,d.pointB):d.pointB,x=o.magnitude(o.sub(p,g));d.length=typeof d.length<"u"?d.length:x,d.id=d.id||h.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 b={visible:!0,lineWidth:2,strokeStyle:"#ffffff",type:"line",anchors:!0};return d.length===0&&d.stiffness>.1?(b.type="pin",b.anchors=!1):d.stiffness<.9&&(b.type="spring"),d.render=h.extend(b,d.render),d},i.preSolveAll=function(m){for(var d=0;d<m.length;d+=1){var p=m[d],g=p.constraintImpulse;p.isStatic||g.x===0&&g.y===0&&g.angle===0||(p.position.x+=g.x,p.position.y+=g.y,p.angle+=g.angle)}},i.solveAll=function(m,d){for(var p=h.clamp(d/h._baseDelta,0,1),g=0;g<m.length;g+=1){var x=m[g],b=!x.bodyA||x.bodyA&&x.bodyA.isStatic,v=!x.bodyB||x.bodyB&&x.bodyB.isStatic;(b||v)&&i.solve(m[g],p)}for(g=0;g<m.length;g+=1)x=m[g],b=!x.bodyA||x.bodyA&&x.bodyA.isStatic,v=!x.bodyB||x.bodyB&&x.bodyB.isStatic,!b&&!v&&i.solve(m[g],p)},i.solve=function(m,d){var p=m.bodyA,g=m.bodyB,x=m.pointA,b=m.pointB;if(!(!p&&!g)){p&&!p.isStatic&&(o.rotate(x,p.angle-m.angleA,x),m.angleA=p.angle),g&&!g.isStatic&&(o.rotate(b,g.angle-m.angleB,b),m.angleB=g.angle);var v=x,T=b;if(p&&(v=o.add(p.position,x)),g&&(T=o.add(g.position,b)),!(!v||!T)){var N=o.sub(v,T),k=o.magnitude(N);k<i._minLength&&(k=i._minLength);var A=(k-m.length)/k,_=m.stiffness>=1||m.length===0,S=_?m.stiffness*d:m.stiffness*d*d,I=m.damping*d,C=o.mult(N,A*S),D=(p?p.inverseMass:0)+(g?g.inverseMass:0),L=(p?p.inverseInertia:0)+(g?g.inverseInertia:0),F=D+L,O,R,H,V,q;if(I>0){var Z=o.create();H=o.div(N,k),q=o.sub(g&&o.sub(g.position,g.positionPrev)||Z,p&&o.sub(p.position,p.positionPrev)||Z),V=o.dot(H,q)}p&&!p.isStatic&&(R=p.inverseMass/D,p.constraintImpulse.x-=C.x*R,p.constraintImpulse.y-=C.y*R,p.position.x-=C.x*R,p.position.y-=C.y*R,I>0&&(p.positionPrev.x-=I*H.x*V*R,p.positionPrev.y-=I*H.y*V*R),O=o.cross(x,C)/F*i._torqueDampen*p.inverseInertia*(1-m.angularStiffness),p.constraintImpulse.angle-=O,p.angle-=O),g&&!g.isStatic&&(R=g.inverseMass/D,g.constraintImpulse.x+=C.x*R,g.constraintImpulse.y+=C.y*R,g.position.x+=C.x*R,g.position.y+=C.y*R,I>0&&(g.positionPrev.x+=I*H.x*V*R,g.positionPrev.y+=I*H.y*V*R),O=o.cross(b,C)/F*i._torqueDampen*g.inverseInertia*(1-m.angularStiffness),g.constraintImpulse.angle+=O,g.angle+=O)}}},i.postSolveAll=function(m){for(var d=0;d<m.length;d++){var p=m[d],g=p.constraintImpulse;if(!(p.isStatic||g.x===0&&g.y===0&&g.angle===0)){l.set(p,!1);for(var x=0;x<p.parts.length;x++){var b=p.parts[x];s.translate(b.vertices,g),x>0&&(b.position.x+=g.x,b.position.y+=g.y),g.angle!==0&&(s.rotate(b.vertices,g.angle,p.position),c.rotate(b.axes,g.angle),x>0&&o.rotateAbout(b.position,g.angle,p.position,b.position)),u.update(b.bounds,b.vertices,p.velocity)}g.angle*=i._warming,g.x*=i._warming,g.y*=i._warming}}},i.pointAWorld=function(m){return{x:(m.bodyA?m.bodyA.position.x:0)+(m.pointA?m.pointA.x:0),y:(m.bodyA?m.bodyA.position.y:0)+(m.pointA?m.pointA.y:0)}},i.pointBWorld=function(m){return{x:(m.bodyB?m.bodyB.position.x:0)+(m.pointB?m.pointB.x:0),y:(m.bodyB?m.bodyB.position.y:0)+(m.pointB?m.pointB.y:0)}}})()}),(function(n,r,a){var i={};n.exports=i;var s=a(2),o=a(0);(function(){i.fromVertices=function(l){for(var u={},c=0;c<l.length;c++){var h=(c+1)%l.length,m=s.normalise({x:l[h].y-l[c].y,y:l[c].x-l[h].x}),d=m.y===0?1/0:m.x/m.y;d=d.toFixed(3).toString(),u[d]=m}return o.values(u)},i.rotate=function(l,u){if(u!==0)for(var c=Math.cos(u),h=Math.sin(u),m=0;m<l.length;m++){var d=l[m],p;p=d.x*c-d.y*h,d.y=d.x*h+d.y*c,d.x=p}}})()}),(function(n,r,a){var i={};n.exports=i;var s=a(3),o=a(0),l=a(4),u=a(1),c=a(2);(function(){i.rectangle=function(h,m,d,p,g){g=g||{};var x={label:"Rectangle Body",position:{x:h,y:m},vertices:s.fromPath("L 0 0 L "+d+" 0 L "+d+" "+p+" L 0 "+p)};if(g.chamfer){var b=g.chamfer;x.vertices=s.chamfer(x.vertices,b.radius,b.quality,b.qualityMin,b.qualityMax),delete g.chamfer}return l.create(o.extend({},x,g))},i.trapezoid=function(h,m,d,p,g,x){x=x||{},g*=.5;var b=(1-g*2)*d,v=d*g,T=v+b,N=T+v,k;g<.5?k="L 0 0 L "+v+" "+-p+" L "+T+" "+-p+" L "+N+" 0":k="L 0 0 L "+T+" "+-p+" L "+N+" 0";var A={label:"Trapezoid Body",position:{x:h,y:m},vertices:s.fromPath(k)};if(x.chamfer){var _=x.chamfer;A.vertices=s.chamfer(A.vertices,_.radius,_.quality,_.qualityMin,_.qualityMax),delete x.chamfer}return l.create(o.extend({},A,x))},i.circle=function(h,m,d,p,g){p=p||{};var x={label:"Circle Body",circleRadius:d};g=g||25;var b=Math.ceil(Math.max(10,Math.min(g,d)));return b%2===1&&(b+=1),i.polygon(h,m,b,d,o.extend({},x,p))},i.polygon=function(h,m,d,p,g){if(g=g||{},d<3)return i.circle(h,m,p,g);for(var x=2*Math.PI/d,b="",v=x*.5,T=0;T<d;T+=1){var N=v+T*x,k=Math.cos(N)*p,A=Math.sin(N)*p;b+="L "+k.toFixed(3)+" "+A.toFixed(3)+" "}var _={label:"Polygon Body",position:{x:h,y:m},vertices:s.fromPath(b)};if(g.chamfer){var S=g.chamfer;_.vertices=s.chamfer(_.vertices,S.radius,S.quality,S.qualityMin,S.qualityMax),delete g.chamfer}return l.create(o.extend({},_,g))},i.fromVertices=function(h,m,d,p,g,x,b,v){var T=o.getDecomp(),N,k,A,_,S,I,C,D,L,F,O;for(N=!!(T&&T.quickDecomp),p=p||{},A=[],g=typeof g<"u"?g:!1,x=typeof x<"u"?x:.01,b=typeof b<"u"?b:10,v=typeof v<"u"?v:.01,o.isArray(d[0])||(d=[d]),F=0;F<d.length;F+=1)if(I=d[F],_=s.isConvex(I),S=!_,S&&!N&&o.warnOnce("Bodies.fromVertices: Install the 'poly-decomp' library and use Common.setDecomp or provide 'decomp' as a global to decompose concave vertices."),_||!N)_?I=s.clockwiseSort(I):I=s.hull(I),A.push({position:{x:h,y:m},vertices:I});else{var R=I.map(function(X){return[X.x,X.y]});T.makeCCW(R),x!==!1&&T.removeCollinearPoints(R,x),v!==!1&&T.removeDuplicatePoints&&T.removeDuplicatePoints(R,v);var H=T.quickDecomp(R);for(C=0;C<H.length;C++){var V=H[C],q=V.map(function(X){return{x:X[0],y:X[1]}});b>0&&s.area(q)<b||A.push({position:s.centre(q),vertices:q})}}for(C=0;C<A.length;C++)A[C]=l.create(o.extend(A[C],p));if(g){var Z=5;for(C=0;C<A.length;C++){var B=A[C];for(D=C+1;D<A.length;D++){var Q=A[D];if(u.overlaps(B.bounds,Q.bounds)){var ne=B.vertices,j=Q.vertices;for(L=0;L<B.vertices.length;L++)for(O=0;O<Q.vertices.length;O++){var re=c.magnitudeSquared(c.sub(ne[(L+1)%ne.length],j[O])),K=c.magnitudeSquared(c.sub(ne[L],j[(O+1)%j.length]));re<Z&&K<Z&&(ne[L].isInternal=!0,j[O].isInternal=!0)}}}}}return A.length>1?(k=l.create(o.extend({parts:A.slice(0)},p)),l.setPosition(k,{x:h,y:m}),k):A[0]}})()}),(function(n,r,a){var i={};n.exports=i;var s=a(0),o=a(8);(function(){i.create=function(l){var u={bodies:[],pairs:null};return s.extend(u,l)},i.setBodies=function(l,u){l.bodies=u.slice(0)},i.clear=function(l){l.bodies=[]},i.collisions=function(l){var u=[],c=l.pairs,h=l.bodies,m=h.length,d=i.canCollide,p=o.collides,g,x;for(h.sort(i._compareBoundsX),g=0;g<m;g++){var b=h[g],v=b.bounds,T=b.bounds.max.x,N=b.bounds.max.y,k=b.bounds.min.y,A=b.isStatic||b.isSleeping,_=b.parts.length,S=_===1;for(x=g+1;x<m;x++){var I=h[x],C=I.bounds;if(C.min.x>T)break;if(!(N<C.min.y||k>C.max.y)&&!(A&&(I.isStatic||I.isSleeping))&&d(b.collisionFilter,I.collisionFilter)){var D=I.parts.length;if(S&&D===1){var L=p(b,I,c);L&&u.push(L)}else for(var F=_>1?1:0,O=D>1?1:0,R=F;R<_;R++)for(var H=b.parts[R],v=H.bounds,V=O;V<D;V++){var q=I.parts[V],C=q.bounds;if(!(v.min.x>C.max.x||v.max.x<C.min.x||v.max.y<C.min.y||v.min.y>C.max.y)){var L=p(H,q,c);L&&u.push(L)}}}}}return u},i.canCollide=function(l,u){return l.group===u.group&&l.group!==0?l.group>0:(l.mask&u.category)!==0&&(u.mask&l.category)!==0},i._compareBoundsX=function(l,u){return l.bounds.min.x-u.bounds.min.x}})()}),(function(n,r,a){var i={};n.exports=i;var s=a(0);(function(){i.create=function(o){var l={};return o||s.log("Mouse.create: element was undefined, defaulting to document.body","warn"),l.element=o||document.body,l.absolute={x:0,y:0},l.position={x:0,y:0},l.mousedownPosition={x:0,y:0},l.mouseupPosition={x:0,y:0},l.offset={x:0,y:0},l.scale={x:1,y:1},l.wheelDelta=0,l.button=-1,l.pixelRatio=parseInt(l.element.getAttribute("data-pixel-ratio"),10)||1,l.sourceEvents={mousemove:null,mousedown:null,mouseup:null,mousewheel:null},l.mousemove=function(u){var c=i._getRelativeMousePosition(u,l.element,l.pixelRatio),h=u.changedTouches;h&&(l.button=0,u.preventDefault()),l.absolute.x=c.x,l.absolute.y=c.y,l.position.x=l.absolute.x*l.scale.x+l.offset.x,l.position.y=l.absolute.y*l.scale.y+l.offset.y,l.sourceEvents.mousemove=u},l.mousedown=function(u){var c=i._getRelativeMousePosition(u,l.element,l.pixelRatio),h=u.changedTouches;h?(l.button=0,u.preventDefault()):l.button=u.button,l.absolute.x=c.x,l.absolute.y=c.y,l.position.x=l.absolute.x*l.scale.x+l.offset.x,l.position.y=l.absolute.y*l.scale.y+l.offset.y,l.mousedownPosition.x=l.position.x,l.mousedownPosition.y=l.position.y,l.sourceEvents.mousedown=u},l.mouseup=function(u){var c=i._getRelativeMousePosition(u,l.element,l.pixelRatio),h=u.changedTouches;h&&u.preventDefault(),l.button=-1,l.absolute.x=c.x,l.absolute.y=c.y,l.position.x=l.absolute.x*l.scale.x+l.offset.x,l.position.y=l.absolute.y*l.scale.y+l.offset.y,l.mouseupPosition.x=l.position.x,l.mouseupPosition.y=l.position.y,l.sourceEvents.mouseup=u},l.mousewheel=function(u){l.wheelDelta=Math.max(-1,Math.min(1,u.wheelDelta||-u.detail)),u.preventDefault()},i.setElement(l,l.element),l},i.setElement=function(o,l){o.element=l,l.addEventListener("mousemove",o.mousemove),l.addEventListener("mousedown",o.mousedown),l.addEventListener("mouseup",o.mouseup),l.addEventListener("mousewheel",o.mousewheel),l.addEventListener("DOMMouseScroll",o.mousewheel),l.addEventListener("touchmove",o.mousemove),l.addEventListener("touchstart",o.mousedown),l.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,l){o.offset.x=l.x,o.offset.y=l.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,l){o.scale.x=l.x,o.scale.y=l.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,l,u){var c=l.getBoundingClientRect(),h=document.documentElement||document.body.parentNode||document.body,m=window.pageXOffset!==void 0?window.pageXOffset:h.scrollLeft,d=window.pageYOffset!==void 0?window.pageYOffset:h.scrollTop,p=o.changedTouches,g,x;return p?(g=p[0].pageX-c.left-m,x=p[0].pageY-c.top-d):(g=o.pageX-c.left-m,x=o.pageY-c.top-d),{x:g/(l.clientWidth/(l.width||l.clientWidth)*u),y:x/(l.clientHeight/(l.height||l.clientHeight)*u)}}})()}),(function(n,r,a){var i={};n.exports=i;var s=a(0);(function(){i._registry={},i.register=function(o){if(i.isPlugin(o)||s.warn("Plugin.register:",i.toString(o),"does not implement all required fields."),o.name in i._registry){var l=i._registry[o.name],u=i.versionParse(o.version).number,c=i.versionParse(l.version).number;u>c?(s.warn("Plugin.register:",i.toString(l),"was upgraded to",i.toString(o)),i._registry[o.name]=o):u<c?s.warn("Plugin.register:",i.toString(l),"can not be downgraded to",i.toString(o)):o!==l&&s.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,l){return o.used.indexOf(l)>-1},i.isFor=function(o,l){var u=o.for&&i.dependencyParse(o.for);return!o.for||l.name===u.name&&i.versionSatisfies(l.version,u.range)},i.use=function(o,l){if(o.uses=(o.uses||[]).concat(l||[]),o.uses.length===0){s.warn("Plugin.use:",i.toString(o),"does not specify any dependencies to install.");return}for(var u=i.dependencies(o),c=s.topologicalSort(u),h=[],m=0;m<c.length;m+=1)if(c[m]!==o.name){var d=i.resolve(c[m]);if(!d){h.push("❌ "+c[m]);continue}i.isUsed(o,d.name)||(i.isFor(d,o)||(s.warn("Plugin.use:",i.toString(d),"is for",d.for,"but installed on",i.toString(o)+"."),d._warned=!0),d.install?d.install(o):(s.warn("Plugin.use:",i.toString(d),"does not specify an install function."),d._warned=!0),d._warned?(h.push("🔶 "+i.toString(d)),delete d._warned):h.push("✅ "+i.toString(d)),o.used.push(d.name))}h.length>0&&s.info(h.join(" "))},i.dependencies=function(o,l){var u=i.dependencyParse(o),c=u.name;if(l=l||{},!(c in l)){o=i.resolve(o)||o,l[c]=s.map(o.uses||[],function(m){i.isPlugin(m)&&i.register(m);var d=i.dependencyParse(m),p=i.resolve(m);return p&&!i.versionSatisfies(p.version,d.range)?(s.warn("Plugin.dependencies:",i.toString(p),"does not satisfy",i.toString(d),"used by",i.toString(u)+"."),p._warned=!0,o._warned=!0):p||(s.warn("Plugin.dependencies:",i.toString(m),"used by",i.toString(u),"could not be resolved."),o._warned=!0),d.name});for(var h=0;h<l[c].length;h+=1)i.dependencies(l[c][h],l);return l}},i.dependencyParse=function(o){if(s.isString(o)){var l=/^[\w-]+(@(\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-+]+)?))?$/;return l.test(o)||s.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 l=/^(\*)|(\^|~|>=|>)?\s*((\d+)\.(\d+)\.(\d+))(-[0-9A-Za-z-+]+)?$/;l.test(o)||s.warn("Plugin.versionParse:",o,"is not a valid version or range.");var u=l.exec(o),c=Number(u[4]),h=Number(u[5]),m=Number(u[6]);return{isRange:!!(u[1]||u[2]),version:u[3],range:o,operator:u[1]||u[2]||"",major:c,minor:h,patch:m,parts:[c,h,m],prerelease:u[7],number:c*1e8+h*1e4+m}},i.versionSatisfies=function(o,l){l=l||"*";var u=i.versionParse(l),c=i.versionParse(o);if(u.isRange){if(u.operator==="*"||o==="*")return!0;if(u.operator===">")return c.number>u.number;if(u.operator===">=")return c.number>=u.number;if(u.operator==="~")return c.major===u.major&&c.minor===u.minor&&c.patch>=u.patch;if(u.operator==="^")return u.major>0?c.major===u.major&&c.number>=u.number:u.minor>0?c.minor===u.minor&&c.patch>=u.patch:c.patch===u.patch}return o===l||o==="*"}})()}),(function(n,r){var a={};n.exports=a,(function(){a.create=function(i){return{vertex:i,normalImpulse:0,tangentImpulse:0}}})()}),(function(n,r,a){var i={};n.exports=i;var s=a(7),o=a(18),l=a(13),u=a(19),c=a(5),h=a(6),m=a(10),d=a(0),p=a(4);(function(){i.create=function(g){g=g||{};var x={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}},b=d.extend(x,g);return b.world=g.world||h.create({label:"World"}),b.pairs=g.pairs||u.create(),b.detector=g.detector||l.create(),b.grid={buckets:[]},b.world.gravity=b.gravity,b.broadphase=b.grid,b.metrics={},b},i.update=function(g,x){var b=d.now(),v=g.world,T=g.detector,N=g.pairs,k=g.timing,A=k.timestamp,_;x=typeof x<"u"?x:d._baseDelta,x*=k.timeScale,k.timestamp+=x,k.lastDelta=x;var S={timestamp:k.timestamp,delta:x};c.trigger(g,"beforeUpdate",S);var I=h.allBodies(v),C=h.allConstraints(v);for(v.isModified&&(l.setBodies(T,I),h.setModified(v,!1,!1,!0)),g.enableSleeping&&s.update(I,x),i._bodiesApplyGravity(I,g.gravity),x>0&&i._bodiesUpdate(I,x),m.preSolveAll(I),_=0;_<g.constraintIterations;_++)m.solveAll(C,x);m.postSolveAll(I),T.pairs=g.pairs;var D=l.collisions(T);u.update(N,D,A),g.enableSleeping&&s.afterCollisions(N.list),N.collisionStart.length>0&&c.trigger(g,"collisionStart",{pairs:N.collisionStart});var L=d.clamp(20/g.positionIterations,0,1);for(o.preSolvePosition(N.list),_=0;_<g.positionIterations;_++)o.solvePosition(N.list,x,L);for(o.postSolvePosition(I),m.preSolveAll(I),_=0;_<g.constraintIterations;_++)m.solveAll(C,x);for(m.postSolveAll(I),o.preSolveVelocity(N.list),_=0;_<g.velocityIterations;_++)o.solveVelocity(N.list,x);return i._bodiesUpdateVelocities(I),N.collisionActive.length>0&&c.trigger(g,"collisionActive",{pairs:N.collisionActive}),N.collisionEnd.length>0&&c.trigger(g,"collisionEnd",{pairs:N.collisionEnd}),i._bodiesClearForces(I),c.trigger(g,"afterUpdate",S),g.timing.lastElapsed=d.now()-b,g},i.merge=function(g,x){if(d.extend(g,x),x.world){g.world=x.world,i.clear(g);for(var b=h.allBodies(g.world),v=0;v<b.length;v++){var T=b[v];s.set(T,!1),T.id=d.nextId()}}},i.clear=function(g){u.clear(g.pairs),l.clear(g.detector)},i._bodiesClearForces=function(g){for(var x=g.length,b=0;b<x;b++){var v=g[b];v.force.x=0,v.force.y=0,v.torque=0}},i._bodiesApplyGravity=function(g,x){var b=typeof x.scale<"u"?x.scale:.001,v=g.length;if(!(x.x===0&&x.y===0||b===0))for(var T=0;T<v;T++){var N=g[T];N.isStatic||N.isSleeping||(N.force.y+=N.mass*x.y*b,N.force.x+=N.mass*x.x*b)}},i._bodiesUpdate=function(g,x){for(var b=g.length,v=0;v<b;v++){var T=g[v];T.isStatic||T.isSleeping||p.update(T,x)}},i._bodiesUpdateVelocities=function(g){for(var x=g.length,b=0;b<x;b++)p.updateVelocities(g[b])}})()}),(function(n,r,a){var i={};n.exports=i;var s=a(3),o=a(0),l=a(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(u){var c,h,m,d=u.length;for(c=0;c<d;c++)h=u[c],h.isActive&&(m=h.activeContacts.length,h.collision.parentA.totalContacts+=m,h.collision.parentB.totalContacts+=m)},i.solvePosition=function(u,c,h){var m,d,p,g,x,b,v,T,N=i._positionDampen*(h||1),k=o.clamp(c/o._baseDelta,0,1),A=u.length;for(m=0;m<A;m++)d=u[m],!(!d.isActive||d.isSensor)&&(p=d.collision,g=p.parentA,x=p.parentB,b=p.normal,d.separation=b.x*(x.positionImpulse.x+p.penetration.x-g.positionImpulse.x)+b.y*(x.positionImpulse.y+p.penetration.y-g.positionImpulse.y));for(m=0;m<A;m++)d=u[m],!(!d.isActive||d.isSensor)&&(p=d.collision,g=p.parentA,x=p.parentB,b=p.normal,T=d.separation-d.slop*k,(g.isStatic||x.isStatic)&&(T*=2),g.isStatic||g.isSleeping||(v=N/g.totalContacts,g.positionImpulse.x+=b.x*T*v,g.positionImpulse.y+=b.y*T*v),x.isStatic||x.isSleeping||(v=N/x.totalContacts,x.positionImpulse.x-=b.x*T*v,x.positionImpulse.y-=b.y*T*v))},i.postSolvePosition=function(u){for(var c=i._positionWarming,h=u.length,m=s.translate,d=l.update,p=0;p<h;p++){var g=u[p],x=g.positionImpulse,b=x.x,v=x.y,T=g.velocity;if(g.totalContacts=0,b!==0||v!==0){for(var N=0;N<g.parts.length;N++){var k=g.parts[N];m(k.vertices,x),d(k.bounds,k.vertices,T),k.position.x+=b,k.position.y+=v}g.positionPrev.x+=b,g.positionPrev.y+=v,b*T.x+v*T.y<0?(x.x=0,x.y=0):(x.x*=c,x.y*=c)}}},i.preSolveVelocity=function(u){var c=u.length,h,m;for(h=0;h<c;h++){var d=u[h];if(!(!d.isActive||d.isSensor)){var p=d.activeContacts,g=p.length,x=d.collision,b=x.parentA,v=x.parentB,T=x.normal,N=x.tangent;for(m=0;m<g;m++){var k=p[m],A=k.vertex,_=k.normalImpulse,S=k.tangentImpulse;if(_!==0||S!==0){var I=T.x*_+N.x*S,C=T.y*_+N.y*S;b.isStatic||b.isSleeping||(b.positionPrev.x+=I*b.inverseMass,b.positionPrev.y+=C*b.inverseMass,b.anglePrev+=b.inverseInertia*((A.x-b.position.x)*C-(A.y-b.position.y)*I)),v.isStatic||v.isSleeping||(v.positionPrev.x-=I*v.inverseMass,v.positionPrev.y-=C*v.inverseMass,v.anglePrev-=v.inverseInertia*((A.x-v.position.x)*C-(A.y-v.position.y)*I))}}}}},i.solveVelocity=function(u,c){var h=c/o._baseDelta,m=h*h,d=m*h,p=-i._restingThresh*h,g=i._restingThreshTangent,x=i._frictionNormalMultiplier*h,b=i._frictionMaxStatic,v=u.length,T,N,k,A;for(k=0;k<v;k++){var _=u[k];if(!(!_.isActive||_.isSensor)){var S=_.collision,I=S.parentA,C=S.parentB,D=I.velocity,L=C.velocity,F=S.normal.x,O=S.normal.y,R=S.tangent.x,H=S.tangent.y,V=_.activeContacts,q=V.length,Z=1/q,B=I.inverseMass+C.inverseMass,Q=_.friction*_.frictionStatic*x;for(D.x=I.position.x-I.positionPrev.x,D.y=I.position.y-I.positionPrev.y,L.x=C.position.x-C.positionPrev.x,L.y=C.position.y-C.positionPrev.y,I.angularVelocity=I.angle-I.anglePrev,C.angularVelocity=C.angle-C.anglePrev,A=0;A<q;A++){var ne=V[A],j=ne.vertex,re=j.x-I.position.x,K=j.y-I.position.y,X=j.x-C.position.x,ce=j.y-C.position.y,le=D.x-K*I.angularVelocity,ee=D.y+re*I.angularVelocity,Ie=L.x-ce*C.angularVelocity,de=L.y+X*C.angularVelocity,he=le-Ie,pe=ee-de,Ce=F*he+O*pe,Oe=R*he+H*pe,st=_.separation+Ce,Be=Math.min(st,1);Be=st<0?0:Be;var ut=Be*Q;Oe<-ut||Oe>ut?(N=Oe>0?Oe:-Oe,T=_.friction*(Oe>0?1:-1)*d,T<-N?T=-N:T>N&&(T=N)):(T=Oe,N=b);var me=re*O-K*F,Ue=X*O-ce*F,ct=Z/(B+I.inverseInertia*me*me+C.inverseInertia*Ue*Ue),tt=(1+_.restitution)*Ce*ct;if(T*=ct,Ce<p)ne.normalImpulse=0;else{var ft=ne.normalImpulse;ne.normalImpulse+=tt,ne.normalImpulse>0&&(ne.normalImpulse=0),tt=ne.normalImpulse-ft}if(Oe<-g||Oe>g)ne.tangentImpulse=0;else{var Xe=ne.tangentImpulse;ne.tangentImpulse+=T,ne.tangentImpulse<-N&&(ne.tangentImpulse=-N),ne.tangentImpulse>N&&(ne.tangentImpulse=N),T=ne.tangentImpulse-Xe}var Pe=F*tt+R*T,oe=O*tt+H*T;I.isStatic||I.isSleeping||(I.positionPrev.x+=Pe*I.inverseMass,I.positionPrev.y+=oe*I.inverseMass,I.anglePrev+=(re*oe-K*Pe)*I.inverseInertia),C.isStatic||C.isSleeping||(C.positionPrev.x-=Pe*C.inverseMass,C.positionPrev.y-=oe*C.inverseMass,C.anglePrev-=(X*oe-ce*Pe)*C.inverseInertia)}}}}})()}),(function(n,r,a){var i={};n.exports=i;var s=a(9),o=a(0);(function(){i.create=function(l){return o.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},l)},i.update=function(l,u,c){var h=l.list,m=h.length,d=l.table,p=u.length,g=l.collisionStart,x=l.collisionEnd,b=l.collisionActive,v,T,N,k;for(g.length=0,x.length=0,b.length=0,k=0;k<m;k++)h[k].confirmedActive=!1;for(k=0;k<p;k++)v=u[k],N=v.pair,N?(N.isActive?b.push(N):g.push(N),s.update(N,v,c),N.confirmedActive=!0):(N=s.create(v,c),d[N.id]=N,g.push(N),h.push(N));var A=[];for(m=h.length,k=0;k<m;k++)N=h[k],N.confirmedActive||(s.setActive(N,!1,c),x.push(N),!N.collision.bodyA.isSleeping&&!N.collision.bodyB.isSleeping&&A.push(k));for(k=0;k<A.length;k++)T=A[k]-k,N=h[T],h.splice(T,1),delete d[N.id]},i.clear=function(l){return l.table={},l.list.length=0,l.collisionStart.length=0,l.collisionActive.length=0,l.collisionEnd.length=0,l}})()}),(function(n,r,a){var i=n.exports=a(21);i.Axes=a(11),i.Bodies=a(12),i.Body=a(4),i.Bounds=a(1),i.Collision=a(8),i.Common=a(0),i.Composite=a(6),i.Composites=a(22),i.Constraint=a(10),i.Contact=a(16),i.Detector=a(13),i.Engine=a(17),i.Events=a(5),i.Grid=a(23),i.Mouse=a(14),i.MouseConstraint=a(24),i.Pair=a(9),i.Pairs=a(19),i.Plugin=a(15),i.Query=a(25),i.Render=a(26),i.Resolver=a(18),i.Runner=a(27),i.SAT=a(28),i.Sleeping=a(7),i.Svg=a(29),i.Vector=a(2),i.Vertices=a(3),i.World=a(30),i.Engine.run=i.Runner.run,i.Common.deprecated(i.Engine,"run","Engine.run ➤ use Matter.Runner.run(engine) instead")}),(function(n,r,a){var i={};n.exports=i;var s=a(15),o=a(0);(function(){i.name="matter-js",i.version="0.19.0",i.uses=[],i.used=[],i.use=function(){s.use(i,Array.prototype.slice.call(arguments))},i.before=function(l,u){return l=l.replace(/^Matter./,""),o.chainPathBefore(i,l,u)},i.after=function(l,u){return l=l.replace(/^Matter./,""),o.chainPathAfter(i,l,u)}})()}),(function(n,r,a){var i={};n.exports=i;var s=a(6),o=a(10),l=a(0),u=a(4),c=a(12),h=l.deprecated;(function(){i.stack=function(m,d,p,g,x,b,v){for(var T=s.create({label:"Stack"}),N=m,k=d,A,_=0,S=0;S<g;S++){for(var I=0,C=0;C<p;C++){var D=v(N,k,C,S,A,_);if(D){var L=D.bounds.max.y-D.bounds.min.y,F=D.bounds.max.x-D.bounds.min.x;L>I&&(I=L),u.translate(D,{x:F*.5,y:L*.5}),N=D.bounds.max.x+x,s.addBody(T,D),A=D,_+=1}else N+=x}k+=I+b,N=m}return T},i.chain=function(m,d,p,g,x,b){for(var v=m.bodies,T=1;T<v.length;T++){var N=v[T-1],k=v[T],A=N.bounds.max.y-N.bounds.min.y,_=N.bounds.max.x-N.bounds.min.x,S=k.bounds.max.y-k.bounds.min.y,I=k.bounds.max.x-k.bounds.min.x,C={bodyA:N,pointA:{x:_*d,y:A*p},bodyB:k,pointB:{x:I*g,y:S*x}},D=l.extend(C,b);s.addConstraint(m,o.create(D))}return m.label+=" Chain",m},i.mesh=function(m,d,p,g,x){var b=m.bodies,v,T,N,k,A;for(v=0;v<p;v++){for(T=1;T<d;T++)N=b[T-1+v*d],k=b[T+v*d],s.addConstraint(m,o.create(l.extend({bodyA:N,bodyB:k},x)));if(v>0)for(T=0;T<d;T++)N=b[T+(v-1)*d],k=b[T+v*d],s.addConstraint(m,o.create(l.extend({bodyA:N,bodyB:k},x))),g&&T>0&&(A=b[T-1+(v-1)*d],s.addConstraint(m,o.create(l.extend({bodyA:A,bodyB:k},x)))),g&&T<d-1&&(A=b[T+1+(v-1)*d],s.addConstraint(m,o.create(l.extend({bodyA:A,bodyB:k},x))))}return m.label+=" Mesh",m},i.pyramid=function(m,d,p,g,x,b,v){return i.stack(m,d,p,g,x,b,function(T,N,k,A,_,S){var I=Math.min(g,Math.ceil(p/2)),C=_?_.bounds.max.x-_.bounds.min.x:0;if(!(A>I)){A=I-A;var D=A,L=p-1-A;if(!(k<D||k>L)){S===1&&u.translate(_,{x:(k+(p%2===1?1:-1))*C,y:0});var F=_?k*C:0;return v(m+F+k*x,N,k,A,_,S)}}})},i.newtonsCradle=function(m,d,p,g,x){for(var b=s.create({label:"Newtons Cradle"}),v=0;v<p;v++){var T=1.9,N=c.circle(m+v*(g*T),d+x,g,{inertia:1/0,restitution:1,friction:0,frictionAir:1e-4,slop:1}),k=o.create({pointA:{x:m+v*(g*T),y:d},bodyB:N});s.addBody(b,N),s.addConstraint(b,k)}return b},h(i,"newtonsCradle","Composites.newtonsCradle ➤ moved to newtonsCradle example"),i.car=function(m,d,p,g,x){var b=u.nextGroup(!0),v=20,T=-p*.5+v,N=p*.5-v,k=0,A=s.create({label:"Car"}),_=c.rectangle(m,d,p,g,{collisionFilter:{group:b},chamfer:{radius:g*.5},density:2e-4}),S=c.circle(m+T,d+k,x,{collisionFilter:{group:b},friction:.8}),I=c.circle(m+N,d+k,x,{collisionFilter:{group:b},friction:.8}),C=o.create({bodyB:_,pointB:{x:T,y:k},bodyA:S,stiffness:1,length:0}),D=o.create({bodyB:_,pointB:{x:N,y:k},bodyA:I,stiffness:1,length:0});return s.addBody(A,_),s.addBody(A,S),s.addBody(A,I),s.addConstraint(A,C),s.addConstraint(A,D),A},h(i,"car","Composites.car ➤ moved to car example"),i.softBody=function(m,d,p,g,x,b,v,T,N,k){N=l.extend({inertia:1/0},N),k=l.extend({stiffness:.2,render:{type:"line",anchors:!1}},k);var A=i.stack(m,d,p,g,x,b,function(_,S){return c.circle(_,S,T,N)});return i.mesh(A,p,g,v,k),A.label="Soft Body",A},h(i,"softBody","Composites.softBody ➤ moved to softBody and cloth examples")})()}),(function(n,r,a){var i={};n.exports=i;var s=a(9),o=a(0),l=o.deprecated;(function(){i.create=function(u){var c={buckets:{},pairs:{},pairsList:[],bucketWidth:48,bucketHeight:48};return o.extend(c,u)},i.update=function(u,c,h,m){var d,p,g,x=h.world,b=u.buckets,v,T,N=!1;for(d=0;d<c.length;d++){var k=c[d];if(!(k.isSleeping&&!m)&&!(x.bounds&&(k.bounds.max.x<x.bounds.min.x||k.bounds.min.x>x.bounds.max.x||k.bounds.max.y<x.bounds.min.y||k.bounds.min.y>x.bounds.max.y))){var A=i._getRegion(u,k);if(!k.region||A.id!==k.region.id||m){(!k.region||m)&&(k.region=A);var _=i._regionUnion(A,k.region);for(p=_.startCol;p<=_.endCol;p++)for(g=_.startRow;g<=_.endRow;g++){T=i._getBucketId(p,g),v=b[T];var S=p>=A.startCol&&p<=A.endCol&&g>=A.startRow&&g<=A.endRow,I=p>=k.region.startCol&&p<=k.region.endCol&&g>=k.region.startRow&&g<=k.region.endRow;!S&&I&&I&&v&&i._bucketRemoveBody(u,v,k),(k.region===A||S&&!I||m)&&(v||(v=i._createBucket(b,T)),i._bucketAddBody(u,v,k))}k.region=A,N=!0}}}N&&(u.pairsList=i._createActivePairsList(u))},l(i,"update","Grid.update ➤ replaced by Matter.Detector"),i.clear=function(u){u.buckets={},u.pairs={},u.pairsList=[]},l(i,"clear","Grid.clear ➤ replaced by Matter.Detector"),i._regionUnion=function(u,c){var h=Math.min(u.startCol,c.startCol),m=Math.max(u.endCol,c.endCol),d=Math.min(u.startRow,c.startRow),p=Math.max(u.endRow,c.endRow);return i._createRegion(h,m,d,p)},i._getRegion=function(u,c){var h=c.bounds,m=Math.floor(h.min.x/u.bucketWidth),d=Math.floor(h.max.x/u.bucketWidth),p=Math.floor(h.min.y/u.bucketHeight),g=Math.floor(h.max.y/u.bucketHeight);return i._createRegion(m,d,p,g)},i._createRegion=function(u,c,h,m){return{id:u+","+c+","+h+","+m,startCol:u,endCol:c,startRow:h,endRow:m}},i._getBucketId=function(u,c){return"C"+u+"R"+c},i._createBucket=function(u,c){var h=u[c]=[];return h},i._bucketAddBody=function(u,c,h){var m=u.pairs,d=s.id,p=c.length,g;for(g=0;g<p;g++){var x=c[g];if(!(h.id===x.id||h.isStatic&&x.isStatic)){var b=d(h,x),v=m[b];v?v[2]+=1:m[b]=[h,x,1]}}c.push(h)},i._bucketRemoveBody=function(u,c,h){var m=u.pairs,d=s.id,p;c.splice(o.indexOf(c,h),1);var g=c.length;for(p=0;p<g;p++){var x=m[d(h,c[p])];x&&(x[2]-=1)}},i._createActivePairsList=function(u){var c,h=u.pairs,m=o.keys(h),d=m.length,p=[],g;for(g=0;g<d;g++)c=h[m[g]],c[2]>0?p.push(c):delete h[m[g]];return p}})()}),(function(n,r,a){var i={};n.exports=i;var s=a(3),o=a(7),l=a(14),u=a(5),c=a(13),h=a(10),m=a(6),d=a(0),p=a(1);(function(){i.create=function(g,x){var b=(g?g.mouse:null)||(x?x.mouse:null);b||(g&&g.render&&g.render.canvas?b=l.create(g.render.canvas):x&&x.element?b=l.create(x.element):(b=l.create(),d.warn("MouseConstraint.create: options.mouse was undefined, options.element was undefined, may not function as expected")));var v=h.create({label:"Mouse Constraint",pointA:b.position,pointB:{x:0,y:0},length:.01,stiffness:.1,angularStiffness:1,render:{strokeStyle:"#90EE90",lineWidth:3}}),T={type:"mouseConstraint",mouse:b,element:null,body:null,constraint:v,collisionFilter:{category:1,mask:4294967295,group:0}},N=d.extend(T,x);return u.on(g,"beforeUpdate",function(){var k=m.allBodies(g.world);i.update(N,k),i._triggerEvents(N)}),N},i.update=function(g,x){var b=g.mouse,v=g.constraint,T=g.body;if(b.button===0){if(v.bodyB)o.set(v.bodyB,!1),v.pointA=b.position;else for(var N=0;N<x.length;N++)if(T=x[N],p.contains(T.bounds,b.position)&&c.canCollide(T.collisionFilter,g.collisionFilter))for(var k=T.parts.length>1?1:0;k<T.parts.length;k++){var A=T.parts[k];if(s.contains(A.vertices,b.position)){v.pointA=b.position,v.bodyB=g.body=T,v.pointB={x:b.position.x-T.position.x,y:b.position.y-T.position.y},v.angleB=T.angle,o.set(T,!1),u.trigger(g,"startdrag",{mouse:b,body:T});break}}}else v.bodyB=g.body=null,v.pointB=null,T&&u.trigger(g,"enddrag",{mouse:b,body:T})},i._triggerEvents=function(g){var x=g.mouse,b=x.sourceEvents;b.mousemove&&u.trigger(g,"mousemove",{mouse:x}),b.mousedown&&u.trigger(g,"mousedown",{mouse:x}),b.mouseup&&u.trigger(g,"mouseup",{mouse:x}),l.clearSourceEvents(x)}})()}),(function(n,r,a){var i={};n.exports=i;var s=a(2),o=a(8),l=a(1),u=a(12),c=a(3);(function(){i.collides=function(h,m){for(var d=[],p=m.length,g=h.bounds,x=o.collides,b=l.overlaps,v=0;v<p;v++){var T=m[v],N=T.parts.length,k=N===1?0:1;if(b(T.bounds,g))for(var A=k;A<N;A++){var _=T.parts[A];if(b(_.bounds,g)){var S=x(_,h);if(S){d.push(S);break}}}}return d},i.ray=function(h,m,d,p){p=p||1e-100;for(var g=s.angle(m,d),x=s.magnitude(s.sub(m,d)),b=(d.x+m.x)*.5,v=(d.y+m.y)*.5,T=u.rectangle(b,v,x,p,{angle:g}),N=i.collides(T,h),k=0;k<N.length;k+=1){var A=N[k];A.body=A.bodyB=A.bodyA}return N},i.region=function(h,m,d){for(var p=[],g=0;g<h.length;g++){var x=h[g],b=l.overlaps(x.bounds,m);(b&&!d||!b&&d)&&p.push(x)}return p},i.point=function(h,m){for(var d=[],p=0;p<h.length;p++){var g=h[p];if(l.contains(g.bounds,m))for(var x=g.parts.length===1?0:1;x<g.parts.length;x++){var b=g.parts[x];if(l.contains(b.bounds,m)&&c.contains(b.vertices,m)){d.push(g);break}}}return d}})()}),(function(n,r,a){var i={};n.exports=i;var s=a(4),o=a(0),l=a(6),u=a(1),c=a(5),h=a(2),m=a(14);(function(){var d,p;typeof window<"u"&&(d=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(k){window.setTimeout(function(){k(o.now())},1e3/60)},p=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame),i._goodFps=30,i._goodDelta=1e3/60,i.create=function(k){var A={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:!!k.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(A,k);return _.canvas&&(_.canvas.width=_.options.width||_.canvas.width,_.canvas.height=_.options.height||_.canvas.height),_.mouse=k.mouse,_.engine=k.engine,_.canvas=_.canvas||b(_.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(k){(function A(_){k.frameRequestId=d(A),g(k,_),i.world(k,_),(k.options.showStats||k.options.showDebug)&&i.stats(k,k.context,_),(k.options.showPerformance||k.options.showDebug)&&i.performance(k,k.context,_)})()},i.stop=function(k){p(k.frameRequestId)},i.setPixelRatio=function(k,A){var _=k.options,S=k.canvas;A==="auto"&&(A=v(S)),_.pixelRatio=A,S.setAttribute("data-pixel-ratio",A),S.width=_.width*A,S.height=_.height*A,S.style.width=_.width+"px",S.style.height=_.height+"px"},i.lookAt=function(k,A,_,S){S=typeof S<"u"?S:!0,A=o.isArray(A)?A:[A],_=_||{x:0,y:0};for(var I={min:{x:1/0,y:1/0},max:{x:-1/0,y:-1/0}},C=0;C<A.length;C+=1){var D=A[C],L=D.bounds?D.bounds.min:D.min||D.position||D,F=D.bounds?D.bounds.max:D.max||D.position||D;L&&F&&(L.x<I.min.x&&(I.min.x=L.x),F.x>I.max.x&&(I.max.x=F.x),L.y<I.min.y&&(I.min.y=L.y),F.y>I.max.y&&(I.max.y=F.y))}var O=I.max.x-I.min.x+2*_.x,R=I.max.y-I.min.y+2*_.y,H=k.canvas.height,V=k.canvas.width,q=V/H,Z=O/R,B=1,Q=1;Z>q?Q=Z/q:B=q/Z,k.options.hasBounds=!0,k.bounds.min.x=I.min.x,k.bounds.max.x=I.min.x+O*B,k.bounds.min.y=I.min.y,k.bounds.max.y=I.min.y+R*Q,S&&(k.bounds.min.x+=O*.5-O*B*.5,k.bounds.max.x+=O*.5-O*B*.5,k.bounds.min.y+=R*.5-R*Q*.5,k.bounds.max.y+=R*.5-R*Q*.5),k.bounds.min.x-=_.x,k.bounds.max.x-=_.x,k.bounds.min.y-=_.y,k.bounds.max.y-=_.y,k.mouse&&(m.setScale(k.mouse,{x:(k.bounds.max.x-k.bounds.min.x)/k.canvas.width,y:(k.bounds.max.y-k.bounds.min.y)/k.canvas.height}),m.setOffset(k.mouse,k.bounds.min))},i.startViewTransform=function(k){var A=k.bounds.max.x-k.bounds.min.x,_=k.bounds.max.y-k.bounds.min.y,S=A/k.options.width,I=_/k.options.height;k.context.setTransform(k.options.pixelRatio/S,0,0,k.options.pixelRatio/I,0,0),k.context.translate(-k.bounds.min.x,-k.bounds.min.y)},i.endViewTransform=function(k){k.context.setTransform(k.options.pixelRatio,0,0,k.options.pixelRatio,0,0)},i.world=function(k,A){var _=o.now(),S=k.engine,I=S.world,C=k.canvas,D=k.context,L=k.options,F=k.timing,O=l.allBodies(I),R=l.allConstraints(I),H=L.wireframes?L.wireframeBackground:L.background,V=[],q=[],Z,B={timestamp:S.timing.timestamp};if(c.trigger(k,"beforeRender",B),k.currentBackground!==H&&N(k,H),D.globalCompositeOperation="source-in",D.fillStyle="transparent",D.fillRect(0,0,C.width,C.height),D.globalCompositeOperation="source-over",L.hasBounds){for(Z=0;Z<O.length;Z++){var Q=O[Z];u.overlaps(Q.bounds,k.bounds)&&V.push(Q)}for(Z=0;Z<R.length;Z++){var ne=R[Z],j=ne.bodyA,re=ne.bodyB,K=ne.pointA,X=ne.pointB;j&&(K=h.add(j.position,ne.pointA)),re&&(X=h.add(re.position,ne.pointB)),!(!K||!X)&&(u.contains(k.bounds,K)||u.contains(k.bounds,X))&&q.push(ne)}i.startViewTransform(k),k.mouse&&(m.setScale(k.mouse,{x:(k.bounds.max.x-k.bounds.min.x)/k.options.width,y:(k.bounds.max.y-k.bounds.min.y)/k.options.height}),m.setOffset(k.mouse,k.bounds.min))}else q=R,V=O,k.options.pixelRatio!==1&&k.context.setTransform(k.options.pixelRatio,0,0,k.options.pixelRatio,0,0);!L.wireframes||S.enableSleeping&&L.showSleeping?i.bodies(k,V,D):(L.showConvexHulls&&i.bodyConvexHulls(k,V,D),i.bodyWireframes(k,V,D)),L.showBounds&&i.bodyBounds(k,V,D),(L.showAxes||L.showAngleIndicator)&&i.bodyAxes(k,V,D),L.showPositions&&i.bodyPositions(k,V,D),L.showVelocity&&i.bodyVelocity(k,V,D),L.showIds&&i.bodyIds(k,V,D),L.showSeparations&&i.separations(k,S.pairs.list,D),L.showCollisions&&i.collisions(k,S.pairs.list,D),L.showVertexNumbers&&i.vertexNumbers(k,V,D),L.showMousePosition&&i.mousePosition(k,k.mouse,D),i.constraints(q,D),L.hasBounds&&i.endViewTransform(k),c.trigger(k,"afterRender",B),F.lastElapsed=o.now()-_},i.stats=function(k,A,_){for(var S=k.engine,I=S.world,C=l.allBodies(I),D=0,L=55,F=44,O=0,R=0,H=0;H<C.length;H+=1)D+=C[H].parts.length;var V={Part:D,Body:C.length,Cons:l.allConstraints(I).length,Comp:l.allComposites(I).length,Pair:S.pairs.list.length};A.fillStyle="#0e0f19",A.fillRect(O,R,L*5.5,F),A.font="12px Arial",A.textBaseline="top",A.textAlign="right";for(var q in V){var Z=V[q];A.fillStyle="#aaa",A.fillText(q,O+L,R+8),A.fillStyle="#eee",A.fillText(Z,O+L,R+26),O+=L}},i.performance=function(k,A){var _=k.engine,S=k.timing,I=S.deltaHistory,C=S.elapsedHistory,D=S.timestampElapsedHistory,L=S.engineDeltaHistory,F=S.engineElapsedHistory,O=_.timing.lastDelta,R=x(I),H=x(C),V=x(L),q=x(F),Z=x(D),B=Z/R||0,Q=1e3/R||0,ne=4,j=12,re=60,K=34,X=10,ce=69;A.fillStyle="#0e0f19",A.fillRect(0,50,j*4+re*5+22,K),i.status(A,X,ce,re,ne,I.length,Math.round(Q)+" fps",Q/i._goodFps,function(le){return I[le]/R-1}),i.status(A,X+j+re,ce,re,ne,L.length,O.toFixed(2)+" dt",i._goodDelta/O,function(le){return L[le]/V-1}),i.status(A,X+(j+re)*2,ce,re,ne,F.length,q.toFixed(2)+" ut",1-q/i._goodFps,function(le){return F[le]/q-1}),i.status(A,X+(j+re)*3,ce,re,ne,C.length,H.toFixed(2)+" rt",1-H/i._goodFps,function(le){return C[le]/H-1}),i.status(A,X+(j+re)*4,ce,re,ne,D.length,B.toFixed(2)+" x",B*B*B,function(le){return(D[le]/I[le]/B||0)-1})},i.status=function(k,A,_,S,I,C,D,L,F){k.strokeStyle="#888",k.fillStyle="#444",k.lineWidth=1,k.fillRect(A,_+7,S,1),k.beginPath(),k.moveTo(A,_+7-I*o.clamp(.4*F(0),-2,2));for(var O=0;O<S;O+=1)k.lineTo(A+O,_+7-(O<C?I*o.clamp(.4*F(O),-2,2):0));k.stroke(),k.fillStyle="hsl("+o.clamp(25+95*L,0,120)+",100%,60%)",k.fillRect(A,_-7,4,4),k.font="12px Arial",k.textBaseline="middle",k.textAlign="right",k.fillStyle="#eee",k.fillText(D,A+S,_-5)},i.constraints=function(k,A){for(var _=A,S=0;S<k.length;S++){var I=k[S];if(!(!I.render.visible||!I.pointA||!I.pointB)){var C=I.bodyA,D=I.bodyB,L,F;if(C?L=h.add(C.position,I.pointA):L=I.pointA,I.render.type==="pin")_.beginPath(),_.arc(L.x,L.y,3,0,2*Math.PI),_.closePath();else{if(D?F=h.add(D.position,I.pointB):F=I.pointB,_.beginPath(),_.moveTo(L.x,L.y),I.render.type==="spring")for(var O=h.sub(F,L),R=h.perp(h.normalise(O)),H=Math.ceil(o.clamp(I.length/5,12,20)),V,q=1;q<H;q+=1)V=q%2===0?1:-1,_.lineTo(L.x+O.x*(q/H)+R.x*V*4,L.y+O.y*(q/H)+R.y*V*4);_.lineTo(F.x,F.y)}I.render.lineWidth&&(_.lineWidth=I.render.lineWidth,_.strokeStyle=I.render.strokeStyle,_.stroke()),I.render.anchors&&(_.fillStyle=I.render.strokeStyle,_.beginPath(),_.arc(L.x,L.y,3,0,2*Math.PI),_.arc(F.x,F.y,3,0,2*Math.PI),_.closePath(),_.fill())}}},i.bodies=function(k,A,_){var S=_;k.engine;var I=k.options,C=I.showInternalEdges||!I.wireframes,D,L,F,O;for(F=0;F<A.length;F++)if(D=A[F],!!D.render.visible){for(O=D.parts.length>1?1:0;O<D.parts.length;O++)if(L=D.parts[O],!!L.render.visible){if(I.showSleeping&&D.isSleeping?S.globalAlpha=.5*L.render.opacity:L.render.opacity!==1&&(S.globalAlpha=L.render.opacity),L.render.sprite&&L.render.sprite.texture&&!I.wireframes){var R=L.render.sprite,H=T(k,R.texture);S.translate(L.position.x,L.position.y),S.rotate(L.angle),S.drawImage(H,H.width*-R.xOffset*R.xScale,H.height*-R.yOffset*R.yScale,H.width*R.xScale,H.height*R.yScale),S.rotate(-L.angle),S.translate(-L.position.x,-L.position.y)}else{if(L.circleRadius)S.beginPath(),S.arc(L.position.x,L.position.y,L.circleRadius,0,2*Math.PI);else{S.beginPath(),S.moveTo(L.vertices[0].x,L.vertices[0].y);for(var V=1;V<L.vertices.length;V++)!L.vertices[V-1].isInternal||C?S.lineTo(L.vertices[V].x,L.vertices[V].y):S.moveTo(L.vertices[V].x,L.vertices[V].y),L.vertices[V].isInternal&&!C&&S.moveTo(L.vertices[(V+1)%L.vertices.length].x,L.vertices[(V+1)%L.vertices.length].y);S.lineTo(L.vertices[0].x,L.vertices[0].y),S.closePath()}I.wireframes?(S.lineWidth=1,S.strokeStyle="#bbb",S.stroke()):(S.fillStyle=L.render.fillStyle,L.render.lineWidth&&(S.lineWidth=L.render.lineWidth,S.strokeStyle=L.render.strokeStyle,S.stroke()),S.fill())}S.globalAlpha=1}}},i.bodyWireframes=function(k,A,_){var S=_,I=k.options.showInternalEdges,C,D,L,F,O;for(S.beginPath(),L=0;L<A.length;L++)if(C=A[L],!!C.render.visible)for(O=C.parts.length>1?1:0;O<C.parts.length;O++){for(D=C.parts[O],S.moveTo(D.vertices[0].x,D.vertices[0].y),F=1;F<D.vertices.length;F++)!D.vertices[F-1].isInternal||I?S.lineTo(D.vertices[F].x,D.vertices[F].y):S.moveTo(D.vertices[F].x,D.vertices[F].y),D.vertices[F].isInternal&&!I&&S.moveTo(D.vertices[(F+1)%D.vertices.length].x,D.vertices[(F+1)%D.vertices.length].y);S.lineTo(D.vertices[0].x,D.vertices[0].y)}S.lineWidth=1,S.strokeStyle="#bbb",S.stroke()},i.bodyConvexHulls=function(k,A,_){var S=_,I,C,D;for(S.beginPath(),C=0;C<A.length;C++)if(I=A[C],!(!I.render.visible||I.parts.length===1)){for(S.moveTo(I.vertices[0].x,I.vertices[0].y),D=1;D<I.vertices.length;D++)S.lineTo(I.vertices[D].x,I.vertices[D].y);S.lineTo(I.vertices[0].x,I.vertices[0].y)}S.lineWidth=1,S.strokeStyle="rgba(255,255,255,0.2)",S.stroke()},i.vertexNumbers=function(k,A,_){var S=_,I,C,D;for(I=0;I<A.length;I++){var L=A[I].parts;for(D=L.length>1?1:0;D<L.length;D++){var F=L[D];for(C=0;C<F.vertices.length;C++)S.fillStyle="rgba(255,255,255,0.2)",S.fillText(I+"_"+C,F.position.x+(F.vertices[C].x-F.position.x)*.8,F.position.y+(F.vertices[C].y-F.position.y)*.8)}}},i.mousePosition=function(k,A,_){var S=_;S.fillStyle="rgba(255,255,255,0.8)",S.fillText(A.position.x+" "+A.position.y,A.position.x+5,A.position.y-5)},i.bodyBounds=function(k,A,_){var S=_;k.engine;var I=k.options;S.beginPath();for(var C=0;C<A.length;C++){var D=A[C];if(D.render.visible)for(var L=A[C].parts,F=L.length>1?1:0;F<L.length;F++){var O=L[F];S.rect(O.bounds.min.x,O.bounds.min.y,O.bounds.max.x-O.bounds.min.x,O.bounds.max.y-O.bounds.min.y)}}I.wireframes?S.strokeStyle="rgba(255,255,255,0.08)":S.strokeStyle="rgba(0,0,0,0.1)",S.lineWidth=1,S.stroke()},i.bodyAxes=function(k,A,_){var S=_;k.engine;var I=k.options,C,D,L,F;for(S.beginPath(),D=0;D<A.length;D++){var O=A[D],R=O.parts;if(O.render.visible)if(I.showAxes)for(L=R.length>1?1:0;L<R.length;L++)for(C=R[L],F=0;F<C.axes.length;F++){var H=C.axes[F];S.moveTo(C.position.x,C.position.y),S.lineTo(C.position.x+H.x*20,C.position.y+H.y*20)}else for(L=R.length>1?1:0;L<R.length;L++)for(C=R[L],F=0;F<C.axes.length;F++)S.moveTo(C.position.x,C.position.y),S.lineTo((C.vertices[0].x+C.vertices[C.vertices.length-1].x)/2,(C.vertices[0].y+C.vertices[C.vertices.length-1].y)/2)}I.wireframes?(S.strokeStyle="indianred",S.lineWidth=1):(S.strokeStyle="rgba(255, 255, 255, 0.4)",S.globalCompositeOperation="overlay",S.lineWidth=2),S.stroke(),S.globalCompositeOperation="source-over"},i.bodyPositions=function(k,A,_){var S=_;k.engine;var I=k.options,C,D,L,F;for(S.beginPath(),L=0;L<A.length;L++)if(C=A[L],!!C.render.visible)for(F=0;F<C.parts.length;F++)D=C.parts[F],S.arc(D.position.x,D.position.y,3,0,2*Math.PI,!1),S.closePath();for(I.wireframes?S.fillStyle="indianred":S.fillStyle="rgba(0,0,0,0.5)",S.fill(),S.beginPath(),L=0;L<A.length;L++)C=A[L],C.render.visible&&(S.arc(C.positionPrev.x,C.positionPrev.y,2,0,2*Math.PI,!1),S.closePath());S.fillStyle="rgba(255,165,0,0.8)",S.fill()},i.bodyVelocity=function(k,A,_){var S=_;S.beginPath();for(var I=0;I<A.length;I++){var C=A[I];if(C.render.visible){var D=s.getVelocity(C);S.moveTo(C.position.x,C.position.y),S.lineTo(C.position.x+D.x,C.position.y+D.y)}}S.lineWidth=3,S.strokeStyle="cornflowerblue",S.stroke()},i.bodyIds=function(k,A,_){var S=_,I,C;for(I=0;I<A.length;I++)if(A[I].render.visible){var D=A[I].parts;for(C=D.length>1?1:0;C<D.length;C++){var L=D[C];S.font="12px Arial",S.fillStyle="rgba(255,255,255,0.5)",S.fillText(L.id,L.position.x+10,L.position.y-10)}}},i.collisions=function(k,A,_){var S=_,I=k.options,C,D,L,F;for(S.beginPath(),L=0;L<A.length;L++)if(C=A[L],!!C.isActive)for(D=C.collision,F=0;F<C.activeContacts.length;F++){var O=C.activeContacts[F],R=O.vertex;S.rect(R.x-1.5,R.y-1.5,3.5,3.5)}for(I.wireframes?S.fillStyle="rgba(255,255,255,0.7)":S.fillStyle="orange",S.fill(),S.beginPath(),L=0;L<A.length;L++)if(C=A[L],!!C.isActive&&(D=C.collision,C.activeContacts.length>0)){var H=C.activeContacts[0].vertex.x,V=C.activeContacts[0].vertex.y;C.activeContacts.length===2&&(H=(C.activeContacts[0].vertex.x+C.activeContacts[1].vertex.x)/2,V=(C.activeContacts[0].vertex.y+C.activeContacts[1].vertex.y)/2),D.bodyB===D.supports[0].body||D.bodyA.isStatic===!0?S.moveTo(H-D.normal.x*8,V-D.normal.y*8):S.moveTo(H+D.normal.x*8,V+D.normal.y*8),S.lineTo(H,V)}I.wireframes?S.strokeStyle="rgba(255,165,0,0.7)":S.strokeStyle="orange",S.lineWidth=1,S.stroke()},i.separations=function(k,A,_){var S=_,I=k.options,C,D,L,F,O;for(S.beginPath(),O=0;O<A.length;O++)if(C=A[O],!!C.isActive){D=C.collision,L=D.bodyA,F=D.bodyB;var R=1;!F.isStatic&&!L.isStatic&&(R=.5),F.isStatic&&(R=0),S.moveTo(F.position.x,F.position.y),S.lineTo(F.position.x-D.penetration.x*R,F.position.y-D.penetration.y*R),R=1,!F.isStatic&&!L.isStatic&&(R=.5),L.isStatic&&(R=0),S.moveTo(L.position.x,L.position.y),S.lineTo(L.position.x+D.penetration.x*R,L.position.y+D.penetration.y*R)}I.wireframes?S.strokeStyle="rgba(255,165,0,0.5)":S.strokeStyle="orange",S.stroke()},i.inspector=function(k,A){k.engine;var _=k.selected,S=k.render,I=S.options,C;if(I.hasBounds){var D=S.bounds.max.x-S.bounds.min.x,L=S.bounds.max.y-S.bounds.min.y,F=D/S.options.width,O=L/S.options.height;A.scale(1/F,1/O),A.translate(-S.bounds.min.x,-S.bounds.min.y)}for(var R=0;R<_.length;R++){var H=_[R].data;switch(A.translate(.5,.5),A.lineWidth=1,A.strokeStyle="rgba(255,165,0,0.9)",A.setLineDash([1,2]),H.type){case"body":C=H.bounds,A.beginPath(),A.rect(Math.floor(C.min.x-3),Math.floor(C.min.y-3),Math.floor(C.max.x-C.min.x+6),Math.floor(C.max.y-C.min.y+6)),A.closePath(),A.stroke();break;case"constraint":var V=H.pointA;H.bodyA&&(V=H.pointB),A.beginPath(),A.arc(V.x,V.y,10,0,2*Math.PI),A.closePath(),A.stroke();break}A.setLineDash([]),A.translate(-.5,-.5)}k.selectStart!==null&&(A.translate(.5,.5),A.lineWidth=1,A.strokeStyle="rgba(255,165,0,0.6)",A.fillStyle="rgba(255,165,0,0.1)",C=k.selectBounds,A.beginPath(),A.rect(Math.floor(C.min.x),Math.floor(C.min.y),Math.floor(C.max.x-C.min.x),Math.floor(C.max.y-C.min.y)),A.closePath(),A.stroke(),A.fill(),A.translate(-.5,-.5)),I.hasBounds&&A.setTransform(1,0,0,1,0,0)};var g=function(k,A){var _=k.engine,S=k.timing,I=S.historySize,C=_.timing.timestamp;S.delta=A-S.lastTime||i._goodDelta,S.lastTime=A,S.timestampElapsed=C-S.lastTimestamp||0,S.lastTimestamp=C,S.deltaHistory.unshift(S.delta),S.deltaHistory.length=Math.min(S.deltaHistory.length,I),S.engineDeltaHistory.unshift(_.timing.lastDelta),S.engineDeltaHistory.length=Math.min(S.engineDeltaHistory.length,I),S.timestampElapsedHistory.unshift(S.timestampElapsed),S.timestampElapsedHistory.length=Math.min(S.timestampElapsedHistory.length,I),S.engineElapsedHistory.unshift(_.timing.lastElapsed),S.engineElapsedHistory.length=Math.min(S.engineElapsedHistory.length,I),S.elapsedHistory.unshift(S.lastElapsed),S.elapsedHistory.length=Math.min(S.elapsedHistory.length,I)},x=function(k){for(var A=0,_=0;_<k.length;_+=1)A+=k[_];return A/k.length||0},b=function(k,A){var _=document.createElement("canvas");return _.width=k,_.height=A,_.oncontextmenu=function(){return!1},_.onselectstart=function(){return!1},_},v=function(k){var A=k.getContext("2d"),_=window.devicePixelRatio||1,S=A.webkitBackingStorePixelRatio||A.mozBackingStorePixelRatio||A.msBackingStorePixelRatio||A.oBackingStorePixelRatio||A.backingStorePixelRatio||1;return _/S},T=function(k,A){var _=k.textures[A];return _||(_=k.textures[A]=new Image,_.src=A,_)},N=function(k,A){var _=A;/(jpg|gif|png)$/.test(A)&&(_="url("+A+")"),k.canvas.style.background=_,k.canvas.style.backgroundSize="contain",k.currentBackground=A}})()}),(function(n,r,a){var i={};n.exports=i;var s=a(5),o=a(17),l=a(0);(function(){var u,c;if(typeof window<"u"&&(u=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame,c=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame),!u){var h;u=function(m){h=setTimeout(function(){m(l.now())},1e3/60)},c=function(){clearTimeout(h)}}i.create=function(m){var d={fps:60,deltaSampleSize:60,counterTimestamp:0,frameCounter:0,deltaHistory:[],timePrev:null,frameRequestId:null,isFixed:!1,enabled:!0},p=l.extend(d,m);return p.delta=p.delta||1e3/p.fps,p.deltaMin=p.deltaMin||1e3/p.fps,p.deltaMax=p.deltaMax||1e3/(p.fps*.5),p.fps=1e3/p.delta,p},i.run=function(m,d){return typeof m.positionIterations<"u"&&(d=m,m=i.create()),(function p(g){m.frameRequestId=u(p),g&&m.enabled&&i.tick(m,d,g)})(),m},i.tick=function(m,d,p){var g=d.timing,x;m.isFixed?x=m.delta:(x=p-m.timePrev||m.delta,m.timePrev=p,m.deltaHistory.push(x),m.deltaHistory=m.deltaHistory.slice(-m.deltaSampleSize),x=Math.min.apply(null,m.deltaHistory),x=x<m.deltaMin?m.deltaMin:x,x=x>m.deltaMax?m.deltaMax:x,m.delta=x);var b={timestamp:g.timestamp};s.trigger(m,"beforeTick",b),m.frameCounter+=1,p-m.counterTimestamp>=1e3&&(m.fps=m.frameCounter*((p-m.counterTimestamp)/1e3),m.counterTimestamp=p,m.frameCounter=0),s.trigger(m,"tick",b),s.trigger(m,"beforeUpdate",b),o.update(d,x),s.trigger(m,"afterUpdate",b),s.trigger(m,"afterTick",b)},i.stop=function(m){c(m.frameRequestId)},i.start=function(m,d){i.run(m,d)}})()}),(function(n,r,a){var i={};n.exports=i;var s=a(8),o=a(0),l=o.deprecated;(function(){i.collides=function(u,c){return s.collides(u,c)},l(i,"collides","SAT.collides ➤ replaced by Collision.collides")})()}),(function(n,r,a){var i={};n.exports=i,a(1);var s=a(0);(function(){i.pathToVertices=function(o,l){typeof window<"u"&&!("SVGPathSeg"in window)&&s.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var u,c,h,m,d,p,g,x,b,v,T=[],N,k,A=0,_=0,S=0;l=l||15;var I=function(D,L,F){var O=F%2===1&&F>1;if(!b||D!=b.x||L!=b.y){b&&O?(N=b.x,k=b.y):(N=0,k=0);var R={x:N+D,y:k+L};(O||!b)&&(b=R),T.push(R),_=N+D,S=k+L}},C=function(D){var L=D.pathSegTypeAsLetter.toUpperCase();if(L!=="Z"){switch(L){case"M":case"L":case"T":case"C":case"S":case"Q":_=D.x,S=D.y;break;case"H":_=D.x;break;case"V":S=D.y;break}I(_,S,D.pathSegType)}};for(i._svgPathToAbsolute(o),h=o.getTotalLength(),p=[],u=0;u<o.pathSegList.numberOfItems;u+=1)p.push(o.pathSegList.getItem(u));for(g=p.concat();A<h;){if(v=o.getPathSegAtLength(A),d=p[v],d!=x){for(;g.length&&g[0]!=d;)C(g.shift());x=d}switch(d.pathSegTypeAsLetter.toUpperCase()){case"C":case"T":case"S":case"Q":case"A":m=o.getPointAtLength(A),I(m.x,m.y,0);break}A+=l}for(u=0,c=g.length;u<c;++u)C(g[u]);return T},i._svgPathToAbsolute=function(o){for(var l,u,c,h,m,d,p=o.pathSegList,g=0,x=0,b=p.numberOfItems,v=0;v<b;++v){var T=p.getItem(v),N=T.pathSegTypeAsLetter;if(/[MLHVCSQTA]/.test(N))"x"in T&&(g=T.x),"y"in T&&(x=T.y);else switch("x1"in T&&(c=g+T.x1),"x2"in T&&(m=g+T.x2),"y1"in T&&(h=x+T.y1),"y2"in T&&(d=x+T.y2),"x"in T&&(g+=T.x),"y"in T&&(x+=T.y),N){case"m":p.replaceItem(o.createSVGPathSegMovetoAbs(g,x),v);break;case"l":p.replaceItem(o.createSVGPathSegLinetoAbs(g,x),v);break;case"h":p.replaceItem(o.createSVGPathSegLinetoHorizontalAbs(g),v);break;case"v":p.replaceItem(o.createSVGPathSegLinetoVerticalAbs(x),v);break;case"c":p.replaceItem(o.createSVGPathSegCurvetoCubicAbs(g,x,c,h,m,d),v);break;case"s":p.replaceItem(o.createSVGPathSegCurvetoCubicSmoothAbs(g,x,m,d),v);break;case"q":p.replaceItem(o.createSVGPathSegCurvetoQuadraticAbs(g,x,c,h),v);break;case"t":p.replaceItem(o.createSVGPathSegCurvetoQuadraticSmoothAbs(g,x),v);break;case"a":p.replaceItem(o.createSVGPathSegArcAbs(g,x,T.r1,T.r2,T.angle,T.largeArcFlag,T.sweepFlag),v);break;case"z":case"Z":g=l,x=u;break}(N=="M"||N=="m")&&(l=g,u=x)}}})()}),(function(n,r,a){var i={};n.exports=i;var s=a(6);a(0),(function(){i.create=s.create,i.add=s.add,i.remove=s.remove,i.clear=s.clear,i.addComposite=s.addComposite,i.addBody=s.addBody,i.addConstraint=s.addConstraint})()})])})})(lo)),lo.exports}var E5=T5();const Dr=O0(E5);{const e=Dr.Resolver;e&&typeof e._restingThresh=="number"&&(e._restingThresh=1.4)}const S5=6,Rn=28,gr=.92,ql=1.12,A5=34;function Rh(e,t,n){return Math.hypot(t-e.startX,n-e.startY)<S5?"click":"drag"}function C5(e){const t=e.length;if(t===0)return"";const n=a=>`${a.x.toFixed(1)} ${a.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 a=1;a<t-1;a++){const i=e[a],s=e[a+1];r+=` Q ${n(i)} ${((i.x+s.x)/2).toFixed(1)} ${((i.y+s.y)/2).toFixed(1)}`}return`${r} L ${n(e[t-1])}`}function N5(e,t){return e*Math.exp(-t/90)}function M5(e,t,n,r){const a=`translate3d(${e.toFixed(1)}px, ${t.toFixed(1)}px, 0)`;if(n<.01)return a;const i=r*180/Math.PI,s=Math.min(.35,n);return`${a} rotate(${i.toFixed(1)}deg) scale(${(1+s).toFixed(3)}, ${(1-s).toFixed(3)}) rotate(${(-i).toFixed(1)}deg)`}const ag=4e-5,I5=5e-4;function ig(e,t,n){return Math.sin(n*37e-5+t*.0013)*.6+Math.sin(n*19e-5+e*7e-4+1.7)*.4}function sg(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 og(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 yi=120,_5=.9,Lh=.7,R5=.09,L5=2.2,D5=2,Vl=Rn*2.45,P5=.006,$l=22,Wl=.06;function O5(e){var F;const t=e.ballRadius??Rn,n=sg(e.weather??"clear"),{Engine:r,Bodies:a,Body:i,Composite:s,Constraint:o,Events:l}=Dr,u=r.create();u.gravity.y=1,u.positionIterations=8,u.velocityIterations=4;const c=e.nodes.map(O=>{var q,Z;const R=((q=O.spawn)==null?void 0:q.x)??O.x,H=((Z=O.spawn)==null?void 0:Z.y)??O.y,V=a.circle(R,H,t,{restitution:.5,friction:.01,frictionAir:.03*n.airDrag,density:O.isExam?.0016:.001,inertia:1/0,isStatic:!!O.locked,collisionFilter:{group:0,category:2,mask:6}});return{nodeId:O.id,body:V,layoutX:O.x,layoutY:O.y,isExam:!!O.isExam,snow:0,field:0,squash:0,squashAngle:0}});for(const O of c){s.add(u.world,O.body);const R=(F=e.nodes.find(H=>H.id===O.nodeId))==null?void 0:F.spawn;R&&(R.vx!==void 0||R.vy!==void 0)&&i.setVelocity(O.body,{x:R.vx??0,y:R.vy??0})}const h=yi/2,m={isStatic:!0,restitution:.4,friction:.05,collisionFilter:{category:4,mask:2}},d=(O,R)=>({x:Math.min(e.width-t,Math.max(t,O)),y:Math.min(e.height-t,Math.max(t,R))});s.add(u.world,[a.rectangle(e.width/2,-h,e.width*3,yi,m),a.rectangle(e.width/2,e.height+h,e.width*3,yi,m),a.rectangle(-h,e.height/2,yi,e.height*3,m),a.rectangle(e.width+h,e.height/2,yi,e.height*3,m)]);const p=O=>({x:O.body.position.x,y:O.body.position.y+t*gr}),g=[];function x(O,R,H,V,q){return"body"in O?o.create({bodyA:O.body,pointA:O.offset,bodyB:R,pointB:H,length:V,stiffness:q,damping:.05}):o.create({pointA:O.point,bodyB:R,pointB:H,length:V,stiffness:q,damping:.05})}function b(O,R,H,V){const q={x:H.body.position.x,y:H.body.position.y+t*gr},Z=q.x-O.x,B=q.y-O.y,Q=Math.max(60,Math.hypot(Z,B)),ne=Math.max(5,Math.min(14,Math.round(Q/A5))),j=Q*ql/ne,re=[];let K=R?{body:R,offset:{x:O.x-R.position.x,y:O.y-R.position.y}}:{point:O},X=!0;for(let ce=1;ce<ne;ce++){const le=ce/ne,ee=Math.sin(Math.PI*le)*Q*(ql-1)*.85,Ie=a.circle(O.x+Z*le,O.y+B*le+ee,3.5,{density:7e-4,frictionAir:.1*n.airDrag,collisionFilter:{category:8,mask:0}});re.push(Ie),s.add(u.world,Ie),s.add(u.world,x(K,Ie,void 0,j,X?Lh:_5)),X=!1,K={body:Ie,offset:{x:0,y:0}}}s.add(u.world,x(K,H.body,{x:0,y:t*gr},j,Lh)),g.push({from:V,to:H.nodeId,restLen:Q*ql,particles:re})}const v=c[0],T=v?{x:e.anchorKnotX??v.layoutX,y:Io}:{x:e.width/2,y:Io};v&&b(T,null,v,"__anchor");for(let O=0;O<c.length-1;O++){const R=c[O],H=c[O+1];b(p(R),R.body,H,R.nodeId)}const N=c[c.length-1],k=e.nextKnot&&(N!=null&&N.isExam)?e.nextKnot:void 0;k&&N&&b(k,null,N,"__next");const A=new Map;for(const O of c){let R=0;for(const V of g)if(V.from===O.nodeId||V.to===O.nodeId)for(const q of V.particles)R+=q.mass*.5;const H=Math.min(.25,R/O.body.mass);A.set(O.nodeId,(1+H)*(.96+og(O.nodeId)*.08))}let _=0,S=1;l.on(u,"beforeUpdate",()=>{const O=u.timing.timestamp;_*=.97,n.gust>0&&Math.random()<.0025*n.gust&&(_=n.gust*(.6+Math.random()*.4),S=Math.random()<.5?-1:1);for(const R of c){const H=R.body.mass,V=u.gravity.y*u.gravity.scale,q=ig(R.body.position.x,R.body.position.y,O)*n.wind*ag*H+S*_*I5*H;let Z=-H*V*(A.get(R.nodeId)??1);n.rainRate>0&&Math.random()<n.rainRate&&(Z+=H*V*.35,i.applyForce(R.body,R.body.position,{x:(Math.random()-.5)*H*V*.3,y:0})),i.applyForce(R.body,R.body.position,{x:q,y:Z})}});const I=[],C=(O,R,H,V)=>{if(O.snow<=Wl)return;const q=Math.max(1,Math.min(V,Math.round(O.snow*V)+1));for(let Z=0;Z<q;Z++){const B=-(.35+Math.random()*1.9),Q=t*(.55+Math.random()*.45);I.push({x:O.body.position.x+Math.cos(B)*Q,y:O.body.position.y+Math.sin(B)*Q,vx:O.body.velocity.x*.75+R.x*(.5+Math.random()*1.8)+(Math.random()-.5)*1.2,vy:O.body.velocity.y*.75+R.y*(.5+Math.random()*1.8)-.6-Math.random()*.8,amount:.02+Math.min(.05,H*.004)})}O.snow=Math.max(Wl*.5,O.snow-q*(.03+Math.min(.07,H*.005))),I.length>96&&I.splice(0,I.length-96)},D=[];l.on(u,"collisionStart",O=>{var R;for(const H of O.pairs){const{bodyA:V,bodyB:q}=H,Z=c.find(X=>X.body===V),B=c.find(X=>X.body===q);if(!Z&&!B)continue;const Q={x:V.velocity.x-q.velocity.x,y:V.velocity.y-q.velocity.y},ne=Math.hypot(Q.x,Q.y);if(ne<L5)continue;const j=H.collision.normal,re=(R=H.collision.supports)==null?void 0:R[0];D.push(re?{x:re.x,y:re.y,speed:ne}:{x:(V.position.x+q.position.x)/2,y:(V.position.y+q.position.y)/2,speed:ne}),D.length>64&&D.shift();const K=Math.min(.32,ne*.028);Z&&K>Z.squash&&(Z.squash=K,Z.squashAngle=Math.atan2(j.y,j.x)),B&&K>B.squash&&(B.squash=K,B.squashAngle=Math.atan2(-j.y,-j.x)),Z&&C(Z,{x:j.x,y:j.y},ne,5),B&&C(B,{x:-j.x,y:-j.y},ne,5)}}),l.on(u,"afterUpdate",()=>{if(!(n.snowRate<=0))for(const O of c)O.snow=Math.min(1,O.snow+n.snowRate)});let L=null;return{balls:c,links:g,anchor:T,nextKnot:k,ball(O){return c.find(R=>R.nodeId===O)},step(O){r.update(u,Math.min(33,Math.max(8,O)));for(let R=0;R<c.length;R++){const H=c[R];for(let V=R+1;V<c.length;V++){const q=c[V],Z=q.body.position.x-H.body.position.x,B=q.body.position.y-H.body.position.y,Q=Z*Z+B*B;if(Q>=Vl*Vl||Q<.01)continue;const ne=Math.sqrt(Q),j=(ne-2*t)/(Vl-2*t),re=j<=0?1:j>=1?0:1-j,X=Math.hypot(H.body.velocity.x-q.body.velocity.x,H.body.velocity.y-q.body.velocity.y)<1.2?P5*re*re:0,ce=Z/ne,le=B/ne;H.body.isStatic||i.applyForce(H.body,H.body.position,{x:-ce*X*H.body.mass,y:-le*X*H.body.mass}),q.body.isStatic||i.applyForce(q.body,q.body.position,{x:ce*X*q.body.mass,y:le*X*q.body.mass}),H.field=Math.max(H.field,re),q.field=Math.max(q.field,re)}}for(const R of c)R.field*=.88;for(const R of c){if(R.body.isStatic)continue;const H=R.body.velocity,V=Math.hypot(H.x,H.y);V>$l&&i.setVelocity(R.body,{x:H.x/V*$l,y:H.y/V*$l})}for(let R=0;R<c.length;R++){const H=c[R];for(let V=R+1;V<c.length;V++){const q=c[V];let Z=q.body.position.x-H.body.position.x,B=q.body.position.y-H.body.position.y,Q=Math.hypot(Z,B);if(Q>=t*2)continue;Q<.01&&(Z=1,B=0,Q=1);const ne=t*2-Q+.05,j=Z/Q,re=B/Q;H.body.isStatic&&q.body.isStatic||(H.body.isStatic?i.setPosition(q.body,{x:q.body.position.x+j*ne,y:q.body.position.y+re*ne}):q.body.isStatic?i.setPosition(H.body,{x:H.body.position.x-j*ne,y:H.body.position.y-re*ne}):(i.setPosition(H.body,{x:H.body.position.x-j*ne/2,y:H.body.position.y-re*ne/2}),i.setPosition(q.body,{x:q.body.position.x+j*ne/2,y:q.body.position.y+re*ne/2})))}}for(const R of c){const H=Math.hypot(R.body.velocity.x,R.body.velocity.y);R.snow>Wl&&H>D5&&C(R,{x:R.body.velocity.x/H,y:R.body.velocity.y/H},H,2)}for(const R of c){if(R.body.isStatic)continue;const H=R.body.position.x,V=R.body.position.y,q=Math.min(e.width-t,Math.max(t,H)),Z=Math.min(e.height-t,Math.max(t,V));(q!==H||Z!==V)&&(i.setPosition(R.body,{x:q,y:Z}),i.setVelocity(R.body,{x:H<t||H>e.width-t?0:R.body.velocity.x,y:V<t||V>e.height-t?0:R.body.velocity.y}))}},beginDrag(O,R,H){this.endDrag();const V=this.ball(O);if(!V)return;const q=o.create({pointA:d(R,H),bodyB:V.body,length:0,stiffness:R5,damping:.12});s.add(u.world,q),L={constraint:q,nodeId:O}},moveDrag(O,R){if(!L)return;const H=d(O,R);L.constraint.pointA=H},endDrag(){L&&(s.remove(u.world,L.constraint),L=null)},isDragging(){return L!==null},drainImpacts(){const O=D.slice();return D.length=0,O},drainFlakes(){const O=I.slice();return I.length=0,O},dispose(){this.endDrag(),l.off(u,"beforeUpdate"),l.off(u,"afterUpdate"),l.off(u,"collisionStart"),s.clear(u.world,!1),r.clear(u)}}}const Io=-12;function Rs(e,t,n=20){return t<=n*2?t/2:n+og(e)*(t-n*2)}function j5(e,t,n,r=Rn){if(t<=0||Math.abs(t-n)<=1)return e;const a=n/t,i={x:Math.min(n-r,Math.max(r,e.x*a)),y:e.y,vy:e.vy};return e.vx!==void 0&&(i.vx=e.vx*a),i}const fa=(e,t,n)=>e+(t-e)*n,nl=(e,t,n)=>e<t?t:e>n?n:e,es=e=>e<0?0:e>1?1:e*e*(3-2*e);function ma(e,t,n){return[fa(e[0],t[0],n),fa(e[1],t[1],n),fa(e[2],t[2],n)]}const Gl=e=>`rgb(${e[0]|0},${e[1]|0},${e[2]|0})`,Ya=(e,t)=>`rgba(${e[0]|0},${e[1]|0},${e[2]|0},${t})`;function rl(){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 al(e,t){return e.map(n=>({t:n.t,top:t(n.top),mid:t(n.mid),hor:t(n.hor)}))}const Yl=()=>al(rl(),e=>[e[0]*1,e[1]*1.15,e[2]*.7]),Ls=()=>al(rl(),e=>[e[0]*.75,e[1]*1,Math.min(255,e[2]*1.25)]),Kl=()=>al(rl(),e=>[Math.min(255,e[0]*1.35),e[1]*.8,e[2]*.55]),Dh=()=>al(rl(),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]}),Xl={far:[28,50,36],near:[56,110,52],snowy:!1},Ds={far:[20,48,30],near:[34,82,40],snowy:!1},Ql={far:[54,36,24],near:[128,78,36],snowy:!1},Ph={far:[60,66,82],near:[232,236,244],snowy:!0};function _n(e){return t=>{let n=e;return t>.3&&t<.5?n=fa(n,Math.min(1,n+.2),es((t-.3)/.2)):t>=.5&&t<.74?n=Math.min(1,n+.15):t>=.74&&t<.84&&(n=fa(n,Math.max(0,n-.3),es((t-.74)/.1))),nl(n,0,1)}}const lg={"spring|clear":{season:"spring",weather:"clear",sky:Yl(),cloudCover:_n(.1),particles:"none",lightning:!1,fogAlpha:0,ground:Xl},"spring|cloudy":{season:"spring",weather:"cloudy",sky:Yl(),cloudCover:_n(.5),particles:"none",lightning:!1,fogAlpha:0,ground:Xl},"spring|rain":{season:"spring",weather:"rain",sky:Yl(),cloudCover:_n(.85),particles:"rain",lightning:!1,fogAlpha:0,ground:Xl},"summer|clear":{season:"summer",weather:"clear",sky:Ls(),cloudCover:_n(.1),particles:"none",lightning:!1,fogAlpha:0,ground:Ds},"summer|cloudy":{season:"summer",weather:"cloudy",sky:Ls(),cloudCover:_n(.5),particles:"none",lightning:!1,fogAlpha:0,ground:Ds},"summer|rain":{season:"summer",weather:"rain",sky:Ls(),cloudCover:_n(.85),particles:"rain",lightning:!1,fogAlpha:0,ground:Ds},"summer|storm":{season:"summer",weather:"storm",sky:Ls(),cloudCover:_n(1),particles:"rain",lightning:!0,fogAlpha:0,ground:Ds},"autumn|clear":{season:"autumn",weather:"clear",sky:Kl(),cloudCover:_n(.15),particles:"none",lightning:!1,fogAlpha:0,ground:Ql,sunTint:[255,180,110]},"autumn|cloudy":{season:"autumn",weather:"cloudy",sky:Kl(),cloudCover:_n(.55),particles:"none",lightning:!1,fogAlpha:0,ground:Ql},"autumn|storm":{season:"autumn",weather:"storm",sky:Kl(),cloudCover:_n(1),particles:"rain",lightning:!0,fogAlpha:0,ground:Ql},"winter|clear":{season:"winter",weather:"clear",sky:Dh(),cloudCover:_n(.2),particles:"none",lightning:!1,fogAlpha:0,ground:Ph,sunTint:[220,230,245]},"winter|snow":{season:"winter",weather:"snow",sky:Dh(),cloudCover:_n(.9),particles:"snow",lightning:!1,fogAlpha:.2,ground:Ph}},Oh=Object.keys(lg);function B5(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 F5(e){const t=`${e??"none"}:${Math.floor(performance.now()/1e3)}`;return Oh[B5(t)%Oh.length]}function z5(e,t){let n=0;for(;n<t.length-1&&e>t[n+1].t;)n++;const r=t[n],a=t[Math.min(n+1,t.length-1)],i=es(nl((e-r.t)/(a.t-r.t||1),0,1));return{top:ma(r.top,a.top,i),mid:ma(r.mid,a.mid,i),hor:ma(r.hor,a.hor,i)}}function H5(e,t,n,r,a){if(e<r||e>a)return null;const i=(e-r)/(a-r),s=fa(.1,.9,i),o=n*.26,l=n*.98,u=l-Math.sin(i*Math.PI)*(l-o);return{x:s*t,y:u,peakness:Math.sin(i*Math.PI)}}function U5(e,t,n,r,a){let i;if(e>=r)i=(e-r)/(1-r+a);else if(e<=a)i=(1-r+e)/(1-r+a);else return null;const s=fa(.12,.88,i),o=n*.26,l=n*.98,u=l-Math.sin(i*Math.PI)*(l-o);return{x:s*t,y:u,peakness:Math.sin(i*Math.PI)}}function ug(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 jh(e,t){const n=ug(20260809),r=Math.max(28,Math.round(e*t/7e3)),a=[];for(let i=0;i<r;i++)a.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 a}function q5(){const e=ug(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 V5(e,t,n,r){const a=e.createLinearGradient(0,0,0,r);a.addColorStop(0,Gl(t.top)),a.addColorStop(.55,Gl(t.mid)),a.addColorStop(1,Gl(t.hor)),e.fillStyle=a,e.fillRect(0,0,n,r)}function $5(e,t,n,r,a,i){let s=0;if(t<.22?s=es(1-t/.22):t>.8&&(s=es((t-.8)/.2)),!(s<=.01))for(const o of n){const l=.55+.45*Math.sin(i*o.sp+o.tw),u=s*l;if(u<.02)continue;e.fillStyle=`rgba(255,248,228,${u})`;const c=o.big?o.r*1.8:o.r;e.beginPath(),e.arc(o.x*r,o.y*a,c,0,Math.PI*2),e.fill(),o.big&&(e.fillStyle=`rgba(255,240,210,${u*.35})`,e.fillRect(o.x*r-c*4,o.y*a-.4,c*8,.8),e.fillRect(o.x*r-.4,o.y*a-c*4,.8,c*8))}}function W5(e,t,n){if(!t)return;const{x:r,y:a,peakness:i}=t,s=28+i*8,o=e.createRadialGradient(r,a,s*.4,r,a,s*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-s*5,a-s*5,s*10,s*10);const l=e.createRadialGradient(r,a,0,r,a,s),u=n??[255,236,180],c=n?ma(n,[255,214,150],.5):[255,214,150];l.addColorStop(0,"rgba(255,252,238,1)"),l.addColorStop(.7,Ya(u,1)),l.addColorStop(1,Ya(c,.9)),e.fillStyle=l,e.beginPath(),e.arc(r,a,s,0,Math.PI*2),e.fill()}function G5(e,t){if(!t)return;const{x:n,y:r}=t,a=24,i=e.createRadialGradient(n,r,a*.8,n,r,a*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-a*5,r-a*5,a*10,a*10);const s=e.createRadialGradient(n-a*.25,r-a*.3,a*.2,n,r,a);s.addColorStop(0,"rgba(255,254,247,1)"),s.addColorStop(.7,"rgba(244,242,232,1)"),s.addColorStop(1,"rgba(214,222,236,1)"),e.fillStyle=s,e.beginPath(),e.arc(n,r,a,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[l,u,c]of o)e.beginPath(),e.arc(n+l,r+u,c,0,Math.PI*2),e.fill()}function Y5(e,t,n,r,a,i){const s=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=Ya([a[0]*.7,a[1]*.7,a[2]*.78],i*.9);for(const[l,u,c]of o)e.beginPath(),e.arc(l*s,u*s*1.1+s*.45,s*c*1.05,0,Math.PI*2),e.fill();e.fillStyle=Ya(a,i);for(const[l,u,c]of o)e.beginPath(),e.arc(l*s,u*s,s*c,0,Math.PI*2),e.fill();e.restore()}function K5(e,t,n,r,a,i,s,o,l){const u=s(t);if(u<.02)return;const c=ma(o.hor,[255,255,255],.35),h=ma(o.mid,[20,20,30],.45),m=l?h:c;for(let d=0;d<n.length;d++){const p=n[d],g=(p.x+i*p.speed)%1.2-.1,x=p.y+Math.sin(i*1e-4+p.seed)*p.drift;d/n.length<u&&Y5(e,g*r,x*a,p.s,m,nl(u*.92,0,.92))}}const Oa=[];let ia=[];const Ii=[];let sa=[];const Ps=[],vi=[];let _i=[];function X5(e,t,n,r,a,i){if(a<.04)return;const s=r*(.02+a*.07),o=.12+a*.73,l=t-r*o,u=t+r*o,c=n-Math.sqrt(Math.max(0,r*r-r*o*(r*o))),h=n-r-s,m=(c+h)/2;e.save(),e.beginPath(),e.moveTo(l,c),e.bezierCurveTo(l,m,t-r*.3,h,t,h),e.bezierCurveTo(t+r*.3,h,u,m,u,c),e.quadraticCurveTo(t,n-r*.78,l,c),e.closePath();const d=e.createLinearGradient(0,h,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(l,c),e.quadraticCurveTo(t,n-r*.78,u,c),e.stroke(),e.restore()}function Zl(e,t,n,r,a){const i=Math.sin(r),s=Math.cos(r);return{x:e+Math.sin(a)*i*n,y:t-s*n}}function Q5(e,t,n,r){e.save(),e.beginPath(),e.arc(t,n,r*.99,0,Math.PI*2),e.clip();const a=e.createRadialGradient(t-r*.35,n-r*.4,0,t-r*.35,n-r*.4,r*.8);a.addColorStop(0,"rgba(255,255,255,0.4)"),a.addColorStop(.5,"rgba(255,255,255,0.12)"),a.addColorStop(1,"rgba(255,255,255,0)"),e.fillStyle=a,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 Z5(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 a=r.life/r.maxLife;e.fillStyle=`rgba(248,250,255,${(.9*a).toFixed(3)})`,e.beginPath(),e.arc(r.x,r.y,r.r*(.5+.5*a),0,Math.PI*2),e.fill()}e.restore()}}function cg(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 a=Math.min(1,r.life/20)*.8;e.fillStyle=`rgba(215,238,255,${a})`,e.beginPath(),e.arc(r.x,r.y,1.3,0,Math.PI*2),e.fill()}e.restore()}function J5(e,t,n,r,a,i){e.save(),e.beginPath(),e.arc(t,n,r*.99,0,Math.PI*2),e.clip();for(let s=a.length-1;s>=0;s--){const o=a[s];if(o.prog+=o.speed,o.life--,o.prog>Math.PI*1.05||o.life<=0){a.splice(s,1);continue}const l=7;for(let h=0;h<l;h++){const m=o.prog-o.len*(h/l),d=o.prog-o.len*((h+1)/l),p=Zl(t,n,r,m,o.theta),g=Zl(t,n,r,d,o.theta),x=(1-h/l)*.42;e.strokeStyle=`rgba(200,228,250,${x})`,e.lineWidth=o.thick*(1-h/l*.7),e.lineCap="round",e.beginPath(),e.moveTo(p.x,p.y),e.lineTo(g.x,g.y),e.stroke()}const u=Zl(t,n,r,o.prog,o.theta),c=e.createRadialGradient(u.x-1.2,u.y-1.2,0,u.x,u.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(u.x,u.y,o.thick*1.1,0,Math.PI*2),e.fill()}e.restore()}function ev(e,t,n,r){for(;Oa.length<t.length;)Oa.push([]);for(;ia.length<t.length;)ia.push(0);for(;_i.length<t.length;)_i.push(.3);for(;Ii.length<t.length;)Ii.push([]);for(;sa.length<t.length;)sa.push(0);for(let a=0;a<t.length;a++){const i=t[a];if(n.particles==="snow"){const s=i.snow!==void 0?i.snow:Math.min(1,(_i[a]??.3)+8e-4);_i[a]=s,X5(e,i.x,i.y,i.r,s)}else if(n.particles==="rain"){if(Q5(e,i.x,i.y,i.r),ia[a]=ia[a]-1,ia[a]<=0&&Oa[a].length<3){const s=Math.random()<.5?-1:1;Oa[a].push({theta:s*(.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}),ia[a]=40+Math.random()*60}if(J5(e,i.x,i.y,i.r,Oa[a]),sa[a]=sa[a]-1,sa[a]<=0){const s=i.x+(Math.random()-.5)*i.r*1.2,o=s-i.x,l=i.y-Math.sqrt(Math.max(0,i.r*i.r-o*o)),u=4+Math.floor(Math.random()*3);for(let c=0;c<u;c++){const h=o<0?-1:1;Ii[a].push({x:s,y:l,vx:h*(.5+Math.random()*2)*(Math.random()<.5?-1:1),vy:-(1.5+Math.random()*2.5),life:18+Math.floor(Math.random()*14)})}sa[a]=30+Math.floor(Math.random()*50)}cg(e,Ii[a])}}}function tv(e,t,n,r,a){e.save(),e.strokeStyle=a?"rgba(205,224,244,0.42)":"rgba(210,224,238,0.3)",e.lineWidth=a?1:.7,e.lineCap="round";const i=a?.013:.007;for(const s of r){s.y+=s.v*i,s.y>1&&(s.y-=1,s.x=Math.random());const o=s.x*t,l=s.y*n;e.beginPath(),e.moveTo(o,l),e.lineTo(o,l+s.len),e.stroke()}e.restore()}function nv(e,t,n,r,a){e.save(),e.fillStyle="rgba(250,250,255,0.85)";for(const i of r){i.y+=i.v*.004;const s=(i.x+Math.sin(a*5e-4+i.phase)*.02)*t,o=i.y*n;i.y>1&&(i.y-=1),e.beginPath(),e.arc(s,o,i.r,0,Math.PI*2),e.fill()}e.restore()}function rv(e,t,n,r,a){const i=e.createLinearGradient(0,n*.4,0,n),s=ma(a.hor,[255,255,255],.3);i.addColorStop(0,Ya(s,0)),i.addColorStop(1,Ya(s,r)),e.fillStyle=i,e.fillRect(0,n*.4,t,n*.6)}let Ia=0,Bh=0;function av(e,t,n,r,a){if(a>Bh&&(Ia=1,Bh=a+1400+Math.random()*2600),Ia*=.86,Ia<.02){Ia=0;return}if(e.fillStyle=`rgba(255,255,255,${Ia*.5})`,e.fillRect(0,0,t,n),Ia>.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),s=0;for(e.beginPath(),e.moveTo(i,s);s<n*.6;)i+=(Math.random()-.5)*60,s+=24+Math.random()*30,e.lineTo(i,s);e.stroke(),e.restore()}}function iv(e,t,n,r){const a=e.getContext("2d");if(!a)return()=>{};const i=a,s=n;let o=0,l=0,u=1,c=jh(1,1);const h=q5();let m=[],d=[],p=0,g=0,x=!0;const b=performance.now(),v=window.matchMedia("(prefers-reduced-motion: reduce)").matches;function T(){const I=s.getBoundingClientRect();if(u=Math.min(window.devicePixelRatio||1,2),o=Math.max(1,I.width),l=Math.max(1,I.height),e.width=Math.floor(o*u),e.height=Math.floor(l*u),e.style.width=o+"px",e.style.height=l+"px",i.setTransform(u,0,0,u,0,0),c=jh(o,l),r.particles==="rain"&&m.length===0){const C=r.weather==="storm",D=C?140:70;for(let L=0;L<D;L++)m.push({x:Math.random(),y:Math.random(),len:C?12+Math.random()*14:6+Math.random()*8,v:C?.9+Math.random()*.4:.5+Math.random()*.3})}if(r.particles==="snow"&&d.length===0)for(let C=0;C<120;C++)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 N(){const I=t.scrollHeight-t.clientHeight;p=I>0?nl(t.scrollTop/I,0,1):0}function k(I){if(!x)return;const C=p,D=v?0:(I-b)/1e3,L=z5(C,r.sky);V5(i,L,o,l),$5(i,C,c,o,l,D),G5(i,U5(C,o,l,.92,.08)),W5(i,H5(C,o,l,.16,.88),r.sunTint),K5(i,C,h,o,l,I,r.cloudCover,L,r.weather==="storm"),r.particles==="rain"&&tv(i,o,l,m,r.weather==="storm"),r.particles==="snow"&&nv(i,o,l,d,I),r.fogAlpha>0&&rv(i,o,l,r.fogAlpha,L),r.lightning&&av(i,o,l,!0,I),v||(g=requestAnimationFrame(k))}const A=()=>N(),_=new ResizeObserver(()=>{T(),N()});_.observe(s),T(),N();let S;if(v){let I=!1;S=()=>{N(),I||(I=!0,requestAnimationFrame(()=>{I=!1,k(performance.now())}))},t.addEventListener("scroll",S,{passive:!0}),k(performance.now())}else S=A,t.addEventListener("scroll",S,{passive:!0}),g=requestAnimationFrame(k);return()=>{x=!1,cancelAnimationFrame(g),_.disconnect(),t.removeEventListener("scroll",S)}}function sv(e,t,n,r,a,i){const s=()=>{Oa.length=0,_i.length=0,ia.length=0,Ii.length=0,sa.length=0,Ps.length=0,vi.length=0;const v=e.getContext("2d");v&&v.clearRect(0,0,e.width,e.height)};if(s(),window.matchMedia("(prefers-reduced-motion: reduce)").matches)return()=>{};if(n.particles!=="rain"&&n.particles!=="snow")return()=>{};const l=e.getContext("2d");if(!l)return()=>{};const u=l;let c=0,h=0,m=1,d=0,p=!0;function g(){const v=t.getBoundingClientRect();m=Math.min(window.devicePixelRatio||1,2),c=Math.max(1,v.width),h=Math.max(1,v.height),e.width=Math.floor(c*m),e.height=Math.floor(h*m),e.style.width=c+"px",e.style.height=h+"px",u.setTransform(m,0,0,m,0,0)}function x(v){if(!p)return;u.clearRect(0,0,c,h);const T=r();if(ev(u,T,n),a){for(const N of a()){const k=3+Math.min(5,Math.floor(N.speed/3));for(let A=0;A<k;A++)Ps.push({x:N.x,y:N.y,vx:(Math.random()-.5)*3.2,vy:-(1.5+Math.random()*2.5),life:16+Math.floor(Math.random()*12)})}Ps.length>0&&cg(u,Ps)}if(i){for(const N of i()){const k=1+Math.min(2,Math.round(N.amount*40));for(let A=0;A<k;A++){const _=55+Math.floor(Math.random()*40);vi.push({x:N.x+(Math.random()-.5)*8,y:N.y+(Math.random()-.5)*6,vx:N.vx*.6+(Math.random()-.5)*.8,vy:N.vy*.6-Math.random()*.5,life:_,maxLife:_,r:1.2+Math.random()*2.2})}}for(;vi.length>240;)vi.shift();Z5(u,vi)}d=requestAnimationFrame(x)}const b=new ResizeObserver(g);return b.observe(t),g(),d=requestAnimationFrame(x),()=>{p=!1,cancelAnimationFrame(d),b.disconnect(),s()}}function ov(e){const t=$e(),[n,r]=w.useState("import"),[a,i]=w.useState("study"),s=w.useRef(null),o=w.useRef(null),l=Math.round(e.overallMastery*100),c=!j0(),h=w.useRef([]),m=w.useRef(L=>{h.current.push(...L),h.current.length>64&&h.current.splice(0,h.current.length-64)}).current,d=w.useRef([]),p=w.useRef(new Map),g=w.useRef(L=>{d.current.push(...L),d.current.length>96&&d.current.splice(0,d.current.length-96)}).current,x=e.sections.filter(L=>(L.world??"study")===a),b=e.sections.some(L=>L.world==="practice"),[v,T]=w.useState(null);w.useEffect(()=>{T(F5(e.courseId))},[e.courseId]);const N=v?lg[v]??null:null;w.useEffect(()=>(ph({nav:s.current,visible:n==="map",weather:(N==null?void 0:N.weather)??"clear"}),()=>{ph({visible:!1,nav:null})}),[n,N,s]);const[k,A]=w.useState(!1);w.useEffect(()=>{if(!e.selectedNodeId)return;const L=o.current;if(!L)return;const F=L.querySelector(`[data-node-id="${CSS.escape(e.selectedNodeId)}"]`);if(!F)return;const O=L.getBoundingClientRect(),R=F.getBoundingClientRect();(R.top<O.top+60||R.bottom>O.bottom-60)&&F.scrollIntoView({behavior:"smooth",block:"center"})},[e.selectedNodeId]);const _=w.useRef(null);w.useEffect(()=>{A(!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[S,I]=w.useState(null),C=w.useRef({}),D=w.useRef(null);return w.useEffect(()=>{var R;const L=C.current,F={};let O=!1;for(const H of e.tree){const V=((R=e.progressMap[H.id])==null?void 0:R.status)??"locked";F[H.id]=V,L[H.id]==="locked"&&V!=="locked"&&(O=!0)}O&&Object.keys(L).length>0&&ha("unlock"),C.current=F},[e.tree,e.progressMap]),f.jsxs("nav",{ref:s,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:[N&&f.jsxs(f.Fragment,{children:[f.jsx(uv,{scrollRef:o,navRef:s,preset:N}),f.jsx(cv,{scrollRef:o,navRef:s,preset:N,getImpacts:()=>h.current.splice(0),getFlakes:()=>d.current.splice(0),orbSnowRef:p})]}),f.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:[f.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:[f.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:[f.jsx(H0,{className:"w-3 h-3"})," ",t("map.tab.map")]}),f.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:[f.jsx(hs,{className:"w-3 h-3"})," ",t("map.tab.import")]})]}),n==="map"&&f.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:[f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.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&&f.jsx(gv,{available:e.availableLanguages,current:e.currentLocale,onChange:e.onLocaleChange}),e.courseId&&f.jsx("button",{onClick:L=>{const F=L.currentTarget.getBoundingClientRect();I({id:e.courseId,title:e.courseTitle??"",rect:F})},"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:f.jsx(Xp,{className:"w-3 h-3"})})]}),f.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[f.jsx("div",{className:"flex-1 h-2.5 bg-black/40 rounded-full overflow-hidden ring-1 ring-white/10",children:f.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${l>=100?"bg-gold":"bg-brand"}`,style:{width:`${Math.max(3,l)}%`}})}),f.jsxs("span",{className:"text-label font-extrabold tabular-nums text-white drop-shadow-[0_1px_3px_rgba(0,0,0,0.6)]",children:[l,"%"]})]}),f.jsxs("div",{className:"flex items-center justify-end gap-1.5 mt-1.5 text-caption",children:[f.jsxs("button",{onClick:()=>A(!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:[f.jsx(U0,{className:"w-3 h-3 text-white/50"}),f.jsx("span",{className:"font-bold text-white/60",children:t("map.search.label")})]}),f.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:[f.jsx(sr,{className:`w-3 h-3 ${e.dueCount>0?"text-review":"text-white/50"}`}),f.jsx("span",{className:`font-bold ${e.dueCount>0?"text-review":"text-white/60"}`,children:t("map.review.label")}),e.dueCount>0&&f.jsx("span",{className:"font-extrabold text-review tabular-nums",children:e.dueCount})]})]}),b&&f.jsxs("div",{className:"flex gap-1 mt-1.5 p-0.5 rounded-lg bg-black/30",children:[f.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 ${a==="study"?"bg-brand/30 text-brand":"text-white/50 hover:text-white/80"}`,children:[f.jsx(sr,{className:"w-3 h-3"})," ",t("map.world.study")]}),f.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 ${a==="practice"?"bg-accent/30 text-accent":"text-white/50 hover:text-white/80"}`,children:[f.jsx(ms,{className:"w-3 h-3"})," ",t("map.world.practice")]})]})]})]}),f.jsx("div",{className:"absolute inset-0 overflow-hidden z-10",children:f.jsxs("div",{className:"flex h-full transition-transform duration-300",style:{transform:n==="map"?"translateX(0)":"translateX(-50%)",width:"200%"},children:[f.jsx("div",{className:"w-1/2 h-full relative",children:f.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:L=>{D.current={x:L.clientX,y:L.clientY}},onClick:L=>{const F=D.current;D.current=null,!(!F||Math.hypot(L.clientX-F.x,L.clientY-F.y)>6)&&(L.target.closest("button, a, input, textarea, select")||P3(L.clientX,L.clientY))},children:f.jsxs("div",{className:`map-sky-content ${N?`env-${N.season} env-${N.weather}`:""}`,children:[e.streaming&&f.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:[f.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?f.jsxs("div",{className:"text-center text-label text-white/60 mt-8 px-4 flex items-center justify-center gap-2",children:[f.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),t("map.generating")]}):f.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:[f.jsx("div",{className:"text-3xl mb-2 group-hover:scale-110 transition-transform",children:"🗺️"}),f.jsx("div",{className:"text-body font-bold text-white/90 mb-1",children:t("map.empty.cta.title")}),f.jsx("div",{className:"text-label text-white/60 leading-relaxed",children:t("map.empty.cta.desc")}),f.jsx("div",{className:"mt-2 text-caption text-brand font-bold",children:t("map.empty.cta.btn")})]}):x.length===0?f.jsx("div",{className:"text-center text-label text-white/60 mt-8 px-4",children:t(a==="practice"?"map.empty.practice":"map.generating")}):f.jsx("div",{className:"space-y-6 pt-2",children:x.map((L,F)=>f.jsx(dv,{section:L,sectionIndex:F,tree:e.tree,progressMap:e.progressMap,selectedNodeId:e.selectedNodeId,dueNodeIds:e.dueNodeIds,onJumpNode:e.onJumpNode,physics:c,physicsWeather:(N==null?void 0:N.weather)??"clear",scrollRef:o,navRef:s,onImpacts:m,onFlakes:g,orbSnowRef:p},L.id))})]})})}),f.jsx("div",{className:"w-1/2 h-full overflow-y-auto px-3 pt-20 pb-3 space-y-2.5",children:f.jsx(lv,{courses:e.courses,selectedCourseId:e.courseId,onSelectCourse:L=>{e.onSelectCourse(L),r("map")},onDeleteCourse:(L,F,O)=>I({id:L,title:F,rect:O}),onCoursesChanged:e.onCoursesChanged})})]})}),k&&e.courseId&&f.jsx(d5,{sections:e.sections,tree:e.tree,progressMap:e.progressMap,selectedNodeId:e.selectedNodeId,onJump:L=>{i(L.world??"study"),A(!1),dc(null,null,L.id),e.onJumpNode(L.id)},onClose:()=>A(!1)}),S&&f.jsx(tl,{anchorRect:S.rect,message:`${S.title} — ${t("import.delete.confirm")}`,danger:!0,confirmLabel:t("import.delete"),testid:"course-delete-confirm",onConfirm:()=>{e.onDeleteCourse(S.id),I(null)},onCancel:()=>I(null)})]})}function lv({courses:e,selectedCourseId:t,onSelectCourse:n,onDeleteCourse:r,onCoursesChanged:a}){const i=$e(),[s,o]=w.useState("url"),[l,u]=w.useState(!1),[c,h]=w.useState(""),[m,d]=w.useState(""),p=w.useRef(null),g=w.useRef(null),x=w.useRef(null),[b,v]=w.useState(""),[T,N]=w.useState(""),[k,A]=w.useState(!1),[_,S]=w.useState(null),[I,C]=w.useState(null),[D,L]=w.useState(null),[F,O]=w.useState(null),[R,H]=w.useState([]),[,V]=w.useState(0),q=w.useRef(null);w.useEffect(()=>{const de=ae.on("import:progress",pe=>{H(Ce=>{const Oe=/\d+\/\d+/.test(pe),st=Ce[Ce.length-1];if(Oe&&st&&st.status==="working"){const ut=[...Ce];return ut[ut.length-1]={...st,msg:pe},ut}const Be=Ce.map(ut=>ut.status==="working"?{...ut,status:"done"}:ut);return Be.push({msg:pe,status:"working",ts:Date.now()}),Be})}),he=setInterval(()=>V(pe=>pe+1),1e3);return()=>{de(),clearInterval(he)}},[]),w.useEffect(()=>ae.on("import:done",he=>{A(!1),In(!1),he.cancelled||B3(he.ok),L(he.ok?null:he.planId??null),he.ok?(C(`${i("import.success.folder")}: ${he.title??""}${he.reused?`(${i("import.success.reused")})`:""}`),O(he.courseId?{courseId:he.courseId,packable:he.packable??!1}:null),a()):he.cancelled?(H([]),S(null),C(i("import.cancelled"))):S(he.error??"导入失败")}),[a,i]),w.useEffect(()=>{const de=q.current;de&&(de.scrollTop=de.scrollHeight)},[R]);const Z=async()=>{if(!(!c.trim()||k)){S(null),C(null),H([]);try{await ae.importUrl(c.trim()),A(!0),In(!0)}catch(de){S(de instanceof Error?de.message:String(de))}}},B=async()=>{if(!(!b.trim()||k)){S(null),C(null),H([]);try{await ae.importText({name:T.trim()||void 0,text:b.trim()}),A(!0),In(!0)}catch(de){S(de instanceof Error?de.message:String(de))}}},Q=async()=>{var he;if(k)return;if(S(null),C(null),H([]),!fr){(he=g.current)==null||he.click();return}await ae.importEpub().catch(pe=>(S(pe instanceof Error?pe.message:String(pe)),null))&&(A(!0),In(!0))},ne=async de=>{if(!(!de||k)){S(null),C(null),H([]);try{const he=new Uint8Array(await de.arrayBuffer());let pe="";for(let Oe=0;Oe<he.length;Oe+=32768)pe+=String.fromCharCode(...he.subarray(Oe,Oe+32768));await ae.importEpub({fileName:de.name,contentBase64:btoa(pe)})&&A(!0),In(!0)}catch(he){S(he instanceof Error?he.message:String(he))}}},j=async()=>{if(k)return;if(S(null),C(null),H([]),!fr){const he=m.trim();if(!he){S(i("import.folder.pathRequired"));return}try{await ae.importLocalFolder(he)&&A(!0),In(!0)}catch(pe){S(pe instanceof Error?pe.message:String(pe))}return}await ae.importLocalFolder()&&(A(!0),In(!0))},re=async()=>{var he;if(k)return;if(S(null),C(null),H([]),!fr){(he=p.current)==null||he.click();return}await ae.importPack().catch(pe=>(S(pe instanceof Error?pe.message:String(pe)),null))&&(A(!0),In(!0))},K=async de=>{if(!(!de||k)){S(null),C(null),H([]);try{const he=await de.text();await ae.importPack({fileName:de.name,content:he})&&A(!0),In(!0)}catch(he){S(he instanceof Error?he.message:String(he))}}},X=async()=>{var he;if(k)return;if(S(null),C(null),H([]),!fr){(he=x.current)==null||he.click();return}await ae.importAudio().catch(pe=>(S(pe instanceof Error?pe.message:String(pe)),null))&&(A(!0),In(!0))},ce=async de=>{if(!(!de||de.length===0||k)){S(null),C(null),H([]);try{const he=[];for(const Ce of Array.from(de)){const Oe=new Uint8Array(await Ce.arrayBuffer());let st="";for(let Be=0;Be<Oe.length;Be+=32768)st+=String.fromCharCode(...Oe.subarray(Be,Be+32768));he.push({fileName:Ce.name,contentBase64:btoa(st)})}await ae.importAudio(he)&&A(!0),In(!0)}catch(he){S(he instanceof Error?he.message:String(he))}}},le=async de=>{if(!k){S(null),H([]);try{await ae.importResume(de),A(!0),In(!0)}catch(he){S(he instanceof Error?he.message:String(he))}}},ee=async de=>{try{const he=await ae.exportPack(de);he!=null&&he.content&&he.fileName?(Ie(he.fileName,he.content),C(i("import.pack.exported",{path:he.fileName}))):he!=null&&he.path&&C(i("import.pack.exported",{path:he.path}))}catch(he){S(he instanceof Error?he.message:String(he))}},Ie=(de,he)=>{const pe=new Blob([he],{type:"application/json"}),Ce=URL.createObjectURL(pe),Oe=document.createElement("a");Oe.href=Ce,Oe.download=de,Oe.click(),setTimeout(()=>URL.revokeObjectURL(Ce),5e3)};return f.jsxs(f.Fragment,{children:[e.length===0?f.jsxs("div",{className:"text-center py-10",children:[f.jsx("div",{className:"text-3xl mb-2 opacity-30",children:"📚"}),f.jsx("p",{className:"text-label text-white/45 leading-relaxed",children:i("import.empty")})]}):f.jsx("div",{className:"space-y-2","data-testid":"course-list",children:e.map(de=>{const he=de.id===t;return f.jsxs("div",{"data-testid":"course-row",className:`relative rounded-xl transition-all duration-150 group ${he?"bg-brand/12 ring-1 ring-brand/40":"bg-white/5 hover:bg-white/10 hover:-translate-y-0.5"}`,children:[f.jsx("button",{onClick:()=>n(de.id),className:"w-full text-left p-3",children:f.jsxs("div",{className:"flex items-start justify-between gap-2",children:[f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:`text-body font-bold truncate ${he?"text-brand":"text-white/90"}`,children:de.title}),f.jsx("div",{className:"text-caption text-white/40 truncate mt-0.5",children:de.repoName})]}),he&&f.jsx("span",{className:"shrink-0 w-5 h-5 rounded-full bg-brand flex items-center justify-center",children:f.jsx(Tn,{className:"w-3 h-3 text-white"})})]})}),f.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:[f.jsxs("button",{onClick:pe=>{pe.stopPropagation(),S(null),C(null),ae.exportPack(de.id).then(Ce=>{Ce!=null&&Ce.content&&Ce.fileName?(Ie(Ce.fileName,Ce.content),C(i("import.pack.exported",{path:Ce.fileName}))):Ce!=null&&Ce.path&&C(i("import.pack.exported",{path:Ce.path}))}).catch(Ce=>{S(Ce instanceof Error?Ce.message:String(Ce))})},"data-testid":"course-row-export",className:"text-caption text-white/40 hover:text-brand flex items-center gap-0.5",children:[f.jsx(Ch,{className:"w-2.5 h-2.5"})," ",i("import.export")]}),f.jsxs("button",{onClick:pe=>{pe.stopPropagation();const Ce=pe.currentTarget.getBoundingClientRect();r(de.id,de.title,Ce)},"data-testid":"course-row-delete",className:"text-caption text-white/40 hover:text-warning flex items-center gap-0.5",children:[f.jsx(Xp,{className:"w-2.5 h-2.5"})," ",i("import.delete")]})]})]},de.id)})}),f.jsxs("div",{className:e.length>0?"mt-6":"",children:[f.jsxs("button",{onClick:()=>u(!l),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 ${l?"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:[f.jsx(el,{className:`w-4 h-4 transition-transform ${l?"rotate-45":""}`})," ",i("import.cta")]}),l&&f.jsxs("div",{className:"mt-3 space-y-3",children:[k?f.jsxs("div",{className:"rounded-xl bg-black/30 border border-brand/30 p-4","data-testid":"import-progress",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[f.jsx("span",{className:"inline-block w-4 h-4 border-2 border-brand border-t-transparent rounded-full animate-spin shrink-0"}),f.jsx("span",{className:"text-body font-bold text-white/90",children:i("import.progress.title")}),f.jsx("button",{onClick:()=>{ae.importCancel()},"data-testid":"import-cancel-btn",className:"ml-auto text-caption text-white/50 hover:text-warning transition-colors",children:i("import.progress.cancel")})]}),f.jsx("div",{className:"text-caption text-white/40 mb-2.5",children:i("import.progress.note")}),(s==="url"?c.trim():s==="markdown"&&T.trim())?f.jsx("div",{className:"text-caption text-white/40 font-mono truncate mb-2.5",children:s==="url"?c.trim():T.trim()}):null,f.jsx("div",{ref:q,className:"space-y-1.5 max-h-[40vh] overflow-y-auto pr-1",children:R.length===0?f.jsx("div",{className:"text-caption text-white/50 py-1",children:i("import.progress.starting")}):R.map((de,he)=>f.jsxs("div",{className:"flex items-start gap-1.5 text-caption",children:[de.status==="done"?f.jsx(Tn,{className:"w-3 h-3 text-brand shrink-0 mt-px"}):f.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"}),f.jsxs("span",{className:de.status==="done"?"text-white/40":"text-white/90",children:[de.msg,de.status==="working"&&f.jsxs("span",{className:"text-white/35 ml-1",children:["(",i("import.progress.elapsed",{s:Math.floor((Date.now()-de.ts)/1e3)}),")"]})]})]},he))})]}):f.jsxs(f.Fragment,{children:[f.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:Ry},{k:"markdown",label:i("import.tab.md"),icon:hs},{k:"folder",label:i("import.tab.folder"),icon:Sy},{k:"epub",label:i("import.tab.epub"),icon:sr},{k:"audio",label:i("import.tab.audio"),icon:Oi},{k:"pack",label:i("import.tab.pack"),icon:Ch}].map(({k:de,label:he,icon:pe})=>f.jsxs("button",{onClick:()=>o(de),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 ${s===de?"bg-brand/15 text-brand":"text-white/50 hover:text-white/80"}`,children:[f.jsx(pe,{className:"w-3 h-3 shrink-0"}),f.jsx("span",{className:"whitespace-nowrap",style:{fontSize:"clamp(0.75rem, 4cqi, 0.875rem)"},children:he})]},de))}),s==="url"?f.jsxs("section",{className:"space-y-2","data-testid":"import-url-section",children:[f.jsx("input",{type:"text",value:c,onChange:de=>h(de.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"}),f.jsx("p",{className:"text-caption text-white/45 leading-relaxed",children:i("import.url.desc")}),f.jsx("button",{onClick:Z,disabled:!c.trim()||k,"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")})]}):s==="markdown"?f.jsxs("section",{className:"space-y-2","data-testid":"import-md-section",children:[f.jsx("input",{type:"text",value:T,onChange:de=>N(de.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"}),f.jsx("textarea",{value:b,onChange:de=>v(de.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"}),f.jsx("button",{onClick:B,disabled:!b.trim()||k,"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")})]}):s==="folder"?f.jsxs("section",{className:"space-y-2","data-testid":"import-folder-section",children:[f.jsx("p",{className:"text-caption text-white/50 leading-relaxed",children:i("import.folder.desc")}),!fr&&f.jsx("input",{type:"text",value:m,onChange:de=>d(de.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"}),f.jsx("button",{onClick:j,disabled:k||!fr&&!m.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")})]}):s==="epub"?f.jsxs("section",{className:"space-y-2","data-testid":"import-epub-section",children:[f.jsx("p",{className:"text-caption text-white/50 leading-relaxed",children:i("import.epub.desc")}),!fr&&f.jsx("input",{ref:g,type:"file",accept:".epub,application/epub+zip",className:"hidden","data-testid":"import-epub-file",onChange:de=>{var he;ne((he=de.target.files)==null?void 0:he[0]),de.currentTarget.value=""}}),f.jsx("button",{onClick:Q,disabled:k,"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")})]}):s==="audio"?f.jsxs("section",{className:"space-y-2","data-testid":"import-audio-section",children:[f.jsx("p",{className:"text-caption text-white/50 leading-relaxed",children:i("import.audio.desc")}),!fr&&f.jsx("input",{ref:x,type:"file",multiple:!0,accept:".wav,.mp3,.m4a,.flac,.aac,.ogg,.opus,audio/*",className:"hidden","data-testid":"import-audio-file",onChange:de=>{ce(de.target.files),de.currentTarget.value=""}}),f.jsx("button",{onClick:X,disabled:k,"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")})]}):f.jsxs("section",{className:"space-y-2","data-testid":"import-pack-section",children:[f.jsx("p",{className:"text-caption text-white/50 leading-relaxed",children:i("import.pack.desc")}),!fr&&f.jsx("input",{ref:p,type:"file",accept:".json,application/json",className:"hidden","data-testid":"import-pack-file",onChange:de=>{var he;K((he=de.target.files)==null?void 0:he[0]),de.currentTarget.value=""}}),f.jsx("button",{onClick:re,disabled:k,"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")})]})]}),_&&f.jsxs("div",{className:"border border-warning/40 text-warning-light text-label rounded-lg p-2 whitespace-pre-wrap","data-testid":"import-error",children:[_,D&&f.jsx("button",{onClick:()=>void le(D),disabled:k,"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&&f.jsxs("div",{className:"border border-brand/30 text-brand text-label rounded-lg p-2","data-testid":"import-success",children:[f.jsx(Tn,{className:"inline-block w-3.5 h-3.5 mr-1 align-[-3px]"}),I,(F==null?void 0:F.packable)&&f.jsx("button",{onClick:()=>void ee(F.courseId),disabled:k,"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 uv({scrollRef:e,navRef:t,preset:n}){const r=w.useRef(null);return w.useEffect(()=>{const a=r.current,i=e.current,s=t.current;return!a||!i||!s?void 0:iv(a,i,s,n)},[e,t,n]),f.jsx("canvas",{ref:r,className:"map-sky-canvas","aria-hidden":"true"})}function cv({scrollRef:e,navRef:t,preset:n,getImpacts:r,getFlakes:a,orbSnowRef:i}){const s=w.useRef(null);return w.useEffect(()=>{const o=s.current,l=t.current,u=e.current;if(!o||!l||!u)return;let c=null,h=null;const m=()=>{c=null,h=null},d=new MutationObserver(m);d.observe(u,{childList:!0,subtree:!0}),window.addEventListener("resize",m);const g=sv(o,l,n,()=>{var v,T;c||(c=Array.from(u.querySelectorAll(".lesson-bubble")));const x=h??l.getBoundingClientRect();h=x;const b=[];for(const N of c){const k=N.getBoundingClientRect();if(k.bottom<x.top||k.top>x.bottom)continue;const A=(v=N.closest("[data-node-id]"))==null?void 0:v.getAttribute("data-node-id"),_=A?(T=i==null?void 0:i.current)==null?void 0:T.get(A):void 0;b.push({x:k.left-x.left+k.width/2,y:k.top-x.top+k.height/2,r:k.width/2,..._!==void 0?{snow:_}:{}})}return b},r,a);return()=>{g(),d.disconnect(),window.removeEventListener("resize",m)}},[e,t,n,r,a]),f.jsx("canvas",{ref:s,className:"map-orb-weather-canvas","aria-hidden":"true"})}function dv({section:e,sectionIndex:t,tree:n,progressMap:r,selectedNodeId:a,dueNodeIds:i,onJumpNode:s,physics:o,physicsWeather:l,scrollRef:u,navRef:c,onImpacts:h,onFlakes:m,orbSnowRef:d}){const p=n.filter(K=>K.parentId===e.id).sort((K,X)=>K.orderIdx-X.orderIdx),g=p.filter(K=>K.type==="lesson"),x=g.length>0&&g.every(K=>{var X;return(((X=r[K.id])==null?void 0:X.mastery)??0)>=Jp}),b=w.useRef(null),[v,T]=w.useState(268);w.useEffect(()=>{if(!b.current)return;const K=()=>{var le;const ce=((le=b.current)==null?void 0:le.clientWidth)??268;T(ce>0?ce:268)};K();const X=new ResizeObserver(K);return X.observe(b.current),()=>X.disconnect()},[]);const N=v5(p.length,v,e.id),k=N.height,A=110,_=76,S=w.useRef(null),I=w.useRef(new Map),C=w.useRef(0),D=w.useRef(null),L=w.useRef(0),F=p.map(K=>K.id).join(","),O=p.map(K=>{var X;return(K.type==="exam"?!x:(((X=r[K.id])==null?void 0:X.status)??"locked")==="locked")?1:0}).join("");w.useEffect(()=>{var ft,Xe;if(!o||p.length===0||v<=0)return;const K=b.current,X=u.current;if(!K||!X)return;let ce;const le=p[p.length-1];if((le==null?void 0:le.type)==="exam"){const Pe=(Xe=(ft=K.closest("section"))==null?void 0:ft.nextElementSibling)==null?void 0:Xe.querySelector(".map-signpost");Pe&&(ce={x:Rs(`${e.id}:next`,v),y:Pe.getBoundingClientRect().top-K.getBoundingClientRect().top})}const ee=O5({nodes:N.nodes.map((Pe,oe)=>{const ge=p[oe];return{id:ge.id,x:Pe.x,y:Pe.y,isExam:ge.type==="exam",locked:R(ge),spawn:(()=>{const _e=I.current.get(ge.id);return _e?j5(_e,C.current,v):void 0})()}}),width:v,height:N.height+40,weather:l,anchorKnotX:Rs(`${e.id}:knot`,v),nextKnot:ce});S.current=ee,O3(e.id,ee,K);const Ie=K.querySelector("[data-next-knot]");Ie&&(ee.nextKnot?(Ie.setAttribute("cx",String(ee.nextKnot.x)),Ie.setAttribute("cy",String(ee.nextKnot.y))):Ie.setAttribute("opacity","0"));const de=K.querySelector("[data-exam-rope]");de&&!ee.nextKnot&&de.setAttribute("opacity","0");const he=new Map;for(const Pe of K.querySelectorAll("[data-node-id]"))Pe.dataset.nodeId&&he.set(Pe.dataset.nodeId,Pe);const pe=Array.from(K.querySelectorAll("[data-rope]")),Ce=Array.from(K.querySelectorAll("[data-pulse]")),Oe=Array.from(K.querySelectorAll("[data-field]"));let st=!0;const Be=new IntersectionObserver(Pe=>{for(const oe of Pe)st=oe.isIntersecting},{root:X,rootMargin:"200px 0px 200px 0px"});Be.observe(K);const ut=520,me=[];let Ue=0,ct=performance.now();const tt=Pe=>{var ze;Ue=requestAnimationFrame(tt);const oe=Math.min(50,Pe-ct);if(ct=Pe,!st)return;ee.step(oe);for(const ye of ee.balls){const Re=he.get(ye.nodeId);Re&&(Re.style.transform=M5(ye.body.position.x-ye.layoutX,ye.body.position.y-ye.layoutY,ye.squash,ye.squashAngle)),ye.squash=N5(ye.squash,oe),(ze=d.current)==null||ze.set(ye.nodeId,ye.snow)}const ge=ye=>{if(ye==="__anchor")return ee.anchor;if(ye==="__next")return ee.nextKnot??ee.anchor;const Re=ee.ball(ye);if(Re)return{x:Re.body.position.x,y:Re.body.position.y+Rn*gr};const He=p.findIndex(Jt=>Jt.id===ye),dt=He>=0?N.nodes[He]:void 0;return dt?{x:dt.x,y:dt.y+Rn*gr}:{x:0,y:0}};for(let ye=0;ye<ee.links.length&&ye<pe.length;ye++){const Re=ee.links[ye],He=[ge(Re.from)];for(const dt of Re.particles)He.push({x:dt.position.x,y:dt.position.y});He.push(ge(Re.to)),pe[ye].setAttribute("d",C5(He))}for(let ye=0;ye<ee.balls.length&&ye<Oe.length;ye++){const Re=ee.balls[ye],He=Oe[ye];Re.field>.03?(He.setAttribute("cx",String(Re.body.position.x)),He.setAttribute("cy",String(Re.body.position.y)),He.setAttribute("r",String(Rn+4+Re.field*5)),He.setAttribute("opacity",String((.3*Re.field).toFixed(3)))):He.setAttribute("opacity","0")}const _e=ee.drainImpacts();for(const ye of _e)me.push({x:ye.x,y:ye.y,t0:Pe,s:Math.min(1,ye.speed/14)});for(let ye=me.length-1;ye>=0;ye--)Pe-me[ye].t0>ut&&me.splice(ye,1);for(let ye=0;ye<Ce.length;ye++){const Re=me[ye],He=Ce[ye];if(!Re){He.setAttribute("opacity","0");continue}const dt=(Pe-Re.t0)/ut;He.setAttribute("cx",String(Re.x)),He.setAttribute("cy",String(Re.y)),He.setAttribute("r",String(6+dt*(14+Re.s*14))),He.setAttribute("opacity",String(.55*(1-dt))),He.setAttribute("stroke-width",String(2+Re.s*1.5))}const Ae=ee.drainFlakes();if((_e.length>0||Ae.length>0)&&c.current){const ye=K.getBoundingClientRect(),Re=c.current.getBoundingClientRect(),He=dt=>({x:dt.x+ye.left-Re.left,y:dt.y+ye.top-Re.top});_e.length>0&&h(_e.map(dt=>({...He(dt),speed:dt.speed}))),Ae.length>0&&m(Ae.map(dt=>({...He(dt),vx:dt.vx,vy:dt.vy,amount:dt.amount})))}};return Ue=requestAnimationFrame(tt),()=>{cancelAnimationFrame(Ue),Be.disconnect();for(const Pe of ee.balls)I.current.set(Pe.nodeId,{x:Pe.body.position.x,y:Pe.body.position.y,vx:Pe.body.velocity.x,vy:Pe.body.velocity.y});C.current=v,j3(e.id),ee.dispose(),S.current=null;for(const Pe of he.values())Pe.style.transform=""}},[o,v,F,O,e.id,l]);const R=K=>{var X;return K?K.type==="exam"?!x:(((X=r[K.id])==null?void 0:X.status)??"locked")==="locked":!0},H=(K,X)=>{if(!(!S.current||K.button!==0||R(p.find(ee=>ee.id===X))||!b.current)){try{K.currentTarget.setPointerCapture(K.pointerId)}catch{}L.current=0,D.current={track:{startX:K.clientX,startY:K.clientY},id:K.pointerId,dragging:!1,nodeId:X}}},V=K=>{const X=D.current,ce=S.current;if(!X||!ce||K.pointerId!==X.id)return;const le=b.current;if(!le||(!X.dragging&&Rh(X.track,K.clientX,K.clientY)==="drag"&&(X.dragging=!0,K.currentTarget.style.zIndex="40",ce.beginDrag(X.nodeId,K.clientX-le.getBoundingClientRect().left,K.clientY-le.getBoundingClientRect().top)),!X.dragging))return;const ee=le.getBoundingClientRect();ce.moveDrag(K.clientX-ee.left,K.clientY-ee.top)},q=K=>{var ce;const X=D.current;if(!(!X||K.pointerId!==X.id)){if((ce=S.current)==null||ce.endDrag(),K.currentTarget.style.zIndex="",Rh(X.track,K.clientX,K.clientY)==="drag")L.current=Date.now()+300;else{const le=p.find(ee=>ee.id===X.nodeId);le&&Date.now()>=L.current&&!R(le)&&(dc(K.clientX,K.clientY,le.id),s(le.id))}D.current=null}},Z=K=>{const X=p[K],ce=X?r[X.id]:void 0,le=(ce==null?void 0:ce.status)==="mastered"||(ce==null?void 0:ce.status)==="in_progress"||(ce==null?void 0:ce.status)==="available";return{stroke:le?"var(--brand)":"var(--ink-faint)",strokeWidth:le?4:2.5,strokeOpacity:le?.6:.5,strokeDasharray:le?"none":"3 7"}},B=N.nodes[0]?{x:Rs(`${e.id}:knot`,v),y:Io}:{x:v/2,y:Io},Q=p[p.length-1],ne=(Q==null?void 0:Q.type)==="exam",j=N.nodes[N.nodes.length-1],re=ne&&j?{x:Rs(`${e.id}:next`,v),y:k+24}:void 0;return f.jsxs("section",{"data-testid":`map-section-${e.id.slice(0,8)}`,className:"py-3 px-2",children:[f.jsxs("div",{className:"map-signpost flex items-center gap-2 mb-3 px-2.5 py-1.5 rounded-lg shadow-sm",children:[f.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}),f.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})]}),f.jsxs("div",{ref:b,className:"relative",style:{minHeight:k},children:[f.jsx("svg",{className:"absolute inset-0 w-full h-full pointer-events-none","aria-hidden":"true",style:{height:k,overflow:"visible"},children:o?f.jsxs(f.Fragment,{children:[N.nodes[0]&&f.jsx("circle",{cx:B.x,cy:B.y,r:3.5,fill:"#ffc800",opacity:.9}),N.nodes[0]&&f.jsx("path",{"data-rope":0,d:`M ${B.x} ${B.y} L ${N.nodes[0].x} ${N.nodes[0].y+Rn*gr}`,fill:"none",strokeLinecap:"round",strokeLinejoin:"round",style:Z(0)}),N.segments.map((K,X)=>f.jsx("path",{"data-rope":X+1,d:`M ${K.from.x} ${K.from.y+Rn*gr} L ${K.to.x} ${K.to.y+Rn*gr}`,fill:"none",strokeLinecap:"round",strokeLinejoin:"round",style:Z(K.index)},K.index)),re&&j&&f.jsxs(f.Fragment,{children:[f.jsx("path",{"data-rope":N.segments.length+1,"data-exam-rope":!0,d:`M ${re.x} ${re.y} L ${j.x} ${j.y+Rn*gr}`,fill:"none",strokeLinecap:"round",strokeLinejoin:"round",style:Z(p.length-1)}),f.jsx("circle",{"data-next-knot":!0,cx:re.x,cy:re.y,r:3.5,fill:"#ffc800",opacity:.9})]}),Array.from({length:8},(K,X)=>f.jsx("circle",{"data-pulse":X,cx:0,cy:0,r:0,fill:"none",stroke:"white",opacity:0},X)),p.map((K,X)=>f.jsx("circle",{"data-field":X,cx:0,cy:0,r:0,fill:"none",stroke:"#1cb0f6",strokeWidth:2,opacity:0},`f-${K.id}`))]}):N.segments.map(K=>{const X=hv(p[K.index],r);return f.jsx("path",{d:w5(K),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},K.index)})}),p.map((K,X)=>{const ce=N.nodes[X];if(!ce)return null;const le=wc(K.id),ee=`${le%40/10}s`,Ie=`${5+le%30/10}s`;return f.jsx("div",{"data-node-id":K.id,"data-noswipe":"",className:o?`absolute hover:z-30 will-change-transform ${R(K)?"cursor-not-allowed":"cursor-grab active:cursor-grabbing"}`:"absolute balloon-bob hover:z-30",style:{left:ce.x-A/2,top:ce.y-_/2+10,width:A,...o?{touchAction:"pan-y"}:{"--bob-delay":ee,"--bob-duration":Ie}},onPointerDown:o?de=>H(de,K.id):void 0,onPointerMove:o?V:void 0,onPointerUp:o?q:void 0,onPointerCancel:o?q:void 0,children:f.jsx(fv,{lesson:K,progress:r[K.id],isSelected:K.id===a,isDue:i.has(K.id),chapterLessonsMastered:x,onClick:()=>{Date.now()<L.current||(dc(null,null,K.id),s(K.id))}})},K.id)})]})]})}function hv(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 fv({lesson:e,progress:t,isSelected:n,isDue:r,chapterLessonsMastered:a,onClick:i}){const s=$e(),o=(t==null?void 0:t.status)??"locked",l=(t==null?void 0:t.crownLevel)??0,u=e.type==="exam",c=Math.min(3,l),h=u?!a:o==="locked",m=u&&h,d=!u&&(o==="in_progress"||o==="mastered"),p=o==="mastered"?100:o==="in_progress"?Math.round(((t==null?void 0:t.mastery)??0)*100):0;return f.jsxs("div",{className:"group relative flex flex-col items-center w-full",children:[f.jsxs("button",{onClick:()=>!h&&i(),disabled:h,"data-testid":`${u?"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 ${u?m?"lesson-bubble exam-bubble-locked":pv(l>0):mv(o)} ${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":m?`🔒 ${e.title}${s("node.locked.chapterHint")}`:u?`🎯 ${e.title}`:h?`🔒 ${e.title}`:r?`📖 ${e.title}${s("node.due.hint")}`:e.title,children:[d&&f.jsxs("svg",{className:"absolute inset-0 w-full h-full -rotate-90 pointer-events-none",viewBox:"0 0 56 56","aria-hidden":"true",children:[f.jsx("circle",{cx:"28",cy:"28",r:"25",fill:"none",stroke:"rgb(255 255 255 / 0.2)",strokeWidth:"2.5"}),f.jsx("circle",{cx:"28",cy:"28",r:"25",fill:"none",stroke:o==="mastered"?"#ffc800":"white",strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${p/100*157} 157`,className:"transition-all duration-500"})]}),u?m?f.jsx("span",{"aria-label":"exam-locked",className:"relative z-10 opacity-60",children:"🔒"}):f.jsx(qa,{"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?f.jsx("span",{"aria-label":"locked",className:"relative z-10 opacity-50",children:"🔒"}):o==="mastered"?f.jsx("span",{"aria-label":"mastered",className:"relative z-10 drop-shadow-lg crown-sparkle",children:"👑"}):o==="in_progress"?f.jsx(sr,{"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}):f.jsx("span",{"aria-label":"available",className:"relative z-10 drop-shadow",children:"⭐"}),r&&!h&&!u&&f.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:"!"})]}),u&&f.jsx("div",{className:"flex gap-0.5 mt-1","data-testid":`map-stars-${e.id.slice(0,8)}`,children:[0,1,2].map(g=>f.jsx("span",{className:`text-caption ${g<c?"text-gold":"text-white/25"}`,children:"★"},g))}),n&&f.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 mv(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 pv(e){return e?"lesson-bubble exam-bubble-passed":"lesson-bubble exam-bubble"}function gv({available:e,current:t,onChange:n}){const r=$e(),[a,i]=w.useState(!1),s={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?s[t]??t:r("lang.original");return f.jsxs("div",{className:"relative shrink-0",children:[f.jsxs("button",{onClick:()=>i(!a),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:[f.jsx(Cy,{className:"w-3 h-3"}),o]}),a&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>i(!1)}),f.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:[f.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(l=>f.jsx("button",{"data-testid":`lang-option-${l}`,onClick:()=>{n(l),i(!1)},className:`w-full text-left px-2 py-1 rounded-md text-caption font-bold transition-colors ${t===l?"bg-brand/15 text-brand":"text-ink-muted hover:bg-neutral-100 dark:hover:bg-neutral-800"}`,children:s[l]??l},l))]})]})]})}const xv=500,Jr=8;function bv(){const[e,t]=w.useState(null),[n,r]=w.useState({mode:"cursor",x:0,y:0}),[a,i]=w.useState({w:0,h:0}),s=w.useRef(null),o=w.useCallback(()=>window.matchMedia("(pointer: coarse)").matches,[]),l=w.useCallback(x=>{o()||r(b=>b.mode==="cursor"?{...b,x:x.clientX,y:x.clientY}:b)},[o]),u=w.useCallback(x=>{var T;if(o())return;const b=(T=x.target)==null?void 0:T.closest("[data-tooltip]"),v=b==null?void 0:b.getAttribute("data-tooltip");if(v){t(v),r({mode:"cursor",x:x.clientX,y:x.clientY});return}t(null)},[o]),c=w.useCallback(x=>{var v,T;if(o())return;((T=(v=x.target)==null?void 0:v.closest)==null?void 0:T.call(v,"[data-tooltip]"))&&t(null)},[o]);if(w.useEffect(()=>(document.addEventListener("mousemove",l,{passive:!0}),document.addEventListener("mouseover",u,{passive:!0}),document.addEventListener("mouseout",c,{passive:!0}),()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseover",u),document.removeEventListener("mouseout",c)}),[l,u,c]),w.useEffect(()=>{let x=null;const b=()=>{x&&(clearTimeout(x),x=null)},v=A=>{var C;if(!o()||A.touches.length!==1)return b();const _=(C=A.target)==null?void 0:C.closest("[data-tooltip]"),S=_==null?void 0:_.getAttribute("data-tooltip");if(!S||!_)return b();const I=_;b(),x=setTimeout(()=>{I.isConnected&&(t(S),r({mode:"rect",x:0,y:0,rect:I.getBoundingClientRect()}))},xv)},T=()=>{b(),t(A=>A&&null)},N=()=>b(),k=()=>{b(),t(null)};return document.addEventListener("touchstart",v,{passive:!0}),document.addEventListener("touchend",T,{passive:!0}),document.addEventListener("touchmove",N,{passive:!0}),document.addEventListener("touchcancel",k,{passive:!0}),()=>{b(),document.removeEventListener("touchstart",v),document.removeEventListener("touchend",T),document.removeEventListener("touchmove",N),document.removeEventListener("touchcancel",k)}},[o]),w.useLayoutEffect(()=>{s.current&&e&&i({w:s.current.offsetWidth,h:s.current.offsetHeight})},[e]),!e)return null;const h=window.innerWidth,m=window.innerHeight;let d,p,g;if(n.mode==="rect"&&n.rect){const x=n.rect;d=x.left+x.width/2-a.w/2,p=x.top-a.h-6,g="none",p<Jr&&(p=x.bottom+6)}else d=n.x,p=n.y-6,g="translate(0, -100%)";return d=Math.min(Math.max(d,Jr),Math.max(Jr,h-a.w-Jr)),p=Math.min(Math.max(p,Jr),Math.max(Jr,m-a.h-Jr)),$0.createPortal(f.jsx("div",{ref:s,style:{position:"fixed",left:d,top:p,transform:g,zIndex:99999,pointerEvents:"none",visibility:a.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 Fh(e){const t=[],n=String(e||"");let r=n.indexOf(","),a=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const s=n.slice(a,r).trim();(s||!i)&&t.push(s),a=r+1,r=n.indexOf(",",a)}return t}function dg(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const yv=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,vv=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,wv={};function zh(e,t){return(wv.jsx?vv:yv).test(e)}const kv=/[ \t\n\f\r]/g;function Tv(e){return typeof e=="object"?e.type==="text"?Hh(e.value):!1:Hh(e)}function Hh(e){return e.replace(kv,"")===""}class ps{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ps.prototype.normal={};ps.prototype.property={};ps.prototype.space=void 0;function hg(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new ps(n,r,t)}function ts(e){return e.toLowerCase()}class yn{constructor(t,n){this.attribute=n,this.property=t}}yn.prototype.attribute="";yn.prototype.booleanish=!1;yn.prototype.boolean=!1;yn.prototype.commaOrSpaceSeparated=!1;yn.prototype.commaSeparated=!1;yn.prototype.defined=!1;yn.prototype.mustUseProperty=!1;yn.prototype.number=!1;yn.prototype.overloadedBoolean=!1;yn.prototype.property="";yn.prototype.spaceSeparated=!1;yn.prototype.space=void 0;let Ev=0;const Ye=Ta(),jt=Ta(),kc=Ta(),ke=Ta(),xt=Ta(),pa=Ta(),kn=Ta();function Ta(){return 2**++Ev}const Tc=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ye,booleanish:jt,commaOrSpaceSeparated:kn,commaSeparated:pa,number:ke,overloadedBoolean:kc,spaceSeparated:xt},Symbol.toStringTag,{value:"Module"})),Jl=Object.keys(Tc);class Y0 extends yn{constructor(t,n,r,a){let i=-1;if(super(t,n),Uh(this,"space",a),typeof r=="number")for(;++i<Jl.length;){const s=Jl[i];Uh(this,Jl[i],(r&Tc[s])===Tc[s])}}}Y0.prototype.defined=!0;function Uh(e,t,n){n&&(e[t]=n)}function ri(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const i=new Y0(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[ts(r)]=r,n[ts(i.attribute)]=r}return new ps(t,n,e.space)}const fg=ri({properties:{ariaActiveDescendant:null,ariaAtomic:jt,ariaAutoComplete:null,ariaBusy:jt,ariaChecked:jt,ariaColCount:ke,ariaColIndex:ke,ariaColSpan:ke,ariaControls:xt,ariaCurrent:null,ariaDescribedBy:xt,ariaDetails:null,ariaDisabled:jt,ariaDropEffect:xt,ariaErrorMessage:null,ariaExpanded:jt,ariaFlowTo:xt,ariaGrabbed:jt,ariaHasPopup:null,ariaHidden:jt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:xt,ariaLevel:ke,ariaLive:null,ariaModal:jt,ariaMultiLine:jt,ariaMultiSelectable:jt,ariaOrientation:null,ariaOwns:xt,ariaPlaceholder:null,ariaPosInSet:ke,ariaPressed:jt,ariaReadOnly:jt,ariaRelevant:null,ariaRequired:jt,ariaRoleDescription:xt,ariaRowCount:ke,ariaRowIndex:ke,ariaRowSpan:ke,ariaSelected:jt,ariaSetSize:ke,ariaSort:null,ariaValueMax:ke,ariaValueMin:ke,ariaValueNow:ke,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function mg(e,t){return t in e?e[t]:t}function pg(e,t){return mg(e,t.toLowerCase())}const Sv=ri({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:pa,acceptCharset:xt,accessKey:xt,action:null,allow:null,allowFullScreen:Ye,allowPaymentRequest:Ye,allowUserMedia:Ye,alpha:Ye,alt:null,as:null,async:Ye,autoCapitalize:null,autoComplete:xt,autoFocus:Ye,autoPlay:Ye,blocking:xt,capture:null,charSet:null,checked:Ye,cite:null,className:xt,closedBy:null,colorSpace:null,cols:ke,colSpan:ke,command:null,commandFor:null,content:null,contentEditable:jt,controls:Ye,controlsList:xt,coords:ke|pa,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ye,defer:Ye,dir:null,dirName:null,disabled:Ye,download:kc,draggable:jt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ye,formTarget:null,headers:xt,height:ke,hidden:kc,high:ke,href:null,hrefLang:null,htmlFor:xt,httpEquiv:xt,id:null,imageSizes:null,imageSrcSet:null,inert:Ye,inputMode:null,integrity:null,is:null,isMap:Ye,itemId:null,itemProp:xt,itemRef:xt,itemScope:Ye,itemType:xt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ye,low:ke,manifest:null,max:null,maxLength:ke,media:null,method:null,min:null,minLength:ke,multiple:Ye,muted:Ye,name:null,nonce:null,noModule:Ye,noValidate:Ye,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:Ye,optimum:ke,pattern:null,ping:xt,placeholder:null,playsInline:Ye,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ye,referrerPolicy:null,rel:xt,required:Ye,reversed:Ye,rows:ke,rowSpan:ke,sandbox:xt,scope:null,scoped:Ye,seamless:Ye,selected:Ye,shadowRootClonable:Ye,shadowRootCustomElementRegistry:Ye,shadowRootDelegatesFocus:Ye,shadowRootMode:null,shadowRootSerializable:Ye,shape:null,size:ke,sizes:null,slot:null,span:ke,spellCheck:jt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ke,step:null,style:null,tabIndex:ke,target:null,title:null,translate:null,type:null,typeMustMatch:Ye,useMap:null,value:jt,width:ke,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:xt,axis:null,background:null,bgColor:null,border:ke,borderColor:null,bottomMargin:ke,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ye,declare:Ye,event:null,face:null,frame:null,frameBorder:null,hSpace:ke,leftMargin:ke,link:null,longDesc:null,lowSrc:null,marginHeight:ke,marginWidth:ke,noResize:Ye,noHref:Ye,noShade:Ye,noWrap:Ye,object:null,profile:null,prompt:null,rev:null,rightMargin:ke,rules:null,scheme:null,scrolling:jt,standby:null,summary:null,text:null,topMargin:ke,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ke,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ye,disablePictureInPicture:Ye,disableRemotePlayback:Ye,exportParts:pa,part:xt,prefix:null,property:null,results:ke,security:null,unselectable:null},space:"html",transform:pg}),Av=ri({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:kn,accentHeight:ke,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ke,amplitude:ke,arabicForm:null,ascent:ke,attributeName:null,attributeType:null,azimuth:ke,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ke,by:null,calcMode:null,capHeight:ke,className:xt,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:ke,diffuseConstant:ke,direction:null,display:null,dur:null,divisor:ke,dominantBaseline:null,download:Ye,dx:null,dy:null,edgeMode:null,editable:null,elevation:ke,enableBackground:null,end:null,event:null,exponent:ke,externalResourcesRequired:null,fill:null,fillOpacity:ke,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:pa,g2:pa,glyphName:pa,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ke,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ke,horizOriginX:ke,horizOriginY:ke,id:null,ideographic:ke,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ke,k:ke,k1:ke,k2:ke,k3:ke,k4:ke,kernelMatrix:kn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ke,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:ke,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:ke,overlineThickness:ke,paintOrder:null,panose1:null,path:null,pathLength:ke,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:xt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ke,pointsAtY:ke,pointsAtZ:ke,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:kn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:kn,rev:kn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:kn,requiredFeatures:kn,requiredFonts:kn,requiredFormats:kn,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:ke,specularExponent:ke,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ke,strikethroughThickness:ke,string:null,stroke:null,strokeDashArray:kn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ke,strokeOpacity:ke,strokeWidth:null,style:null,surfaceScale:ke,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:kn,tabIndex:ke,tableValues:null,target:null,targetX:ke,targetY:ke,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:kn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ke,underlineThickness:ke,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ke,values:null,vAlphabetic:ke,vMathematical:ke,vectorEffect:null,vHanging:ke,vIdeographic:ke,version:null,vertAdvY:ke,vertOriginX:ke,vertOriginY:ke,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ke,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:mg}),gg=ri({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()}}),xg=ri({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:pg}),bg=ri({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Cv={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"},Nv=/[A-Z]/g,qh=/-[a-z]/g,Mv=/^data[-\w.:]+$/i;function il(e,t){const n=ts(t);let r=t,a=yn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Mv.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(qh,_v);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!qh.test(i)){let s=i.replace(Nv,Iv);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}a=Y0}return new a(r,t)}function Iv(e){return"-"+e.toLowerCase()}function _v(e){return e.charAt(1).toUpperCase()}const gs=hg([fg,Sv,gg,xg,bg],"html"),Vr=hg([fg,Av,gg,xg,bg],"svg");function Vh(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function yg(e){return e.join(" ").trim()}var _a={},eu,$h;function Rv(){if($h)return eu;$h=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,o=/^\s+|\s+$/g,l=`
|
|
478
|
+
`,u="/",c="*",h="",m="comment",d="declaration";function p(x,b){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];b=b||{};var v=1,T=1;function N(O){var R=O.match(t);R&&(v+=R.length);var H=O.lastIndexOf(l);T=~H?O.length-H:T+O.length}function k(){var O={line:v,column:T};return function(R){return R.position=new A(O),I(),R}}function A(O){this.start=O,this.end={line:v,column:T},this.source=b.source}A.prototype.content=x;function _(O){var R=new Error(b.source+":"+v+":"+T+": "+O);if(R.reason=O,R.filename=b.source,R.line=v,R.column=T,R.source=x,!b.silent)throw R}function S(O){var R=O.exec(x);if(R){var H=R[0];return N(H),x=x.slice(H.length),R}}function I(){S(n)}function C(O){var R;for(O=O||[];R=D();)R!==!1&&O.push(R);return O}function D(){var O=k();if(!(u!=x.charAt(0)||c!=x.charAt(1))){for(var R=2;h!=x.charAt(R)&&(c!=x.charAt(R)||u!=x.charAt(R+1));)++R;if(R+=2,h===x.charAt(R-1))return _("End of comment missing");var H=x.slice(2,R-2);return T+=2,N(H),x=x.slice(R),T+=2,O({type:m,comment:H})}}function L(){var O=k(),R=S(r);if(R){if(D(),!S(a))return _("property missing ':'");var H=S(i),V=O({type:d,property:g(R[0].replace(e,h)),value:H?g(H[0].replace(e,h)):h});return S(s),V}}function F(){var O=[];C(O);for(var R;R=L();)R!==!1&&(O.push(R),C(O));return O}return I(),F()}function g(x){return x?x.replace(o,h):h}return eu=p,eu}var Wh;function Lv(){if(Wh)return _a;Wh=1;var e=_a&&_a.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_a,"__esModule",{value:!0}),_a.default=n;const t=e(Rv());function n(r,a){let i=null;if(!r||typeof r!="string")return i;const s=(0,t.default)(r),o=typeof a=="function";return s.forEach(l=>{if(l.type!=="declaration")return;const{property:u,value:c}=l;o?a(u,c,l):c&&(i=i||{},i[u]=c)}),i}return _a}var wi={},Gh;function Dv(){if(Gh)return wi;Gh=1,Object.defineProperty(wi,"__esModule",{value:!0}),wi.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,i=function(u){return!u||n.test(u)||e.test(u)},s=function(u,c){return c.toUpperCase()},o=function(u,c){return"".concat(c,"-")},l=function(u,c){return c===void 0&&(c={}),i(u)?u:(u=u.toLowerCase(),c.reactCompat?u=u.replace(a,o):u=u.replace(r,o),u.replace(t,s))};return wi.camelCase=l,wi}var ki,Yh;function Pv(){if(Yh)return ki;Yh=1;var e=ki&&ki.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(Lv()),n=Dv();function r(a,i){var s={};return!a||typeof a!="string"||(0,t.default)(a,function(o,l){o&&l&&(s[(0,n.camelCase)(o,i)]=l)}),s}return r.default=r,ki=r,ki}var Ov=Pv();const jv=O0(Ov),sl=vg("end"),lr=vg("start");function vg(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 wg(e){const t=lr(e),n=sl(e);if(t&&n)return{start:t,end:n}}function Bi(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Kh(e.position):"start"in e||"end"in e?Kh(e):"line"in e||"column"in e?Ec(e):""}function Ec(e){return Xh(e&&e.line)+":"+Xh(e&&e.column)}function Kh(e){return Ec(e&&e.start)+"-"+Ec(e&&e.end)}function Xh(e){return e&&typeof e=="number"?e:1}class sn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",i={},s=!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"?a=t:!i.cause&&t&&(s=!0,a=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.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=a,this.line=o?o.line:void 0,this.name=Bi(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=s&&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}}sn.prototype.file="";sn.prototype.name="";sn.prototype.reason="";sn.prototype.message="";sn.prototype.stack="";sn.prototype.column=void 0;sn.prototype.line=void 0;sn.prototype.ancestors=void 0;sn.prototype.cause=void 0;sn.prototype.fatal=void 0;sn.prototype.place=void 0;sn.prototype.ruleId=void 0;sn.prototype.source=void 0;const K0={}.hasOwnProperty,Bv=new Map,Fv=/[A-Z]/g,zv=new Set(["table","tbody","thead","tfoot","tr"]),Hv=new Set(["td","th"]),kg="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Uv(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=Xv(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=Kv(n,t.jsx,t.jsxs)}const a={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"?Vr:gs,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=Tg(a,e,void 0);return i&&typeof i!="string"?i:a.create(e,a.Fragment,{children:i||void 0},void 0)}function Tg(e,t,n){if(t.type==="element")return qv(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Vv(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Wv(e,t,n);if(t.type==="mdxjsEsm")return $v(e,t);if(t.type==="root")return Gv(e,t,n);if(t.type==="text")return Yv(e,t)}function qv(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=Vr,e.schema=a),e.ancestors.push(t);const i=Sg(e,t.tagName,!1),s=Qv(e,t);let o=Q0(e,t);return zv.has(t.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!Tv(l):!0})),Eg(e,s,i,t),X0(s,o),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function Vv(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)}ns(e,t.position)}function $v(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ns(e,t.position)}function Wv(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=Vr,e.schema=a),e.ancestors.push(t);const i=t.name===null?e.Fragment:Sg(e,t.name,!0),s=Zv(e,t),o=Q0(e,t);return Eg(e,s,i,t),X0(s,o),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function Gv(e,t,n){const r={};return X0(r,Q0(e,t)),e.create(t,e.Fragment,r,n)}function Yv(e,t){return t.value}function Eg(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function X0(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Kv(e,t,n){return r;function r(a,i,s,o){const u=Array.isArray(s.children)?n:t;return o?u(i,s,o):u(i,s)}}function Xv(e,t){return n;function n(r,a,i,s){const o=Array.isArray(i.children),l=lr(r);return t(a,i,s,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function Qv(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&K0.call(t.properties,a)){const i=Jv(e,a,t.properties[a]);if(i){const[s,o]=i;e.tableCellAlignToStyle&&s==="align"&&typeof o=="string"&&Hv.has(t.tagName)?r=o:n[s]=o}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Zv(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 s=i.expression;s.type;const o=s.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else ns(e,t.position);else{const a=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 ns(e,t.position);else i=r.value===null?!0:r.value;n[a]=i}return n}function Q0(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:Bv;for(;++r<t.children.length;){const i=t.children[r];let s;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const u=a.get(l)||0;s=l+"-"+u,a.set(l,u+1)}}const o=Tg(e,i,s);o!==void 0&&n.push(o)}return n}function Jv(e,t,n){const r=il(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?dg(n):yg(n)),r.property==="style"){let a=typeof n=="object"?n:e6(e,String(n));return e.stylePropertyNameCase==="css"&&(a=t6(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?Cv[r.property]||r.property:r.attribute,n]}}function e6(e,t){try{return jv(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new sn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=kg+"#cannot-parse-style-attribute",a}}function Sg(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let i=-1,s;for(;++i<a.length;){const o=zh(a[i])?{type:"Identifier",name:a[i]}:{type:"Literal",value:a[i]};s=s?{type:"MemberExpression",object:s,property:o,computed:!!(i&&o.type==="Literal"),optional:!1}:o}r=s}else r=zh(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return K0.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);ns(e)}function ns(e,t){const n=new sn("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=kg+"#cannot-handle-mdx-estrees-without-createevaluater",n}function t6(e){const t={};let n;for(n in e)K0.call(e,n)&&(t[n6(n)]=e[n]);return t}function n6(e){let t=e.replace(Fv,r6);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function r6(e){return"-"+e.toLowerCase()}const tu={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"]},a6={};function Z0(e,t){const n=a6,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Ag(e,r,a)}function Ag(e,t,n){if(i6(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 Qh(e.children,t,n)}return Array.isArray(e)?Qh(e,t,n):""}function Qh(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=Ag(e[a],t,n);return r.join("")}function i6(e){return!!(e&&typeof e=="object")}const Zh=document.createElement("i");function J0(e){const t="&"+e+";";Zh.innerHTML=t;const n=Zh.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function En(e,t,n,r){const a=e.length;let i=0,s;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);i<r.length;)s=r.slice(i,i+1e4),s.unshift(t,0),e.splice(...s),i+=1e4,t+=1e4}function Ln(e,t){return e.length>0?(En(e,e.length,0,t),e):t}const Jh={}.hasOwnProperty;function Cg(e){const t={};let n=-1;for(;++n<e.length;)s6(t,e[n]);return t}function s6(e,t){let n;for(n in t){const a=(Jh.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){Jh.call(a,s)||(a[s]=[]);const o=i[s];o6(a[s],Array.isArray(o)?o:o?[o]:[])}}}function o6(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);En(e,0,0,r)}function Ng(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 Gn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const dn=$r(/[A-Za-z]/),rn=$r(/[\dA-Za-z]/),l6=$r(/[#-'*+\--9=?A-Z^-~]/);function _o(e){return e!==null&&(e<32||e===127)}const Sc=$r(/\d/),u6=$r(/[\dA-Fa-f]/),c6=$r(/[!-/:-@[-`{-~]/);function Fe(e){return e!==null&&e<-2}function vt(e){return e!==null&&(e<0||e===32)}function lt(e){return e===-2||e===-1||e===32}const ol=$r(new RegExp("\\p{P}|\\p{S}","u")),wa=$r(/\s/);function $r(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ai(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const i=e.charCodeAt(n);let s="";if(i===37&&rn(e.charCodeAt(n+1))&&rn(e.charCodeAt(n+2)))a=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(s=String.fromCharCode(i));else if(i>55295&&i<57344){const o=e.charCodeAt(n+1);i<56320&&o>56319&&o<57344?(s=String.fromCharCode(i,o),a=1):s="�"}else s=String.fromCharCode(i);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+a+1,s=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function it(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(l){return lt(l)?(e.enter(n),o(l)):t(l)}function o(l){return lt(l)&&i++<a?(e.consume(l),o):(e.exit(n),t(l))}}const d6={tokenize:h6};function h6(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),it(e,t,"linePrefix")}function a(o){return e.enter("paragraph"),i(o)}function i(o){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(o)}function s(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return Fe(o)?(e.consume(o),e.exit("chunkText"),i):(e.consume(o),s)}}const f6={tokenize:m6},ef={tokenize:p6};function m6(e){const t=this,n=[];let r=0,a,i,s;return o;function o(T){if(r<n.length){const N=n[r];return t.containerState=N[1],e.attempt(N[0].continuation,l,u)(T)}return u(T)}function l(T){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&v();const N=t.events.length;let k=N,A;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){A=t.events[k][1].end;break}b(r);let _=N;for(;_<t.events.length;)t.events[_][1].end={...A},_++;return En(t.events,k+1,0,t.events.slice(N)),t.events.length=_,u(T)}return o(T)}function u(T){if(r===n.length){if(!a)return m(T);if(a.currentConstruct&&a.currentConstruct.concrete)return p(T);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(ef,c,h)(T)}function c(T){return a&&v(),b(r),m(T)}function h(T){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,p(T)}function m(T){return t.containerState={},e.attempt(ef,d,p)(T)}function d(T){return r++,n.push([t.currentConstruct,t.containerState]),m(T)}function p(T){if(T===null){a&&v(),b(0),e.consume(T);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:i}),g(T)}function g(T){if(T===null){x(e.exit("chunkFlow"),!0),b(0),e.consume(T);return}return Fe(T)?(e.consume(T),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(T),g)}function x(T,N){const k=t.sliceStream(T);if(N&&k.push(null),T.previous=i,i&&(i.next=T),i=T,a.defineSkip(T.start),a.write(k),t.parser.lazy[T.start.line]){let A=a.events.length;for(;A--;)if(a.events[A][1].start.offset<s&&(!a.events[A][1].end||a.events[A][1].end.offset>s))return;const _=t.events.length;let S=_,I,C;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){if(I){C=t.events[S][1].end;break}I=!0}for(b(r),A=_;A<t.events.length;)t.events[A][1].end={...C},A++;En(t.events,S+1,0,t.events.slice(_)),t.events.length=A}}function b(T){let N=n.length;for(;N-- >T;){const k=n[N];t.containerState=k[1],k[0].exit.call(t,e)}n.length=T}function v(){a.write([null]),i=void 0,a=void 0,t.containerState._closeFlow=void 0}}function p6(e,t,n){return it(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ka(e){if(e===null||vt(e)||wa(e))return 1;if(ol(e))return 2}function ll(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const i=e[a].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const Ac={name:"attention",resolveAll:g6,tokenize:x6};function g6(e,t){let n=-1,r,a,i,s,o,l,u,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;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},m={...e[n][1].start};tf(h,-l),tf(m,l),s={type:l>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:l>1?"strong":"emphasis",start:{...s.start},end:{...o.end}},e[r][1].end={...s.start},e[n][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Ln(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Ln(u,[["enter",a,t],["enter",s,t],["exit",s,t],["enter",i,t]]),u=Ln(u,ll(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Ln(u,[["exit",i,t],["enter",o,t],["exit",o,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=Ln(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,En(e,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function x6(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=Ka(r);let i;return s;function s(l){return i=l,e.enter("attentionSequence"),o(l)}function o(l){if(l===i)return e.consume(l),o;const u=e.exit("attentionSequence"),c=Ka(l),h=!c||c===2&&a||n.includes(l),m=!a||a===2&&c||n.includes(r);return u._open=!!(i===42?h:h&&(a||!m)),u._close=!!(i===42?m:m&&(c||!h)),t(l)}}function tf(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const b6={name:"autolink",tokenize:y6};function y6(e,t,n){let r=0;return a;function a(d){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(d){return dn(d)?(e.consume(d),s):d===64?n(d):u(d)}function s(d){return d===43||d===45||d===46||rn(d)?(r=1,o(d)):u(d)}function o(d){return d===58?(e.consume(d),r=0,l):(d===43||d===45||d===46||rn(d))&&r++<32?(e.consume(d),o):(r=0,u(d))}function l(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||_o(d)?n(d):(e.consume(d),l)}function u(d){return d===64?(e.consume(d),c):l6(d)?(e.consume(d),u):n(d)}function c(d){return rn(d)?h(d):n(d)}function h(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):m(d)}function m(d){if((d===45||rn(d))&&r++<63){const p=d===45?m:h;return e.consume(d),p}return n(d)}}const xs={partial:!0,tokenize:v6};function v6(e,t,n){return r;function r(i){return lt(i)?it(e,a,"linePrefix")(i):a(i)}function a(i){return i===null||Fe(i)?t(i):n(i)}}const Mg={continuation:{tokenize:k6},exit:T6,name:"blockQuote",tokenize:w6};function w6(e,t,n){const r=this;return a;function a(s){if(s===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),i}return n(s)}function i(s){return lt(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function k6(e,t,n){const r=this;return a;function a(s){return lt(s)?it(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(Mg,t,n)(s)}}function T6(e){e.exit("blockQuote")}const Ig={name:"characterEscape",tokenize:E6};function E6(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),a}function a(i){return c6(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const _g={name:"characterReference",tokenize:S6};function S6(e,t,n){const r=this;let a=0,i,s;return o;function o(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),l}function l(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),i=31,s=rn,c(h))}function u(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=u6,c):(e.enter("characterReferenceValue"),i=7,s=Sc,c(h))}function c(h){if(h===59&&a){const m=e.exit("characterReferenceValue");return s===rn&&!J0(r.sliceSerialize(m))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(h)&&a++<i?(e.consume(h),c):n(h)}}const nf={partial:!0,tokenize:C6},rf={concrete:!0,name:"codeFenced",tokenize:A6};function A6(e,t,n){const r=this,a={partial:!0,tokenize:k};let i=0,s=0,o;return l;function l(A){return u(A)}function u(A){const _=r.events[r.events.length-1];return i=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,o=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(A)}function c(A){return A===o?(s++,e.consume(A),c):s<3?n(A):(e.exit("codeFencedFenceSequence"),lt(A)?it(e,h,"whitespace")(A):h(A))}function h(A){return A===null||Fe(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check(nf,g,N)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(A))}function m(A){return A===null||Fe(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(A)):lt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),it(e,d,"whitespace")(A)):A===96&&A===o?n(A):(e.consume(A),m)}function d(A){return A===null||Fe(A)?h(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(A))}function p(A){return A===null||Fe(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(A)):A===96&&A===o?n(A):(e.consume(A),p)}function g(A){return e.attempt(a,N,x)(A)}function x(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),b}function b(A){return i>0&<(A)?it(e,v,"linePrefix",i+1)(A):v(A)}function v(A){return A===null||Fe(A)?e.check(nf,g,N)(A):(e.enter("codeFlowValue"),T(A))}function T(A){return A===null||Fe(A)?(e.exit("codeFlowValue"),v(A)):(e.consume(A),T)}function N(A){return e.exit("codeFenced"),t(A)}function k(A,_,S){let I=0;return C;function C(R){return A.enter("lineEnding"),A.consume(R),A.exit("lineEnding"),D}function D(R){return A.enter("codeFencedFence"),lt(R)?it(A,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):L(R)}function L(R){return R===o?(A.enter("codeFencedFenceSequence"),F(R)):S(R)}function F(R){return R===o?(I++,A.consume(R),F):I>=s?(A.exit("codeFencedFenceSequence"),lt(R)?it(A,O,"whitespace")(R):O(R)):S(R)}function O(R){return R===null||Fe(R)?(A.exit("codeFencedFence"),_(R)):S(R)}}}function C6(e,t,n){const r=this;return a;function a(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const nu={name:"codeIndented",tokenize:M6},N6={partial:!0,tokenize:I6};function M6(e,t,n){const r=this;return a;function a(u){return e.enter("codeIndented"),it(e,i,"linePrefix",5)(u)}function i(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):Fe(u)?e.attempt(N6,s,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||Fe(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),o)}function l(u){return e.exit("codeIndented"),t(u)}}function I6(e,t,n){const r=this;return a;function a(s){return r.parser.lazy[r.now().line]?n(s):Fe(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):it(e,i,"linePrefix",5)(s)}function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):Fe(s)?a(s):n(s)}}const _6={name:"codeText",previous:L6,resolve:R6,tokenize:D6};function R6(e){let t=e.length-4,n=3,r,a;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;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function L6(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function D6(e,t,n){let r=0,a,i;return s;function s(h){return e.enter("codeText"),e.enter("codeTextSequence"),o(h)}function o(h){return h===96?(e.consume(h),r++,o):(e.exit("codeTextSequence"),l(h))}function l(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),l):h===96?(i=e.enter("codeTextSequence"),a=0,c(h)):Fe(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(h))}function u(h){return h===null||h===32||h===96||Fe(h)?(e.exit("codeTextData"),l(h)):(e.consume(h),u)}function c(h){return h===96?(e.consume(h),a++,c):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(i.type="codeTextData",u(h))}}class P6{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 a=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&Ti(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),Ti(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ti(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);Ti(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ti(this.left,n.reverse())}}}function Ti(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 Rg(e){const t={};let n=-1,r,a,i,s,o,l,u;const c=new P6(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"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,O6(c,n)),n=t[n],u=!0);else if(r[1]._container){for(i=n,a=void 0;i--;)if(s=c.get(i),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(a&&(c.get(a)[1].type="lineEndingBlank"),s[1].type="lineEnding",a=i);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;a&&(r[1].end={...c.get(a)[1].start},o=c.slice(a,n),o.unshift(r),c.splice(a,n-a+1,o))}}return En(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function O6(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const i=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const o=s.events,l=[],u={};let c,h,m=-1,d=n,p=0,g=0;const x=[g];for(;d;){for(;e.get(++a)[1]!==d;);i.push(a),d._tokenizer||(c=r.sliceStream(d),d.next||c.push(null),h&&s.defineSkip(d.start),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(c),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),h=d,d=d.next}for(d=n;++m<o.length;)o[m][0]==="exit"&&o[m-1][0]==="enter"&&o[m][1].type===o[m-1][1].type&&o[m][1].start.line!==o[m][1].end.line&&(g=m+1,x.push(g),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(s.events=[],d?(d._tokenizer=void 0,d.previous=void 0):x.pop(),m=x.length;m--;){const b=o.slice(x[m],x[m+1]),v=i.pop();l.push([v,v+b.length-1]),e.splice(v,2,b)}for(l.reverse(),m=-1;++m<l.length;)u[p+l[m][0]]=p+l[m][1],p+=l[m][1]-l[m][0]-1;return u}const j6={resolve:F6,tokenize:z6},B6={partial:!0,tokenize:H6};function F6(e){return Rg(e),e}function z6(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(o)}function a(o){return o===null?i(o):Fe(o)?e.check(B6,s,i)(o):(e.consume(o),a)}function i(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function s(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function H6(e,t,n){const r=this;return a;function a(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),it(e,i,"linePrefix")}function i(s){if(s===null||Fe(s))return n(s);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(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function Lg(e,t,n,r,a,i,s,o,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return h;function h(b){return b===60?(e.enter(r),e.enter(a),e.enter(i),e.consume(b),e.exit(i),m):b===null||b===32||b===41||_o(b)?n(b):(e.enter(r),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),g(b))}function m(b){return b===62?(e.enter(i),e.consume(b),e.exit(i),e.exit(a),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),d(b))}function d(b){return b===62?(e.exit("chunkString"),e.exit(o),m(b)):b===null||b===60||Fe(b)?n(b):(e.consume(b),b===92?p:d)}function p(b){return b===60||b===62||b===92?(e.consume(b),d):d(b)}function g(b){return!c&&(b===null||b===41||vt(b))?(e.exit("chunkString"),e.exit(o),e.exit(s),e.exit(r),t(b)):c<u&&b===40?(e.consume(b),c++,g):b===41?(e.consume(b),c--,g):b===null||b===32||b===40||_o(b)?n(b):(e.consume(b),b===92?x:g)}function x(b){return b===40||b===41||b===92?(e.consume(b),g):g(b)}}function Dg(e,t,n,r,a,i){const s=this;let o=0,l;return u;function u(d){return e.enter(r),e.enter(a),e.consume(d),e.exit(a),e.enter(i),c}function c(d){return o>999||d===null||d===91||d===93&&!l||d===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):d===93?(e.exit(i),e.enter(a),e.consume(d),e.exit(a),e.exit(r),t):Fe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),h(d))}function h(d){return d===null||d===91||d===93||Fe(d)||o++>999?(e.exit("chunkString"),c(d)):(e.consume(d),l||(l=!lt(d)),d===92?m:h)}function m(d){return d===91||d===92||d===93?(e.consume(d),o++,h):h(d)}}function Pg(e,t,n,r,a,i){let s;return o;function o(m){return m===34||m===39||m===40?(e.enter(r),e.enter(a),e.consume(m),e.exit(a),s=m===40?41:m,l):n(m)}function l(m){return m===s?(e.enter(a),e.consume(m),e.exit(a),e.exit(r),t):(e.enter(i),u(m))}function u(m){return m===s?(e.exit(i),l(s)):m===null?n(m):Fe(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),it(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(m))}function c(m){return m===s||m===null||Fe(m)?(e.exit("chunkString"),u(m)):(e.consume(m),m===92?h:c)}function h(m){return m===s||m===92?(e.consume(m),c):c(m)}}function Fi(e,t){let n;return r;function r(a){return Fe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):lt(a)?it(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const U6={name:"definition",tokenize:V6},q6={partial:!0,tokenize:$6};function V6(e,t,n){const r=this;let a;return i;function i(d){return e.enter("definition"),s(d)}function s(d){return Dg.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function o(d){return a=Gn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),l):n(d)}function l(d){return vt(d)?Fi(e,u)(d):u(d)}function u(d){return Lg(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return e.attempt(q6,h,h)(d)}function h(d){return lt(d)?it(e,m,"whitespace")(d):m(d)}function m(d){return d===null||Fe(d)?(e.exit("definition"),r.parser.defined.push(a),t(d)):n(d)}}function $6(e,t,n){return r;function r(o){return vt(o)?Fi(e,a)(o):n(o)}function a(o){return Pg(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return lt(o)?it(e,s,"whitespace")(o):s(o)}function s(o){return o===null||Fe(o)?t(o):n(o)}}const W6={name:"hardBreakEscape",tokenize:G6};function G6(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),a}function a(i){return Fe(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const Y6={name:"headingAtx",resolve:K6,tokenize:X6};function K6(e,t){let n=e.length-2,r=3,a,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&&(a={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"},En(e,r,n-r+1,[["enter",a,t],["enter",i,t],["exit",i,t],["exit",a,t]])),e}function X6(e,t,n){let r=0;return a;function a(c){return e.enter("atxHeading"),i(c)}function i(c){return e.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&r++<6?(e.consume(c),s):c===null||vt(c)?(e.exit("atxHeadingSequence"),o(c)):n(c)}function o(c){return c===35?(e.enter("atxHeadingSequence"),l(c)):c===null||Fe(c)?(e.exit("atxHeading"),t(c)):lt(c)?it(e,o,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function l(c){return c===35?(e.consume(c),l):(e.exit("atxHeadingSequence"),o(c))}function u(c){return c===null||c===35||vt(c)?(e.exit("atxHeadingText"),o(c)):(e.consume(c),u)}}const Q6=["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"],af=["pre","script","style","textarea"],Z6={concrete:!0,name:"htmlFlow",resolveTo:t8,tokenize:n8},J6={partial:!0,tokenize:a8},e8={partial:!0,tokenize:r8};function t8(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 n8(e,t,n){const r=this;let a,i,s,o,l;return u;function u(j){return c(j)}function c(j){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(j),h}function h(j){return j===33?(e.consume(j),m):j===47?(e.consume(j),i=!0,g):j===63?(e.consume(j),a=3,r.interrupt?t:B):dn(j)?(e.consume(j),s=String.fromCharCode(j),x):n(j)}function m(j){return j===45?(e.consume(j),a=2,d):j===91?(e.consume(j),a=5,o=0,p):dn(j)?(e.consume(j),a=4,r.interrupt?t:B):n(j)}function d(j){return j===45?(e.consume(j),r.interrupt?t:B):n(j)}function p(j){const re="CDATA[";return j===re.charCodeAt(o++)?(e.consume(j),o===re.length?r.interrupt?t:L:p):n(j)}function g(j){return dn(j)?(e.consume(j),s=String.fromCharCode(j),x):n(j)}function x(j){if(j===null||j===47||j===62||vt(j)){const re=j===47,K=s.toLowerCase();return!re&&!i&&af.includes(K)?(a=1,r.interrupt?t(j):L(j)):Q6.includes(s.toLowerCase())?(a=6,re?(e.consume(j),b):r.interrupt?t(j):L(j)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(j):i?v(j):T(j))}return j===45||rn(j)?(e.consume(j),s+=String.fromCharCode(j),x):n(j)}function b(j){return j===62?(e.consume(j),r.interrupt?t:L):n(j)}function v(j){return lt(j)?(e.consume(j),v):C(j)}function T(j){return j===47?(e.consume(j),C):j===58||j===95||dn(j)?(e.consume(j),N):lt(j)?(e.consume(j),T):C(j)}function N(j){return j===45||j===46||j===58||j===95||rn(j)?(e.consume(j),N):k(j)}function k(j){return j===61?(e.consume(j),A):lt(j)?(e.consume(j),k):T(j)}function A(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),l=j,_):lt(j)?(e.consume(j),A):S(j)}function _(j){return j===l?(e.consume(j),l=null,I):j===null||Fe(j)?n(j):(e.consume(j),_)}function S(j){return j===null||j===34||j===39||j===47||j===60||j===61||j===62||j===96||vt(j)?k(j):(e.consume(j),S)}function I(j){return j===47||j===62||lt(j)?T(j):n(j)}function C(j){return j===62?(e.consume(j),D):n(j)}function D(j){return j===null||Fe(j)?L(j):lt(j)?(e.consume(j),D):n(j)}function L(j){return j===45&&a===2?(e.consume(j),H):j===60&&a===1?(e.consume(j),V):j===62&&a===4?(e.consume(j),Q):j===63&&a===3?(e.consume(j),B):j===93&&a===5?(e.consume(j),Z):Fe(j)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(J6,ne,F)(j)):j===null||Fe(j)?(e.exit("htmlFlowData"),F(j)):(e.consume(j),L)}function F(j){return e.check(e8,O,ne)(j)}function O(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),R}function R(j){return j===null||Fe(j)?F(j):(e.enter("htmlFlowData"),L(j))}function H(j){return j===45?(e.consume(j),B):L(j)}function V(j){return j===47?(e.consume(j),s="",q):L(j)}function q(j){if(j===62){const re=s.toLowerCase();return af.includes(re)?(e.consume(j),Q):L(j)}return dn(j)&&s.length<8?(e.consume(j),s+=String.fromCharCode(j),q):L(j)}function Z(j){return j===93?(e.consume(j),B):L(j)}function B(j){return j===62?(e.consume(j),Q):j===45&&a===2?(e.consume(j),B):L(j)}function Q(j){return j===null||Fe(j)?(e.exit("htmlFlowData"),ne(j)):(e.consume(j),Q)}function ne(j){return e.exit("htmlFlow"),t(j)}}function r8(e,t,n){const r=this;return a;function a(s){return Fe(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):n(s)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function a8(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(xs,t,n)}}const i8={name:"htmlText",tokenize:s8};function s8(e,t,n){const r=this;let a,i,s;return o;function o(B){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(B),l}function l(B){return B===33?(e.consume(B),u):B===47?(e.consume(B),k):B===63?(e.consume(B),T):dn(B)?(e.consume(B),S):n(B)}function u(B){return B===45?(e.consume(B),c):B===91?(e.consume(B),i=0,p):dn(B)?(e.consume(B),v):n(B)}function c(B){return B===45?(e.consume(B),d):n(B)}function h(B){return B===null?n(B):B===45?(e.consume(B),m):Fe(B)?(s=h,V(B)):(e.consume(B),h)}function m(B){return B===45?(e.consume(B),d):h(B)}function d(B){return B===62?H(B):B===45?m(B):h(B)}function p(B){const Q="CDATA[";return B===Q.charCodeAt(i++)?(e.consume(B),i===Q.length?g:p):n(B)}function g(B){return B===null?n(B):B===93?(e.consume(B),x):Fe(B)?(s=g,V(B)):(e.consume(B),g)}function x(B){return B===93?(e.consume(B),b):g(B)}function b(B){return B===62?H(B):B===93?(e.consume(B),b):g(B)}function v(B){return B===null||B===62?H(B):Fe(B)?(s=v,V(B)):(e.consume(B),v)}function T(B){return B===null?n(B):B===63?(e.consume(B),N):Fe(B)?(s=T,V(B)):(e.consume(B),T)}function N(B){return B===62?H(B):T(B)}function k(B){return dn(B)?(e.consume(B),A):n(B)}function A(B){return B===45||rn(B)?(e.consume(B),A):_(B)}function _(B){return Fe(B)?(s=_,V(B)):lt(B)?(e.consume(B),_):H(B)}function S(B){return B===45||rn(B)?(e.consume(B),S):B===47||B===62||vt(B)?I(B):n(B)}function I(B){return B===47?(e.consume(B),H):B===58||B===95||dn(B)?(e.consume(B),C):Fe(B)?(s=I,V(B)):lt(B)?(e.consume(B),I):H(B)}function C(B){return B===45||B===46||B===58||B===95||rn(B)?(e.consume(B),C):D(B)}function D(B){return B===61?(e.consume(B),L):Fe(B)?(s=D,V(B)):lt(B)?(e.consume(B),D):I(B)}function L(B){return B===null||B===60||B===61||B===62||B===96?n(B):B===34||B===39?(e.consume(B),a=B,F):Fe(B)?(s=L,V(B)):lt(B)?(e.consume(B),L):(e.consume(B),O)}function F(B){return B===a?(e.consume(B),a=void 0,R):B===null?n(B):Fe(B)?(s=F,V(B)):(e.consume(B),F)}function O(B){return B===null||B===34||B===39||B===60||B===61||B===96?n(B):B===47||B===62||vt(B)?I(B):(e.consume(B),O)}function R(B){return B===47||B===62||vt(B)?I(B):n(B)}function H(B){return B===62?(e.consume(B),e.exit("htmlTextData"),e.exit("htmlText"),t):n(B)}function V(B){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),q}function q(B){return lt(B)?it(e,Z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):Z(B)}function Z(B){return e.enter("htmlTextData"),s(B)}}const ed={name:"labelEnd",resolveAll:c8,resolveTo:d8,tokenize:h8},o8={tokenize:f8},l8={tokenize:m8},u8={tokenize:p8};function c8(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 a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&En(e,0,e.length,n),e}function d8(e,t){let n=e.length,r=0,a,i,s,o;for(;n--;)if(a=e[n][1],i){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(i=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(s=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[i][1].start},end:{...e[s][1].end}},c={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[s-2][1].start}};return o=[["enter",l,t],["enter",u,t]],o=Ln(o,e.slice(i+1,i+r+3)),o=Ln(o,[["enter",c,t]]),o=Ln(o,ll(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),o=Ln(o,[["exit",c,t],e[s-2],e[s-1],["exit",u,t]]),o=Ln(o,e.slice(s+1)),o=Ln(o,[["exit",l,t]]),En(e,i,e.length,o),e}function h8(e,t,n){const r=this;let a=r.events.length,i,s;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){i=r.events[a][1];break}return o;function o(m){return i?i._inactive?h(m):(s=r.parser.defined.includes(Gn(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),l):n(m)}function l(m){return m===40?e.attempt(o8,c,s?c:h)(m):m===91?e.attempt(l8,c,s?u:h)(m):s?c(m):h(m)}function u(m){return e.attempt(u8,c,h)(m)}function c(m){return t(m)}function h(m){return i._balanced=!0,n(m)}}function f8(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),a}function a(h){return vt(h)?Fi(e,i)(h):i(h)}function i(h){return h===41?c(h):Lg(e,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function s(h){return vt(h)?Fi(e,l)(h):c(h)}function o(h){return n(h)}function l(h){return h===34||h===39||h===40?Pg(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):c(h)}function u(h){return vt(h)?Fi(e,c)(h):c(h)}function c(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function m8(e,t,n){const r=this;return a;function a(o){return Dg.call(r,e,i,s,"reference","referenceMarker","referenceString")(o)}function i(o){return r.parser.defined.includes(Gn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function s(o){return n(o)}}function p8(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),a}function a(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const g8={name:"labelStartImage",resolveAll:ed.resolveAll,tokenize:x8};function x8(e,t,n){const r=this;return a;function a(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"),s):n(o)}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const b8={name:"labelStartLink",resolveAll:ed.resolveAll,tokenize:y8};function y8(e,t,n){const r=this;return a;function a(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),i}function i(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const ru={name:"lineEnding",tokenize:v8};function v8(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),it(e,t,"linePrefix")}}const uo={name:"thematicBreak",tokenize:w8};function w8(e,t,n){let r=0,a;return i;function i(u){return e.enter("thematicBreak"),s(u)}function s(u){return a=u,o(u)}function o(u){return u===a?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||Fe(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===a?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),lt(u)?it(e,o,"whitespace")(u):o(u))}}const xn={continuation:{tokenize:S8},exit:C8,name:"list",tokenize:E8},k8={partial:!0,tokenize:N8},T8={partial:!0,tokenize:A8};function E8(e,t,n){const r=this,a=r.events[r.events.length-1];let i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,s=0;return o;function o(d){const p=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:Sc(d)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(uo,n,u)(d):u(d);if(!r.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(d)}return n(d)}function l(d){return Sc(d)&&++s<10?(e.consume(d),l):(!r.interrupt||s<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),u(d)):n(d)}function u(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,e.check(xs,r.interrupt?n:c,e.attempt(k8,m,h))}function c(d){return r.containerState.initialBlankLine=!0,i++,m(d)}function h(d){return lt(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),m):n(d)}function m(d){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function S8(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(xs,a,i);function a(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,it(e,t,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!lt(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(T8,t,s)(o))}function s(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,it(e,e.attempt(xn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function A8(e,t,n){const r=this;return it(e,a,"listItemIndent",r.containerState.size+1);function a(i){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(i):n(i)}}function C8(e){e.exit(this.containerState.type)}function N8(e,t,n){const r=this;return it(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(i){const s=r.events[r.events.length-1];return!lt(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const sf={name:"setextUnderline",resolveTo:M8,tokenize:I8};function M8(e,t){let n=e.length,r,a,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",i?(e.splice(a,0,["enter",s,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function I8(e,t,n){const r=this;let a;return i;function i(u){let c=r.events.length,h;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){h=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),a=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===a?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),lt(u)?it(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||Fe(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const _8={tokenize:R8};function R8(e){const t=this,n=e.attempt(xs,r,e.attempt(this.parser.constructs.flowInitial,a,it(e,e.attempt(this.parser.constructs.flow,a,e.attempt(j6,a)),"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 a(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const L8={resolveAll:jg()},D8=Og("string"),P8=Og("text");function Og(e){return{resolveAll:jg(e==="text"?O8:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],i=n.attempt(a,s,o);return s;function s(c){return u(c)?i(c):o(c)}function o(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),i(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;const h=a[c];let m=-1;if(h)for(;++m<h.length;){const d=h[m];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function jg(e){return t;function t(n,r){let a=-1,i;for(;++a<=n.length;)i===void 0?n[a]&&n[a][1].type==="data"&&(i=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==i+2&&(n[i][1].end=n[a-1][1].end,n.splice(i+2,a-i-2),a=i+2),i=void 0);return e?e(n,r):n}}function O8(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],a=t.sliceStream(r);let i=a.length,s=-1,o=0,l;for(;i--;){const u=a[i];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)o++,s--;if(s)break;s=-1}else if(u===-2)l=!0,o++;else if(u!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const u={type:n===e.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?s:r.start._bufferIndex+s,_index:r.start._index+i,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const j8={42:xn,43:xn,45:xn,48:xn,49:xn,50:xn,51:xn,52:xn,53:xn,54:xn,55:xn,56:xn,57:xn,62:Mg},B8={91:U6},F8={[-2]:nu,[-1]:nu,32:nu},z8={35:Y6,42:uo,45:[sf,uo],60:Z6,61:sf,95:uo,96:rf,126:rf},H8={38:_g,92:Ig},U8={[-5]:ru,[-4]:ru,[-3]:ru,33:g8,38:_g,42:Ac,60:[b6,i8],91:b8,92:[W6,Ig],93:ed,95:Ac,96:_6},q8={null:[Ac,L8]},V8={null:[42,95]},$8={null:[]},W8=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:V8,contentInitial:B8,disable:$8,document:j8,flow:z8,flowInitial:F8,insideSpan:q8,string:H8,text:U8},Symbol.toStringTag,{value:"Module"}));function G8(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 a={},i=[];let s=[],o=[];const l={attempt:_(k),check:_(A),consume:v,enter:T,exit:N,interrupt:_(A,{interrupt:!0})},u={code:null,containerState:{},defineSkip:g,events:[],now:p,parser:e,previous:null,sliceSerialize:m,sliceStream:d,write:h};let c=t.tokenize.call(u,l);return t.resolveAll&&i.push(t),u;function h(D){return s=Ln(s,D),x(),s[s.length-1]!==null?[]:(S(t,0),u.events=ll(i,u.events,u),u.events)}function m(D,L){return K8(d(D),L)}function d(D){return Y8(s,D)}function p(){const{_bufferIndex:D,_index:L,line:F,column:O,offset:R}=r;return{_bufferIndex:D,_index:L,line:F,column:O,offset:R}}function g(D){a[D.line]=D.column,C()}function x(){let D;for(;r._index<s.length;){const L=s[r._index];if(typeof L=="string")for(D=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===D&&r._bufferIndex<L.length;)b(L.charCodeAt(r._bufferIndex));else b(L)}}function b(D){c=c(D)}function v(D){Fe(D)?(r.line++,r.column=1,r.offset+=D===-3?2:1,C()):D!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=D}function T(D,L){const F=L||{};return F.type=D,F.start=p(),u.events.push(["enter",F,u]),o.push(F),F}function N(D){const L=o.pop();return L.end=p(),u.events.push(["exit",L,u]),L}function k(D,L){S(D,L.from)}function A(D,L){L.restore()}function _(D,L){return F;function F(O,R,H){let V,q,Z,B;return Array.isArray(O)?ne(O):"tokenize"in O?ne([O]):Q(O);function Q(X){return ce;function ce(le){const ee=le!==null&&X[le],Ie=le!==null&&X.null,de=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(Ie)?Ie:Ie?[Ie]:[]];return ne(de)(le)}}function ne(X){return V=X,q=0,X.length===0?H:j(X[q])}function j(X){return ce;function ce(le){return B=I(),Z=X,X.partial||(u.currentConstruct=X),X.name&&u.parser.constructs.disable.null.includes(X.name)?K():X.tokenize.call(L?Object.assign(Object.create(u),L):u,l,re,K)(le)}}function re(X){return D(Z,B),R}function K(X){return B.restore(),++q<V.length?j(V[q]):H}}}function S(D,L){D.resolveAll&&!i.includes(D)&&i.push(D),D.resolve&&En(u.events,L,u.events.length-L,D.resolve(u.events.slice(L),u)),D.resolveTo&&(u.events=D.resolveTo(u.events,u))}function I(){const D=p(),L=u.previous,F=u.currentConstruct,O=u.events.length,R=Array.from(o);return{from:O,restore:H};function H(){r=D,u.previous=L,u.currentConstruct=F,u.events.length=O,o=R,C()}}function C(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function Y8(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,i=t.end._bufferIndex;let s;if(n===a)s=[e[n].slice(r,i)];else{if(s=e.slice(n,a),r>-1){const o=s[0];typeof o=="string"?s[0]=o.slice(r):s.shift()}i>0&&s.push(e[a].slice(0,i))}return s}function K8(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const i=e[n];let s;if(typeof i=="string")s=i;else switch(i){case-5:{s="\r";break}case-4:{s=`
|
|
479
|
+
`;break}case-3:{s=`\r
|
|
480
|
+
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&a)continue;s=" ";break}default:s=String.fromCharCode(i)}a=i===-2,r.push(s)}return r.join("")}function X8(e){const r={constructs:Cg([W8,...(e||{}).extensions||[]]),content:a(d6),defined:[],document:a(f6),flow:a(_8),lazy:{},string:a(D8),text:a(P8)};return r;function a(i){return s;function s(o){return G8(r,i,o)}}}function Q8(e){for(;!Rg(e););return e}const of=/[\0\t\n\r]/g;function Z8(){let e=1,t="",n=!0,r;return a;function a(i,s,o){const l=[];let u,c,h,m,d;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),h=0,t="",n&&(i.charCodeAt(0)===65279&&h++,n=void 0);h<i.length;){if(of.lastIndex=h,u=of.exec(i),m=u&&u.index!==void 0?u.index:i.length,d=i.charCodeAt(m),!u){t=i.slice(h);break}if(d===10&&h===m&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),h<m&&(l.push(i.slice(h,m)),e+=m-h),d){case 0:{l.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,l.push(-2);e++<c;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}h=m+1}return o&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const J8=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function e7(e){return e.replace(J8,t7)}function t7(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),i=a===120||a===88;return Ng(n.slice(i?2:1),i?16:10)}return J0(n)||e}const Bg={}.hasOwnProperty;function n7(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),r7(n)(Q8(X8(n).document().write(Z8()(e,t,!0))))}function r7(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(me),autolinkProtocol:I,autolinkEmail:I,atxHeading:i(Oe),blockQuote:i(Ie),characterEscape:I,characterReference:I,codeFenced:i(de),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(de,s),codeText:i(he,s),codeTextData:I,data:I,codeFlowValue:I,definition:i(pe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(Ce),hardBreakEscape:i(st),hardBreakTrailing:i(st),htmlFlow:i(Be,s),htmlFlowData:I,htmlText:i(Be,s),htmlTextData:I,image:i(ut),label:s,link:i(me),listItem:i(ct),listItemValue:m,listOrdered:i(Ue,h),listUnordered:i(Ue),paragraph:i(tt),reference:j,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(Oe),strong:i(ft),thematicBreak:i(Pe)},exit:{atxHeading:l(),atxHeadingSequence:k,autolink:l(),autolinkEmail:ee,autolinkProtocol:le,blockQuote:l(),characterEscapeValue:C,characterReferenceMarkerHexadecimal:K,characterReferenceMarkerNumeric:K,characterReferenceValue:X,characterReference:ce,codeFenced:l(x),codeFencedFence:g,codeFencedFenceInfo:d,codeFencedFenceMeta:p,codeFlowValue:C,codeIndented:l(b),codeText:l(R),codeTextData:C,data:C,definition:l(),definitionDestinationString:N,definitionLabelString:v,definitionTitleString:T,emphasis:l(),hardBreakEscape:l(L),hardBreakTrailing:l(L),htmlFlow:l(F),htmlFlowData:C,htmlText:l(O),htmlTextData:C,image:l(V),label:Z,labelText:q,lineEnding:D,link:l(H),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:re,resourceDestinationString:B,resourceTitleString:Q,resource:ne,setextHeading:l(S),setextHeadingLineSequence:_,setextHeadingText:A,strong:l(),thematicBreak:l()}};Fg(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(oe){let ge={type:"root",children:[]};const _e={stack:[ge],tokenStack:[],config:t,enter:o,exit:u,buffer:s,resume:c,data:n},Ae=[];let ze=-1;for(;++ze<oe.length;)if(oe[ze][1].type==="listOrdered"||oe[ze][1].type==="listUnordered")if(oe[ze][0]==="enter")Ae.push(ze);else{const ye=Ae.pop();ze=a(oe,ye,ze)}for(ze=-1;++ze<oe.length;){const ye=t[oe[ze][0]];Bg.call(ye,oe[ze][1].type)&&ye[oe[ze][1].type].call(Object.assign({sliceSerialize:oe[ze][2].sliceSerialize},_e),oe[ze][1])}if(_e.tokenStack.length>0){const ye=_e.tokenStack[_e.tokenStack.length-1];(ye[1]||lf).call(_e,void 0,ye[0])}for(ge.position={start:Cr(oe.length>0?oe[0][1].start:{line:1,column:1,offset:0}),end:Cr(oe.length>0?oe[oe.length-2][1].end:{line:1,column:1,offset:0})},ze=-1;++ze<t.transforms.length;)ge=t.transforms[ze](ge)||ge;return ge}function a(oe,ge,_e){let Ae=ge-1,ze=-1,ye=!1,Re,He,dt,Jt;for(;++Ae<=_e;){const Ot=oe[Ae];switch(Ot[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ot[0]==="enter"?ze++:ze--,Jt=void 0;break}case"lineEndingBlank":{Ot[0]==="enter"&&(Re&&!Jt&&!ze&&!dt&&(dt=Ae),Jt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Jt=void 0}if(!ze&&Ot[0]==="enter"&&Ot[1].type==="listItemPrefix"||ze===-1&&Ot[0]==="exit"&&(Ot[1].type==="listUnordered"||Ot[1].type==="listOrdered")){if(Re){let en=Ae;for(He=void 0;en--;){const Ze=oe[en];if(Ze[1].type==="lineEnding"||Ze[1].type==="lineEndingBlank"){if(Ze[0]==="exit")continue;He&&(oe[He][1].type="lineEndingBlank",ye=!0),Ze[1].type="lineEnding",He=en}else if(!(Ze[1].type==="linePrefix"||Ze[1].type==="blockQuotePrefix"||Ze[1].type==="blockQuotePrefixWhitespace"||Ze[1].type==="blockQuoteMarker"||Ze[1].type==="listItemIndent"))break}dt&&(!He||dt<He)&&(Re._spread=!0),Re.end=Object.assign({},He?oe[He][1].start:Ot[1].end),oe.splice(He||Ae,0,["exit",Re,Ot[2]]),Ae++,_e++}if(Ot[1].type==="listItemPrefix"){const en={type:"listItem",_spread:!1,start:Object.assign({},Ot[1].start),end:void 0};Re=en,oe.splice(Ae,0,["enter",en,Ot[2]]),Ae++,_e++,dt=void 0,Jt=!0}}}return oe[ge][1]._spread=ye,_e}function i(oe,ge){return _e;function _e(Ae){o.call(this,oe(Ae),Ae),ge&&ge.call(this,Ae)}}function s(){this.stack.push({type:"fragment",children:[]})}function o(oe,ge,_e){this.stack[this.stack.length-1].children.push(oe),this.stack.push(oe),this.tokenStack.push([ge,_e||void 0]),oe.position={start:Cr(ge.start),end:void 0}}function l(oe){return ge;function ge(_e){oe&&oe.call(this,_e),u.call(this,_e)}}function u(oe,ge){const _e=this.stack.pop(),Ae=this.tokenStack.pop();if(Ae)Ae[0].type!==oe.type&&(ge?ge.call(this,oe,Ae[0]):(Ae[1]||lf).call(this,oe,Ae[0]));else throw new Error("Cannot close `"+oe.type+"` ("+Bi({start:oe.start,end:oe.end})+"): it’s not open");_e.position.end=Cr(oe.end)}function c(){return Z0(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function m(oe){if(this.data.expectingFirstListItemValue){const ge=this.stack[this.stack.length-2];ge.start=Number.parseInt(this.sliceSerialize(oe),10),this.data.expectingFirstListItemValue=void 0}}function d(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.lang=oe}function p(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.meta=oe}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe.replace(/(\r?\n|\r)$/g,"")}function v(oe){const ge=this.resume(),_e=this.stack[this.stack.length-1];_e.label=ge,_e.identifier=Gn(this.sliceSerialize(oe)).toLowerCase()}function T(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.title=oe}function N(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.url=oe}function k(oe){const ge=this.stack[this.stack.length-1];if(!ge.depth){const _e=this.sliceSerialize(oe).length;ge.depth=_e}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function _(oe){const ge=this.stack[this.stack.length-1];ge.depth=this.sliceSerialize(oe).codePointAt(0)===61?1:2}function S(){this.data.setextHeadingSlurpLineEnding=void 0}function I(oe){const _e=this.stack[this.stack.length-1].children;let Ae=_e[_e.length-1];(!Ae||Ae.type!=="text")&&(Ae=Xe(),Ae.position={start:Cr(oe.start),end:void 0},_e.push(Ae)),this.stack.push(Ae)}function C(oe){const ge=this.stack.pop();ge.value+=this.sliceSerialize(oe),ge.position.end=Cr(oe.end)}function D(oe){const ge=this.stack[this.stack.length-1];if(this.data.atHardBreak){const _e=ge.children[ge.children.length-1];_e.position.end=Cr(oe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ge.type)&&(I.call(this,oe),C.call(this,oe))}function L(){this.data.atHardBreak=!0}function F(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe}function O(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe}function R(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe}function H(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=ge,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function V(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=ge,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function q(oe){const ge=this.sliceSerialize(oe),_e=this.stack[this.stack.length-2];_e.label=e7(ge),_e.identifier=Gn(ge).toLowerCase()}function Z(){const oe=this.stack[this.stack.length-1],ge=this.resume(),_e=this.stack[this.stack.length-1];if(this.data.inReference=!0,_e.type==="link"){const Ae=oe.children;_e.children=Ae}else _e.alt=ge}function B(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.url=oe}function Q(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.title=oe}function ne(){this.data.inReference=void 0}function j(){this.data.referenceType="collapsed"}function re(oe){const ge=this.resume(),_e=this.stack[this.stack.length-1];_e.label=ge,_e.identifier=Gn(this.sliceSerialize(oe)).toLowerCase(),this.data.referenceType="full"}function K(oe){this.data.characterReferenceType=oe.type}function X(oe){const ge=this.sliceSerialize(oe),_e=this.data.characterReferenceType;let Ae;_e?(Ae=Ng(ge,_e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ae=J0(ge);const ze=this.stack[this.stack.length-1];ze.value+=Ae}function ce(oe){const ge=this.stack.pop();ge.position.end=Cr(oe.end)}function le(oe){C.call(this,oe);const ge=this.stack[this.stack.length-1];ge.url=this.sliceSerialize(oe)}function ee(oe){C.call(this,oe);const ge=this.stack[this.stack.length-1];ge.url="mailto:"+this.sliceSerialize(oe)}function Ie(){return{type:"blockquote",children:[]}}function de(){return{type:"code",lang:null,meta:null,value:""}}function he(){return{type:"inlineCode",value:""}}function pe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ce(){return{type:"emphasis",children:[]}}function Oe(){return{type:"heading",depth:0,children:[]}}function st(){return{type:"break"}}function Be(){return{type:"html",value:""}}function ut(){return{type:"image",title:null,url:"",alt:null}}function me(){return{type:"link",title:null,url:"",children:[]}}function Ue(oe){return{type:"list",ordered:oe.type==="listOrdered",start:null,spread:oe._spread,children:[]}}function ct(oe){return{type:"listItem",spread:oe._spread,checked:null,children:[]}}function tt(){return{type:"paragraph",children:[]}}function ft(){return{type:"strong",children:[]}}function Xe(){return{type:"text",value:""}}function Pe(){return{type:"thematicBreak"}}}function Cr(e){return{line:e.line,column:e.column,offset:e.offset}}function Fg(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Fg(e,r):a7(e,r)}}function a7(e,t){let n;for(n in t)if(Bg.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 lf(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Bi({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Bi({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Bi({start:t.start,end:t.end})+") is still open")}function i7(e){const t=this;t.parser=n;function n(r){return n7(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function s7(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 o7(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
481
|
+
`}]}function l7(e,t){const n=t.value?t.value+`
|
|
482
|
+
`:"",r={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[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 u7(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function c7(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function d7(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=ai(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let s,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=i+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function h7(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 f7(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function zg(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 a=e.all(t),i=a[0];i&&i.type==="text"?i.value="["+i.value:a.unshift({type:"text",value:"["});const s=a[a.length-1];return s&&s.type==="text"?s.value+=r:a.push({type:"text",value:r}),a}function m7(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return zg(e,t);const a={src:ai(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const i={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,i),e.applyData(t,i)}function p7(e,t){const n={src:ai(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 g7(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 x7(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return zg(e,t);const a={href:ai(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const i={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function b7(e,t){const n={href:ai(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 y7(e,t,n){const r=e.all(t),a=n?v7(n):Hg(t),i={},s=[];if(typeof t.checked=="boolean"){const c=r[0];let h;c&&c.type==="element"&&c.tagName==="p"?h=c:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const c=r[o];(a||o!==0||c.type!=="element"||c.tagName!=="p")&&s.push({type:"text",value:`
|
|
483
|
+
`}),c.type==="element"&&c.tagName==="p"&&!a?s.push(...c.children):s.push(c)}const l=r[r.length-1];l&&(a||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
|
|
484
|
+
`});const u={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,u),e.applyData(t,u)}function v7(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=Hg(n[r])}return t}function Hg(e){const t=e.spread;return t??e.children.length>1}function w7(e,t){const n={},r=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<r.length;){const s=r[a];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.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 k7(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function T7(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function E7(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function S7(e,t){const n=e.all(t),r=n.shift(),a=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),a.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=lr(t.children[1]),l=sl(t.children[t.children.length-1]);o&&l&&(s.position={start:o,end:l}),a.push(s)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,i),e.applyData(t,i)}function A7(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,o=s?s.length:t.children.length;let l=-1;const u=[];for(;++l<o;){const h=t.children[l],m={},d=s?s[l]:void 0;d&&(m.align=d);let p={type:"element",tagName:i,properties:m,children:[]};h&&(p.children=e.all(h),e.patch(h,p),p=e.applyData(h,p)),u.push(p)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,c),e.applyData(t,c)}function C7(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const uf=9,cf=32;function N7(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const i=[];for(;r;)i.push(df(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return i.push(df(t.slice(a),a>0,!1)),i.join("")}function df(e,t,n){let r=0,a=e.length;if(t){let i=e.codePointAt(r);for(;i===uf||i===cf;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(a-1);for(;i===uf||i===cf;)a--,i=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function M7(e,t){const n={type:"text",value:N7(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function I7(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const _7={blockquote:s7,break:o7,code:l7,delete:u7,emphasis:c7,footnoteReference:d7,heading:h7,html:f7,imageReference:m7,image:p7,inlineCode:g7,linkReference:x7,link:b7,listItem:y7,list:w7,paragraph:k7,root:T7,strong:E7,table:S7,tableCell:C7,tableRow:A7,text:M7,thematicBreak:I7,toml:Os,yaml:Os,definition:Os,footnoteDefinition:Os};function Os(){}const Ug=-1,ul=0,zi=1,Ro=2,td=3,nd=4,rd=5,ad=6,qg=7,Vg=8,$g=typeof self=="object"?self:globalThis,hf=(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 $g[e](t)},R7=(e,t)=>{const n=(a,i)=>(e.set(i,a),a),r=a=>{if(e.has(a))return e.get(a);const[i,s]=t[a];switch(i){case ul:case Ug:return n(s,a);case zi:{const o=n([],a);for(const l of s)o.push(r(l));return o}case Ro:{const o=n({},a);for(const[l,u]of s)o[r(l)]=r(u);return o}case td:return n(new Date(s),a);case nd:{const{source:o,flags:l}=s;return n(new RegExp(o,l),a)}case rd:{const o=n(new Map,a);for(const[l,u]of s)o.set(r(l),r(u));return o}case ad:{const o=n(new Set,a);for(const l of s)o.add(r(l));return o}case qg:{const{name:o,message:l}=s;return n(typeof $g[o]=="function"?hf(o,l):new Error(l),a)}case Vg:return n(BigInt(s),a);case"BigInt":return n(Object(BigInt(s)),a);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:o}=new Uint8Array(s);return n(new DataView(o),s)}}return n(hf(i,s),a)};return r},ff=e=>R7(new Map,e)(0),oa="",{toString:L7}={},{keys:D7}=Object,Ei=e=>{const t=typeof e;if(t!=="object"||!e)return[ul,t];const n=L7.call(e).slice(8,-1);switch(n){case"Array":return[zi,oa];case"Object":return[Ro,oa];case"Date":return[td,oa];case"RegExp":return[nd,oa];case"Map":return[rd,oa];case"Set":return[ad,oa];case"DataView":return[zi,n]}return n.includes("Array")?[zi,n]:e instanceof Error?[qg,e.name||"Error"]:[Ro,n]},js=([e,t])=>e===ul&&(t==="function"||t==="symbol"),P7=(e,t,n,r)=>{const a=(s,o)=>{const l=r.push(s)-1;return n.set(o,l),l},i=s=>{if(n.has(s))return n.get(s);let[o,l]=Ei(s);switch(o){case ul:{let c=s;switch(l){case"bigint":o=Vg,c=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);c=null;break;case"undefined":return a([Ug],s)}return a([o,c],s)}case zi:{if(l){let m=s;return l==="DataView"?m=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(m=new Uint8Array(s)),a([l,[...m]],s)}const c=[],h=a([o,c],s);for(const m of s)c.push(i(m));return h}case Ro:{if(l)switch(l){case"BigInt":return a([l,s.toString()],s);case"Boolean":case"Number":case"String":return a([l,s.valueOf()],s)}if(t&&"toJSON"in s)return i(s.toJSON());const c=[],h=a([o,c],s);for(const m of D7(s))(e||!js(Ei(s[m])))&&c.push([i(m),i(s[m])]);return h}case td:return a([o,isNaN(s.getTime())?oa:s.toISOString()],s);case nd:{const{source:c,flags:h}=s;return a([o,{source:c,flags:h}],s)}case rd:{const c=[],h=a([o,c],s);for(const[m,d]of s)(e||!(js(Ei(m))||js(Ei(d))))&&c.push([i(m),i(d)]);return h}case ad:{const c=[],h=a([o,c],s);for(const m of s)(e||!js(Ei(m)))&&c.push(i(m));return h}}const{message:u}=s;return a([o,{name:l,message:u}],s)};return i},mf=(e,{json:t,lossy:n}={})=>{const r=[];return P7(!(t||n),!!t,new Map,r)(e),r},ka=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ff(mf(e,t)):structuredClone(e):(e,t)=>ff(mf(e,t));function O7(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 j7(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function B7(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||O7,r=e.options.footnoteBackLabel||j7,a=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const c=e.all(u),h=String(u.identifier).toUpperCase(),m=ai(h.toLowerCase());let d=0;const p=[],g=e.footnoteCounts.get(h);for(;g!==void 0&&++d<=g;){p.length>0&&p.push({type:"text",value:" "});let v=typeof n=="string"?n:n(l,d);typeof v=="string"&&(v={type:"text",value:v}),p.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const x=c[c.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const v=x.children[x.children.length-1];v&&v.type==="text"?v.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...p)}else c.push(...p);const b={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(c,!0)};e.patch(u,b),o.push(b)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...ka(s),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
|
|
485
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
|
|
486
|
+
`}]}}const bs=(function(e){if(e==null)return U7;if(typeof e=="function")return cl(e);if(typeof e=="object")return Array.isArray(e)?F7(e):z7(e);if(typeof e=="string")return H7(e);throw new Error("Expected function, string, or object as test")});function F7(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=bs(e[n]);return cl(r);function r(...a){let i=-1;for(;++i<t.length;)if(t[i].apply(this,a))return!0;return!1}}function z7(e){const t=e;return cl(n);function n(r){const a=r;let i;for(i in e)if(a[i]!==t[i])return!1;return!0}}function H7(e){return cl(t);function t(n){return n&&n.type===e}}function cl(e){return t;function t(n,r,a){return!!(q7(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function U7(){return!0}function q7(e){return e!==null&&typeof e=="object"&&"type"in e}const Wg=[],V7=!0,Cc=!1,Gg="skip";function id(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const i=bs(a),s=r?-1:1;o(e,void 0,[])();function o(l,u,c){const h=l&&typeof l=="object"?l:{};if(typeof h.type=="string"){const d=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(l.type+(d?"<"+d+">":""))+")"})}return m;function m(){let d=Wg,p,g,x;if((!t||i(l,u,c[c.length-1]||void 0))&&(d=$7(n(l,c)),d[0]===Cc))return d;if("children"in l&&l.children){const b=l;if(b.children&&d[0]!==Gg)for(g=(r?b.children.length:-1)+s,x=c.concat(b);g>-1&&g<b.children.length;){const v=b.children[g];if(p=o(v,g,x)(),p[0]===Cc)return p;g=typeof p[1]=="number"?p[1]:g+s}}return d}}}function $7(e){return Array.isArray(e)?e:typeof e=="number"?[V7,e]:e==null?Wg:[e]}function dl(e,t,n,r){let a,i,s;typeof t=="function"&&typeof n!="function"?(i=void 0,s=t,a=n):(i=t,s=n,a=r),id(e,i,o,a);function o(l,u){const c=u[u.length-1],h=c?c.children.indexOf(l):void 0;return s(l,h,c)}}const Nc={}.hasOwnProperty,W7={};function G7(e,t){const n=t||W7,r=new Map,a=new Map,i=new Map,s={..._7,...n.handlers},o={all:u,applyData:K7,definitionById:r,footnoteById:a,footnoteCounts:i,footnoteOrder:[],handlers:s,one:l,options:n,patch:Y7,wrap:Q7};return dl(e,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){const h=c.type==="definition"?r:a,m=String(c.identifier).toUpperCase();h.has(m)||h.set(m,c)}}),o;function l(c,h){const m=c.type,d=o.handlers[m];if(Nc.call(o.handlers,m)&&d)return d(o,c,h);if(o.options.passThrough&&o.options.passThrough.includes(m)){if("children"in c){const{children:g,...x}=c,b=ka(x);return b.children=o.all(c),b}return ka(c)}return(o.options.unknownHandler||X7)(o,c,h)}function u(c){const h=[];if("children"in c){const m=c.children;let d=-1;for(;++d<m.length;){const p=o.one(m[d],c);if(p){if(d&&m[d-1].type==="break"&&(!Array.isArray(p)&&p.type==="text"&&(p.value=pf(p.value)),!Array.isArray(p)&&p.type==="element")){const g=p.children[0];g&&g.type==="text"&&(g.value=pf(g.value))}Array.isArray(p)?h.push(...p):h.push(p)}}}return h}}function Y7(e,t){e.position&&(t.position=wg(e))}function K7(e,t){let n=t;if(e&&e.data){const r=e.data.hName,a=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&i&&Object.assign(n.properties,ka(i)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function X7(e,t){const n=t.data||{},r="value"in t&&!(Nc.call(n,"hProperties")||Nc.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 Q7(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
487
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
488
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
489
|
+
`}),n}function pf(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function gf(e,t){const n=G7(e,t),r=n.one(e,void 0),a=B7(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&i.children.push({type:"text",value:`
|
|
490
|
+
`},a),i}function Z7(e,t){return e&&"run"in e?async function(n,r){const a=gf(n,{file:r,...t});await e.run(a,r)}:function(n,r){return gf(n,{file:r,...e||t})}}function xf(e){if(e)throw e}var au,bf;function J7(){if(bf)return au;bf=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(u){return typeof Array.isArray=="function"?Array.isArray(u):t.call(u)==="[object Array]"},i=function(u){if(!u||t.call(u)!=="[object Object]")return!1;var c=e.call(u,"constructor"),h=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!c&&!h)return!1;var m;for(m in u);return typeof m>"u"||e.call(u,m)},s=function(u,c){n&&c.name==="__proto__"?n(u,c.name,{enumerable:!0,configurable:!0,value:c.newValue,writable:!0}):u[c.name]=c.newValue},o=function(u,c){if(c==="__proto__")if(e.call(u,c)){if(r)return r(u,c).value}else return;return u[c]};return au=function l(){var u,c,h,m,d,p,g=arguments[0],x=1,b=arguments.length,v=!1;for(typeof g=="boolean"&&(v=g,g=arguments[1]||{},x=2),(g==null||typeof g!="object"&&typeof g!="function")&&(g={});x<b;++x)if(u=arguments[x],u!=null)for(c in u)h=o(g,c),m=o(u,c),g!==m&&(v&&m&&(i(m)||(d=a(m)))?(d?(d=!1,p=h&&a(h)?h:[]):p=h&&i(h)?h:{},s(g,{name:c,newValue:l(v,p,m)})):typeof m<"u"&&s(g,{name:c,newValue:m}));return g},au}var ew=J7();const iu=O0(ew);function Mc(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 tw(){const e=[],t={run:n,use:r};return t;function n(...a){let i=-1;const s=a.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);o(null,...a);function o(l,...u){const c=e[++i];let h=-1;if(l){s(l);return}for(;++h<a.length;)(u[h]===null||u[h]===void 0)&&(u[h]=a[h]);a=u,c?nw(c,o)(...u):s(null,...u)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function nw(e,t){let n;return r;function r(...s){const o=e.length>s.length;let l;o&&s.push(a);try{l=e.apply(this,s)}catch(u){const c=u;if(o&&n)throw c;return a(c)}o||(l&&l.then&&typeof l.then=="function"?l.then(i,a):l instanceof Error?a(l):i(l))}function a(s,...o){n||(n=!0,t(s,...o))}function i(s){a(null,s)}}const Qn={basename:rw,dirname:aw,extname:iw,join:sw,sep:"/"};function rw(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ys(e);let n=0,r=-1,a=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(i){n=a+1;break}}else r<0&&(i=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,o=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(i){n=a+1;break}}else s<0&&(i=!0,s=a+1),o>-1&&(e.codePointAt(a)===t.codePointAt(o--)?o<0&&(r=a):(o=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function aw(e){if(ys(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 iw(e){ys(e);let t=e.length,n=-1,r=0,a=-1,i=0,s;for(;t--;){const o=e.codePointAt(t);if(o===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),o===46?a<0?a=t:i!==1&&(i=1):a>-1&&(i=-1)}return a<0||n<0||i===0||i===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function sw(...e){let t=-1,n;for(;++t<e.length;)ys(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":ow(n)}function ow(e){ys(e);const t=e.codePointAt(0)===47;let n=lw(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function lw(e,t){let n="",r=0,a=-1,i=0,s=-1,o,l;for(;++s<=e.length;){if(s<e.length)o=e.codePointAt(s);else{if(o===47)break;o=47}if(o===47){if(!(a===s-1||i===1))if(a!==s-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(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),a=s,i=0;continue}}else if(n.length>0){n="",r=0,a=s,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,s):n=e.slice(a+1,s),r=s-a-1;a=s,i=0}else o===46&&i>-1?i++:i=-1}return n}function ys(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const uw={cwd:cw};function cw(){return"/"}function Ic(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function dw(e){if(typeof e=="string")e=new URL(e);else if(!Ic(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 hw(e)}function hw(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 a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const su=["history","path","basename","stem","extname","dirname"];class Yg{constructor(t){let n;t?Ic(t)?n={path:t}:typeof t=="string"||fw(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":uw.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<su.length;){const i=su[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let a;for(a in n)su.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?Qn.basename(this.path):void 0}set basename(t){lu(t,"basename"),ou(t,"basename"),this.path=Qn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Qn.dirname(this.path):void 0}set dirname(t){yf(this.basename,"dirname"),this.path=Qn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Qn.extname(this.path):void 0}set extname(t){if(ou(t,"extname"),yf(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=Qn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Ic(t)&&(t=dw(t)),lu(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Qn.basename(this.path,this.extname):void 0}set stem(t){lu(t,"stem"),ou(t,"stem"),this.path=Qn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new sn(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function ou(e,t){if(e&&e.includes(Qn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Qn.sep+"`")}function lu(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function yf(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function fw(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const mw=(function(e){const r=this.constructor.prototype,a=r[e],i=function(){return a.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),pw={}.hasOwnProperty;class sd extends mw{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=tw()}copy(){const t=new sd;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(iu(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(du("data",this.frozen),this.namespace[t]=n,this):pw.call(this.namespace,t)&&this.namespace[t]||void 0:t?(du("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 a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Bs(t),r=this.parser||this.Parser;return uu("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),uu("process",this.parser||this.Parser),cu("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(i,s){const o=Bs(t),l=r.parse(o);r.run(l,o,function(c,h,m){if(c||!h||!m)return u(c);const d=h,p=r.stringify(d,m);bw(p)?m.value=p:m.result=p,u(c,m)});function u(c,h){c||!h?s(c):i?i(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),uu("processSync",this.parser||this.Parser),cu("processSync",this.compiler||this.Compiler),this.process(t,a),wf("processSync","process",n),r;function a(i,s){n=!0,xf(i),r=s}}run(t,n,r){vf(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(s,o){const l=Bs(n);a.run(t,l,u);function u(c,h,m){const d=h||t;c?o(c):s?s(d):r(void 0,d,m)}}}runSync(t,n){let r=!1,a;return this.run(t,n,i),wf("runSync","run",r),a;function i(s,o){xf(s),a=o,r=!0}}stringify(t,n){this.freeze();const r=Bs(n),a=this.compiler||this.Compiler;return cu("stringify",a),vf(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(du("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[c,...h]=u;l(c,h)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(u){if(!("plugins"in u)&&!("settings"in u))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(u.plugins),u.settings&&(a.settings=iu(!0,a.settings,u.settings))}function o(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){const h=u[c];i(h)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,c){let h=-1,m=-1;for(;++h<r.length;)if(r[h][0]===u){m=h;break}if(m===-1)r.push([u,...c]);else if(c.length>0){let[d,...p]=c;const g=r[m][1];Mc(g)&&Mc(d)&&(d=iu(!0,g,d)),r[m]=[u,d,...p]}}}}const gw=new sd().freeze();function uu(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function cu(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function du(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 vf(e){if(!Mc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function wf(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Bs(e){return xw(e)?e:new Yg(e)}function xw(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function bw(e){return typeof e=="string"||yw(e)}function yw(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const vw="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",kf=[],Tf={allowDangerousHtml:!0},ww=/^(https?|ircs?|mailto|xmpp)$/i,kw=[{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 Kg(e){const t=Tw(e),n=Ew(e);return Sw(t.runSync(t.parse(n),n),e)}function Tw(e){const t=e.rehypePlugins||kf,n=e.remarkPlugins||kf,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Tf}:Tf;return gw().use(i7).use(n).use(Z7,r).use(t)}function Ew(e){const t=e.children||"",n=new Yg;return typeof t=="string"&&(n.value=t),n}function Sw(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,i=t.disallowedElements,s=t.skipHtml,o=t.unwrapDisallowed,l=t.urlTransform||Aw;for(const c of kw)Object.hasOwn(t,c.from)&&(""+c.from+(c.to?"use `"+c.to+"` instead":"remove it")+vw+c.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),dl(e,u),Uv(e,{Fragment:f.Fragment,components:a,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function u(c,h,m){if(c.type==="raw"&&m&&typeof h=="number")return s?m.children.splice(h,1):m.children[h]={type:"text",value:c.value},h;if(c.type==="element"){let d;for(d in tu)if(Object.hasOwn(tu,d)&&Object.hasOwn(c.properties,d)){const p=c.properties[d],g=tu[d];(g===null||g.includes(c.tagName))&&(c.properties[d]=l(String(p||""),d,c))}}if(c.type==="element"){let d=n?!n.includes(c.tagName):i?i.includes(c.tagName):!1;if(!d&&r&&typeof h=="number"&&(d=!r(c,h,m)),d&&m&&typeof h=="number")return o&&c.children?m.children.splice(h,1,...c.children):m.children.splice(h,1),h}}}function Aw(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||ww.test(e.slice(0,t))?e:""}function Ef(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function Cw(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Nw(e,t,n){const a=bs((n||{}).ignore||[]),i=Mw(t);let s=-1;for(;++s<i.length;)id(e,"text",o);function o(u,c){let h=-1,m;for(;++h<c.length;){const d=c[h],p=m?m.children:void 0;if(a(d,p?p.indexOf(d):void 0,m))return;m=d}if(m)return l(u,c)}function l(u,c){const h=c[c.length-1],m=i[s][0],d=i[s][1];let p=0;const x=h.children.indexOf(u);let b=!1,v=[];m.lastIndex=0;let T=m.exec(u.value);for(;T;){const N=T.index,k={index:T.index,input:T.input,stack:[...c,u]};let A=d(...T,k);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?m.lastIndex=N+1:(p!==N&&v.push({type:"text",value:u.value.slice(p,N)}),Array.isArray(A)?v.push(...A):A&&v.push(A),p=N+T[0].length,b=!0),!m.global)break;T=m.exec(u.value)}return b?(p<u.value.length&&v.push({type:"text",value:u.value.slice(p)}),h.children.splice(x,1,...v)):v=[u],x+v.length}}function Mw(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 a=n[r];t.push([Iw(a[0]),_w(a[1])])}return t}function Iw(e){return typeof e=="string"?new RegExp(Cw(e),"g"):e}function _w(e){return typeof e=="function"?e:function(){return e}}const hu="phrasing",fu=["autolink","link","image","label"];function Rw(){return{transforms:[Fw],enter:{literalAutolink:Dw,literalAutolinkEmail:mu,literalAutolinkHttp:mu,literalAutolinkWww:mu},exit:{literalAutolink:Bw,literalAutolinkEmail:jw,literalAutolinkHttp:Pw,literalAutolinkWww:Ow}}}function Lw(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:hu,notInConstruct:fu},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:hu,notInConstruct:fu},{character:":",before:"[ps]",after:"\\/",inConstruct:hu,notInConstruct:fu}]}}function Dw(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function mu(e){this.config.enter.autolinkProtocol.call(this,e)}function Pw(e){this.config.exit.autolinkProtocol.call(this,e)}function Ow(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 jw(e){this.config.exit.autolinkEmail.call(this,e)}function Bw(e){this.exit(e)}function Fw(e){Nw(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,zw],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Hw]],{ignore:["link","linkReference"]})}function zw(e,t,n,r,a){let i="";if(!Xg(a)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!Uw(n)))return!1;const s=qw(n+r);if(!s[0])return!1;const o={type:"link",title:null,url:i+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[o,{type:"text",value:s[1]}]:o}function Hw(e,t,n,r){return!Xg(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Uw(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 qw(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 a=Ef(e,"(");let i=Ef(e,")");for(;r!==-1&&a>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}function Xg(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||wa(n)||ol(n))&&(!t||n!==47)}Qg.peek=Zw;function Vw(){this.buffer()}function $w(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Ww(){this.buffer()}function Gw(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Yw(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Gn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Kw(e){this.exit(e)}function Xw(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Gn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Qw(e){this.exit(e)}function Zw(){return"["}function Qg(e,t,n,r){const a=n.createTracker(r);let i=a.move("[^");const s=n.enter("footnoteReference"),o=n.enter("reference");return i+=a.move(n.safe(n.associationId(e),{after:"]",before:i})),o(),s(),i+=a.move("]"),i}function Jw(){return{enter:{gfmFootnoteCallString:Vw,gfmFootnoteCall:$w,gfmFootnoteDefinitionLabelString:Ww,gfmFootnoteDefinition:Gw},exit:{gfmFootnoteCallString:Yw,gfmFootnoteCall:Kw,gfmFootnoteDefinitionLabelString:Xw,gfmFootnoteDefinition:Qw}}}function ek(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Qg},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,i,s){const o=i.createTracker(s);let l=o.move("[^");const u=i.enter("footnoteDefinition"),c=i.enter("label");return l+=o.move(i.safe(i.associationId(r),{before:l,after:"]"})),c(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((t?`
|
|
491
|
+
`:" ")+i.indentLines(i.containerFlow(r,o.current()),t?Zg:tk))),u(),l}}function tk(e,t,n){return t===0?e:Zg(e,t,n)}function Zg(e,t,n){return(n?"":" ")+e}const nk=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Jg.peek=ok;function rk(){return{canContainEols:["delete"],enter:{strikethrough:ik},exit:{strikethrough:sk}}}function ak(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:nk}],handlers:{delete:Jg}}}function ik(e){this.enter({type:"delete",children:[]},e)}function sk(e){this.exit(e)}function Jg(e,t,n,r){const a=n.createTracker(r),i=n.enter("strikethrough");let s=a.move("~~");return s+=n.containerPhrasing(e,{...a.current(),before:s,after:"~"}),s+=a.move("~~"),i(),s}function ok(){return"~"}function lk(e){return e.length}function uk(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||lk,i=[],s=[],o=[],l=[];let u=0,c=-1;for(;++c<e.length;){const g=[],x=[];let b=-1;for(e[c].length>u&&(u=e[c].length);++b<e[c].length;){const v=ck(e[c][b]);if(n.alignDelimiters!==!1){const T=a(v);x[b]=T,(l[b]===void 0||T>l[b])&&(l[b]=T)}g.push(v)}s[c]=g,o[c]=x}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<u;)i[h]=Sf(r[h]);else{const g=Sf(r);for(;++h<u;)i[h]=g}h=-1;const m=[],d=[];for(;++h<u;){const g=i[h];let x="",b="";g===99?(x=":",b=":"):g===108?x=":":g===114&&(b=":");let v=n.alignDelimiters===!1?1:Math.max(1,l[h]-x.length-b.length);const T=x+"-".repeat(v)+b;n.alignDelimiters!==!1&&(v=x.length+v+b.length,v>l[h]&&(l[h]=v),d[h]=v),m[h]=T}s.splice(1,0,m),o.splice(1,0,d),c=-1;const p=[];for(;++c<s.length;){const g=s[c],x=o[c];h=-1;const b=[];for(;++h<u;){const v=g[h]||"";let T="",N="";if(n.alignDelimiters!==!1){const k=l[h]-(x[h]||0),A=i[h];A===114?T=" ".repeat(k):A===99?k%2?(T=" ".repeat(k/2+.5),N=" ".repeat(k/2-.5)):(T=" ".repeat(k/2),N=T):N=" ".repeat(k)}n.delimiterStart!==!1&&!h&&b.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||h)&&b.push(" "),n.alignDelimiters!==!1&&b.push(T),b.push(v),n.alignDelimiters!==!1&&b.push(N),n.padding!==!1&&b.push(" "),(n.delimiterEnd!==!1||h!==u-1)&&b.push("|")}p.push(n.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return p.join(`
|
|
492
|
+
`)}function ck(e){return e==null?"":String(e)}function Sf(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 Af={}.hasOwnProperty;function e2(e,t){const n=t||{};function r(a,...i){let s=r.invalid;const o=r.handlers;if(a&&Af.call(a,e)){const l=String(a[e]);s=Af.call(o,l)?o[l]:r.unknown}if(s)return s.call(this,a,...i)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}function dk(e,t,n,r){const a=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const s=n.indentLines(n.containerFlow(e,i.current()),hk);return a(),s}function hk(e,t,n){return">"+(n?"":" ")+e}function fk(e,t){return Cf(e,t.inConstruct,!0)&&!Cf(e,t.notInConstruct,!1)}function Cf(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 Nf(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
|
|
493
|
+
`&&fk(n.stack,n.unsafe[a]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
494
|
+
`}function t2(e,t){const n=String(e);let r=n.indexOf(t),a=r,i=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===a?++i>s&&(s=i):i=1,a=r+t.length,r=n.indexOf(t,a);return s}function mk(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 pk(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 gk(e,t,n,r){const a=pk(n),i=e.value||"",s=a==="`"?"GraveAccent":"Tilde";if(mk(e,n)){const h=n.enter("codeIndented"),m=n.indentLines(i,xk);return h(),m}const o=n.createTracker(r),l=a.repeat(Math.max(t2(i,a)+1,3)),u=n.enter("codeFenced");let c=o.move(l);if(e.lang){const h=n.enter(`codeFencedLang${s}`);c+=o.move(n.safe(e.lang,{before:c,after:" ",encode:["`"],...o.current()})),h()}if(e.lang&&e.meta){const h=n.enter(`codeFencedMeta${s}`);c+=o.move(" "),c+=o.move(n.safe(e.meta,{before:c,after:`
|
|
495
|
+
`,encode:["`"],...o.current()})),h()}return c+=o.move(`
|
|
496
|
+
`),i&&(c+=o.move(i+`
|
|
497
|
+
`)),c+=o.move(l),u(),c}function xk(e,t,n){return(n?"":" ")+e}function od(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 bk(e,t,n,r){const a=od(n),i=a==='"'?"Quote":"Apostrophe",s=n.enter("definition");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":`
|
|
498
|
+
`,...l.current()}))),o(),e.title&&(o=n.enter(`title${i}`),u+=l.move(" "+a),u+=l.move(n.safe(e.title,{before:u,after:a,...l.current()})),u+=l.move(a),o()),s(),u}function yk(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 rs(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Lo(e,t,n){const r=Ka(e),a=Ka(t);return r===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}n2.peek=vk;function n2(e,t,n,r){const a=yk(n),i=n.enter("emphasis"),s=n.createTracker(r),o=s.move(a);let l=s.move(n.containerPhrasing(e,{after:a,before:o,...s.current()}));const u=l.charCodeAt(0),c=Lo(r.before.charCodeAt(r.before.length-1),u,a);c.inside&&(l=rs(u)+l.slice(1));const h=l.charCodeAt(l.length-1),m=Lo(r.after.charCodeAt(0),h,a);m.inside&&(l=l.slice(0,-1)+rs(h));const d=s.move(a);return i(),n.attentionEncodeSurroundingInfo={after:m.outside,before:c.outside},o+l+d}function vk(e,t,n){return n.options.emphasis||"*"}function wk(e,t){let n=!1;return dl(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Cc}),!!((!e.depth||e.depth<3)&&Z0(e)&&(t.options.setext||n))}function kk(e,t,n,r){const a=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(wk(e,n)){const c=n.enter("headingSetext"),h=n.enter("phrasing"),m=n.containerPhrasing(e,{...i.current(),before:`
|
|
499
|
+
`,after:`
|
|
500
|
+
`});return h(),c(),m+`
|
|
501
|
+
`+(a===1?"=":"-").repeat(m.length-(Math.max(m.lastIndexOf("\r"),m.lastIndexOf(`
|
|
502
|
+
`))+1))}const s="#".repeat(a),o=n.enter("headingAtx"),l=n.enter("phrasing");i.move(s+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
|
|
503
|
+
`,...i.current()});return/^[\t ]/.test(u)&&(u=rs(u.charCodeAt(0))+u.slice(1)),u=u?s+" "+u:s,n.options.closeAtx&&(u+=" "+s),l(),o(),u}r2.peek=Tk;function r2(e){return e.value||""}function Tk(){return"<"}a2.peek=Ek;function a2(e,t,n,r){const a=od(n),i=a==='"'?"Quote":"Apostrophe",s=n.enter("image");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=n.enter(`title${i}`),u+=l.move(" "+a),u+=l.move(n.safe(e.title,{before:u,after:a,...l.current()})),u+=l.move(a),o()),u+=l.move(")"),s(),u}function Ek(){return"!"}i2.peek=Sk;function i2(e,t,n,r){const a=e.referenceType,i=n.enter("imageReference");let s=n.enter("label");const o=n.createTracker(r);let l=o.move("![");const u=n.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),s();const c=n.stack;n.stack=[],s=n.enter("reference");const h=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return s(),n.stack=c,i(),a==="full"||!u||u!==h?l+=o.move(h+"]"):a==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function Sk(){return"!"}s2.peek=Ak;function s2(e,t,n){let r=e.value||"",a="`",i=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(r);)a+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const s=n.unsafe[i],o=n.compilePattern(s);let l;if(s.atBreak)for(;l=o.exec(r);){let u=l.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(l.index+1)}}return a+r+a}function Ak(){return"`"}function o2(e,t){const n=Z0(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))}l2.peek=Ck;function l2(e,t,n,r){const a=od(n),i=a==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let o,l;if(o2(e,n)){const c=n.stack;n.stack=[],o=n.enter("autolink");let h=s.move("<");return h+=s.move(n.containerPhrasing(e,{before:h,after:">",...s.current()})),h+=s.move(">"),o(),n.stack=c,h}o=n.enter("link"),l=n.enter("label");let u=s.move("[");return u+=s.move(n.containerPhrasing(e,{before:u,after:"](",...s.current()})),u+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(n.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(l=n.enter("destinationRaw"),u+=s.move(n.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=n.enter(`title${i}`),u+=s.move(" "+a),u+=s.move(n.safe(e.title,{before:u,after:a,...s.current()})),u+=s.move(a),l()),u+=s.move(")"),o(),u}function Ck(e,t,n){return o2(e,n)?"<":"["}u2.peek=Nk;function u2(e,t,n,r){const a=e.referenceType,i=n.enter("linkReference");let s=n.enter("label");const o=n.createTracker(r);let l=o.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),s();const c=n.stack;n.stack=[],s=n.enter("reference");const h=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return s(),n.stack=c,i(),a==="full"||!u||u!==h?l+=o.move(h+"]"):a==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function Nk(){return"["}function ld(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 Mk(e){const t=ld(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 Ik(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 c2(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 _k(e,t,n,r){const a=n.enter("list"),i=n.bulletCurrent;let s=e.ordered?Ik(n):ld(n);const o=e.ordered?s==="."?")":".":Mk(n);let l=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const c=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&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&&(l=!0),c2(n)===s&&c){let h=-1;for(;++h<e.children.length;){const m=e.children[h];if(m&&m.type==="listItem"&&m.children&&m.children[0]&&m.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(s=o),n.bulletCurrent=s;const u=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=i,a(),u}function Rk(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 Lk(e,t,n,r){const a=Rk(n);let i=n.bulletCurrent||ld(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 s=i.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const o=n.createTracker(r);o.move(i+" ".repeat(s-i.length)),o.shift(s);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,o.current()),c);return l(),u;function c(h,m,d){return m?(d?"":" ".repeat(s))+h:(d?i:i+" ".repeat(s-i.length))+h}}function Dk(e,t,n,r){const a=n.enter("paragraph"),i=n.enter("phrasing"),s=n.containerPhrasing(e,r);return i(),a(),s}const Pk=bs(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Ok(e,t,n,r){return(e.children.some(function(s){return Pk(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function jk(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}d2.peek=Bk;function d2(e,t,n,r){const a=jk(n),i=n.enter("strong"),s=n.createTracker(r),o=s.move(a+a);let l=s.move(n.containerPhrasing(e,{after:a,before:o,...s.current()}));const u=l.charCodeAt(0),c=Lo(r.before.charCodeAt(r.before.length-1),u,a);c.inside&&(l=rs(u)+l.slice(1));const h=l.charCodeAt(l.length-1),m=Lo(r.after.charCodeAt(0),h,a);m.inside&&(l=l.slice(0,-1)+rs(h));const d=s.move(a+a);return i(),n.attentionEncodeSurroundingInfo={after:m.outside,before:c.outside},o+l+d}function Bk(e,t,n){return n.options.strong||"*"}function Fk(e,t,n,r){return n.safe(e.value,r)}function zk(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 Hk(e,t,n){const r=(c2(n)+(n.options.ruleSpaces?" ":"")).repeat(zk(n));return n.options.ruleSpaces?r.slice(0,-1):r}const h2={blockquote:dk,break:Nf,code:gk,definition:bk,emphasis:n2,hardBreak:Nf,heading:kk,html:r2,image:a2,imageReference:i2,inlineCode:s2,link:l2,linkReference:u2,list:_k,listItem:Lk,paragraph:Dk,root:Ok,strong:d2,text:Fk,thematicBreak:Hk};function Uk(){return{enter:{table:qk,tableData:Mf,tableHeader:Mf,tableRow:$k},exit:{codeText:Wk,table:Vk,tableData:pu,tableHeader:pu,tableRow:pu}}}function qk(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 Vk(e){this.exit(e),this.data.inTable=void 0}function $k(e){this.enter({type:"tableRow",children:[]},e)}function pu(e){this.exit(e)}function Mf(e){this.enter({type:"tableCell",children:[]},e)}function Wk(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Gk));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Gk(e,t){return t==="|"?t:e}function Yk(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,a=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
504
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:s,tableCell:l,tableRow:o}};function s(d,p,g,x){return u(c(d,g,x),d.align)}function o(d,p,g,x){const b=h(d,g,x),v=u([b]);return v.slice(0,v.indexOf(`
|
|
505
|
+
`))}function l(d,p,g,x){const b=g.enter("tableCell"),v=g.enter("phrasing"),T=g.containerPhrasing(d,{...x,before:i,after:i});return v(),b(),T}function u(d,p){return uk(d,{align:p,alignDelimiters:r,padding:n,stringLength:a})}function c(d,p,g){const x=d.children;let b=-1;const v=[],T=p.enter("table");for(;++b<x.length;)v[b]=h(x[b],p,g);return T(),v}function h(d,p,g){const x=d.children;let b=-1;const v=[],T=p.enter("tableRow");for(;++b<x.length;)v[b]=l(x[b],d,p,g);return T(),v}function m(d,p,g){let x=h2.inlineCode(d,p,g);return g.stack.includes("tableCell")&&(x=x.replace(/\|/g,"\\$&")),x}}function Kk(){return{exit:{taskListCheckValueChecked:If,taskListCheckValueUnchecked:If,paragraph:Qk}}}function Xk(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Zk}}}function If(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Qk(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 a=t.children;let i=-1,s;for(;++i<a.length;){const o=a[i];if(o.type==="paragraph"){s=o;break}}s===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 Zk(e,t,n,r){const a=e.children[0],i=typeof e.checked=="boolean"&&a&&a.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);i&&o.move(s);let l=h2.listItem(e,t,n,{...r,...o.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(c){return c+s}}function Jk(){return[Rw(),Jw(),rk(),Uk(),Kk()]}function e9(e){return{extensions:[Lw(),ek(e),ak(),Yk(e),Xk()]}}const t9={tokenize:o9,partial:!0},f2={tokenize:l9,partial:!0},m2={tokenize:u9,partial:!0},p2={tokenize:c9,partial:!0},n9={tokenize:d9,partial:!0},g2={name:"wwwAutolink",tokenize:i9,previous:b2},x2={name:"protocolAutolink",tokenize:s9,previous:y2},kr={name:"emailAutolink",tokenize:a9,previous:v2},ur={};function r9(){return{text:ur}}let ea=48;for(;ea<123;)ur[ea]=kr,ea++,ea===58?ea=65:ea===91&&(ea=97);ur[43]=kr;ur[45]=kr;ur[46]=kr;ur[95]=kr;ur[72]=[kr,x2];ur[104]=[kr,x2];ur[87]=[kr,g2];ur[119]=[kr,g2];function a9(e,t,n){const r=this;let a,i;return s;function s(h){return!_c(h)||!v2.call(r,r.previous)||ud(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(h))}function o(h){return _c(h)?(e.consume(h),o):h===64?(e.consume(h),l):n(h)}function l(h){return h===46?e.check(n9,c,u)(h):h===45||h===95||rn(h)?(i=!0,e.consume(h),l):c(h)}function u(h){return e.consume(h),a=!0,l}function c(h){return i&&a&&dn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function i9(e,t,n){const r=this;return a;function a(s){return s!==87&&s!==119||!b2.call(r,r.previous)||ud(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(t9,e.attempt(f2,e.attempt(m2,i),n),n)(s))}function i(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function s9(e,t,n){const r=this;let a="",i=!1;return s;function s(h){return(h===72||h===104)&&y2.call(r,r.previous)&&!ud(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(h),e.consume(h),o):n(h)}function o(h){if(dn(h)&&a.length<5)return a+=String.fromCodePoint(h),e.consume(h),o;if(h===58){const m=a.toLowerCase();if(m==="http"||m==="https")return e.consume(h),l}return n(h)}function l(h){return h===47?(e.consume(h),i?u:(i=!0,l)):n(h)}function u(h){return h===null||_o(h)||vt(h)||wa(h)||ol(h)?n(h):e.attempt(f2,e.attempt(m2,c),n)(h)}function c(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function o9(e,t,n){let r=0;return a;function a(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),a):s===46&&r===3?(e.consume(s),i):n(s)}function i(s){return s===null?n(s):t(s)}}function l9(e,t,n){let r,a,i;return s;function s(u){return u===46||u===95?e.check(p2,l,o)(u):u===null||vt(u)||wa(u)||u!==45&&ol(u)?l(u):(i=!0,e.consume(u),s)}function o(u){return u===95?r=!0:(a=r,r=void 0),e.consume(u),s}function l(u){return a||r||!i?n(u):t(u)}}function u9(e,t){let n=0,r=0;return a;function a(s){return s===40?(n++,e.consume(s),a):s===41&&r<n?i(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(p2,t,i)(s):s===null||vt(s)||wa(s)?t(s):(e.consume(s),a)}function i(s){return s===41&&r++,e.consume(s),a}}function c9(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),a):o===60||o===null||vt(o)||wa(o)?t(o):n(o)}function a(o){return o===null||o===40||o===91||vt(o)||wa(o)?t(o):r(o)}function i(o){return dn(o)?s(o):n(o)}function s(o){return o===59?(e.consume(o),r):dn(o)?(e.consume(o),s):n(o)}}function d9(e,t,n){return r;function r(i){return e.consume(i),a}function a(i){return rn(i)?n(i):t(i)}}function b2(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||vt(e)}function y2(e){return!dn(e)}function v2(e){return!(e===47||_c(e))}function _c(e){return e===43||e===45||e===46||e===95||rn(e)}function ud(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 h9={tokenize:v9,partial:!0};function f9(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:x9,continuation:{tokenize:b9},exit:y9}},text:{91:{name:"gfmFootnoteCall",tokenize:g9},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:m9,resolveTo:p9}}}}function m9(e,t,n){const r=this;let a=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;a--;){const l=r.events[a][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!s||!s._balanced)return n(l);const u=Gn(r.sliceSerialize({start:s.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function p9(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)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},s={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",a,t],["exit",a,t],["enter",i,t],["enter",s,t],["exit",s,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 g9(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,s;return o;function o(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),l}function l(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(h){if(i>999||h===93&&!s||h===null||h===91||vt(h))return n(h);if(h===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return a.includes(Gn(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return vt(h)||(s=!0),i++,e.consume(h),h===92?c:u}function c(h){return h===91||h===92||h===93?(e.consume(h),i++,u):u(h)}}function x9(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,s=0,o;return l;function l(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(p)}function c(p){if(s>999||p===93&&!o||p===null||p===91||vt(p))return n(p);if(p===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return i=Gn(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return vt(p)||(o=!0),s++,e.consume(p),p===92?h:c}function h(p){return p===91||p===92||p===93?(e.consume(p),s++,c):c(p)}function m(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),a.includes(i)||a.push(i),it(e,d,"gfmFootnoteDefinitionWhitespace")):n(p)}function d(p){return t(p)}}function b9(e,t,n){return e.check(xs,t,e.attempt(h9,t,n))}function y9(e){e.exit("gfmFootnoteDefinition")}function v9(e,t,n){const r=this;return it(e,a,"gfmFootnoteDefinitionIndent",5);function a(i){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(i):n(i)}}function w9(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:a};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function a(s,o){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let u=l;for(;u--;)if(s[u][0]==="exit"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[u][1].end.offset-s[u][1].start.offset){s[l][1].type="strikethroughSequence",s[u][1].type="strikethroughSequence";const c={type:"strikethrough",start:Object.assign({},s[u][1].start),end:Object.assign({},s[l][1].end)},h={type:"strikethroughText",start:Object.assign({},s[u][1].end),end:Object.assign({},s[l][1].start)},m=[["enter",c,o],["enter",s[u][1],o],["exit",s[u][1],o],["enter",h,o]],d=o.parser.constructs.insideSpan.null;d&&En(m,m.length,0,ll(d,s.slice(u+1,l),o)),En(m,m.length,0,[["exit",h,o],["enter",s[l][1],o],["exit",s[l][1],o],["exit",c,o]]),En(s,u-1,l-u+3,m),l=u+m.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function i(s,o,l){const u=this.previous,c=this.events;let h=0;return m;function m(p){return u===126&&c[c.length-1][1].type!=="characterEscape"?l(p):(s.enter("strikethroughSequenceTemporary"),d(p))}function d(p){const g=Ka(u);if(p===126)return h>1?l(p):(s.consume(p),h++,d);if(h<2&&!n)return l(p);const x=s.exit("strikethroughSequenceTemporary"),b=Ka(p);return x._open=!b||b===2&&!!g,x._close=!g||g===2&&!!b,o(p)}}}class k9{constructor(){this.map=[]}add(t,n,r){T9(this,t,n,r)}consume(t){if(this.map.sort(function(i,s){return i[0]-s[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 a=r.pop();for(;a;){for(const i of a)t.push(i);a=r.pop()}this.map.length=0}}function T9(e,t,n,r){let a=0;if(!(n===0&&r.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...r);return}a+=1}e.map.push([t,n,r])}}function E9(e,t){let n=!1;const r=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function S9(){return{flow:{null:{name:"table",tokenize:A9,resolveAll:C9}}}}function A9(e,t,n){const r=this;let a=0,i=0,s;return o;function o(C){let D=r.events.length-1;for(;D>-1;){const O=r.events[D][1].type;if(O==="lineEnding"||O==="linePrefix")D--;else break}const L=D>-1?r.events[D][1].type:null,F=L==="tableHead"||L==="tableRow"?A:l;return F===A&&r.parser.lazy[r.now().line]?n(C):F(C)}function l(C){return e.enter("tableHead"),e.enter("tableRow"),u(C)}function u(C){return C===124||(s=!0,i+=1),c(C)}function c(C){return C===null?n(C):Fe(C)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),d):n(C):lt(C)?it(e,c,"whitespace")(C):(i+=1,s&&(s=!1,a+=1),C===124?(e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),s=!0,c):(e.enter("data"),h(C)))}function h(C){return C===null||C===124||vt(C)?(e.exit("data"),c(C)):(e.consume(C),C===92?m:h)}function m(C){return C===92||C===124?(e.consume(C),h):h(C)}function d(C){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(C):(e.enter("tableDelimiterRow"),s=!1,lt(C)?it(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):p(C))}function p(C){return C===45||C===58?x(C):C===124?(s=!0,e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),g):k(C)}function g(C){return lt(C)?it(e,x,"whitespace")(C):x(C)}function x(C){return C===58?(i+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(C),e.exit("tableDelimiterMarker"),b):C===45?(i+=1,b(C)):C===null||Fe(C)?N(C):k(C)}function b(C){return C===45?(e.enter("tableDelimiterFiller"),v(C)):k(C)}function v(C){return C===45?(e.consume(C),v):C===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(C),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(C))}function T(C){return lt(C)?it(e,N,"whitespace")(C):N(C)}function N(C){return C===124?p(C):C===null||Fe(C)?!s||a!==i?k(C):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(C)):k(C)}function k(C){return n(C)}function A(C){return e.enter("tableRow"),_(C)}function _(C){return C===124?(e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),_):C===null||Fe(C)?(e.exit("tableRow"),t(C)):lt(C)?it(e,_,"whitespace")(C):(e.enter("data"),S(C))}function S(C){return C===null||C===124||vt(C)?(e.exit("data"),_(C)):(e.consume(C),C===92?I:S)}function I(C){return C===92||C===124?(e.consume(C),S):S(C)}}function C9(e,t){let n=-1,r=!0,a=0,i=[0,0,0,0],s=[0,0,0,0],o=!1,l=0,u,c,h;const m=new k9;for(;++n<e.length;){const d=e[n],p=d[1];d[0]==="enter"?p.type==="tableHead"?(o=!1,l!==0&&(_f(m,t,l,u,c),c=void 0,l=0),u={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},m.add(n,0,[["enter",u,t]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(r=!0,h=void 0,i=[0,0,0,0],s=[0,n+1,0,0],o&&(o=!1,c={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},m.add(n,0,[["enter",c,t]])),a=p.type==="tableDelimiterRow"?2:c?3:1):a&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(i[1]!==0&&(s[0]=s[1],h=Fs(m,t,i,a,void 0,h),i=[0,0,0,0]),s[2]=n)):p.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(s[0]=s[1],h=Fs(m,t,i,a,void 0,h)),i=s,s=[i[1],n,0,0])):p.type==="tableHead"?(o=!0,l=n):p.type==="tableRow"||p.type==="tableDelimiterRow"?(l=n,i[1]!==0?(s[0]=s[1],h=Fs(m,t,i,a,n,h)):s[1]!==0&&(h=Fs(m,t,s,a,n,h)),a=0):a&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&_f(m,t,l,u,c),m.consume(t.events),n=-1;++n<t.events.length;){const d=t.events[n];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=E9(t.events,n))}return e}function Fs(e,t,n,r,a,i){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(i.end=Object.assign({},ja(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const l=ja(t.events,n[1]);if(i={type:s,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",i,t]]),n[2]!==0){const u=ja(t.events,n[2]),c=ja(t.events,n[3]),h={type:o,start:Object.assign({},u),end:Object.assign({},c)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const m=t.events[n[2]],d=t.events[n[3]];if(m[1].end=Object.assign({},d[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){const p=n[2]+1,g=n[3]-n[2]-1;e.add(p,g,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return a!==void 0&&(i.end=Object.assign({},ja(t.events,a)),e.add(a,0,[["exit",i,t]]),i=void 0),i}function _f(e,t,n,r,a){const i=[],s=ja(t.events,n);a&&(a.end=Object.assign({},s),i.push(["exit",a,t])),r.end=Object.assign({},s),i.push(["exit",r,t]),e.add(n+1,0,i)}function ja(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const N9={name:"tasklistCheck",tokenize:I9};function M9(){return{text:{91:N9}}}function I9(e,t,n){const r=this;return a;function a(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),i)}function i(l){return vt(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(l)}function o(l){return Fe(l)?t(l):lt(l)?e.check({tokenize:_9},t,n)(l):n(l)}}function _9(e,t,n){return it(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function R9(e){return Cg([r9(),f9(),w9(e),S9(),M9()])}const L9={};function w2(e){const t=this,n=e||L9,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(R9(n)),i.push(Jk()),s.push(e9(n))}function D9(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:i},exit:{mathFlow:a,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:o,mathText:s,mathTextData:o}};function e(l){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},l)}function t(){this.buffer()}function n(){const l=this.resume(),u=this.stack[this.stack.length-1];u.type,u.meta=l}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function a(l){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),c=this.stack[this.stack.length-1];c.type,this.exit(l),c.value=u;const h=c.data.hChildren[0];h.type,h.tagName,h.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function i(l){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},l),this.buffer()}function s(l){const u=this.resume(),c=this.stack[this.stack.length-1];c.type,this.exit(l),c.value=u,c.data.hChildren.push({type:"text",value:u})}function o(l){this.config.enter.data.call(this,l),this.config.exit.data.call(this,l)}}function P9(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=a,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
|
|
506
|
+
`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(i,s,o,l){const u=i.value||"",c=o.createTracker(l),h="$".repeat(Math.max(t2(u,"$")+1,2)),m=o.enter("mathFlow");let d=c.move(h);if(i.meta){const p=o.enter("mathFlowMeta");d+=c.move(o.safe(i.meta,{after:`
|
|
507
|
+
`,before:d,encode:["$"],...c.current()})),p()}return d+=c.move(`
|
|
508
|
+
`),u&&(d+=c.move(u+`
|
|
509
|
+
`)),d+=c.move(h),m(),d}function r(i,s,o){let l=i.value||"",u=1;for(t||u++;new RegExp("(^|[^$])"+"\\$".repeat(u)+"([^$]|$)").test(l);)u++;const c="$".repeat(u);/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^\$|\$$/.test(l))&&(l=" "+l+" ");let h=-1;for(;++h<o.unsafe.length;){const m=o.unsafe[h];if(!m.atBreak)continue;const d=o.compilePattern(m);let p;for(;p=d.exec(l);){let g=p.index;l.codePointAt(g)===10&&l.codePointAt(g-1)===13&&g--,l=l.slice(0,g)+" "+l.slice(p.index+1)}}return c+l+c}function a(){return"$"}}const O9={tokenize:j9,concrete:!0,name:"mathFlow"},Rf={tokenize:B9,partial:!0};function j9(e,t,n){const r=this,a=r.events[r.events.length-1],i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0;let s=0;return o;function o(v){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),l(v)}function l(v){return v===36?(e.consume(v),s++,l):s<2?n(v):(e.exit("mathFlowFenceSequence"),it(e,u,"whitespace")(v))}function u(v){return v===null||Fe(v)?h(v):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),c(v))}function c(v){return v===null||Fe(v)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),h(v)):v===36?n(v):(e.consume(v),c)}function h(v){return e.exit("mathFlowFence"),r.interrupt?t(v):e.attempt(Rf,m,x)(v)}function m(v){return e.attempt({tokenize:b,partial:!0},x,d)(v)}function d(v){return(i?it(e,p,"linePrefix",i+1):p)(v)}function p(v){return v===null?x(v):Fe(v)?e.attempt(Rf,m,x)(v):(e.enter("mathFlowValue"),g(v))}function g(v){return v===null||Fe(v)?(e.exit("mathFlowValue"),p(v)):(e.consume(v),g)}function x(v){return e.exit("mathFlow"),t(v)}function b(v,T,N){let k=0;return it(v,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function A(I){return v.enter("mathFlowFence"),v.enter("mathFlowFenceSequence"),_(I)}function _(I){return I===36?(k++,v.consume(I),_):k<s?N(I):(v.exit("mathFlowFenceSequence"),it(v,S,"whitespace")(I))}function S(I){return I===null||Fe(I)?(v.exit("mathFlowFence"),T(I)):N(I)}}}function B9(e,t,n){const r=this;return a;function a(s){return s===null?t(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function F9(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),{tokenize:r,resolve:z9,previous:H9,name:"mathText"};function r(a,i,s){let o=0,l,u;return c;function c(g){return a.enter("mathText"),a.enter("mathTextSequence"),h(g)}function h(g){return g===36?(a.consume(g),o++,h):o<2&&!n?s(g):(a.exit("mathTextSequence"),m(g))}function m(g){return g===null?s(g):g===36?(u=a.enter("mathTextSequence"),l=0,p(g)):g===32?(a.enter("space"),a.consume(g),a.exit("space"),m):Fe(g)?(a.enter("lineEnding"),a.consume(g),a.exit("lineEnding"),m):(a.enter("mathTextData"),d(g))}function d(g){return g===null||g===32||g===36||Fe(g)?(a.exit("mathTextData"),m(g)):(a.consume(g),d)}function p(g){return g===36?(a.consume(g),l++,p):l===o?(a.exit("mathTextSequence"),a.exit("mathText"),i(g)):(u.type="mathTextData",d(g))}}}function z9(e){let t=e.length-4,n=3,r,a;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==="mathTextData"){e[t][1].type="mathTextPadding",e[n][1].type="mathTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="mathTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function H9(e){return e!==36||this.events[this.events.length-1][1].type==="characterEscape"}function U9(e){return{flow:{36:O9},text:{36:F9(e)}}}const q9={};function k2(e){const t=this,n=e||q9,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(U9(n)),i.push(D9()),s.push(P9(n))}const Lf=/[#.]/g;function V9(e,t){const n=e||"",r={};let a=0,i,s;for(;a<n.length;){Lf.lastIndex=a;const o=Lf.exec(n),l=n.slice(a,o?o.index:n.length);l&&(i?i==="#"?r.id=l:Array.isArray(r.className)?r.className.push(l):r.className=[l]:s=l,a+=l.length),o&&(i=o[0],a++)}return{type:"element",tagName:s||t||"div",properties:r,children:[]}}function T2(e,t,n){const r=n?Y9(n):void 0;function a(i,s,...o){let l;if(i==null){l={type:"root",children:[]};const u=s;o.unshift(u)}else{l=V9(i,t);const u=l.tagName.toLowerCase(),c=r?r.get(u):void 0;if(l.tagName=c||u,$9(s))o.unshift(s);else for(const[h,m]of Object.entries(s))W9(e,l.properties,h,m)}for(const u of o)Rc(l.children,u);return l.type==="element"&&l.tagName==="template"&&(l.content={type:"root",children:l.children},l.children=[]),l}return a}function $9(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 a=t[r];if(a&&typeof a=="object"){if(!Array.isArray(a))return!0;const i=a;for(const s of i)if(typeof s!="number"&&typeof s!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function W9(e,t,n,r){const a=il(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"?a.spaceSeparated?i=Vh(r):a.commaSeparated?i=Fh(r):a.commaOrSpaceSeparated?i=Vh(Fh(r).join(" ")):i=Df(a,a.property,r):Array.isArray(r)?i=[...r]:i=a.property==="style"?G9(r):String(r);if(Array.isArray(i)){const s=[];for(const o of i)s.push(Df(a,a.property,o));i=s}a.property==="className"&&Array.isArray(t.className)&&(i=t.className.concat(i)),t[a.property]=i}}function Rc(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)Rc(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?Rc(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function Df(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||ts(n)===ts(t)))return!0}return n}function G9(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function Y9(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const K9=["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"],E2=T2(gs,"div"),S2=T2(Vr,"g",K9),rr={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/"};function X9(e,t){return A2(e,{})||{type:"root",children:[]}}function A2(e,t){const n=Q9(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function Q9(e,t){switch(e.nodeType){case 1:return tT(e,t);case 3:return J9(e);case 8:return eT(e);case 9:return Pf(e,t);case 10:return Z9();case 11:return Pf(e,t);default:return}}function Pf(e,t){return{type:"root",children:C2(e,t)}}function Z9(){return{type:"doctype"}}function J9(e){return{type:"text",value:e.nodeValue||""}}function eT(e){return{type:"comment",value:e.nodeValue||""}}function tT(e,t){const n=e.namespaceURI,r=n===rr.svg?S2:E2,a=n===rr.html?e.tagName.toLowerCase():e.tagName,i=n===rr.html&&a==="template"?e.content:e,s=e.getAttributeNames(),o={};let l=-1;for(;++l<s.length;)o[s[l]]=e.getAttribute(s[l])||"";return r(a,o,C2(i,t))}function C2(e,t){const n=e.childNodes,r=[];let a=-1;for(;++a<n.length;){const i=A2(n[a],t);i!==void 0&&r.push(i)}return r}new DOMParser;function nT(e,t){const n=rT(e);return X9(n)}function rT(e){const t=document.createElement("template");return t.innerHTML=e,t.content}const Of=(function(e,t,n){const r=bs(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),Ea=(function(e){if(e==null)return sT;if(typeof e=="string")return iT(e);if(typeof e=="object")return aT(e);if(typeof e=="function")return cd(e);throw new Error("Expected function, string, or array as `test`")});function aT(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ea(e[n]);return cd(r);function r(...a){let i=-1;for(;++i<t.length;)if(t[i].apply(this,a))return!0;return!1}}function iT(e){return cd(t);function t(n){return n.tagName===e}}function cd(e){return t;function t(n,r,a){return!!(oT(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function sT(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function oT(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const jf=/\n/g,Bf=/[\t ]+/g,Lc=Ea("br"),Ff=Ea(pT),lT=Ea("p"),zf=Ea("tr"),uT=Ea(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",mT,gT]),N2=Ea(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function cT(e,t){const n=t||{},r="children"in e?e.children:[],a=N2(e),i=_2(e,{whitespace:n.whitespace||"normal"}),s=[];(e.type==="text"||e.type==="comment")&&s.push(...I2(e,{breakBefore:!0,breakAfter:!0}));let o=-1;for(;++o<r.length;)s.push(...M2(r[o],e,{whitespace:i,breakBefore:o?void 0:a,breakAfter:o<r.length-1?Lc(r[o+1]):a}));const l=[];let u;for(o=-1;++o<s.length;){const c=s[o];typeof c=="number"?u!==void 0&&c>u&&(u=c):c&&(u!==void 0&&u>-1&&l.push(`
|
|
510
|
+
`.repeat(u)||" "),u=-1,l.push(c))}return l.join("")}function M2(e,t,n){return e.type==="element"?dT(e,t,n):e.type==="text"?n.whitespace==="normal"?I2(e,n):hT(e):[]}function dT(e,t,n){const r=_2(e,n),a=e.children||[];let i=-1,s=[];if(uT(e))return s;let o,l;for(Lc(e)||zf(e)&&Of(t,e,zf)?l=`
|
|
511
|
+
`:lT(e)?(o=2,l=2):N2(e)&&(o=1,l=1);++i<a.length;)s=s.concat(M2(a[i],e,{whitespace:r,breakBefore:i?void 0:o,breakAfter:i<a.length-1?Lc(a[i+1]):l}));return Ff(e)&&Of(t,e,Ff)&&s.push(" "),o&&s.unshift(o),l&&s.push(l),s}function I2(e,t){const n=String(e.value),r=[],a=[];let i=0;for(;i<=n.length;){jf.lastIndex=i;const l=jf.exec(n),u=l&&"index"in l?l.index:n.length;r.push(fT(n.slice(i,u).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),i===0?t.breakBefore:!0,u===n.length?t.breakAfter:!0)),i=u+1}let s=-1,o;for(;++s<r.length;)r[s].charCodeAt(r[s].length-1)===8203||s<r.length-1&&r[s+1].charCodeAt(0)===8203?(a.push(r[s]),o=void 0):r[s]?(typeof o=="number"&&a.push(o),a.push(r[s]),o=0):(s===0||s===r.length-1)&&a.push(0);return a}function hT(e){return[String(e.value)]}function fT(e,t,n){const r=[];let a=0,i;for(;a<e.length;){Bf.lastIndex=a;const s=Bf.exec(e);i=s?s.index:e.length,!a&&!i&&s&&!t&&r.push(""),a!==i&&r.push(e.slice(a,i)),a=s?i+s[0].length:i}return a!==i&&!n&&r.push(""),r.join(" ")}function _2(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function mT(e){return!!(e.properties||{}).hidden}function pT(e){return e.tagName==="td"||e.tagName==="th"}function gT(e){return e.tagName==="dialog"&&!(e.properties||{}).open}class Te extends Error{constructor(t,n){var r="KaTeX parse error: "+t,a,i,s=n&&n.loc;if(s&&s.start<=s.end){var o=s.lexer.input;a=s.start,i=s.end,a===o.length?r+=" at end of input: ":r+=" at position "+(a+1)+": ";var l=o.slice(a,i).replace(/[^]/g,"$&̲"),u;a>15?u="…"+o.slice(a-15,a):u=o.slice(0,a);var c;i+15<o.length?c=o.slice(i,i+15)+"…":c=o.slice(i),r+=u+l+c}super(r),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,Te.prototype),this.position=a,a!=null&&i!=null&&(this.length=i-a),this.rawMessage=t}}var xT=/([A-Z])/g,bT=e=>e.replace(xT,"-$1").toLowerCase(),yT={"&":"&",">":">","<":"<",'"':""","'":"'"},vT=/[&><"']/g,an=e=>String(e).replace(vT,t=>yT[t]),co=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?co(e.body[0]):e:e.type==="font"?co(e.body):e,wT=new Set(["mathord","textord","atom"]),Tr=e=>wT.has(co(e).type),kT=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():"_relative"},Dc={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function TT(e){if(typeof e!="string")return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function ET(e){if(e.default!==void 0)return e.default;var t=Array.isArray(e.type)?e.type[0]:e.type;return TT(t)}function ST(e,t,n,r){var a=n[t];e[t]=a!==void 0?r.processor?r.processor(a):a:ET(r)}class dd{constructor(t){t===void 0&&(t={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,t=t||{};for(var n of Object.keys(Dc)){var r=Dc[n];r&&ST(this,n,t,r)}}reportNonstrict(t,n,r){var a=this.strict;if(typeof a=="function"&&(a=a(t,n,r)),!(!a||a==="ignore")){if(a===!0||a==="error")throw new Te("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+t+"]"),r);a==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+a+"': "+n+" ["+t+"]"))}}useStrictBehavior(t,n,r){var a=this.strict;if(typeof a=="function")try{a=a(t,n,r)}catch{a="error"}return!a||a==="ignore"?!1:a===!0||a==="error"?!0:a==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+a+"': "+n+" ["+t+"]")),!1)}isTrusted(t){if("url"in t&&t.url&&!t.protocol){var n=kT(t.url);if(n==null)return!1;t.protocol=n}var r=typeof this.trust=="function"?this.trust(t):this.trust;return!!r}}class Nr{constructor(t,n,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=n,this.cramped=r}sup(){return Jn[AT[this.id]]}sub(){return Jn[CT[this.id]]}fracNum(){return Jn[NT[this.id]]}fracDen(){return Jn[MT[this.id]]}cramp(){return Jn[IT[this.id]]}text(){return Jn[_T[this.id]]}isTight(){return this.size>=2}}var hd=0,Do=1,Va=2,yr=3,as=4,Pn=5,Xa=6,hn=7,Jn=[new Nr(hd,0,!1),new Nr(Do,0,!0),new Nr(Va,1,!1),new Nr(yr,1,!0),new Nr(as,2,!1),new Nr(Pn,2,!0),new Nr(Xa,3,!1),new Nr(hn,3,!0)],AT=[as,Pn,as,Pn,Xa,hn,Xa,hn],CT=[Pn,Pn,Pn,Pn,hn,hn,hn,hn],NT=[Va,yr,as,Pn,Xa,hn,Xa,hn],MT=[yr,yr,Pn,Pn,hn,hn,hn,hn],IT=[Do,Do,yr,yr,Pn,Pn,hn,hn],_T=[hd,Do,Va,yr,Va,yr,Va,yr],Ke={DISPLAY:Jn[hd],TEXT:Jn[Va],SCRIPT:Jn[as],SCRIPTSCRIPT:Jn[Xa]},Pc=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function RT(e){for(var t=0;t<Pc.length;t++)for(var n=Pc[t],r=0;r<n.blocks.length;r++){var a=n.blocks[r];if(e>=a[0]&&e<=a[1])return n.name}return null}var ho=[];Pc.forEach(e=>e.blocks.forEach(t=>ho.push(...t)));function R2(e){for(var t=0;t<ho.length;t+=2)if(e>=ho[t]&&e<=ho[t+1])return!0;return!1}var qt=e=>e+" "+e,Ra=80,LT=function(t,n){return"M95,"+(622+t+n)+`
|
|
512
|
+
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
|
513
|
+
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
|
514
|
+
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
|
|
515
|
+
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
|
|
516
|
+
c69,-144,104.5,-217.7,106.5,-221
|
|
517
|
+
l`+t/2.075+" -"+t+`
|
|
518
|
+
c5.3,-9.3,12,-14,20,-14
|
|
519
|
+
H400000v`+(40+t)+`H845.2724
|
|
520
|
+
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
|
|
521
|
+
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
|
|
522
|
+
M`+(834+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},DT=function(t,n){return"M263,"+(601+t+n)+`c0.7,0,18,39.7,52,119
|
|
523
|
+
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
|
|
524
|
+
c340,-704.7,510.7,-1060.3,512,-1067
|
|
525
|
+
l`+t/2.084+" -"+t+`
|
|
526
|
+
c4.7,-7.3,11,-11,19,-11
|
|
527
|
+
H40000v`+(40+t)+`H1012.3
|
|
528
|
+
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
|
|
529
|
+
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
|
|
530
|
+
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
|
|
531
|
+
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
|
|
532
|
+
M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},PT=function(t,n){return"M983 "+(10+t+n)+`
|
|
533
|
+
l`+t/3.13+" -"+t+`
|
|
534
|
+
c4,-6.7,10,-10,18,-10 H400000v`+(40+t)+`
|
|
535
|
+
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
|
|
536
|
+
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
|
|
537
|
+
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
|
|
538
|
+
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
|
|
539
|
+
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
|
|
540
|
+
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
|
|
541
|
+
M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},OT=function(t,n){return"M424,"+(2398+t+n)+`
|
|
542
|
+
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
|
|
543
|
+
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
|
|
544
|
+
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
|
|
545
|
+
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
|
|
546
|
+
l`+t/4.223+" -"+t+`c4,-6.7,10,-10,18,-10 H400000
|
|
547
|
+
v`+(40+t)+`H1014.6
|
|
548
|
+
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
|
|
549
|
+
c-2,6,-10,9,-24,9
|
|
550
|
+
c-8,0,-12,-0.7,-12,-2z M`+(1001+t)+" "+n+`
|
|
551
|
+
h400000v`+(40+t)+"h-400000z"},jT=function(t,n){return"M473,"+(2713+t+n)+`
|
|
552
|
+
c339.3,-1799.3,509.3,-2700,510,-2702 l`+t/5.298+" -"+t+`
|
|
553
|
+
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+t)+`H1017.7
|
|
554
|
+
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
|
|
555
|
+
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
|
|
556
|
+
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
|
|
557
|
+
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
|
|
558
|
+
606zM`+(1001+t)+" "+n+"h400000v"+(40+t)+"H1017.7z"},BT=function(t){var n=t/2;return"M400000 "+t+" H0 L"+n+" 0 l65 45 L145 "+(t-80)+" H400000z"},FT=function(t,n,r){var a=r-54-n-t;return"M702 "+(t+n)+"H400000"+(40+t)+`
|
|
559
|
+
H742v`+a+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
|
|
560
|
+
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
|
|
561
|
+
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
|
|
562
|
+
219 661 l218 661zM702 `+n+"H400000v"+(40+t)+"H742z"},zT=function(t,n,r){n=1e3*n;var a="";switch(t){case"sqrtMain":a=LT(n,Ra);break;case"sqrtSize1":a=DT(n,Ra);break;case"sqrtSize2":a=PT(n,Ra);break;case"sqrtSize3":a=OT(n,Ra);break;case"sqrtSize4":a=jT(n,Ra);break;case"sqrtTall":a=FT(n,Ra,r)}return a},HT=function(t,n){switch(t){case"⎜":return qt("M291 0 H417 V"+n+" H291z");case"∣":return qt("M145 0 H188 V"+n+" H145z");case"∥":return qt("M145 0 H188 V"+n+" H145z")+qt("M367 0 H410 V"+n+" H367z");case"⎟":return qt("M457 0 H583 V"+n+" H457z");case"⎢":return qt("M319 0 H403 V"+n+" H319z");case"⎥":return qt("M263 0 H347 V"+n+" H263z");case"⎪":return qt("M384 0 H504 V"+n+" H384z");case"⏐":return qt("M312 0 H355 V"+n+" H312z");case"‖":return qt("M257 0 H300 V"+n+" H257z")+qt("M478 0 H521 V"+n+" H478z");default:return""}},Hf={doubleleftarrow:`M262 157
|
|
563
|
+
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
|
|
564
|
+
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
|
|
565
|
+
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
|
|
566
|
+
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
|
|
567
|
+
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
|
|
568
|
+
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
|
|
569
|
+
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
|
|
570
|
+
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
|
|
571
|
+
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
|
|
572
|
+
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
|
|
573
|
+
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
|
|
574
|
+
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
|
|
575
|
+
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
|
|
576
|
+
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
|
|
577
|
+
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
|
|
578
|
+
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
|
|
579
|
+
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
|
|
580
|
+
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
|
|
581
|
+
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
|
|
582
|
+
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
|
|
583
|
+
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
|
|
584
|
+
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
|
|
585
|
+
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
|
|
586
|
+
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
|
|
587
|
+
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
|
|
588
|
+
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
|
|
589
|
+
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
|
|
590
|
+
435 0h399565z`,leftgroupunder:`M400000 262
|
|
591
|
+
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
|
|
592
|
+
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
|
|
593
|
+
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
|
|
594
|
+
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
|
|
595
|
+
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
|
|
596
|
+
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
|
|
597
|
+
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
|
|
598
|
+
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
|
|
599
|
+
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
|
|
600
|
+
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
|
|
601
|
+
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
|
|
602
|
+
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
|
|
603
|
+
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
|
|
604
|
+
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
|
|
605
|
+
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
|
|
606
|
+
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
|
|
607
|
+
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
|
|
608
|
+
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:qt("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:qt("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:qt("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:qt("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
|
|
609
|
+
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
|
|
610
|
+
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
|
|
611
|
+
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:qt("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334
|
|
612
|
+
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
|
|
613
|
+
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
|
|
614
|
+
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
|
|
615
|
+
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
|
|
616
|
+
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
|
|
617
|
+
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
|
|
618
|
+
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
|
|
619
|
+
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
|
|
620
|
+
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
|
|
621
|
+
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
|
|
622
|
+
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
|
|
623
|
+
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
|
|
624
|
+
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
|
|
625
|
+
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
|
|
626
|
+
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
|
|
627
|
+
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
|
|
628
|
+
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
|
|
629
|
+
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
|
|
630
|
+
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
|
|
631
|
+
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
|
|
632
|
+
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
|
|
633
|
+
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
|
|
634
|
+
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
|
|
635
|
+
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|
636
|
+
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|
637
|
+
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
|
|
638
|
+
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
|
|
639
|
+
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
|
|
640
|
+
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
|
|
641
|
+
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
|
|
642
|
+
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
|
|
643
|
+
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
|
|
644
|
+
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
|
|
645
|
+
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
|
|
646
|
+
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
|
|
647
|
+
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
|
|
648
|
+
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
|
|
649
|
+
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
|
|
650
|
+
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
|
|
651
|
+
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
|
|
652
|
+
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
|
|
653
|
+
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
|
|
654
|
+
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
|
|
655
|
+
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
|
|
656
|
+
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
|
|
657
|
+
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
|
|
658
|
+
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
|
|
659
|
+
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
|
|
660
|
+
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:qt("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:qt("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:qt("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
|
|
661
|
+
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
|
|
662
|
+
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
|
|
663
|
+
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
|
|
664
|
+
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
|
|
665
|
+
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
|
|
666
|
+
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
|
|
667
|
+
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
|
|
668
|
+
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
|
|
669
|
+
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
|
|
670
|
+
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
|
|
671
|
+
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
|
|
672
|
+
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
|
|
673
|
+
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
|
|
674
|
+
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
|
|
675
|
+
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
|
|
676
|
+
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
|
|
677
|
+
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
|
|
678
|
+
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
|
|
679
|
+
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
|
|
680
|
+
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
|
|
681
|
+
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
|
|
682
|
+
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
|
|
683
|
+
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
|
|
684
|
+
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
|
|
685
|
+
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
|
|
686
|
+
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
|
|
687
|
+
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
|
|
688
|
+
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
|
|
689
|
+
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
|
|
690
|
+
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
|
|
691
|
+
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
|
|
692
|
+
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
|
|
693
|
+
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
|
|
694
|
+
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
|
|
695
|
+
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
|
|
696
|
+
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
697
|
+
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
698
|
+
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
699
|
+
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
|
|
700
|
+
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
701
|
+
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
702
|
+
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
703
|
+
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
|
|
704
|
+
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
|
|
705
|
+
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
|
|
706
|
+
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
|
|
707
|
+
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
|
|
708
|
+
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
|
|
709
|
+
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
|
|
710
|
+
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
|
|
711
|
+
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
|
|
712
|
+
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
|
|
713
|
+
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
|
|
714
|
+
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|
715
|
+
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|
716
|
+
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
717
|
+
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
|
|
718
|
+
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
|
|
719
|
+
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
|
|
720
|
+
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
|
|
721
|
+
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
|
|
722
|
+
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|
723
|
+
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|
724
|
+
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|
725
|
+
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
726
|
+
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
|
|
727
|
+
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
|
|
728
|
+
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
|
|
729
|
+
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
|
|
730
|
+
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|
731
|
+
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|
732
|
+
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|
733
|
+
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},UT=function(t,n){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 v84 h347 v-84
|
|
734
|
+
H403z M403 1759 V0 H319 V1759 v`+n+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z
|
|
735
|
+
M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
|
|
736
|
+
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
737
|
+
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
|
|
738
|
+
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
739
|
+
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z
|
|
740
|
+
M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15
|
|
741
|
+
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
742
|
+
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z
|
|
743
|
+
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z
|
|
744
|
+
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z
|
|
745
|
+
M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z
|
|
746
|
+
M347 1759 V0 h-84 V1759 v`+n+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
|
|
747
|
+
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
|
|
748
|
+
-36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
|
|
749
|
+
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
|
|
750
|
+
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
|
|
751
|
+
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
|
|
752
|
+
l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
|
|
753
|
+
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
|
|
754
|
+
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
|
|
755
|
+
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+`
|
|
756
|
+
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
|
|
757
|
+
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
|
|
758
|
+
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
|
|
759
|
+
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
|
|
760
|
+
l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
|
761
|
+
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function qT(e){return"toText"in e}class ii{constructor(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){for(var t=document.createDocumentFragment(),n=0;n<this.children.length;n++)t.appendChild(this.children[n].toNode());return t}toMarkup(){for(var t="",n=0;n<this.children.length;n++)t+=this.children[n].toMarkup();return t}toText(){return this.children.map(t=>{if(qT(t))return t.toText();throw new Error("Expected MathDomNode with toText, got "+t.constructor.name)}).join("")}}var Oc={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},VT={ex:!0,em:!0,mu:!0},L2=function(t){return typeof t!="string"&&(t=t.unit),t in Oc||t in VT||t==="ex"},It=function(t,n){var r;if(t.unit in Oc)r=Oc[t.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(t.unit==="mu")r=n.fontMetrics().cssEmPerMu;else{var a;if(n.style.isTight()?a=n.havingStyle(n.style.text()):a=n,t.unit==="ex")r=a.fontMetrics().xHeight;else if(t.unit==="em")r=a.fontMetrics().quad;else throw new Te("Invalid unit: '"+t.unit+"'");a!==n&&(r*=a.sizeMultiplier/n.sizeMultiplier)}return Math.min(t.number*r,n.maxSize)},Se=function(t){return+t.toFixed(4)+"em"},Br=function(t){return t.filter(n=>n).join(" ")},fd=function(t){var n="";for(var r of Object.keys(t)){var a=t[r];a!==void 0&&(n+=bT(r)+":"+a+";")}return n},D2=function(t,n,r){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},n){n.style.isTight()&&this.classes.push("mtight");var a=n.getColor();a&&(this.style.color=a)}},P2=function(t){var n=document.createElement(t);n.className=Br(this.classes),Object.assign(n.style,this.style);for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var a=0;a<this.children.length;a++)n.appendChild(this.children[a].toNode());return n},$T=/[\s"'>/=\x00-\x1f]/,O2=function(t){var n="<"+t;this.classes.length&&(n+=' class="'+an(Br(this.classes))+'"');var r=fd(this.style);r&&(n+=' style="'+an(r)+'"');for(var a of Object.keys(this.attributes)){if($T.test(a))throw new Te("Invalid attribute name '"+a+"'");n+=" "+a+'="'+an(this.attributes[a])+'"'}n+=">";for(var i=0;i<this.children.length;i++)n+=this.children[i].toMarkup();return n+="</"+t+">",n};class si{constructor(t,n,r,a){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,D2.call(this,t,r,a),this.children=n||[]}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return P2.call(this,"span")}toMarkup(){return O2.call(this,"span")}}class hl{constructor(t,n,r,a){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,D2.call(this,n,a),this.children=r||[],this.setAttribute("href",t)}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return P2.call(this,"a")}toMarkup(){return O2.call(this,"a")}}class WT{constructor(t,n,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=t,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createElement("img");return t.src=this.src,t.alt=this.alt,t.className="mord",Object.assign(t.style,this.style),t}toMarkup(){var t='<img src="'+an(this.src)+'"'+(' alt="'+an(this.alt)+'"'),n=fd(this.style);return n&&(t+=' style="'+an(n)+'"'),t+="'/>",t}}var GT={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class Cn{constructor(t,n,r,a,i,s,o,l){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=t,this.height=n||0,this.depth=r||0,this.italic=a||0,this.skew=i||0,this.width=s||0,this.classes=o||[],this.style=l||{},this.maxFontSize=0;var u=RT(this.text.charCodeAt(0));u&&this.classes.push(u+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=GT[this.text])}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createTextNode(this.text),n=null;return this.italic>0&&(n=document.createElement("span"),n.style.marginRight=Se(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=Br(this.classes)),Object.keys(this.style).length>0&&(n=n||document.createElement("span"),Object.assign(n.style,this.style)),n?(n.appendChild(t),n):t}toMarkup(){var t=!1,n="<span";this.classes.length&&(t=!0,n+=' class="',n+=an(Br(this.classes)),n+='"');var r="";this.italic>0&&(r+="margin-right:"+Se(this.italic)+";"),r+=fd(this.style),r&&(t=!0,n+=' style="'+an(r)+'"');var a=an(this.text);return t?(n+=">",n+=a,n+="</span>",n):a}}class wr{constructor(t,n){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=n||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var a=0;a<this.children.length;a++)n.appendChild(this.children[a].toNode());return n}toMarkup(){var t='<svg xmlns="http://www.w3.org/2000/svg"';for(var n of Object.keys(this.attributes))t+=" "+n+'="'+an(this.attributes[n])+'"';t+=">";for(var r=0;r<this.children.length;r++)t+=this.children[r].toMarkup();return t+="</svg>",t}}class Fr{constructor(t,n){this.pathName=void 0,this.alternate=void 0,this.pathName=t,this.alternate=n}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"path");return this.alternate?n.setAttribute("d",this.alternate):n.setAttribute("d",Hf[this.pathName]),n}toMarkup(){return this.alternate?'<path d="'+an(this.alternate)+'"/>':'<path d="'+an(Hf[this.pathName])+'"/>'}}class jc{constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"line");for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);return n}toMarkup(){var t="<line";for(var n of Object.keys(this.attributes))t+=" "+n+'="'+an(this.attributes[n])+'"';return t+="/>",t}}function YT(e){if(e instanceof Cn)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}function KT(e){if(e instanceof si)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}var XT=e=>e instanceof si||e instanceof hl||e instanceof ii,ar={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},zs={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Uf={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function QT(e,t){ar[e]=t}function md(e,t,n){if(!ar[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),a=ar[t][r];if(!a&&e[0]in Uf&&(r=Uf[e[0]].charCodeAt(0),a=ar[t][r]),!a&&n==="text"&&R2(r)&&(a=ar[t][77]),a)return{depth:a[0],height:a[1],italic:a[2],skew:a[3],width:a[4]}}var gu={};function ZT(e){var t;if(e>=5?t=0:e>=3?t=1:t=2,!gu[t]){var n=gu[t]={cssEmPerMu:zs.quad[t]/18};for(var r in zs)zs.hasOwnProperty(r)&&(n[r]=zs[r][t])}return gu[t]}var At={math:{},text:{}};function E(e,t,n,r,a,i){At[e][a]={font:t,group:n,replace:r},i&&r&&(At[e][r]=At[e][a])}var M="math",xe="text",P="main",W="ams",Ct="accent-token",De="bin",pn="close",oi="inner",Ve="mathord",Ht="op-token",Nn="open",vs="punct",G="rel",Er="spacing",J="textord";E(M,P,G,"≡","\\equiv",!0);E(M,P,G,"≺","\\prec",!0);E(M,P,G,"≻","\\succ",!0);E(M,P,G,"∼","\\sim",!0);E(M,P,G,"⊥","\\perp");E(M,P,G,"⪯","\\preceq",!0);E(M,P,G,"⪰","\\succeq",!0);E(M,P,G,"≃","\\simeq",!0);E(M,P,G,"∣","\\mid",!0);E(M,P,G,"≪","\\ll",!0);E(M,P,G,"≫","\\gg",!0);E(M,P,G,"≍","\\asymp",!0);E(M,P,G,"∥","\\parallel");E(M,P,G,"⋈","\\bowtie",!0);E(M,P,G,"⌣","\\smile",!0);E(M,P,G,"⊑","\\sqsubseteq",!0);E(M,P,G,"⊒","\\sqsupseteq",!0);E(M,P,G,"≐","\\doteq",!0);E(M,P,G,"⌢","\\frown",!0);E(M,P,G,"∋","\\ni",!0);E(M,P,G,"∝","\\propto",!0);E(M,P,G,"⊢","\\vdash",!0);E(M,P,G,"⊣","\\dashv",!0);E(M,P,G,"∋","\\owns");E(M,P,vs,".","\\ldotp");E(M,P,vs,"⋅","\\cdotp");E(M,P,vs,"⋅","·");E(xe,P,J,"⋅","·");E(M,P,J,"#","\\#");E(xe,P,J,"#","\\#");E(M,P,J,"&","\\&");E(xe,P,J,"&","\\&");E(M,P,J,"ℵ","\\aleph",!0);E(M,P,J,"∀","\\forall",!0);E(M,P,J,"ℏ","\\hbar",!0);E(M,P,J,"∃","\\exists",!0);E(M,P,J,"∇","\\nabla",!0);E(M,P,J,"♭","\\flat",!0);E(M,P,J,"ℓ","\\ell",!0);E(M,P,J,"♮","\\natural",!0);E(M,P,J,"♣","\\clubsuit",!0);E(M,P,J,"℘","\\wp",!0);E(M,P,J,"♯","\\sharp",!0);E(M,P,J,"♢","\\diamondsuit",!0);E(M,P,J,"ℜ","\\Re",!0);E(M,P,J,"♡","\\heartsuit",!0);E(M,P,J,"ℑ","\\Im",!0);E(M,P,J,"♠","\\spadesuit",!0);E(M,P,J,"§","\\S",!0);E(xe,P,J,"§","\\S");E(M,P,J,"¶","\\P",!0);E(xe,P,J,"¶","\\P");E(M,P,J,"†","\\dag");E(xe,P,J,"†","\\dag");E(xe,P,J,"†","\\textdagger");E(M,P,J,"‡","\\ddag");E(xe,P,J,"‡","\\ddag");E(xe,P,J,"‡","\\textdaggerdbl");E(M,P,pn,"⎱","\\rmoustache",!0);E(M,P,Nn,"⎰","\\lmoustache",!0);E(M,P,pn,"⟯","\\rgroup",!0);E(M,P,Nn,"⟮","\\lgroup",!0);E(M,P,De,"∓","\\mp",!0);E(M,P,De,"⊖","\\ominus",!0);E(M,P,De,"⊎","\\uplus",!0);E(M,P,De,"⊓","\\sqcap",!0);E(M,P,De,"∗","\\ast");E(M,P,De,"⊔","\\sqcup",!0);E(M,P,De,"◯","\\bigcirc",!0);E(M,P,De,"∙","\\bullet",!0);E(M,P,De,"‡","\\ddagger");E(M,P,De,"≀","\\wr",!0);E(M,P,De,"⨿","\\amalg");E(M,P,De,"&","\\And");E(M,P,G,"⟵","\\longleftarrow",!0);E(M,P,G,"⇐","\\Leftarrow",!0);E(M,P,G,"⟸","\\Longleftarrow",!0);E(M,P,G,"⟶","\\longrightarrow",!0);E(M,P,G,"⇒","\\Rightarrow",!0);E(M,P,G,"⟹","\\Longrightarrow",!0);E(M,P,G,"↔","\\leftrightarrow",!0);E(M,P,G,"⟷","\\longleftrightarrow",!0);E(M,P,G,"⇔","\\Leftrightarrow",!0);E(M,P,G,"⟺","\\Longleftrightarrow",!0);E(M,P,G,"↦","\\mapsto",!0);E(M,P,G,"⟼","\\longmapsto",!0);E(M,P,G,"↗","\\nearrow",!0);E(M,P,G,"↩","\\hookleftarrow",!0);E(M,P,G,"↪","\\hookrightarrow",!0);E(M,P,G,"↘","\\searrow",!0);E(M,P,G,"↼","\\leftharpoonup",!0);E(M,P,G,"⇀","\\rightharpoonup",!0);E(M,P,G,"↙","\\swarrow",!0);E(M,P,G,"↽","\\leftharpoondown",!0);E(M,P,G,"⇁","\\rightharpoondown",!0);E(M,P,G,"↖","\\nwarrow",!0);E(M,P,G,"⇌","\\rightleftharpoons",!0);E(M,W,G,"≮","\\nless",!0);E(M,W,G,"","\\@nleqslant");E(M,W,G,"","\\@nleqq");E(M,W,G,"⪇","\\lneq",!0);E(M,W,G,"≨","\\lneqq",!0);E(M,W,G,"","\\@lvertneqq");E(M,W,G,"⋦","\\lnsim",!0);E(M,W,G,"⪉","\\lnapprox",!0);E(M,W,G,"⊀","\\nprec",!0);E(M,W,G,"⋠","\\npreceq",!0);E(M,W,G,"⋨","\\precnsim",!0);E(M,W,G,"⪹","\\precnapprox",!0);E(M,W,G,"≁","\\nsim",!0);E(M,W,G,"","\\@nshortmid");E(M,W,G,"∤","\\nmid",!0);E(M,W,G,"⊬","\\nvdash",!0);E(M,W,G,"⊭","\\nvDash",!0);E(M,W,G,"⋪","\\ntriangleleft");E(M,W,G,"⋬","\\ntrianglelefteq",!0);E(M,W,G,"⊊","\\subsetneq",!0);E(M,W,G,"","\\@varsubsetneq");E(M,W,G,"⫋","\\subsetneqq",!0);E(M,W,G,"","\\@varsubsetneqq");E(M,W,G,"≯","\\ngtr",!0);E(M,W,G,"","\\@ngeqslant");E(M,W,G,"","\\@ngeqq");E(M,W,G,"⪈","\\gneq",!0);E(M,W,G,"≩","\\gneqq",!0);E(M,W,G,"","\\@gvertneqq");E(M,W,G,"⋧","\\gnsim",!0);E(M,W,G,"⪊","\\gnapprox",!0);E(M,W,G,"⊁","\\nsucc",!0);E(M,W,G,"⋡","\\nsucceq",!0);E(M,W,G,"⋩","\\succnsim",!0);E(M,W,G,"⪺","\\succnapprox",!0);E(M,W,G,"≆","\\ncong",!0);E(M,W,G,"","\\@nshortparallel");E(M,W,G,"∦","\\nparallel",!0);E(M,W,G,"⊯","\\nVDash",!0);E(M,W,G,"⋫","\\ntriangleright");E(M,W,G,"⋭","\\ntrianglerighteq",!0);E(M,W,G,"","\\@nsupseteqq");E(M,W,G,"⊋","\\supsetneq",!0);E(M,W,G,"","\\@varsupsetneq");E(M,W,G,"⫌","\\supsetneqq",!0);E(M,W,G,"","\\@varsupsetneqq");E(M,W,G,"⊮","\\nVdash",!0);E(M,W,G,"⪵","\\precneqq",!0);E(M,W,G,"⪶","\\succneqq",!0);E(M,W,G,"","\\@nsubseteqq");E(M,W,De,"⊴","\\unlhd");E(M,W,De,"⊵","\\unrhd");E(M,W,G,"↚","\\nleftarrow",!0);E(M,W,G,"↛","\\nrightarrow",!0);E(M,W,G,"⇍","\\nLeftarrow",!0);E(M,W,G,"⇏","\\nRightarrow",!0);E(M,W,G,"↮","\\nleftrightarrow",!0);E(M,W,G,"⇎","\\nLeftrightarrow",!0);E(M,W,G,"△","\\vartriangle");E(M,W,J,"ℏ","\\hslash");E(M,W,J,"▽","\\triangledown");E(M,W,J,"◊","\\lozenge");E(M,W,J,"Ⓢ","\\circledS");E(M,W,J,"®","\\circledR");E(xe,W,J,"®","\\circledR");E(M,W,J,"∡","\\measuredangle",!0);E(M,W,J,"∄","\\nexists");E(M,W,J,"℧","\\mho");E(M,W,J,"Ⅎ","\\Finv",!0);E(M,W,J,"⅁","\\Game",!0);E(M,W,J,"‵","\\backprime");E(M,W,J,"▲","\\blacktriangle");E(M,W,J,"▼","\\blacktriangledown");E(M,W,J,"■","\\blacksquare");E(M,W,J,"⧫","\\blacklozenge");E(M,W,J,"★","\\bigstar");E(M,W,J,"∢","\\sphericalangle",!0);E(M,W,J,"∁","\\complement",!0);E(M,W,J,"ð","\\eth",!0);E(xe,P,J,"ð","ð");E(M,W,J,"╱","\\diagup");E(M,W,J,"╲","\\diagdown");E(M,W,J,"□","\\square");E(M,W,J,"□","\\Box");E(M,W,J,"◊","\\Diamond");E(M,W,J,"¥","\\yen",!0);E(xe,W,J,"¥","\\yen",!0);E(M,W,J,"✓","\\checkmark",!0);E(xe,W,J,"✓","\\checkmark");E(M,W,J,"ℶ","\\beth",!0);E(M,W,J,"ℸ","\\daleth",!0);E(M,W,J,"ℷ","\\gimel",!0);E(M,W,J,"ϝ","\\digamma",!0);E(M,W,J,"ϰ","\\varkappa");E(M,W,Nn,"┌","\\@ulcorner",!0);E(M,W,pn,"┐","\\@urcorner",!0);E(M,W,Nn,"└","\\@llcorner",!0);E(M,W,pn,"┘","\\@lrcorner",!0);E(M,W,G,"≦","\\leqq",!0);E(M,W,G,"⩽","\\leqslant",!0);E(M,W,G,"⪕","\\eqslantless",!0);E(M,W,G,"≲","\\lesssim",!0);E(M,W,G,"⪅","\\lessapprox",!0);E(M,W,G,"≊","\\approxeq",!0);E(M,W,De,"⋖","\\lessdot");E(M,W,G,"⋘","\\lll",!0);E(M,W,G,"≶","\\lessgtr",!0);E(M,W,G,"⋚","\\lesseqgtr",!0);E(M,W,G,"⪋","\\lesseqqgtr",!0);E(M,W,G,"≑","\\doteqdot");E(M,W,G,"≓","\\risingdotseq",!0);E(M,W,G,"≒","\\fallingdotseq",!0);E(M,W,G,"∽","\\backsim",!0);E(M,W,G,"⋍","\\backsimeq",!0);E(M,W,G,"⫅","\\subseteqq",!0);E(M,W,G,"⋐","\\Subset",!0);E(M,W,G,"⊏","\\sqsubset",!0);E(M,W,G,"≼","\\preccurlyeq",!0);E(M,W,G,"⋞","\\curlyeqprec",!0);E(M,W,G,"≾","\\precsim",!0);E(M,W,G,"⪷","\\precapprox",!0);E(M,W,G,"⊲","\\vartriangleleft");E(M,W,G,"⊴","\\trianglelefteq");E(M,W,G,"⊨","\\vDash",!0);E(M,W,G,"⊪","\\Vvdash",!0);E(M,W,G,"⌣","\\smallsmile");E(M,W,G,"⌢","\\smallfrown");E(M,W,G,"≏","\\bumpeq",!0);E(M,W,G,"≎","\\Bumpeq",!0);E(M,W,G,"≧","\\geqq",!0);E(M,W,G,"⩾","\\geqslant",!0);E(M,W,G,"⪖","\\eqslantgtr",!0);E(M,W,G,"≳","\\gtrsim",!0);E(M,W,G,"⪆","\\gtrapprox",!0);E(M,W,De,"⋗","\\gtrdot");E(M,W,G,"⋙","\\ggg",!0);E(M,W,G,"≷","\\gtrless",!0);E(M,W,G,"⋛","\\gtreqless",!0);E(M,W,G,"⪌","\\gtreqqless",!0);E(M,W,G,"≖","\\eqcirc",!0);E(M,W,G,"≗","\\circeq",!0);E(M,W,G,"≜","\\triangleq",!0);E(M,W,G,"∼","\\thicksim");E(M,W,G,"≈","\\thickapprox");E(M,W,G,"⫆","\\supseteqq",!0);E(M,W,G,"⋑","\\Supset",!0);E(M,W,G,"⊐","\\sqsupset",!0);E(M,W,G,"≽","\\succcurlyeq",!0);E(M,W,G,"⋟","\\curlyeqsucc",!0);E(M,W,G,"≿","\\succsim",!0);E(M,W,G,"⪸","\\succapprox",!0);E(M,W,G,"⊳","\\vartriangleright");E(M,W,G,"⊵","\\trianglerighteq");E(M,W,G,"⊩","\\Vdash",!0);E(M,W,G,"∣","\\shortmid");E(M,W,G,"∥","\\shortparallel");E(M,W,G,"≬","\\between",!0);E(M,W,G,"⋔","\\pitchfork",!0);E(M,W,G,"∝","\\varpropto");E(M,W,G,"◀","\\blacktriangleleft");E(M,W,G,"∴","\\therefore",!0);E(M,W,G,"∍","\\backepsilon");E(M,W,G,"▶","\\blacktriangleright");E(M,W,G,"∵","\\because",!0);E(M,W,G,"⋘","\\llless");E(M,W,G,"⋙","\\gggtr");E(M,W,De,"⊲","\\lhd");E(M,W,De,"⊳","\\rhd");E(M,W,G,"≂","\\eqsim",!0);E(M,P,G,"⋈","\\Join");E(M,W,G,"≑","\\Doteq",!0);E(M,W,De,"∔","\\dotplus",!0);E(M,W,De,"∖","\\smallsetminus");E(M,W,De,"⋒","\\Cap",!0);E(M,W,De,"⋓","\\Cup",!0);E(M,W,De,"⩞","\\doublebarwedge",!0);E(M,W,De,"⊟","\\boxminus",!0);E(M,W,De,"⊞","\\boxplus",!0);E(M,W,De,"⋇","\\divideontimes",!0);E(M,W,De,"⋉","\\ltimes",!0);E(M,W,De,"⋊","\\rtimes",!0);E(M,W,De,"⋋","\\leftthreetimes",!0);E(M,W,De,"⋌","\\rightthreetimes",!0);E(M,W,De,"⋏","\\curlywedge",!0);E(M,W,De,"⋎","\\curlyvee",!0);E(M,W,De,"⊝","\\circleddash",!0);E(M,W,De,"⊛","\\circledast",!0);E(M,W,De,"⋅","\\centerdot");E(M,W,De,"⊺","\\intercal",!0);E(M,W,De,"⋒","\\doublecap");E(M,W,De,"⋓","\\doublecup");E(M,W,De,"⊠","\\boxtimes",!0);E(M,W,G,"⇢","\\dashrightarrow",!0);E(M,W,G,"⇠","\\dashleftarrow",!0);E(M,W,G,"⇇","\\leftleftarrows",!0);E(M,W,G,"⇆","\\leftrightarrows",!0);E(M,W,G,"⇚","\\Lleftarrow",!0);E(M,W,G,"↞","\\twoheadleftarrow",!0);E(M,W,G,"↢","\\leftarrowtail",!0);E(M,W,G,"↫","\\looparrowleft",!0);E(M,W,G,"⇋","\\leftrightharpoons",!0);E(M,W,G,"↶","\\curvearrowleft",!0);E(M,W,G,"↺","\\circlearrowleft",!0);E(M,W,G,"↰","\\Lsh",!0);E(M,W,G,"⇈","\\upuparrows",!0);E(M,W,G,"↿","\\upharpoonleft",!0);E(M,W,G,"⇃","\\downharpoonleft",!0);E(M,P,G,"⊶","\\origof",!0);E(M,P,G,"⊷","\\imageof",!0);E(M,W,G,"⊸","\\multimap",!0);E(M,W,G,"↭","\\leftrightsquigarrow",!0);E(M,W,G,"⇉","\\rightrightarrows",!0);E(M,W,G,"⇄","\\rightleftarrows",!0);E(M,W,G,"↠","\\twoheadrightarrow",!0);E(M,W,G,"↣","\\rightarrowtail",!0);E(M,W,G,"↬","\\looparrowright",!0);E(M,W,G,"↷","\\curvearrowright",!0);E(M,W,G,"↻","\\circlearrowright",!0);E(M,W,G,"↱","\\Rsh",!0);E(M,W,G,"⇊","\\downdownarrows",!0);E(M,W,G,"↾","\\upharpoonright",!0);E(M,W,G,"⇂","\\downharpoonright",!0);E(M,W,G,"⇝","\\rightsquigarrow",!0);E(M,W,G,"⇝","\\leadsto");E(M,W,G,"⇛","\\Rrightarrow",!0);E(M,W,G,"↾","\\restriction");E(M,P,J,"‘","`");E(M,P,J,"$","\\$");E(xe,P,J,"$","\\$");E(xe,P,J,"$","\\textdollar");E(M,P,J,"%","\\%");E(xe,P,J,"%","\\%");E(M,P,J,"_","\\_");E(xe,P,J,"_","\\_");E(xe,P,J,"_","\\textunderscore");E(M,P,J,"∠","\\angle",!0);E(M,P,J,"∞","\\infty",!0);E(M,P,J,"′","\\prime");E(M,P,J,"△","\\triangle");E(M,P,J,"Γ","\\Gamma",!0);E(M,P,J,"Δ","\\Delta",!0);E(M,P,J,"Θ","\\Theta",!0);E(M,P,J,"Λ","\\Lambda",!0);E(M,P,J,"Ξ","\\Xi",!0);E(M,P,J,"Π","\\Pi",!0);E(M,P,J,"Σ","\\Sigma",!0);E(M,P,J,"Υ","\\Upsilon",!0);E(M,P,J,"Φ","\\Phi",!0);E(M,P,J,"Ψ","\\Psi",!0);E(M,P,J,"Ω","\\Omega",!0);E(M,P,J,"A","Α");E(M,P,J,"B","Β");E(M,P,J,"E","Ε");E(M,P,J,"Z","Ζ");E(M,P,J,"H","Η");E(M,P,J,"I","Ι");E(M,P,J,"K","Κ");E(M,P,J,"M","Μ");E(M,P,J,"N","Ν");E(M,P,J,"O","Ο");E(M,P,J,"P","Ρ");E(M,P,J,"T","Τ");E(M,P,J,"X","Χ");E(M,P,J,"¬","\\neg",!0);E(M,P,J,"¬","\\lnot");E(M,P,J,"⊤","\\top");E(M,P,J,"⊥","\\bot");E(M,P,J,"∅","\\emptyset");E(M,W,J,"∅","\\varnothing");E(M,P,Ve,"α","\\alpha",!0);E(M,P,Ve,"β","\\beta",!0);E(M,P,Ve,"γ","\\gamma",!0);E(M,P,Ve,"δ","\\delta",!0);E(M,P,Ve,"ϵ","\\epsilon",!0);E(M,P,Ve,"ζ","\\zeta",!0);E(M,P,Ve,"η","\\eta",!0);E(M,P,Ve,"θ","\\theta",!0);E(M,P,Ve,"ι","\\iota",!0);E(M,P,Ve,"κ","\\kappa",!0);E(M,P,Ve,"λ","\\lambda",!0);E(M,P,Ve,"μ","\\mu",!0);E(M,P,Ve,"ν","\\nu",!0);E(M,P,Ve,"ξ","\\xi",!0);E(M,P,Ve,"ο","\\omicron",!0);E(M,P,Ve,"π","\\pi",!0);E(M,P,Ve,"ρ","\\rho",!0);E(M,P,Ve,"σ","\\sigma",!0);E(M,P,Ve,"τ","\\tau",!0);E(M,P,Ve,"υ","\\upsilon",!0);E(M,P,Ve,"ϕ","\\phi",!0);E(M,P,Ve,"χ","\\chi",!0);E(M,P,Ve,"ψ","\\psi",!0);E(M,P,Ve,"ω","\\omega",!0);E(M,P,Ve,"ε","\\varepsilon",!0);E(M,P,Ve,"ϑ","\\vartheta",!0);E(M,P,Ve,"ϖ","\\varpi",!0);E(M,P,Ve,"ϱ","\\varrho",!0);E(M,P,Ve,"ς","\\varsigma",!0);E(M,P,Ve,"φ","\\varphi",!0);E(M,P,De,"∗","*",!0);E(M,P,De,"+","+");E(M,P,De,"−","-",!0);E(M,P,De,"⋅","\\cdot",!0);E(M,P,De,"∘","\\circ",!0);E(M,P,De,"÷","\\div",!0);E(M,P,De,"±","\\pm",!0);E(M,P,De,"×","\\times",!0);E(M,P,De,"∩","\\cap",!0);E(M,P,De,"∪","\\cup",!0);E(M,P,De,"∖","\\setminus",!0);E(M,P,De,"∧","\\land");E(M,P,De,"∨","\\lor");E(M,P,De,"∧","\\wedge",!0);E(M,P,De,"∨","\\vee",!0);E(M,P,J,"√","\\surd");E(M,P,Nn,"⟨","\\langle",!0);E(M,P,Nn,"∣","\\lvert");E(M,P,Nn,"∥","\\lVert");E(M,P,pn,"?","?");E(M,P,pn,"!","!");E(M,P,pn,"⟩","\\rangle",!0);E(M,P,pn,"∣","\\rvert");E(M,P,pn,"∥","\\rVert");E(M,P,G,"=","=");E(M,P,G,":",":");E(M,P,G,"≈","\\approx",!0);E(M,P,G,"≅","\\cong",!0);E(M,P,G,"≥","\\ge");E(M,P,G,"≥","\\geq",!0);E(M,P,G,"←","\\gets");E(M,P,G,">","\\gt",!0);E(M,P,G,"∈","\\in",!0);E(M,P,G,"","\\@not");E(M,P,G,"⊂","\\subset",!0);E(M,P,G,"⊃","\\supset",!0);E(M,P,G,"⊆","\\subseteq",!0);E(M,P,G,"⊇","\\supseteq",!0);E(M,W,G,"⊈","\\nsubseteq",!0);E(M,W,G,"⊉","\\nsupseteq",!0);E(M,P,G,"⊨","\\models");E(M,P,G,"←","\\leftarrow",!0);E(M,P,G,"≤","\\le");E(M,P,G,"≤","\\leq",!0);E(M,P,G,"<","\\lt",!0);E(M,P,G,"→","\\rightarrow",!0);E(M,P,G,"→","\\to");E(M,W,G,"≱","\\ngeq",!0);E(M,W,G,"≰","\\nleq",!0);E(M,P,Er," ","\\ ");E(M,P,Er," ","\\space");E(M,P,Er," ","\\nobreakspace");E(xe,P,Er," ","\\ ");E(xe,P,Er," "," ");E(xe,P,Er," ","\\space");E(xe,P,Er," ","\\nobreakspace");E(M,P,Er,"","\\nobreak");E(M,P,Er,"","\\allowbreak");E(M,P,vs,",",",");E(M,P,vs,";",";");E(M,W,De,"⊼","\\barwedge",!0);E(M,W,De,"⊻","\\veebar",!0);E(M,P,De,"⊙","\\odot",!0);E(M,P,De,"⊕","\\oplus",!0);E(M,P,De,"⊗","\\otimes",!0);E(M,P,J,"∂","\\partial",!0);E(M,P,De,"⊘","\\oslash",!0);E(M,W,De,"⊚","\\circledcirc",!0);E(M,W,De,"⊡","\\boxdot",!0);E(M,P,De,"△","\\bigtriangleup");E(M,P,De,"▽","\\bigtriangledown");E(M,P,De,"†","\\dagger");E(M,P,De,"⋄","\\diamond");E(M,P,De,"⋆","\\star");E(M,P,De,"◃","\\triangleleft");E(M,P,De,"▹","\\triangleright");E(M,P,Nn,"{","\\{");E(xe,P,J,"{","\\{");E(xe,P,J,"{","\\textbraceleft");E(M,P,pn,"}","\\}");E(xe,P,J,"}","\\}");E(xe,P,J,"}","\\textbraceright");E(M,P,Nn,"{","\\lbrace");E(M,P,pn,"}","\\rbrace");E(M,P,Nn,"[","\\lbrack",!0);E(xe,P,J,"[","\\lbrack",!0);E(M,P,pn,"]","\\rbrack",!0);E(xe,P,J,"]","\\rbrack",!0);E(M,P,Nn,"(","\\lparen",!0);E(M,P,pn,")","\\rparen",!0);E(xe,P,J,"<","\\textless",!0);E(xe,P,J,">","\\textgreater",!0);E(M,P,Nn,"⌊","\\lfloor",!0);E(M,P,pn,"⌋","\\rfloor",!0);E(M,P,Nn,"⌈","\\lceil",!0);E(M,P,pn,"⌉","\\rceil",!0);E(M,P,J,"\\","\\backslash");E(M,P,J,"∣","|");E(M,P,J,"∣","\\vert");E(xe,P,J,"|","\\textbar",!0);E(M,P,J,"∥","\\|");E(M,P,J,"∥","\\Vert");E(xe,P,J,"∥","\\textbardbl");E(xe,P,J,"~","\\textasciitilde");E(xe,P,J,"\\","\\textbackslash");E(xe,P,J,"^","\\textasciicircum");E(M,P,G,"↑","\\uparrow",!0);E(M,P,G,"⇑","\\Uparrow",!0);E(M,P,G,"↓","\\downarrow",!0);E(M,P,G,"⇓","\\Downarrow",!0);E(M,P,G,"↕","\\updownarrow",!0);E(M,P,G,"⇕","\\Updownarrow",!0);E(M,P,Ht,"∐","\\coprod");E(M,P,Ht,"⋁","\\bigvee");E(M,P,Ht,"⋀","\\bigwedge");E(M,P,Ht,"⨄","\\biguplus");E(M,P,Ht,"⋂","\\bigcap");E(M,P,Ht,"⋃","\\bigcup");E(M,P,Ht,"∫","\\int");E(M,P,Ht,"∫","\\intop");E(M,P,Ht,"∬","\\iint");E(M,P,Ht,"∭","\\iiint");E(M,P,Ht,"∏","\\prod");E(M,P,Ht,"∑","\\sum");E(M,P,Ht,"⨂","\\bigotimes");E(M,P,Ht,"⨁","\\bigoplus");E(M,P,Ht,"⨀","\\bigodot");E(M,P,Ht,"∮","\\oint");E(M,P,Ht,"∯","\\oiint");E(M,P,Ht,"∰","\\oiiint");E(M,P,Ht,"⨆","\\bigsqcup");E(M,P,Ht,"∫","\\smallint");E(xe,P,oi,"…","\\textellipsis");E(M,P,oi,"…","\\mathellipsis");E(xe,P,oi,"…","\\ldots",!0);E(M,P,oi,"…","\\ldots",!0);E(M,P,oi,"⋯","\\@cdots",!0);E(M,P,oi,"⋱","\\ddots",!0);E(M,P,J,"⋮","\\varvdots");E(xe,P,J,"⋮","\\varvdots");E(M,P,Ct,"ˊ","\\acute");E(M,P,Ct,"ˋ","\\grave");E(M,P,Ct,"¨","\\ddot");E(M,P,Ct,"~","\\tilde");E(M,P,Ct,"ˉ","\\bar");E(M,P,Ct,"˘","\\breve");E(M,P,Ct,"ˇ","\\check");E(M,P,Ct,"^","\\hat");E(M,P,Ct,"⃗","\\vec");E(M,P,Ct,"˙","\\dot");E(M,P,Ct,"˚","\\mathring");E(M,P,Ve,"","\\@imath");E(M,P,Ve,"","\\@jmath");E(M,P,J,"ı","ı");E(M,P,J,"ȷ","ȷ");E(xe,P,J,"ı","\\i",!0);E(xe,P,J,"ȷ","\\j",!0);E(xe,P,J,"ß","\\ss",!0);E(xe,P,J,"æ","\\ae",!0);E(xe,P,J,"œ","\\oe",!0);E(xe,P,J,"ø","\\o",!0);E(xe,P,J,"Æ","\\AE",!0);E(xe,P,J,"Œ","\\OE",!0);E(xe,P,J,"Ø","\\O",!0);E(xe,P,Ct,"ˊ","\\'");E(xe,P,Ct,"ˋ","\\`");E(xe,P,Ct,"ˆ","\\^");E(xe,P,Ct,"˜","\\~");E(xe,P,Ct,"ˉ","\\=");E(xe,P,Ct,"˘","\\u");E(xe,P,Ct,"˙","\\.");E(xe,P,Ct,"¸","\\c");E(xe,P,Ct,"˚","\\r");E(xe,P,Ct,"ˇ","\\v");E(xe,P,Ct,"¨",'\\"');E(xe,P,Ct,"˝","\\H");E(xe,P,Ct,"◯","\\textcircled");var j2={"--":!0,"---":!0,"``":!0,"''":!0};E(xe,P,J,"–","--",!0);E(xe,P,J,"–","\\textendash");E(xe,P,J,"—","---",!0);E(xe,P,J,"—","\\textemdash");E(xe,P,J,"‘","`",!0);E(xe,P,J,"‘","\\textquoteleft");E(xe,P,J,"’","'",!0);E(xe,P,J,"’","\\textquoteright");E(xe,P,J,"“","``",!0);E(xe,P,J,"“","\\textquotedblleft");E(xe,P,J,"”","''",!0);E(xe,P,J,"”","\\textquotedblright");E(M,P,J,"°","\\degree",!0);E(xe,P,J,"°","\\degree");E(xe,P,J,"°","\\textdegree",!0);E(M,P,J,"£","\\pounds");E(M,P,J,"£","\\mathsterling",!0);E(xe,P,J,"£","\\pounds");E(xe,P,J,"£","\\textsterling",!0);E(M,W,J,"✠","\\maltese");E(xe,W,J,"✠","\\maltese");var qf='0123456789/@."';for(var xu=0;xu<qf.length;xu++){var Vf=qf.charAt(xu);E(M,P,J,Vf,Vf)}var $f='0123456789!@*()-=+";:?/.,';for(var bu=0;bu<$f.length;bu++){var Wf=$f.charAt(bu);E(xe,P,J,Wf,Wf)}var Po="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var yu=0;yu<Po.length;yu++){var Hs=Po.charAt(yu);E(M,P,Ve,Hs,Hs),E(xe,P,J,Hs,Hs)}E(M,W,J,"C","ℂ");E(xe,W,J,"C","ℂ");E(M,W,J,"H","ℍ");E(xe,W,J,"H","ℍ");E(M,W,J,"N","ℕ");E(xe,W,J,"N","ℕ");E(M,W,J,"P","ℙ");E(xe,W,J,"P","ℙ");E(M,W,J,"Q","ℚ");E(xe,W,J,"Q","ℚ");E(M,W,J,"R","ℝ");E(xe,W,J,"R","ℝ");E(M,W,J,"Z","ℤ");E(xe,W,J,"Z","ℤ");E(M,P,Ve,"h","ℎ");E(xe,P,Ve,"h","ℎ");var We;for(var un=0;un<Po.length;un++){var _t=Po.charAt(un);We=String.fromCharCode(55349,56320+un),E(M,P,Ve,_t,We),E(xe,P,J,_t,We),We=String.fromCharCode(55349,56372+un),E(M,P,Ve,_t,We),E(xe,P,J,_t,We),We=String.fromCharCode(55349,56424+un),E(M,P,Ve,_t,We),E(xe,P,J,_t,We),We=String.fromCharCode(55349,56580+un),E(M,P,Ve,_t,We),E(xe,P,J,_t,We),We=String.fromCharCode(55349,56684+un),E(M,P,Ve,_t,We),E(xe,P,J,_t,We),We=String.fromCharCode(55349,56736+un),E(M,P,Ve,_t,We),E(xe,P,J,_t,We),We=String.fromCharCode(55349,56788+un),E(M,P,Ve,_t,We),E(xe,P,J,_t,We),We=String.fromCharCode(55349,56840+un),E(M,P,Ve,_t,We),E(xe,P,J,_t,We),We=String.fromCharCode(55349,56944+un),E(M,P,Ve,_t,We),E(xe,P,J,_t,We),un<26&&(We=String.fromCharCode(55349,56632+un),E(M,P,Ve,_t,We),E(xe,P,J,_t,We),We=String.fromCharCode(55349,56476+un),E(M,P,Ve,_t,We),E(xe,P,J,_t,We))}We="𝕜";E(M,P,Ve,"k",We);E(xe,P,J,"k",We);for(var ta=0;ta<10;ta++){var Mr=ta.toString();We=String.fromCharCode(55349,57294+ta),E(M,P,Ve,Mr,We),E(xe,P,J,Mr,We),We=String.fromCharCode(55349,57314+ta),E(M,P,Ve,Mr,We),E(xe,P,J,Mr,We),We=String.fromCharCode(55349,57324+ta),E(M,P,Ve,Mr,We),E(xe,P,J,Mr,We),We=String.fromCharCode(55349,57334+ta),E(M,P,Ve,Mr,We),E(xe,P,J,Mr,We)}var Bc="ÐÞþ";for(var vu=0;vu<Bc.length;vu++){var Us=Bc.charAt(vu);E(M,P,Ve,Us,Us),E(xe,P,J,Us,Us)}var Fc={mathClass:"mathbf",textClass:"textbf",font:"Main-Bold"},Gf={mathClass:"mathnormal",textClass:"textit",font:"Math-Italic"},Yf={mathClass:"boldsymbol",textClass:"boldsymbol",font:"Main-BoldItalic"},JT={mathClass:"mathscr",textClass:"textscr",font:"Script-Regular"},ua={mathClass:"",textClass:"",font:""},Kf={mathClass:"mathfrak",textClass:"textfrak",font:"Fraktur-Regular"},Xf={mathClass:"mathbb",textClass:"textbb",font:"AMS-Regular"},Qf={mathClass:"mathboldfrak",textClass:"textboldfrak",font:"Fraktur-Regular"},zc={mathClass:"mathsf",textClass:"textsf",font:"SansSerif-Regular"},Hc={mathClass:"mathboldsf",textClass:"textboldsf",font:"SansSerif-Bold"},Zf={mathClass:"mathitsf",textClass:"textitsf",font:"SansSerif-Italic"},Uc={mathClass:"mathtt",textClass:"texttt",font:"Typewriter-Regular"},Jf=[Fc,Fc,Gf,Gf,Yf,Yf,JT,ua,ua,ua,Kf,Kf,Xf,Xf,Qf,Qf,zc,zc,Hc,Hc,Zf,Zf,ua,ua,Uc,Uc],eE=[Fc,ua,zc,Hc,Uc],tE=e=>{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484){var a=Math.floor((r-119808)/26);return Jf[a]}else if(120782<=r&&r<=120831){var i=Math.floor((r-120782)/10);return eE[i]}else{if(r===120485||r===120486)return Jf[0];if(120486<r&&r<120782)return ua;throw new Te("Unsupported character: "+e)}},fl=function(t,n,r){if(At[r][t]){var a=At[r][t].replace;a&&(t=a)}return{value:t,metrics:md(t,n,r)}},cn=function(t,n,r,a,i){var s=fl(t,n,r),o=s.metrics;t=s.value;var l;if(o){var u=o.italic;(r==="text"||a&&a.font==="mathit")&&(u=0),l=new Cn(t,o.height,o.depth,u,o.skew,o.width,i)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+t+"' in style '"+n+"' and mode '"+r+"'")),l=new Cn(t,0,0,0,0,0,i);if(a){l.maxFontSize=a.sizeMultiplier,a.style.isTight()&&l.classes.push("mtight");var c=a.getColor();c&&(l.style.color=c)}return l},pd=function(t,n,r,a){return a===void 0&&(a=[]),r.font==="boldsymbol"&&fl(t,"Main-Bold",n).metrics?cn(t,"Main-Bold",n,r,a.concat(["mathbf"])):t==="\\"||At[n][t].font==="main"?cn(t,"Main-Regular",n,r,a):cn(t,"AMS-Regular",n,r,a.concat(["amsrm"]))},nE=function(t,n,r){return r!=="textord"&&fl(t,"Math-BoldItalic",n).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},ml=function(t,n,r){var a=t.mode,i=t.text,s=["mord"],{font:o,fontFamily:l,fontWeight:u,fontShape:c}=n,h=a==="math"||a==="text"&&!!o,m=h?o:l,d="",p="";if(i.charCodeAt(0)===55349){var g=tE(i);d=g.font,p=g[a+"Class"]}if(d)return cn(i,d,a,n,s.concat(p));if(m){var x,b;if(m==="boldsymbol"){var v=nE(i,a,r);x=v.fontName,b=[v.fontClass]}else h?(x=qc[o].fontName,b=[o]):(x=qs(l,u,c),b=[l,u,c]);if(fl(i,x,a).metrics)return cn(i,x,a,n,s.concat(b));if(j2.hasOwnProperty(i)&&x.slice(0,10)==="Typewriter"){for(var T=[],N=0;N<i.length;N++)T.push(cn(i[N],x,a,n,s.concat(b)));return Sr(T)}}if(r==="mathord")return cn(i,"Math-Italic",a,n,s.concat(["mathnormal"]));if(r==="textord"){var k=At[a][i]&&At[a][i].font;if(k==="ams"){var A=qs("amsrm",u,c);return cn(i,A,a,n,s.concat("amsrm",u,c))}else if(k==="main"||!k){var _=qs("textrm",u,c);return cn(i,_,a,n,s.concat(u,c))}else{var S=qs(k,u,c);return cn(i,S,a,n,s.concat(S,u,c))}}else throw new Error("unexpected type: "+r+" in makeOrd")},rE=(e,t)=>{if(Br(e.classes)!==Br(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var n=e.classes[0];if(n==="mbin"||n==="mord")return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var a of Object.keys(t.style))if(e.style[a]!==t.style[a])return!1;return!0},B2=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof Cn&&r instanceof Cn&&rE(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e},gd=function(t){for(var n=0,r=0,a=0,i=0;i<t.children.length;i++){var s=t.children[i];s.height>n&&(n=s.height),s.depth>r&&(r=s.depth),s.maxFontSize>a&&(a=s.maxFontSize)}t.height=n,t.depth=r,t.maxFontSize=a},ve=function(t,n,r,a){var i=new si(t,n,r,a);return gd(i),i},zr=(e,t,n,r)=>new si(e,t,n,r),Qa=function(t,n,r){var a=ve([t],[],n);return a.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),a.style.borderBottomWidth=Se(a.height),a.maxFontSize=1,a},aE=function(t,n,r,a){var i=new hl(t,n,r,a);return gd(i),i},Sr=function(t){var n=new ii(t);return gd(n),n},Za=function(t,n){return t instanceof ii?ve([],[t],n):t},iE=function(t){if(t.positionType==="individualShift"){for(var n=t.children,r=[n[0]],a=-n[0].shift-n[0].elem.depth,i=a,s=1;s<n.length;s++){var o=-n[s].shift-i-n[s].elem.depth,l=o-(n[s-1].elem.height+n[s-1].elem.depth);i=i+o,r.push({type:"kern",size:l}),r.push(n[s])}return{children:r,depth:a}}var u;if(t.positionType==="top"){for(var c=t.positionData,h=0;h<t.children.length;h++){var m=t.children[h];c-=m.type==="kern"?m.size:m.elem.height+m.elem.depth}u=c}else if(t.positionType==="bottom")u=-t.positionData;else{var d=t.children[0];if(d.type!=="elem")throw new Error('First child must have type "elem".');if(t.positionType==="shift")u=-d.elem.depth-t.positionData;else if(t.positionType==="firstBaseline")u=-d.elem.depth;else throw new Error("Invalid positionType "+t.positionType+".")}return{children:t.children,depth:u}},mt=function(t,n){for(var{children:r,depth:a}=iE(t),i=0,s=0;s<r.length;s++){var o=r[s];if(o.type==="elem"){var l=o.elem;i=Math.max(i,l.maxFontSize,l.height)}}i+=2;var u=ve(["pstrut"],[]);u.style.height=Se(i);for(var c=[],h=a,m=a,d=a,p=0;p<r.length;p++){var g=r[p];if(g.type==="kern")d+=g.size;else{var x=g.elem,b=g.wrapperClasses||[],v=g.wrapperStyle||{},T=ve(b,[u,x],void 0,v);T.style.top=Se(-i-d-x.depth),g.marginLeft&&(T.style.marginLeft=g.marginLeft),g.marginRight&&(T.style.marginRight=g.marginRight),c.push(T),d+=x.height+x.depth}h=Math.min(h,d),m=Math.max(m,d)}var N=ve(["vlist"],c);N.style.height=Se(m);var k;if(h<0){var A=ve([],[]),_=ve(["vlist"],[A]);_.style.height=Se(-h);var S=ve(["vlist-s"],[new Cn("")]);k=[ve(["vlist-r"],[N,S]),ve(["vlist-r"],[_])]}else k=[ve(["vlist-r"],[N])];var I=ve(["vlist-t"],k);return k.length===2&&I.classes.push("vlist-t2"),I.height=m,I.depth=-h,I},F2=(e,t)=>{var n=ve(["mspace"],[],t),r=It(e,t);return n.style.marginRight=Se(r),n},qs=(e,t,n)=>{var r,a;switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return t==="textbf"&&n==="textit"?a="BoldItalic":t==="textbf"?a="Bold":n==="textit"?a="Italic":a="Regular",r+"-"+a},qc={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},z2={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},H2=function(t,n){var[r,a,i]=z2[t],s=new Fr(r),o=new wr([s],{width:Se(a),height:Se(i),style:"width:"+Se(a),viewBox:"0 0 "+1e3*a+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),l=zr(["overlay"],[o],n);return l.height=i,l.style.height=Se(i),l.style.width=Se(a),l},Mt={number:3,unit:"mu"},na={number:4,unit:"mu"},mr={number:5,unit:"mu"},sE={mord:{mop:Mt,mbin:na,mrel:mr,minner:Mt},mop:{mord:Mt,mop:Mt,mrel:mr,minner:Mt},mbin:{mord:na,mop:na,mopen:na,minner:na},mrel:{mord:mr,mop:mr,mopen:mr,minner:mr},mopen:{},mclose:{mop:Mt,mbin:na,mrel:mr,minner:Mt},mpunct:{mord:Mt,mop:Mt,mrel:mr,mopen:Mt,mclose:Mt,mpunct:Mt,minner:Mt},minner:{mord:Mt,mop:Mt,mbin:na,mrel:mr,mopen:Mt,mpunct:Mt,minner:Mt}},oE={mord:{mop:Mt},mop:{mord:Mt,mop:Mt},mbin:{},mrel:{},mopen:{},mclose:{mop:Mt},mpunct:{},minner:{mop:Mt}},U2={},Oo={},jo={};function Le(e){for(var{type:t,names:n,props:r,handler:a,htmlBuilder:i,mathmlBuilder:s}=e,o={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:a},l=0;l<n.length;++l)U2[n[l]]=o;t&&(i&&(Oo[t]=i),s&&(jo[t]=s))}function Sa(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;Le({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:r})}var Bo=function(t){return t.type==="ordgroup"&&t.body.length===1?t.body[0]:t},Ft=function(t){return t.type==="ordgroup"?t.body:[t]},lE=new Set(["leftmost","mbin","mopen","mrel","mop","mpunct"]),uE=new Set(["rightmost","mrel","mclose","mpunct"]),cE={display:Ke.DISPLAY,text:Ke.TEXT,script:Ke.SCRIPT,scriptscript:Ke.SCRIPTSCRIPT},dE={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Vt=function(t,n,r,a){a===void 0&&(a=[null,null]);for(var i=[],s=0;s<t.length;s++){var o=pt(t[s],n);if(o instanceof ii){var l=o.children;i.push(...l)}else i.push(o)}if(B2(i),!r)return i;var u=n;if(t.length===1){var c=t[0];c.type==="sizing"?u=n.havingSize(c.size):c.type==="styling"&&(u=n.havingStyle(cE[c.style]))}var h=ve([a[0]||"leftmost"],[],n),m=ve([a[1]||"rightmost"],[],n),d=r==="root";return Vc(i,(p,g)=>{var x=g.classes[0],b=p.classes[0];x==="mbin"&&uE.has(b)?g.classes[0]="mord":b==="mbin"&&lE.has(x)&&(p.classes[0]="mord")},{node:h},m,d),Vc(i,(p,g)=>{var x,b,v=Wc(g),T=Wc(p),N=v&&T?p.hasClass("mtight")?(x=oE[v])==null?void 0:x[T]:(b=sE[v])==null?void 0:b[T]:null;if(N)return F2(N,u)},{node:h},m,d),i},Vc=function(t,n,r,a,i){a&&t.push(a);for(var s=0;s<t.length;s++){var o=t[s],l=q2(o);if(l){Vc(l.children,n,r,null,i);continue}var u=!o.hasClass("mspace");if(u){var c=n(o,r.node);c&&(r.insertAfter?r.insertAfter(c):(t.unshift(c),s++))}u?r.node=o:i&&o.hasClass("newline")&&(r.node=ve(["leftmost"])),r.insertAfter=(h=>m=>{t.splice(h+1,0,m),s++})(s)}a&&t.pop()},q2=function(t){return t instanceof ii||t instanceof hl||t instanceof si&&t.hasClass("enclosing")?t:null},$c=function(t,n){var r=q2(t);if(r){var a=r.children;if(a.length){if(n==="right")return $c(a[a.length-1],"right");if(n==="left")return $c(a[0],"left")}}return t},Wc=function(t,n){if(!t)return null;n&&(t=$c(t,n));var r=t.classes[0];return dE[r]||null},is=function(t,n){var r=["nulldelimiter"].concat(t.baseSizingClasses());return ve(n.concat(r))},pt=function(t,n,r){if(!t)return ve();if(Oo[t.type]){var a=Oo[t.type](t,n);if(r&&n.size!==r.size){a=ve(n.sizingClasses(r),[a],n);var i=n.sizeMultiplier/r.sizeMultiplier;a.height*=i,a.depth*=i}return a}else throw new Te("Got group of unknown type: '"+t.type+"'")};function Vs(e,t){var n=ve(["base"],e,t),r=ve(["strut"]);return r.style.height=Se(n.height+n.depth),n.depth&&(r.style.verticalAlign=Se(-n.depth)),n.children.unshift(r),n}function Gc(e,t){var n=null;e.length===1&&e[0].type==="tag"&&(n=e[0].tag,e=e[0].body);var r=Vt(e,t,"root"),a;r.length===2&&r[1].hasClass("tag")&&(a=r.pop());for(var i=[],s=[],o=0;o<r.length;o++)if(s.push(r[o]),r[o].hasClass("mbin")||r[o].hasClass("mrel")||r[o].hasClass("allowbreak")){for(var l=!1;o<r.length-1&&r[o+1].hasClass("mspace")&&!r[o+1].hasClass("newline");)o++,s.push(r[o]),r[o].hasClass("nobreak")&&(l=!0);l||(i.push(Vs(s,t)),s=[])}else r[o].hasClass("newline")&&(s.pop(),s.length>0&&(i.push(Vs(s,t)),s=[]),i.push(r[o]));s.length>0&&i.push(Vs(s,t));var u;n?(u=Vs(Vt(n,t,!0),t),u.classes=["tag"],i.push(u)):a&&i.push(a);var c=ve(["katex-html"],i);if(c.setAttribute("aria-hidden","true"),u){var h=u.children[0];h.style.height=Se(c.height+c.depth),c.depth&&(h.style.verticalAlign=Se(-c.depth))}return c}function V2(e){return new ii(e)}class Ee{constructor(t,n,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=n||[],this.classes=r||[]}setAttribute(t,n){this.attributes[t]=n}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);this.classes.length>0&&(t.className=Br(this.classes));for(var r=0;r<this.children.length;r++)if(this.children[r]instanceof zt&&this.children[r+1]instanceof zt){for(var a=this.children[r].toText()+this.children[++r].toText();this.children[r+1]instanceof zt;)a+=this.children[++r].toText();t.appendChild(new zt(a).toNode())}else t.appendChild(this.children[r].toNode());return t}toMarkup(){var t="<"+this.type;for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(t+=" "+n+'="',t+=an(this.attributes[n]),t+='"');this.classes.length>0&&(t+=' class ="'+an(Br(this.classes))+'"'),t+=">";for(var r=0;r<this.children.length;r++)t+=this.children[r].toMarkup();return t+="</"+this.type+">",t}toText(){return this.children.map(t=>t.toText()).join("")}}class zt{constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return an(this.toText())}toText(){return this.text}}class $2{constructor(t){this.width=void 0,this.character=void 0,this.width=t,t>=.05555&&t<=.05556?this.character=" ":t>=.1666&&t<=.1667?this.character=" ":t>=.2222&&t<=.2223?this.character=" ":t>=.2777&&t<=.2778?this.character=" ":t>=-.05556&&t<=-.05555?this.character=" ":t>=-.1667&&t<=-.1666?this.character=" ":t>=-.2223&&t<=-.2222?this.character=" ":t>=-.2778&&t<=-.2777?this.character=" ":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",Se(this.width)),t}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+Se(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var hE=new Set(["\\imath","\\jmath"]),fE=new Set(["mrow","mtable"]),Fn=function(t,n,r){return At[n][t]&&At[n][t].replace&&t.charCodeAt(0)!==55349&&!(j2.hasOwnProperty(t)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(t=At[n][t].replace),new zt(t)},xd=function(t){return t.length===1?t[0]:new Ee("mrow",t)},mE={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},bd=(e,t)=>{if(e.mode==="text"){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold"}var n=t.font;if(!n||n==="mathnormal")return null;var r=e.mode,a=mE[n];if(a)return typeof a=="function"?a(e):a;var i=e.text;if(hE.has(i))return null;if(At[r][i]){var s=At[r][i].replace;s&&(i=s)}var o=qc[n].fontName;return md(i,o,r)?qc[n].variant:null};function wu(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var t=e.children[0];return t instanceof zt&&t.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var n=e.children[0];return n instanceof zt&&n.text===","}else return!1}var Mn=function(t,n,r){if(t.length===1){var a=wt(t[0],n);return r&&a instanceof Ee&&a.type==="mo"&&(a.setAttribute("lspace","0em"),a.setAttribute("rspace","0em")),[a]}for(var i=[],s,o=0;o<t.length;o++){var l=wt(t[o],n);if(l instanceof Ee&&s instanceof Ee){if(l.type==="mtext"&&s.type==="mtext"&&l.getAttribute("mathvariant")===s.getAttribute("mathvariant")){s.children.push(...l.children);continue}else if(l.type==="mn"&&s.type==="mn"){s.children.push(...l.children);continue}else if(wu(l)&&s.type==="mn"){s.children.push(...l.children);continue}else if(l.type==="mn"&&wu(s))l.children=[...s.children,...l.children],i.pop();else if((l.type==="msup"||l.type==="msub")&&l.children.length>=1&&(s.type==="mn"||wu(s))){var u=l.children[0];u instanceof Ee&&u.type==="mn"&&(u.children=[...s.children,...u.children],i.pop())}else if(s.type==="mi"&&s.children.length===1){var c=s.children[0];if(c instanceof zt&&c.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var h=l.children[0];h instanceof zt&&h.text.length>0&&(h.text=h.text.slice(0,1)+"̸"+h.text.slice(1),i.pop())}}}i.push(l),s=l}return i},Hr=function(t,n,r){return xd(Mn(t,n,r))},wt=function(t,n){if(!t)return new Ee("mrow");if(jo[t.type])return jo[t.type](t,n);throw new Te("Got group of unknown type: '"+t.type+"'")};function em(e,t,n,r,a){var i=Mn(e,n),s;i.length===1&&i[0]instanceof Ee&&fE.has(i[0].type)?s=i[0]:s=new Ee("mrow",i);var o=new Ee("annotation",[new zt(t)]);o.setAttribute("encoding","application/x-tex");var l=new Ee("semantics",[s,o]),u=new Ee("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&u.setAttribute("display","block");var c=a?"katex":"katex-mathml";return ve([c],[u])}var pE=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],tm=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],nm=function(t,n){return n.size<2?t:pE[t-1][n.size-1]};class xr{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||xr.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.sizeMultiplier=tm[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(n,t),new xr(n)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:nm(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:tm[t-1]})}havingBaseStyle(t){t=t||this.style.text();var n=nm(xr.BASESIZE,t);return this.size===n&&this.textSize===xr.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==xr.BASESIZE?["sizing","reset-size"+this.size,"size"+xr.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=ZT(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}xr.BASESIZE=6;var W2=function(t){return new xr({style:t.displayMode?Ke.DISPLAY:Ke.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},G2=function(t,n){if(n.displayMode){var r=["katex-display"];n.leqno&&r.push("leqno"),n.fleqn&&r.push("fleqn"),t=ve(r,[t])}return t},gE=function(t,n,r){var a=W2(r),i;if(r.output==="mathml")return em(t,n,a,r.displayMode,!0);if(r.output==="html"){var s=Gc(t,a);i=ve(["katex"],[s])}else{var o=em(t,n,a,r.displayMode,!1),l=Gc(t,a);i=ve(["katex"],[o,l])}return G2(i,r)},xE=function(t,n,r){var a=W2(r),i=Gc(t,a),s=ve(["katex"],[i]);return G2(s,r)},bE={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},pl=function(t){var n=new Ee("mo",[new zt(bE[t.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},yE={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},vE=new Set(["widehat","widecheck","widetilde","utilde"]),gl=function(t,n){function r(){var o=4e5,l=t.label.slice(1);if(vE.has(l)&&"base"in t){var u=t.base.type==="ordgroup"?t.base.body.length:1,c,h,m;if(u>5)l==="widehat"||l==="widecheck"?(c=420,o=2364,m=.42,h=l+"4"):(c=312,o=2340,m=.34,h="tilde4");else{var d=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(o=[0,1062,2364,2364,2364][d],c=[0,239,300,360,420][d],m=[0,.24,.3,.3,.36,.42][d],h=l+d):(o=[0,600,1033,2339,2340][d],c=[0,260,286,306,312][d],m=[0,.26,.286,.3,.306,.34][d],h="tilde"+d)}var p=new Fr(h),g=new wr([p],{width:"100%",height:Se(m),viewBox:"0 0 "+o+" "+c,preserveAspectRatio:"none"});return{span:zr([],[g],n),minWidth:0,height:m}}else{var x=[],b=yE[l];if(!b)throw new Error('No SVG data for "'+l+'".');var[v,T,N]=b,k=N/1e3,A=v.length,_,S;if(A===1){if(b.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');_=["hide-tail"],S=[b[3]]}else if(A===2)_=["halfarrow-left","halfarrow-right"],S=["xMinYMin","xMaxYMin"];else if(A===3)_=["brace-left","brace-center","brace-right"],S=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
|
|
762
|
+
`+A+" children.");for(var I=0;I<A;I++){var C=new Fr(v[I]),D=new wr([C],{width:"400em",height:Se(k),viewBox:"0 0 "+o+" "+N,preserveAspectRatio:S[I]+" slice"}),L=zr([_[I]],[D],n);if(A===1)return{span:L,minWidth:T,height:k};L.style.height=Se(k),x.push(L)}return{span:ve(["stretchy"],x,n),minWidth:T,height:k}}}var{span:a,minWidth:i,height:s}=r();return a.height=s,a.style.height=Se(s),i>0&&(a.style.minWidth=Se(i)),a},wE=function(t,n,r,a,i){var s,o=t.height+t.depth+r+a;if(/fbox|color|angl/.test(n)){if(s=ve(["stretchy",n],[],i),n==="fbox"){var l=i.color&&i.getColor();l&&(s.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(n)&&u.push(new jc({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&u.push(new jc({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new wr(u,{width:"100%",height:Se(o)});s=zr([],[c],i)}return s.height=o,s.style.height=Se(o),s},kE={bin:1,close:1,inner:1,open:1,punct:1,rel:1},TE={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function EE(e){return e in kE}function Je(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function xl(e){var t=bl(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function bl(e){return e&&(e.type==="atom"||TE.hasOwnProperty(e.type))?e:null}var Y2=e=>{if(e instanceof Cn)return e;if(XT(e)&&e.children.length===1)return Y2(e.children[0])},yd=(e,t)=>{var n,r,a;e&&e.type==="supsub"?(r=Je(e.base,"accent"),n=r.base,e.base=n,a=KT(pt(e,t)),e.base=r):(r=Je(e,"accent"),n=r.base);var i=pt(n,t.havingCrampedStyle()),s=r.isShifty&&Tr(n),o=0;if(s){var l,u;o=(l=(u=Y2(i))==null?void 0:u.skew)!=null?l:0}var c=r.label==="\\c",h=c?i.height+i.depth:Math.min(i.height,t.fontMetrics().xHeight),m;if(r.isStretchy)m=gl(r,t),m=mt({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:m,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Se(2*o)+")",marginLeft:Se(2*o)}:void 0}]});else{var d,p;r.label==="\\vec"?(d=H2("vec",t),p=z2.vec[1]):(d=ml({mode:r.mode,text:r.label},t,"textord"),d=YT(d),d.italic=0,p=d.width,c&&(h+=d.depth)),m=ve(["accent-body"],[d]);var g=r.label==="\\textcircled";g&&(m.classes.push("accent-full"),h=i.height);var x=o;g||(x-=p/2),m.style.left=Se(x),r.label==="\\textcircled"&&(m.style.top=".2em"),m=mt({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-h},{type:"elem",elem:m}]})}var b=ve(["mord","accent"],[m],t);return a?(a.children[0]=b,a.height=Math.max(b.height,a.height),a.classes[0]="mord",a):b},K2=(e,t)=>{var n=e.isStretchy?pl(e.label):new Ee("mo",[Fn(e.label,e.mode)]),r=new Ee("mover",[wt(e.base,t),n]);return r.setAttribute("accent","true"),r},SE=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));Le({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=Bo(t[0]),r=!SE.test(e.funcName),a=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:a,base:n}},htmlBuilder:yd,mathmlBuilder:K2});Le({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:yd,mathmlBuilder:K2});Le({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,a=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:a}},htmlBuilder:(e,t)=>{var n=pt(e.base,t),r=gl(e,t),a=e.label==="\\utilde"?.12:0,i=mt({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:a},{type:"elem",elem:n}]});return ve(["mord","accentunder"],[i],t)},mathmlBuilder:(e,t)=>{var n=pl(e.label),r=new Ee("munder",[wt(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var $s=e=>{var t=new Ee("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};Le({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:a}=e;return{type:"xArrow",mode:r.mode,label:a,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),a=Za(pt(e.body,r,t),t),i=e.label.slice(0,2)==="\\x"?"x":"cd";a.classes.push(i+"-arrow-pad");var s;e.below&&(r=t.havingStyle(n.sub()),s=Za(pt(e.below,r,t),t),s.classes.push(i+"-arrow-pad"));var o=gl(e,t),l=-t.fontMetrics().axisHeight+.5*o.height,u=-t.fontMetrics().axisHeight-.5*o.height-.111;(a.depth>.25||e.label==="\\xleftequilibrium")&&(u-=a.depth);var c;if(s){var h=-t.fontMetrics().axisHeight+s.height+.5*o.height+.111;c=mt({positionType:"individualShift",children:[{type:"elem",elem:a,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:s,shift:h}]})}else c=mt({positionType:"individualShift",children:[{type:"elem",elem:a,shift:u},{type:"elem",elem:o,shift:l,wrapperClasses:["svg-align"]}]});return ve(["mrel","x-arrow"],[c],t)},mathmlBuilder(e,t){var n=pl(e.label);n.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var a=$s(wt(e.body,t));if(e.below){var i=$s(wt(e.below,t));r=new Ee("munderover",[n,i,a])}else r=new Ee("mover",[n,a])}else if(e.below){var s=$s(wt(e.below,t));r=new Ee("munder",[n,s])}else r=$s(),r=new Ee("mover",[n,r]);return r}});function X2(e,t){var n=Vt(e.body,t,!0);return ve([e.mclass],n,t)}function Q2(e,t){var n,r=Mn(e.body,t);return e.mclass==="minner"?n=new Ee("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(n=r[0],n.type="mi"):n=new Ee("mi",r):(e.isCharacterBox?(n=r[0],n.type="mo"):n=new Ee("mo",r),e.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):e.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):e.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}Le({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,a=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:Ft(a),isCharacterBox:Tr(a)}},htmlBuilder:X2,mathmlBuilder:Q2});var yl=e=>{var t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return t.type==="atom"&&(t.family==="bin"||t.family==="rel")?"m"+t.family:"mord"};Le({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:yl(t[0]),body:Ft(t[1]),isCharacterBox:Tr(t[1])}}});Le({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var{parser:n,funcName:r}=e,a=t[1],i=t[0],s;r!=="\\stackrel"?s=yl(a):s="mrel";var o={type:"op",mode:a.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:Ft(a)},l={type:"supsub",mode:i.mode,base:o,sup:r==="\\underset"?null:i,sub:r==="\\underset"?i:null};return{type:"mclass",mode:n.mode,mclass:s,body:[l],isCharacterBox:Tr(l)}},htmlBuilder:X2,mathmlBuilder:Q2});Le({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:yl(t[0]),body:Ft(t[0])}},htmlBuilder(e,t){var n=Vt(e.body,t,!0),r=ve([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=Mn(e.body,t),r=new Ee("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var AE={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},rm=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),am=e=>e.type==="textord"&&e.text==="@",CE=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function NE(e,t,n){var r=AE[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var a=n.callFunction("\\\\cdleft",[t[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},s=n.callFunction("\\Big",[i],[]),o=n.callFunction("\\\\cdright",[t[1]],[]),l={type:"ordgroup",mode:"math",body:[a,s,o]};return n.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function ME(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n==="&"||n==="\\\\")e.consume();else if(n==="\\end"){t[t.length-1].length===0&&t.pop();break}else throw new Te("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],a=[r],i=0;i<t.length;i++){for(var s=t[i],o=rm(),l=0;l<s.length;l++)if(!am(s[l]))o.body.push(s[l]);else{r.push(o),l+=1;var u=xl(s[l]).text,c=new Array(2);if(c[0]={type:"ordgroup",mode:"math",body:[]},c[1]={type:"ordgroup",mode:"math",body:[]},!"=|.".includes(u))if("<>AV".includes(u))for(var h=0;h<2;h++){for(var m=!0,d=l+1;d<s.length;d++){if(CE(s[d],u)){m=!1,l=d;break}if(am(s[d]))throw new Te("Missing a "+u+" character to complete a CD arrow.",s[d]);c[h].body.push(s[d])}if(m)throw new Te("Missing a "+u+" character to complete a CD arrow.",s[l])}else throw new Te('Expected one of "<>AV=|." after @',s[l]);var p=NE(u,c,e),g={type:"styling",body:[p],mode:"math",style:"display",resetFont:!0};r.push(g),o=rm()}i%2===0?r.push(o):r.shift(),r=[],a.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var x=new Array(a[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:a,arraystretch:1,addJot:!0,rowGaps:[null],cols:x,colSeparationType:"CD",hLinesBeforeRow:new Array(a.length+1).fill([])}}Le({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=Za(pt(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=Se(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new Ee("mrow",[wt(e.label,t)]);return n=new Ee("mpadded",[n]),n.setAttribute("width","0"),e.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new Ee("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});Le({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=Za(pt(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(e,t){return new Ee("mrow",[wt(e.fragment,t)])}});Le({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=Je(t[0],"ordgroup"),a=r.body,i="",s=0;s<a.length;s++){var o=Je(a[s],"textord");i+=o.text}var l=parseInt(i),u;if(isNaN(l))throw new Te("\\@char has non-numeric argument "+i);if(l<0||l>=1114111)throw new Te("\\@char with invalid code point "+i);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:n.mode,text:u}}});var Z2=(e,t)=>{var n=Vt(e.body,t.withColor(e.color),!1);return Sr(n)},J2=(e,t)=>{var n=Mn(e.body,t.withColor(e.color)),r=new Ee("mstyle",n);return r.setAttribute("mathcolor",e.color),r};Le({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=Je(t[0],"color-token").color,a=t[1];return{type:"color",mode:n.mode,color:r,body:Ft(a)}},htmlBuilder:Z2,mathmlBuilder:J2});Le({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,a=Je(t[0],"color-token").color;n.gullet.macros.set("\\current@color",a);var i=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:a,body:i}},htmlBuilder:Z2,mathmlBuilder:J2});Le({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,a=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:a&&Je(a,"size").value}},htmlBuilder(e,t){var n=ve(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=Se(It(e.size,t)))),n},mathmlBuilder(e,t){var n=new Ee("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",Se(It(e.size,t)))),n}});var Yc={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},ex=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new Te("Expected a control sequence",e);return t},IE=e=>{var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},tx=(e,t,n,r)=>{var a=e.gullet.macros.get(n.text);a==null&&(n.noexpand=!0,a={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,a,r)};Le({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(Yc[r.text])return(n==="\\global"||n==="\\\\globallong")&&(r.text=Yc[r.text]),Je(t.parseFunction(),"internal");throw new Te("Invalid token after macro prefix",r)}});Le({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),a=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(a))throw new Te("Expected a control sequence",r);for(var i=0,s,o=[[]];t.gullet.future().text!=="{";)if(r=t.gullet.popToken(),r.text==="#"){if(t.gullet.future().text==="{"){s=t.gullet.future(),o[i].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Te('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new Te('Argument number "'+r.text+'" out of order');i++,o.push([])}else{if(r.text==="EOF")throw new Te("Expected a macro definition");o[i].push(r.text)}var{tokens:l}=t.gullet.consumeArg();return s&&l.unshift(s),(n==="\\edef"||n==="\\xdef")&&(l=t.gullet.expandTokens(l),l.reverse()),t.gullet.macros.set(a,{tokens:l,numArgs:i,delimiters:o},n===Yc[n]),{type:"internal",mode:t.mode}}});Le({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=ex(t.gullet.popToken());t.gullet.consumeSpaces();var a=IE(t);return tx(t,r,a,n==="\\\\globallet"),{type:"internal",mode:t.mode}}});Le({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=ex(t.gullet.popToken()),a=t.gullet.popToken(),i=t.gullet.popToken();return tx(t,r,i,n==="\\\\globalfuture"),t.gullet.pushToken(i),t.gullet.pushToken(a),{type:"internal",mode:t.mode}}});var Ri=function(t,n,r){var a=At.math[t]&&At.math[t].replace,i=md(a||t,n,r);if(!i)throw new Error("Unsupported symbol "+t+" and font size "+n+".");return i},vd=function(t,n,r,a){var i=r.havingBaseStyle(n),s=ve(a.concat(i.sizingClasses(r)),[t],r),o=i.sizeMultiplier/r.sizeMultiplier;return s.height*=o,s.depth*=o,s.maxFontSize=i.sizeMultiplier,s},nx=function(t,n,r){var a=n.havingBaseStyle(r),i=(1-n.sizeMultiplier/a.sizeMultiplier)*n.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=Se(i),t.height-=i,t.depth+=i},_E=function(t,n,r,a,i,s){var o=cn(t,"Main-Regular",i,a),l=vd(o,n,a,s);return nx(l,a,n),l},RE=function(t,n,r,a){return cn(t,"Size"+n+"-Regular",r,a)},rx=function(t,n,r,a,i,s){var o=RE(t,n,i,a),l=vd(ve(["delimsizing","size"+n],[o],a),Ke.TEXT,a,s);return r&&nx(l,a,Ke.TEXT),l},ku=function(t,n,r){var a;n==="Size1-Regular"?a="delim-size1":a="delim-size4";var i=ve(["delimsizinginner",a],[ve([],[cn(t,n,r)])]);return{type:"elem",elem:i}},Tu=function(t,n,r){var a=ar["Size4-Regular"][t.charCodeAt(0)]?ar["Size4-Regular"][t.charCodeAt(0)][4]:ar["Size1-Regular"][t.charCodeAt(0)][4],i=new Fr("inner",HT(t,Math.round(1e3*n))),s=new wr([i],{width:Se(a),height:Se(n),style:"width:"+Se(a),viewBox:"0 0 "+1e3*a+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),o=zr([],[s],r);return o.height=n,o.style.height=Se(n),o.style.width=Se(a),{type:"elem",elem:o}},Kc=.008,Ws={type:"kern",size:-1*Kc},LE=new Set(["|","\\lvert","\\rvert","\\vert"]),DE=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),ax=function(t,n,r,a,i,s){var o,l,u,c,h="",m=0;o=u=c=t,l=null;var d="Size1-Regular";t==="\\uparrow"?u=c="⏐":t==="\\Uparrow"?u=c="‖":t==="\\downarrow"?o=u="⏐":t==="\\Downarrow"?o=u="‖":t==="\\updownarrow"?(o="\\uparrow",u="⏐",c="\\downarrow"):t==="\\Updownarrow"?(o="\\Uparrow",u="‖",c="\\Downarrow"):LE.has(t)?(u="∣",h="vert",m=333):DE.has(t)?(u="∥",h="doublevert",m=556):t==="["||t==="\\lbrack"?(o="⎡",u="⎢",c="⎣",d="Size4-Regular",h="lbrack",m=667):t==="]"||t==="\\rbrack"?(o="⎤",u="⎥",c="⎦",d="Size4-Regular",h="rbrack",m=667):t==="\\lfloor"||t==="⌊"?(u=o="⎢",c="⎣",d="Size4-Regular",h="lfloor",m=667):t==="\\lceil"||t==="⌈"?(o="⎡",u=c="⎢",d="Size4-Regular",h="lceil",m=667):t==="\\rfloor"||t==="⌋"?(u=o="⎥",c="⎦",d="Size4-Regular",h="rfloor",m=667):t==="\\rceil"||t==="⌉"?(o="⎤",u=c="⎥",d="Size4-Regular",h="rceil",m=667):t==="("||t==="\\lparen"?(o="⎛",u="⎜",c="⎝",d="Size4-Regular",h="lparen",m=875):t===")"||t==="\\rparen"?(o="⎞",u="⎟",c="⎠",d="Size4-Regular",h="rparen",m=875):t==="\\{"||t==="\\lbrace"?(o="⎧",l="⎨",c="⎩",u="⎪",d="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(o="⎫",l="⎬",c="⎭",u="⎪",d="Size4-Regular"):t==="\\lgroup"||t==="⟮"?(o="⎧",c="⎩",u="⎪",d="Size4-Regular"):t==="\\rgroup"||t==="⟯"?(o="⎫",c="⎭",u="⎪",d="Size4-Regular"):t==="\\lmoustache"||t==="⎰"?(o="⎧",c="⎭",u="⎪",d="Size4-Regular"):(t==="\\rmoustache"||t==="⎱")&&(o="⎫",c="⎩",u="⎪",d="Size4-Regular");var p=Ri(o,d,i),g=p.height+p.depth,x=Ri(u,d,i),b=x.height+x.depth,v=Ri(c,d,i),T=v.height+v.depth,N=0,k=1;if(l!==null){var A=Ri(l,d,i);N=A.height+A.depth,k=2}var _=g+T+N,S=Math.max(0,Math.ceil((n-_)/(k*b))),I=_+S*k*b,C=a.fontMetrics().axisHeight;r&&(C*=a.sizeMultiplier);var D=I/2-C,L=[];if(h.length>0){var F=I-g-T,O=Math.round(I*1e3),R=UT(h,Math.round(F*1e3)),H=new Fr(h,R),V=Se(m/1e3),q=Se(O/1e3),Z=new wr([H],{width:V,height:q,viewBox:"0 0 "+m+" "+O}),B=zr([],[Z],a);B.height=O/1e3,B.style.width=V,B.style.height=q,L.push({type:"elem",elem:B})}else{if(L.push(ku(c,d,i)),L.push(Ws),l===null){var Q=I-g-T+2*Kc;L.push(Tu(u,Q,a))}else{var ne=(I-g-T-N)/2+2*Kc;L.push(Tu(u,ne,a)),L.push(Ws),L.push(ku(l,d,i)),L.push(Ws),L.push(Tu(u,ne,a))}L.push(Ws),L.push(ku(o,d,i))}var j=a.havingBaseStyle(Ke.TEXT),re=mt({positionType:"bottom",positionData:D,children:L});return vd(ve(["delimsizing","mult"],[re],j),Ke.TEXT,a,s)},Eu=80,Su=.08,Au=function(t,n,r,a,i){var s=zT(t,a,r),o=new Fr(t,s),l=new wr([o],{width:"400em",height:Se(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return zr(["hide-tail"],[l],i)},PE=function(t,n){var r=n.havingBaseSizing(),a=ux("\\surd",t*r.sizeMultiplier,lx,r),i=r.sizeMultiplier,s=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),o,l,u,c,h;return a.type==="small"?(c=1e3+1e3*s+Eu,t<1?i=1:t<1.4&&(i=.7),l=(1+s+Su)/i,u=(1+s)/i,o=Au("sqrtMain",l,c,s,n),o.style.minWidth="0.853em",h=.833/i):a.type==="large"?(c=(1e3+Eu)*Hi[a.size],u=(Hi[a.size]+s)/i,l=(Hi[a.size]+s+Su)/i,o=Au("sqrtSize"+a.size,l,c,s,n),o.style.minWidth="1.02em",h=1/i):(l=t+s+Su,u=t+s,c=Math.floor(1e3*t+s)+Eu,o=Au("sqrtTall",l,c,s,n),o.style.minWidth="0.742em",h=1.056),o.height=u,o.style.height=Se(l),{span:o,advanceWidth:h,ruleWidth:(n.fontMetrics().sqrtRuleThickness+s)*i}},ix=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),OE=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),sx=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Hi=[0,1.2,1.8,2.4,3],ox=function(t,n,r,a,i){if(t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle"),ix.has(t)||sx.has(t))return rx(t,n,!1,r,a,i);if(OE.has(t))return ax(t,Hi[n],!1,r,a,i);throw new Te("Illegal delimiter: '"+t+"'")},jE=[{type:"small",style:Ke.SCRIPTSCRIPT},{type:"small",style:Ke.SCRIPT},{type:"small",style:Ke.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],BE=[{type:"small",style:Ke.SCRIPTSCRIPT},{type:"small",style:Ke.SCRIPT},{type:"small",style:Ke.TEXT},{type:"stack"}],lx=[{type:"small",style:Ke.SCRIPTSCRIPT},{type:"small",style:Ke.SCRIPT},{type:"small",style:Ke.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],FE=function(t){if(t.type==="small")return"Main-Regular";if(t.type==="large")return"Size"+t.size+"-Regular";if(t.type==="stack")return"Size4-Regular";var n=t.type;throw new Error("Add support for delim type '"+n+"' here.")},ux=function(t,n,r,a){for(var i=Math.min(2,3-a.style.size),s=i;s<r.length;s++){var o=r[s];if(o.type==="stack")break;var l=Ri(t,FE(o),"math"),u=l.height+l.depth;if(o.type==="small"){var c=a.havingBaseStyle(o.style);u*=c.sizeMultiplier}if(u>n)return o}return r[r.length-1]},Xc=function(t,n,r,a,i,s){t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle");var o;sx.has(t)?o=jE:ix.has(t)?o=lx:o=BE;var l=ux(t,n,o,a);return l.type==="small"?_E(t,l.style,r,a,i,s):l.type==="large"?rx(t,l.size,r,a,i,s):ax(t,n,r,a,i,s)},Cu=function(t,n,r,a,i,s){var o=a.fontMetrics().axisHeight*a.sizeMultiplier,l=901,u=5/a.fontMetrics().ptPerEm,c=Math.max(n-o,r+o),h=Math.max(c/500*l,2*c-u);return Xc(t,h,!0,a,i,s)},im={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},zE=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function sm(e){return"isMiddle"in e}function vl(e,t){var n=bl(e);if(n&&zE.has(n.text))return n;throw n?new Te("Invalid delimiter '"+n.text+"' after '"+t.funcName+"'",e):new Te("Invalid delimiter type '"+e.type+"'",e)}Le({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=vl(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:im[e.funcName].size,mclass:im[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim==="."?ve([e.mclass]):ox(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!=="."&&t.push(Fn(e.delim,e.mode));var n=new Ee("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=Se(Hi[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function om(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Le({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new Te("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:vl(t[0],e).text,color:n}}});Le({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=vl(t[0],e),r=e.parser;++r.leftrightDepth;var a=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=Je(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:a,left:n.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,t)=>{om(e);for(var n=Vt(e.body,t,!0,["mopen","mclose"]),r=0,a=0,i=!1,s=0;s<n.length;s++){var o=n[s];sm(o)?i=!0:(r=Math.max(n[s].height,r),a=Math.max(n[s].depth,a))}r*=t.sizeMultiplier,a*=t.sizeMultiplier;var l;if(e.left==="."?l=is(t,["mopen"]):l=Cu(e.left,r,a,t,e.mode,["mopen"]),n.unshift(l),i)for(var u=1;u<n.length;u++){var c=n[u];if(sm(c)){var h=c.isMiddle;n[u]=Cu(h.delim,r,a,h.options,e.mode,[])}}var m;if(e.right===".")m=is(t,["mclose"]);else{var d=e.rightColor?t.withColor(e.rightColor):t;m=Cu(e.right,r,a,d,e.mode,["mclose"])}return n.push(m),ve(["minner"],n,t)},mathmlBuilder:(e,t)=>{om(e);var n=Mn(e.body,t);if(e.left!=="."){var r=new Ee("mo",[Fn(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(e.right!=="."){var a=new Ee("mo",[Fn(e.right,e.mode)]);a.setAttribute("fence","true"),e.rightColor&&a.setAttribute("mathcolor",e.rightColor),n.push(a)}return xd(n)}});Le({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=vl(t[0],e);if(!e.parser.leftrightDepth)throw new Te("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim==="."?n=is(t,[]):(n=ox(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=e.delim==="\\vert"||e.delim==="|"?Fn("|","text"):Fn(e.delim,e.mode),r=new Ee("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var wl=(e,t)=>{var n=Za(pt(e.body,t),t),r=e.label.slice(1),a=t.sizeMultiplier,i,s,o=Tr(e.body);if(r==="sout")i=ve(["stretchy","sout"]),i.height=t.fontMetrics().defaultRuleThickness/a,s=-.5*t.fontMetrics().xHeight;else if(r==="phase"){var l=It({number:.6,unit:"pt"},t),u=It({number:.35,unit:"ex"},t),c=t.havingBaseSizing();a=a/c.sizeMultiplier;var h=n.height+n.depth+l+u;n.style.paddingLeft=Se(h/2+l);var m=Math.floor(1e3*h*a),d=BT(m),p=new wr([new Fr("phase",d)],{width:"400em",height:Se(m/1e3),viewBox:"0 0 400000 "+m,preserveAspectRatio:"xMinYMin slice"});i=zr(["hide-tail"],[p],t),i.style.height=Se(h),s=n.depth+l+u}else{/cancel/.test(r)?o||n.classes.push("cancel-pad"):r==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var g,x,b=0;/box/.test(r)?(b=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),g=t.fontMetrics().fboxsep+(r==="colorbox"?0:b),x=g):r==="angl"?(b=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),g=4*b,x=Math.max(0,.25-n.depth)):(g=o?.2:0,x=g),i=wE(n,r,g,x,t),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=Se(b)):r==="angl"&&b!==.049&&(i.style.borderTopWidth=Se(b),i.style.borderRightWidth=Se(b)),s=n.depth+x,e.backgroundColor&&(i.style.backgroundColor=e.backgroundColor,e.borderColor&&(i.style.borderColor=e.borderColor))}var v;if(e.backgroundColor)v=mt({positionType:"individualShift",children:[{type:"elem",elem:i,shift:s},{type:"elem",elem:n,shift:0}]});else{var T=/cancel|phase/.test(r)?["svg-align"]:[];v=mt({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:i,shift:s,wrapperClasses:T}]})}return/cancel/.test(r)&&(v.height=n.height,v.depth=n.depth),/cancel/.test(r)&&!o?ve(["mord","cancel-lap"],[v],t):ve(["mord"],[v],t)},kl=(e,t)=>{var n,r=new Ee(e.label.includes("colorbox")?"mpadded":"menclose",[wt(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),e.label==="\\fcolorbox"){var a=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+Se(a)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};Le({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,t,n){var{parser:r,funcName:a}=e,i=Je(t[0],"color-token").color,s=t[1];return{type:"enclose",mode:r.mode,label:a,backgroundColor:i,body:s}},htmlBuilder:wl,mathmlBuilder:kl});Le({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,t,n){var{parser:r,funcName:a}=e,i=Je(t[0],"color-token").color,s=Je(t[1],"color-token").color,o=t[2];return{type:"enclose",mode:r.mode,label:a,backgroundColor:s,borderColor:i,body:o}},htmlBuilder:wl,mathmlBuilder:kl});Le({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}});Le({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,a=t[0];return{type:"enclose",mode:n.mode,label:r,body:a}},htmlBuilder:wl,mathmlBuilder:kl});Le({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e;n.mode==="math"&&n.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var a=t[0];return{type:"enclose",mode:n.mode,label:r,body:a}},htmlBuilder:wl,mathmlBuilder:kl});Le({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var cx={};function cr(e){for(var{type:t,names:n,props:r,handler:a,htmlBuilder:i,mathmlBuilder:s}=e,o={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:a},l=0;l<n.length;++l)cx[n[l]]=o;i&&(Oo[t]=i),s&&(jo[t]=s)}var dx={};function z(e,t){dx[e]=t}class bn{constructor(t,n,r){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=t,this.start=n,this.end=r}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new bn(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}}class Sn{constructor(t,n){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=t,this.loc=n}range(t,n){return new Sn(n,bn.range(this,t))}}function lm(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for(n==="\\relax"&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);n==="\\hline"||n==="\\hdashline";)e.consume(),t.push(n==="\\hdashline"),e.consumeSpaces(),n=e.fetch().text;return t}var Tl=e=>{var t=e.parser.settings;if(!t.displayMode)throw new Te("{"+e.envName+"} can be used only in display mode.")},HE=new Set(["gather","gather*"]);function wd(e){if(!e.includes("ed"))return!e.includes("*")}function Wr(e,t,n){var{hskipBeforeAndAfter:r,addJot:a,cols:i,arraystretch:s,colSeparationType:o,autoTag:l,singleRow:u,emptySingleRow:c,maxNumCols:h,leqno:m}=t;if(e.gullet.beginGroup(),u||e.gullet.macros.set("\\cr","\\\\\\relax"),!s){var d=e.gullet.expandMacroAsText("\\arraystretch");if(d==null)s=1;else if(s=parseFloat(d),!s||s<0)throw new Te("Invalid \\arraystretch: "+d)}e.gullet.beginGroup();var p=[],g=[p],x=[],b=[],v=l!=null?[]:void 0;function T(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function N(){v&&(e.gullet.macros.get("\\df@tag")?(v.push(e.subparse([new Sn("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):v.push(!!l&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(T(),b.push(lm(e));;){var k=e.parseExpression(!1,u?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var A={type:"ordgroup",mode:e.mode,body:k};n&&(A={type:"styling",mode:e.mode,style:n,resetFont:!0,body:[A]}),p.push(A);var _=e.fetch().text;if(_==="&"){if(h&&p.length===h){if(u||o)throw new Te("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(_==="\\end"){N(),p.length===1&&A.type==="styling"&&A.body.length===1&&A.body[0].type==="ordgroup"&&A.body[0].body.length===0&&(g.length>1||!c)&&g.pop(),b.length<g.length+1&&b.push([]);break}else if(_==="\\\\"){e.consume();var S=void 0;e.gullet.future().text!==" "&&(S=e.parseSizeGroup(!0)),x.push(S?S.value:null),N(),b.push(lm(e)),p=[],g.push(p),T()}else throw new Te("Expected & or \\\\ or \\cr or \\end",e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:a,arraystretch:s,body:g,cols:i,rowGaps:x,hskipBeforeAndAfter:r,hLinesBeforeRow:b,colSeparationType:o,tags:v,leqno:m}}function kd(e){return e.slice(0,1)==="d"?"display":"text"}var dr=function(t,n){var r,a,i=t.body.length,s=t.hLinesBeforeRow,o=0,l=new Array(i),u=[],c=Math.max(n.fontMetrics().arrayRuleWidth,n.minRuleThickness),h=1/n.fontMetrics().ptPerEm,m=5*h;if(t.colSeparationType&&t.colSeparationType==="small"){var d=n.havingStyle(Ke.SCRIPT).sizeMultiplier;m=.2778*(d/n.sizeMultiplier)}var p=t.colSeparationType==="CD"?It({number:3,unit:"ex"},n):12*h,g=3*h,x=t.arraystretch*p,b=.7*x,v=.3*x,T=0;function N(_e){for(var Ae=0;Ae<_e.length;++Ae)Ae>0&&(T+=.25),u.push({pos:T,isDashed:_e[Ae]})}for(N(s[0]),r=0;r<t.body.length;++r){var k=t.body[r],A=b,_=v;o<k.length&&(o=k.length);var S={cells:new Array(k.length),height:0,depth:0,pos:0};for(a=0;a<k.length;++a){var I=pt(k[a],n);_<I.depth&&(_=I.depth),A<I.height&&(A=I.height),S.cells[a]=I}var C=t.rowGaps[r],D=0;C&&(D=It(C,n),D>0&&(D+=v,_<D&&(_=D),D=0)),t.addJot&&r<t.body.length-1&&(_+=g),S.height=A,S.depth=_,T+=A,S.pos=T,T+=_+D,l[r]=S,N(s[r+1])}var L=T/2+n.fontMetrics().axisHeight,F=t.cols||[],O=[],R,H,V=[];if(t.tags&&t.tags.some(_e=>_e))for(r=0;r<i;++r){var q=l[r],Z=q.pos-L,B=t.tags[r],Q=void 0;B===!0?Q=ve(["eqn-num"],[],n):B===!1?Q=ve([],[],n):Q=ve([],Vt(B,n,!0),n),Q.depth=q.depth,Q.height=q.height,V.push({type:"elem",elem:Q,shift:Z})}for(a=0,H=0;a<o||H<F.length;++a,++H){for(var ne,j=F[H],re=!0;((K=j)==null?void 0:K.type)==="separator";){var K;if(re||(R=ve(["arraycolsep"],[]),R.style.width=Se(n.fontMetrics().doubleRuleSep),O.push(R)),j.separator==="|"||j.separator===":"){var X=j.separator==="|"?"solid":"dashed",ce=ve(["vertical-separator"],[],n);ce.style.height=Se(T),ce.style.borderRightWidth=Se(c),ce.style.borderRightStyle=X,ce.style.margin="0 "+Se(-c/2);var le=T-L;le&&(ce.style.verticalAlign=Se(-le)),O.push(ce)}else throw new Te("Invalid separator type: "+j.separator);H++,j=F[H],re=!1}if(!(a>=o)){var ee=void 0;if(a>0||t.hskipBeforeAndAfter){var Ie,de;ee=(Ie=(de=j)==null?void 0:de.pregap)!=null?Ie:m,ee!==0&&(R=ve(["arraycolsep"],[]),R.style.width=Se(ee),O.push(R))}var he=[];for(r=0;r<i;++r){var pe=l[r],Ce=pe.cells[a];if(Ce){var Oe=pe.pos-L;Ce.depth=pe.depth,Ce.height=pe.height,he.push({type:"elem",elem:Ce,shift:Oe})}}var st=mt({positionType:"individualShift",children:he}),Be=ve(["col-align-"+(((ne=j)==null?void 0:ne.align)||"c")],[st]);if(O.push(Be),a<o-1||t.hskipBeforeAndAfter){var ut,me;ee=(ut=(me=j)==null?void 0:me.postgap)!=null?ut:m,ee!==0&&(R=ve(["arraycolsep"],[]),R.style.width=Se(ee),O.push(R))}}}var Ue=ve(["mtable"],O);if(u.length>0){for(var ct=Qa("hline",n,c),tt=Qa("hdashline",n,c),ft=[{type:"elem",elem:Ue,shift:0}];u.length>0;){var Xe=u.pop(),Pe=Xe.pos-L;Xe.isDashed?ft.push({type:"elem",elem:tt,shift:Pe}):ft.push({type:"elem",elem:ct,shift:Pe})}Ue=mt({positionType:"individualShift",children:ft})}if(V.length===0)return ve(["mord"],[Ue],n);var oe=mt({positionType:"individualShift",children:V}),ge=ve(["tag"],[oe],n);return Sr([Ue,ge])},UE={c:"center ",l:"left ",r:"right "},hr=function(t,n){for(var r=[],a=new Ee("mtd",[],["mtr-glue"]),i=new Ee("mtd",[],["mml-eqn-num"]),s=0;s<t.body.length;s++){for(var o=t.body[s],l=[],u=0;u<o.length;u++)l.push(new Ee("mtd",[wt(o[u],n)]));t.tags&&t.tags[s]&&(l.unshift(a),l.push(a),t.leqno?l.unshift(i):l.push(i)),r.push(new Ee("mtr",l))}var c=new Ee("mtable",r),h=t.arraystretch===.5?.1:.16+t.arraystretch-1+(t.addJot?.09:0);c.setAttribute("rowspacing",Se(h));var m="",d="";if(t.cols&&t.cols.length>0){var p=t.cols,g="",x=!1,b=0,v=p.length;p[0].type==="separator"&&(m+="top ",b=1),p[p.length-1].type==="separator"&&(m+="bottom ",v-=1);for(var T=b;T<v;T++){var N=p[T];N.type==="align"?(d+=UE[N.align],x&&(g+="none "),x=!0):N.type==="separator"&&x&&(g+=N.separator==="|"?"solid ":"dashed ",x=!1)}c.setAttribute("columnalign",d.trim()),/[sd]/.test(g)&&c.setAttribute("columnlines",g.trim())}if(t.colSeparationType==="align"){for(var k=t.cols||[],A="",_=1;_<k.length;_++)A+=_%2?"0em ":"1em ";c.setAttribute("columnspacing",A.trim())}else t.colSeparationType==="alignat"||t.colSeparationType==="gather"?c.setAttribute("columnspacing","0em"):t.colSeparationType==="small"?c.setAttribute("columnspacing","0.2778em"):t.colSeparationType==="CD"?c.setAttribute("columnspacing","0.5em"):c.setAttribute("columnspacing","1em");var S="",I=t.hLinesBeforeRow;m+=I[0].length>0?"left ":"",m+=I[I.length-1].length>0?"right ":"";for(var C=1;C<I.length-1;C++)S+=I[C].length===0?"none ":I[C][0]?"dashed ":"solid ";return/[sd]/.test(S)&&c.setAttribute("rowlines",S.trim()),m!==""&&(c=new Ee("menclose",[c]),c.setAttribute("notation",m.trim())),t.arraystretch&&t.arraystretch<1&&(c=new Ee("mstyle",[c]),c.setAttribute("scriptlevel","1")),c},hx=function(t,n){t.envName.includes("ed")||Tl(t);var r=[],a=t.envName.includes("at")?"alignat":"align",i=t.envName==="split",s=Wr(t.parser,{cols:r,addJot:!0,autoTag:i?void 0:wd(t.envName),emptySingleRow:!0,colSeparationType:a,maxNumCols:i?2:void 0,leqno:t.parser.settings.leqno},"display"),o=0,l=0,u={type:"ordgroup",mode:t.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var c="",h=0;h<n[0].body.length;h++){var m=Je(n[0].body[h],"textord");c+=m.text}o=Number(c),l=o*2}var d=!l;s.body.forEach(function(b){for(var v=1;v<b.length;v+=2){var T=Je(b[v],"styling"),N=Je(T.body[0],"ordgroup");N.body.unshift(u)}if(d)l<b.length&&(l=b.length);else{var k=b.length/2;if(o<k)throw new Te("Too many math in a row: "+("expected "+o+", but got "+k),b[0])}});for(var p=0;p<l;++p){var g="r",x=0;p%2===1?g="l":p>0&&d&&(x=1),r[p]={type:"align",align:g,pregap:x,postgap:0}}return s.colSeparationType=d?"align":"alignat",s};cr({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=bl(t[0]),r=n?[t[0]]:Je(t[0],"ordgroup").body,a=r.map(function(s){var o=xl(s),l=o.text;if("lcr".includes(l))return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new Te("Unknown column alignment: "+l,s)}),i={cols:a,hskipBeforeAndAfter:!0,maxNumCols:a.length};return Wr(e.parser,i,kd(e.envName))},htmlBuilder:dr,mathmlBuilder:hr});cr({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(e.envName.charAt(e.envName.length-1)==="*"){var a=e.parser;if(a.consumeSpaces(),a.fetch().text==="["){if(a.consume(),a.consumeSpaces(),n=a.fetch().text,!"lcr".includes(n))throw new Te("Expected l or c or r",a.nextToken);a.consume(),a.consumeSpaces(),a.expect("]"),a.consume(),r.cols=[{type:"align",align:n}]}}var i=Wr(e.parser,r,kd(e.envName)),s=Math.max(0,...i.body.map(o=>o.length));return i.cols=new Array(s).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[i],left:t[0],right:t[1],rightColor:void 0}:i},htmlBuilder:dr,mathmlBuilder:hr});cr({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},n=Wr(e.parser,t,"script");return n.colSeparationType="small",n},htmlBuilder:dr,mathmlBuilder:hr});cr({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=bl(t[0]),r=n?[t[0]]:Je(t[0],"ordgroup").body,a=r.map(function(o){var l=xl(o),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Te("Unknown column alignment: "+u,o)});if(a.length>1)throw new Te("{subarray} can contain only one column");var i={cols:a,hskipBeforeAndAfter:!1,arraystretch:.5},s=Wr(e.parser,i,"script");if(s.body.length>0&&s.body[0].length>1)throw new Te("{subarray} can contain only one column");return s},htmlBuilder:dr,mathmlBuilder:hr});cr({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=Wr(e.parser,t,kd(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:dr,mathmlBuilder:hr});cr({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:hx,htmlBuilder:dr,mathmlBuilder:hr});cr({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){HE.has(e.envName)&&Tl(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:wd(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Wr(e.parser,t,"display")},htmlBuilder:dr,mathmlBuilder:hr});cr({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:hx,htmlBuilder:dr,mathmlBuilder:hr});cr({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Tl(e);var t={autoTag:wd(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Wr(e.parser,t,"display")},htmlBuilder:dr,mathmlBuilder:hr});cr({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Tl(e),ME(e.parser)},htmlBuilder:dr,mathmlBuilder:hr});z("\\nonumber","\\gdef\\@eqnsw{0}");z("\\notag","\\nonumber");Le({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new Te(e.funcName+" valid only within array environment")}});var um=cx;Le({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,a=t[0];if(a.type!=="ordgroup")throw new Te("Invalid environment name",a);for(var i="",s=0;s<a.body.length;++s)i+=Je(a.body[s],"textord").text;if(r==="\\begin"){if(!um.hasOwnProperty(i))throw new Te("No such environment: "+i,a);var o=um[i],{args:l,optArgs:u}=n.parseArguments("\\begin{"+i+"}",o),c={mode:n.mode,envName:i,parser:n},h=o.handler(c,l,u);n.expect("\\end",!1);var m=n.nextToken,d=Je(n.parseFunction(),"environment");if(d.name!==i)throw new Te("Mismatch: \\begin{"+i+"} matched by \\end{"+d.name+"}",m);return h}return{type:"environment",mode:n.mode,name:i,nameGroup:a}}});var fx=(e,t)=>{var n=e.font,r=t.withFont(n);return pt(e.body,r)},mx=(e,t)=>{var n=e.font,r=t.withFont(n);return wt(e.body,r)},cm={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};Le({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,a=Bo(t[0]),i=r;return i in cm&&(i=cm[i]),{type:"font",mode:n.mode,font:i.slice(1),body:a}},htmlBuilder:fx,mathmlBuilder:mx});Le({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"mclass",mode:n.mode,mclass:yl(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:Tr(r)}}});Le({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:a}=e,{mode:i}=n,s=n.parseExpression(!0,a);return{type:"font",mode:i,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:s}}},htmlBuilder:fx,mathmlBuilder:mx});var qE=(e,t)=>{var n=t.style,r=n.fracNum(),a=n.fracDen(),i;i=t.havingStyle(r);var s=pt(e.numer,i,t);if(e.continued){var o=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;s.height=s.height<o?o:s.height,s.depth=s.depth<l?l:s.depth}i=t.havingStyle(a);var u=pt(e.denom,i,t),c,h,m;e.hasBarLine?(e.barSize?(h=It(e.barSize,t),c=Qa("frac-line",t,h)):c=Qa("frac-line",t),h=c.height,m=c.height):(c=null,h=0,m=t.fontMetrics().defaultRuleThickness);var d,p,g;n.size===Ke.DISPLAY.size?(d=t.fontMetrics().num1,h>0?p=3*m:p=7*m,g=t.fontMetrics().denom1):(h>0?(d=t.fontMetrics().num2,p=m):(d=t.fontMetrics().num3,p=3*m),g=t.fontMetrics().denom2);var x;if(c){var v=t.fontMetrics().axisHeight;d-s.depth-(v+.5*h)<p&&(d+=p-(d-s.depth-(v+.5*h))),v-.5*h-(u.height-g)<p&&(g+=p-(v-.5*h-(u.height-g)));var T=-(v-.5*h);x=mt({positionType:"individualShift",children:[{type:"elem",elem:u,shift:g},{type:"elem",elem:c,shift:T},{type:"elem",elem:s,shift:-d}]})}else{var b=d-s.depth-(u.height-g);b<p&&(d+=.5*(p-b),g+=.5*(p-b)),x=mt({positionType:"individualShift",children:[{type:"elem",elem:u,shift:g},{type:"elem",elem:s,shift:-d}]})}i=t.havingStyle(n),x.height*=i.sizeMultiplier/t.sizeMultiplier,x.depth*=i.sizeMultiplier/t.sizeMultiplier;var N;n.size===Ke.DISPLAY.size?N=t.fontMetrics().delim1:n.size===Ke.SCRIPTSCRIPT.size?N=t.havingStyle(Ke.SCRIPT).fontMetrics().delim2:N=t.fontMetrics().delim2;var k,A;return e.leftDelim==null?k=is(t,["mopen"]):k=Xc(e.leftDelim,N,!0,t.havingStyle(n),e.mode,["mopen"]),e.continued?A=ve([]):e.rightDelim==null?A=is(t,["mclose"]):A=Xc(e.rightDelim,N,!0,t.havingStyle(n),e.mode,["mclose"]),ve(["mord"].concat(i.sizingClasses(t)),[k,ve(["mfrac"],[x]),A],t)},VE=(e,t)=>{var n=new Ee("mfrac",[wt(e.numer,t),wt(e.denom,t)]);if(!e.hasBarLine)n.setAttribute("linethickness","0px");else if(e.barSize){var r=It(e.barSize,t);n.setAttribute("linethickness",Se(r))}if(e.leftDelim!=null||e.rightDelim!=null){var a=[];if(e.leftDelim!=null){var i=new Ee("mo",[new zt(e.leftDelim.replace("\\",""))]);i.setAttribute("fence","true"),a.push(i)}if(a.push(n),e.rightDelim!=null){var s=new Ee("mo",[new zt(e.rightDelim.replace("\\",""))]);s.setAttribute("fence","true"),a.push(s)}return xd(a)}return n},px=(e,t)=>{if(!t)return e;var n={type:"styling",mode:e.mode,style:t,body:[e]};return n};Le({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,a=t[0],i=t[1],s,o=null,l=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":s=!0;break;case"\\\\atopfrac":s=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":s=!1,o="(",l=")";break;case"\\\\bracefrac":s=!1,o="\\{",l="\\}";break;case"\\\\brackfrac":s=!1,o="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var u=r==="\\cfrac",c=null;return u||r.startsWith("\\d")?c="display":r.startsWith("\\t")&&(c="text"),px({type:"genfrac",mode:n.mode,numer:a,denom:i,continued:u,hasBarLine:s,leftDelim:o,rightDelim:l,barSize:null},c)},htmlBuilder:qE,mathmlBuilder:VE});Le({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:r}=e,a;switch(n){case"\\over":a="\\frac";break;case"\\choose":a="\\binom";break;case"\\atop":a="\\\\atopfrac";break;case"\\brace":a="\\\\bracefrac";break;case"\\brack":a="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:a,token:r}}});var dm=["display","text","script","scriptscript"],hm=function(t){var n=null;return t.length>0&&(n=t,n=n==="."?null:n),n};Le({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var{parser:n}=e,r=t[4],a=t[5],i=Bo(t[0]),s=i.type==="atom"&&i.family==="open"?hm(i.text):null,o=Bo(t[1]),l=o.type==="atom"&&o.family==="close"?hm(o.text):null,u=Je(t[2],"size"),c,h=null;u.isBlank?c=!0:(h=u.value,c=h.number>0);var m=null,d=t[3];if(d.type==="ordgroup"){if(d.body.length>0){var p=Je(d.body[0],"textord");m=dm[Number(p.text)]}}else d=Je(d,"textord"),m=dm[Number(d.text)];return px({type:"genfrac",mode:n.mode,numer:r,denom:a,continued:!1,hasBarLine:c,barSize:h,leftDelim:s,rightDelim:l},m)}});Le({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:r,token:a}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:Je(t[0],"size").value,token:a}}});Le({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:r}=e,a=t[0],i=Je(t[1],"infix").size;if(!i)throw new Error("\\\\abovefrac expected size, but got "+String(i));var s=t[2],o=i.number>0;return{type:"genfrac",mode:n.mode,numer:a,denom:s,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null}}});var gx=(e,t)=>{var n=t.style,r,a;e.type==="supsub"?(r=e.sup?pt(e.sup,t.havingStyle(n.sup()),t):pt(e.sub,t.havingStyle(n.sub()),t),a=Je(e.base,"horizBrace")):a=Je(e,"horizBrace");var i=pt(a.base,t.havingBaseStyle(Ke.DISPLAY)),s=gl(a,t),o;if(a.isOver?o=mt({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:s,wrapperClasses:["svg-align"]}]}):o=mt({positionType:"bottom",positionData:i.depth+.1+s.height,children:[{type:"elem",elem:s,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:i}]}),r){var l=ve(["minner",a.isOver?"mover":"munder"],[o],t);a.isOver?o=mt({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]}):o=mt({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]})}return ve(["minner",a.isOver?"mover":"munder"],[o],t)},$E=(e,t)=>{var n=pl(e.label);return new Ee(e.isOver?"mover":"munder",[wt(e.base,t),n])};Le({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:r.includes("\\over"),base:t[0]}},htmlBuilder:gx,mathmlBuilder:$E});Le({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],a=Je(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:a})?{type:"href",mode:n.mode,href:a,body:Ft(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=Vt(e.body,t,!1);return aE(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=Hr(e.body,t);return n instanceof Ee||(n=new Ee("mrow",[n])),n.setAttribute("href",e.href),n}});Le({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=Je(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var a=[],i=0;i<r.length;i++){var s=r[i];s==="~"&&(s="\\textasciitilde"),a.push({type:"textord",mode:"text",text:s})}var o={type:"text",mode:n.mode,font:"\\texttt",body:a};return{type:"href",mode:n.mode,href:r,body:Ft(o)}}});Le({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:Ft(t[0])}},htmlBuilder(e,t){var n=Vt(e.body,t.withFont(""),!1);return Sr(n)},mathmlBuilder(e,t){return new Ee("mrow",Mn(e.body,t.withFont("")))}});Le({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,token:a}=e,i=Je(t[0],"raw").string,s=t[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,l={};switch(r){case"\\htmlClass":l.class=i,o={command:"\\htmlClass",class:i};break;case"\\htmlId":l.id=i,o={command:"\\htmlId",id:i};break;case"\\htmlStyle":l.style=i,o={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var u=i.split(","),c=0;c<u.length;c++){var h=u[c],m=h.indexOf("=");if(m<0)throw new Te("\\htmlData key/value '"+h+"' missing equals sign");var d=h.slice(0,m),p=h.slice(m+1);l["data-"+d.trim()]=p}o={command:"\\htmlData",attributes:l};break}default:throw new Error("Unrecognized html command")}return n.settings.isTrusted(o)?{type:"html",mode:n.mode,attributes:l,body:Ft(s)}:n.formatUnsupportedCmd(r)},htmlBuilder:(e,t)=>{var n=Vt(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var a=ve(r,n,t);for(var i in e.attributes)i!=="class"&&e.attributes.hasOwnProperty(i)&&a.setAttribute(i,e.attributes[i]);return a},mathmlBuilder:(e,t)=>Hr(e.body,t)});Le({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:Ft(t[0]),mathml:Ft(t[1])}},htmlBuilder:(e,t)=>{var n=Vt(e.html,t,!1);return Sr(n)},mathmlBuilder:(e,t)=>Hr(e.mathml,t)});var Nu=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!n)throw new Te("Invalid size: '"+t+"' in \\includegraphics");var r={number:+(n[1]+n[2]),unit:n[3]};if(!L2(r))throw new Te("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};Le({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,a={number:0,unit:"em"},i={number:.9,unit:"em"},s={number:0,unit:"em"},o="";if(n[0])for(var l=Je(n[0],"raw").string,u=l.split(","),c=0;c<u.length;c++){var h=u[c].split("=");if(h.length===2){var m=h[1].trim();switch(h[0].trim()){case"alt":o=m;break;case"width":a=Nu(m);break;case"height":i=Nu(m);break;case"totalheight":s=Nu(m);break;default:throw new Te("Invalid key: '"+h[0]+"' in \\includegraphics.")}}}var d=Je(t[0],"url").url;return o===""&&(o=d,o=o.replace(/^.*[\\/]/,""),o=o.substring(0,o.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:d})?{type:"includegraphics",mode:r.mode,alt:o,width:a,height:i,totalheight:s,src:d}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=It(e.height,t),r=0;e.totalheight.number>0&&(r=It(e.totalheight,t)-n);var a=0;e.width.number>0&&(a=It(e.width,t));var i={height:Se(n+r)};a>0&&(i.width=Se(a)),r>0&&(i.verticalAlign=Se(-r));var s=new WT(e.src,e.alt,i);return s.height=n,s.depth=r,s},mathmlBuilder:(e,t)=>{var n=new Ee("mglyph",[]);n.setAttribute("alt",e.alt);var r=It(e.height,t),a=0;if(e.totalheight.number>0&&(a=It(e.totalheight,t)-r,n.setAttribute("valign",Se(-a))),n.setAttribute("height",Se(r+a)),e.width.number>0){var i=It(e.width,t);n.setAttribute("width",Se(i))}return n.setAttribute("src",e.src),n}});Le({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,a=Je(t[0],"size");if(n.settings.strict){var i=r[1]==="m",s=a.value.unit==="mu";i?(s||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+a.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):s&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:a.value}},htmlBuilder(e,t){return F2(e.dimension,t)},mathmlBuilder(e,t){var n=It(e.dimension,t);return new $2(n)}});Le({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,a=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:a}},htmlBuilder:(e,t)=>{var n;e.alignment==="clap"?(n=ve([],[pt(e.body,t)]),n=ve(["inner"],[n],t)):n=ve(["inner"],[pt(e.body,t)]);var r=ve(["fix"],[]),a=ve([e.alignment],[n,r],t),i=ve(["strut"]);return i.style.height=Se(a.height+a.depth),a.depth&&(i.style.verticalAlign=Se(-a.depth)),a.children.unshift(i),a=ve(["thinbox"],[a],t),ve(["mord","vbox"],[a],t)},mathmlBuilder:(e,t)=>{var n=new Ee("mpadded",[wt(e.body,t)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}});Le({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,a=r.mode;r.switchMode("math");var i=n==="\\("?"\\)":"$",s=r.parseExpression(!1,i);return r.expect(i),r.switchMode(a),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:s}}});Le({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new Te("Mismatched "+e.funcName)}});var fm=(e,t)=>{switch(t.style.size){case Ke.DISPLAY.size:return e.display;case Ke.TEXT.size:return e.text;case Ke.SCRIPT.size:return e.script;case Ke.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Le({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:Ft(t[0]),text:Ft(t[1]),script:Ft(t[2]),scriptscript:Ft(t[3])}},htmlBuilder:(e,t)=>{var n=fm(e,t),r=Vt(n,t,!1);return Sr(r)},mathmlBuilder:(e,t)=>{var n=fm(e,t);return Hr(n,t)}});var xx=(e,t,n,r,a,i,s)=>{e=ve([],[e]);var o=n&&Tr(n),l,u;if(t){var c=pt(t,r.havingStyle(a.sup()),r);u={elem:c,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-c.depth)}}if(n){var h=pt(n,r.havingStyle(a.sub()),r);l={elem:h,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-h.height)}}var m;if(u&&l){var d=r.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+e.depth+s;m=mt({positionType:"bottom",positionData:d,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Se(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Se(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(l){var p=e.height-s;m=mt({positionType:"top",positionData:p,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:Se(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e}]})}else if(u){var g=e.depth+s;m=mt({positionType:"bottom",positionData:g,children:[{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Se(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var x=[m];if(l&&i!==0&&!o){var b=ve(["mspace"],[],r);b.style.marginRight=Se(i),x.unshift(b)}return ve(["mop","op-limits"],x,r)},bx=new Set(["\\smallint"]),li=(e,t)=>{var n,r,a=!1,i;e.type==="supsub"?(n=e.sup,r=e.sub,i=Je(e.base,"op"),a=!0):i=Je(e,"op");var s=t.style,o=!1;s.size===Ke.DISPLAY.size&&i.symbol&&!bx.has(i.name)&&(o=!0);var l,u;if(i.symbol){var c=o?"Size2-Regular":"Size1-Regular",h="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(h=i.name.slice(1),i.name=h==="oiint"?"\\iint":"\\iiint"),l=cn(i.name,c,"math",t,["mop","op-symbol",o?"large-op":"small-op"]),u=l.italic,h.length>0){var m=H2(h+"Size"+(o?"2":"1"),t);l=mt({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:m,shift:o?.08:0}]}),i.name="\\"+h,l.classes.unshift("mop"),l.italic=u}}else if(i.body){var d=Vt(i.body,t,!0);d.length===1&&d[0]instanceof Cn?(l=d[0],l.classes[0]="mop"):l=ve(["mop"],d,t)}else{for(var p=[],g=1;g<i.name.length;g++)p.push(pd(i.name[g],i.mode,t));l=ve(["mop"],p,t)}var x=0,b=0;if((l instanceof Cn||i.name==="\\oiint"||i.name==="\\oiiint")&&!i.suppressBaseShift){var v;x=(l.height-l.depth)/2-t.fontMetrics().axisHeight,b=(v=l.italic)!=null?v:0}return a?xx(l,n,r,t,s,b,x):(x&&(l.style.position="relative",l.style.top=Se(x)),l)},ws=(e,t)=>{var n;if(e.symbol)n=new Ee("mo",[Fn(e.name,e.mode)]),bx.has(e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new Ee("mo",Mn(e.body,t));else{n=new Ee("mi",[new zt(e.name.slice(1))]);var r=new Ee("mo",[Fn("","text")]);e.parentIsSupSub?n=new Ee("mrow",[n,r]):n=V2([n,r])}return n},WE={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Le({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,a=r;return a.length===1&&(a=WE[a]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:a}},htmlBuilder:li,mathmlBuilder:ws});Le({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Ft(r)}},htmlBuilder:li,mathmlBuilder:ws});var GE={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Le({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:li,mathmlBuilder:ws});Le({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:li,mathmlBuilder:ws});Le({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:t,funcName:n}=e,r=n;return r.length===1&&(r=GE[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:li,mathmlBuilder:ws});var yx=(e,t)=>{var n,r,a=!1,i;e.type==="supsub"?(n=e.sup,r=e.sub,i=Je(e.base,"operatorname"),a=!0):i=Je(e,"operatorname");var s;if(i.body.length>0){for(var o=i.body.map(h=>{var m="text"in h?h.text:void 0;return typeof m=="string"?{type:"textord",mode:h.mode,text:m}:h}),l=Vt(o,t.withFont("mathrm"),!0),u=0;u<l.length;u++){var c=l[u];c instanceof Cn&&(c.text=c.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}s=ve(["mop"],l,t)}else s=ve(["mop"],[],t);return a?xx(s,n,r,t,t.style,0,0):s},YE=(e,t)=>{for(var n=Mn(e.body,t.withFont("mathrm")),r=!0,a=0;a<n.length;a++){var i=n[a];if(!(i instanceof $2))if(i instanceof Ee)switch(i.type){case"mi":case"mn":case"mspace":case"mtext":break;case"mo":{var s=i.children[0];i.children.length===1&&s instanceof zt?s.text=s.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break}default:r=!1}else r=!1}if(r){var o=n.map(c=>c.toText()).join("");n=[new zt(o)]}var l=new Ee("mi",n);l.setAttribute("mathvariant","normal");var u=new Ee("mo",[Fn("","text")]);return e.parentIsSupSub?new Ee("mrow",[l,u]):V2([l,u])};Le({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,a=t[0];return{type:"operatorname",mode:n.mode,body:Ft(a),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:yx,mathmlBuilder:YE});z("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Sa({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?Sr(Vt(e.body,t,!1)):ve(["mord"],Vt(e.body,t,!0),t)},mathmlBuilder(e,t){return Hr(e.body,t,!0)}});Le({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=pt(e.body,t.havingCrampedStyle()),r=Qa("overline-line",t),a=t.fontMetrics().defaultRuleThickness,i=mt({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*a},{type:"elem",elem:r},{type:"kern",size:a}]});return ve(["mord","overline"],[i],t)},mathmlBuilder(e,t){var n=new Ee("mo",[new zt("‾")]);n.setAttribute("stretchy","true");var r=new Ee("mover",[wt(e.body,t),n]);return r.setAttribute("accent","true"),r}});Le({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:Ft(r)}},htmlBuilder:(e,t)=>{var n=Vt(e.body,t.withPhantom(),!1);return Sr(n)},mathmlBuilder:(e,t)=>{var n=Mn(e.body,t);return new Ee("mphantom",n)}});z("\\hphantom","\\smash{\\phantom{#1}}");Le({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=ve(["inner"],[pt(e.body,t.withPhantom())]),r=ve(["fix"],[]);return ve(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=Mn(Ft(e.body),t),r=new Ee("mphantom",n),a=new Ee("mpadded",[r]);return a.setAttribute("width","0px"),a}});Le({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,r=Je(t[0],"size").value,a=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:a}},htmlBuilder(e,t){var n=pt(e.body,t),r=It(e.dy,t);return mt({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new Ee("mpadded",[wt(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}});Le({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});Le({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:r}=e,a=n[0],i=Je(t[0],"size"),s=Je(t[1],"size");return{type:"rule",mode:r.mode,shift:a&&Je(a,"size").value,width:i.value,height:s.value}},htmlBuilder(e,t){var n=ve(["mord","rule"],[],t),r=It(e.width,t),a=It(e.height,t),i=e.shift?It(e.shift,t):0;return n.style.borderRightWidth=Se(r),n.style.borderTopWidth=Se(a),n.style.bottom=Se(i),n.width=r,n.height=a+i,n.depth=-i,n.maxFontSize=a*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=It(e.width,t),r=It(e.height,t),a=e.shift?It(e.shift,t):0,i=t.color&&t.getColor()||"black",s=new Ee("mspace");s.setAttribute("mathbackground",i),s.setAttribute("width",Se(n)),s.setAttribute("height",Se(r));var o=new Ee("mpadded",[s]);return a>=0?o.setAttribute("height",Se(a)):(o.setAttribute("height",Se(a)),o.setAttribute("depth",Se(-a))),o.setAttribute("voffset",Se(a)),o}});function vx(e,t,n){for(var r=Vt(e,t,!1),a=t.sizeMultiplier/n.sizeMultiplier,i=0;i<r.length;i++){var s=r[i].classes.indexOf("sizing");s<0?Array.prototype.push.apply(r[i].classes,t.sizingClasses(n)):r[i].classes[s+1]==="reset-size"+t.size&&(r[i].classes[s+1]="reset-size"+n.size),r[i].height*=a,r[i].depth*=a}return Sr(r)}var mm=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],KE=(e,t)=>{var n=t.havingSize(e.size);return vx(e.body,n,t)};Le({type:"sizing",names:mm,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:a}=e,i=a.parseExpression(!1,n);return{type:"sizing",mode:a.mode,size:mm.indexOf(r)+1,body:i}},htmlBuilder:KE,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=Mn(e.body,n),a=new Ee("mstyle",r);return a.setAttribute("mathsize",Se(n.sizeMultiplier)),a}});Le({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,a=!1,i=!1,s=n[0]&&Je(n[0],"ordgroup");if(s)for(var o,l=0;l<s.body.length;++l){var u=s.body[l];if(o=xl(u).text,o==="t")a=!0;else if(o==="b")i=!0;else{a=!1,i=!1;break}}else a=!0,i=!0;var c=t[0];return{type:"smash",mode:r.mode,body:c,smashHeight:a,smashDepth:i}},htmlBuilder:(e,t)=>{var n=ve([],[pt(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return ve(["mord","smash"],[n],t);if(n.children)for(var r=0;r<n.children.length;r++)e.smashHeight&&(n.children[r].height=0),e.smashDepth&&(n.children[r].depth=0);var a=mt({positionType:"firstBaseline",children:[{type:"elem",elem:n}]});return ve(["mord"],[a],t)},mathmlBuilder:(e,t)=>{var n=new Ee("mpadded",[wt(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}});Le({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,a=n[0],i=t[0];return{type:"sqrt",mode:r.mode,body:i,index:a}},htmlBuilder(e,t){var n=pt(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=Za(n,t);var r=t.fontMetrics(),a=r.defaultRuleThickness,i=a;t.style.id<Ke.TEXT.id&&(i=t.fontMetrics().xHeight);var s=a+i/4,o=n.height+n.depth+s+a,{span:l,ruleWidth:u,advanceWidth:c}=PE(o,t),h=l.height-u;h>n.height+n.depth+s&&(s=(s+h-n.height-n.depth)/2);var m=l.height-n.height-s-u;n.style.paddingLeft=Se(c);var d=mt({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+m)},{type:"elem",elem:l},{type:"kern",size:u}]});if(e.index){var p=t.havingStyle(Ke.SCRIPTSCRIPT),g=pt(e.index,p,t),x=.6*(d.height-d.depth),b=mt({positionType:"shift",positionData:-x,children:[{type:"elem",elem:g}]}),v=ve(["root"],[b]);return ve(["mord","sqrt"],[v,d],t)}else return ve(["mord","sqrt"],[d],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new Ee("mroot",[wt(n,t),wt(r,t)]):new Ee("msqrt",[wt(n,t)])}});var Qc={display:Ke.DISPLAY,text:Ke.TEXT,script:Ke.SCRIPT,scriptscript:Ke.SCRIPTSCRIPT};function XE(e){return e in Qc}Le({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:a}=e,i=a.parseExpression(!0,n),s=r.slice(1,r.length-5);if(!XE(s))throw new Error("Unknown style: "+s);return{type:"styling",mode:a.mode,style:s,body:i}},htmlBuilder(e,t){var n=Qc[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont("")),vx(e.body,r,t)},mathmlBuilder(e,t){var n=Qc[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(""));var a=Mn(e.body,r),i=new Ee("mstyle",a),s={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=s[e.style];return i.setAttribute("scriptlevel",o[0]),i.setAttribute("displaystyle",o[1]),i}});var QE=function(t,n){var r=t.base;if(r)if(r.type==="op"){var a=r.limits&&(n.style.size===Ke.DISPLAY.size||r.alwaysHandleSupSub);return a?li:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(n.style.size===Ke.DISPLAY.size||r.limits);return i?yx:null}else{if(r.type==="accent")return Tr(r.base)?yd:null;if(r.type==="horizBrace"){var s=!t.sub;return s===r.isOver?gx:null}else return null}else return null};Sa({type:"supsub",htmlBuilder(e,t){var n=QE(e,t);if(n)return n(e,t);var{base:r,sup:a,sub:i}=e,s=pt(r,t),o,l,u=t.fontMetrics(),c=0,h=0,m=r&&Tr(r);if(a){var d=t.havingStyle(t.style.sup());o=pt(a,d,t),m||(c=s.height-d.fontMetrics().supDrop*d.sizeMultiplier/t.sizeMultiplier)}if(i){var p=t.havingStyle(t.style.sub());l=pt(i,p,t),m||(h=s.depth+p.fontMetrics().subDrop*p.sizeMultiplier/t.sizeMultiplier)}var g;t.style===Ke.DISPLAY?g=u.sup1:t.style.cramped?g=u.sup3:g=u.sup2;var x=t.sizeMultiplier,b=Se(.5/u.ptPerEm/x),v=null;if(l){var T=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(s instanceof Cn||T){var N;v=Se(-((N=s.italic)!=null?N:0))}}var k;if(o&&l){c=Math.max(c,g,o.depth+.25*u.xHeight),h=Math.max(h,u.sub2);var A=u.defaultRuleThickness,_=4*A;if(c-o.depth-(l.height-h)<_){h=_-(c-o.depth)+l.height;var S=.8*u.xHeight-(c-o.depth);S>0&&(c+=S,h-=S)}var I=[{type:"elem",elem:l,shift:h,marginRight:b,marginLeft:v},{type:"elem",elem:o,shift:-c,marginRight:b}];k=mt({positionType:"individualShift",children:I})}else if(l){h=Math.max(h,u.sub1,l.height-.8*u.xHeight);var C=[{type:"elem",elem:l,marginLeft:v,marginRight:b}];k=mt({positionType:"shift",positionData:h,children:C})}else if(o)c=Math.max(c,g,o.depth+.25*u.xHeight),k=mt({positionType:"shift",positionData:-c,children:[{type:"elem",elem:o,marginRight:b}]});else throw new Error("supsub must have either sup or sub.");var D=Wc(s,"right")||"mord";return ve([D],[s,ve(["msupsub"],[k])],t)},mathmlBuilder(e,t){var n=!1,r,a;e.base&&e.base.type==="horizBrace"&&(a=!!e.sup,a===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var i=[wt(e.base,t)];e.sub&&i.push(wt(e.sub,t)),e.sup&&i.push(wt(e.sup,t));var s;if(n)s=r?"mover":"munder";else if(e.sub)if(e.sup){var u=e.base;u&&u.type==="op"&&u.limits&&t.style===Ke.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(t.style===Ke.DISPLAY||u.limits)?s="munderover":s="msubsup"}else{var l=e.base;l&&l.type==="op"&&l.limits&&(t.style===Ke.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||t.style===Ke.DISPLAY)?s="munder":s="msub"}else{var o=e.base;o&&o.type==="op"&&o.limits&&(t.style===Ke.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||t.style===Ke.DISPLAY)?s="mover":s="msup"}return new Ee(s,i)}});Sa({type:"atom",htmlBuilder(e,t){return pd(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new Ee("mo",[Fn(e.text,e.mode)]);if(e.family==="bin"){var r=bd(e,t);r==="bold-italic"&&n.setAttribute("mathvariant",r)}else e.family==="punct"?n.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&n.setAttribute("stretchy","false");return n}});var wx={mi:"italic",mn:"normal",mtext:"normal"};Sa({type:"mathord",htmlBuilder(e,t){return ml(e,t,"mathord")},mathmlBuilder(e,t){var n=new Ee("mi",[Fn(e.text,e.mode,t)]),r=bd(e,t)||"italic";return r!==wx[n.type]&&n.setAttribute("mathvariant",r),n}});Sa({type:"textord",htmlBuilder(e,t){return ml(e,t,"textord")},mathmlBuilder(e,t){var n=Fn(e.text,e.mode,t),r=bd(e,t)||"normal",a;return e.mode==="text"?a=new Ee("mtext",[n]):/[0-9]/.test(e.text)?a=new Ee("mn",[n]):e.text==="\\prime"?a=new Ee("mo",[n]):a=new Ee("mi",[n]),r!==wx[a.type]&&a.setAttribute("mathvariant",r),a}});var Mu={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Iu={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Sa({type:"spacing",htmlBuilder(e,t){if(Iu.hasOwnProperty(e.text)){var n=Iu[e.text].className||"";if(e.mode==="text"){var r=ml(e,t,"textord");return r.classes.push(n),r}else return ve(["mspace",n],[pd(e.text,e.mode,t)],t)}else{if(Mu.hasOwnProperty(e.text))return ve(["mspace",Mu[e.text]],[],t);throw new Te('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var n;if(Iu.hasOwnProperty(e.text))n=new Ee("mtext",[new zt(" ")]);else{if(Mu.hasOwnProperty(e.text))return new Ee("mspace");throw new Te('Unknown type of space "'+e.text+'"')}return n}});var pm=()=>{var e=new Ee("mtd",[]);return e.setAttribute("width","50%"),e};Sa({type:"tag",mathmlBuilder(e,t){var n=new Ee("mtable",[new Ee("mtr",[pm(),new Ee("mtd",[Hr(e.body,t)]),pm(),new Ee("mtd",[Hr(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var gm={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},xm={"\\textbf":"textbf","\\textmd":"textmd"},ZE={"\\textit":"textit","\\textup":"textup"},bm=(e,t)=>{var n=e.font;if(n){if(gm[n])return t.withTextFontFamily(gm[n]);if(xm[n])return t.withTextFontWeight(xm[n]);if(n==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}else return t;return t.withTextFontShape(ZE[n])};Le({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,a=t[0];return{type:"text",mode:n.mode,body:Ft(a),font:r}},htmlBuilder(e,t){var n=bm(e,t),r=Vt(e.body,n,!0);return ve(["mord","text"],r,n)},mathmlBuilder(e,t){var n=bm(e,t);return Hr(e.body,n)}});Le({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=pt(e.body,t),r=Qa("underline-line",t),a=t.fontMetrics().defaultRuleThickness,i=mt({positionType:"top",positionData:n.height,children:[{type:"kern",size:a},{type:"elem",elem:r},{type:"kern",size:3*a},{type:"elem",elem:n}]});return ve(["mord","underline"],[i],t)},mathmlBuilder(e,t){var n=new Ee("mo",[new zt("‾")]);n.setAttribute("stretchy","true");var r=new Ee("munder",[wt(e.body,t),n]);return r.setAttribute("accentunder","true"),r}});Le({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=pt(e.body,t),r=t.fontMetrics().axisHeight,a=.5*(n.height-r-(n.depth+r));return mt({positionType:"shift",positionData:a,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new Ee("mpadded",[wt(e.body,t)],["vcenter"]);return new Ee("mrow",[n])}});Le({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new Te("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=ym(e),r=[],a=t.havingStyle(t.style.text()),i=0;i<n.length;i++){var s=n[i];s==="~"&&(s="\\textasciitilde"),r.push(cn(s,"Typewriter-Regular",e.mode,a,["mord","texttt"]))}return ve(["mord","text"].concat(a.sizingClasses(t)),B2(r),a)},mathmlBuilder(e,t){var n=new zt(ym(e)),r=new Ee("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var ym=e=>e.body.replace(/ /g,e.star?"␣":" "),Pr=U2,kx=`[ \r
|
|
763
|
+
]`,JE="\\\\[a-zA-Z@]+",eS="\\\\[^\uD800-\uDFFF]",tS="("+JE+")"+kx+"*",nS=`\\\\(
|
|
764
|
+
|[ \r ]+
|
|
765
|
+
?)[ \r ]*`,Zc="[̀-ͯ]",rS=new RegExp(Zc+"+$"),aS="("+kx+"+)|"+(nS+"|")+"([!-\\[\\]-‧-豈-]"+(Zc+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Zc+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+tS)+("|"+eS+")");class vm{constructor(t,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=n,this.tokenRegex=new RegExp(aS,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,n){this.catcodes[t]=n}lex(){var t=this.input,n=this.tokenRegex.lastIndex;if(n===t.length)return new Sn("EOF",new bn(this,n,n));var r=this.tokenRegex.exec(t);if(r===null||r.index!==n)throw new Te("Unexpected character: '"+t[n]+"'",new Sn(t[n],new bn(this,n,n+1)));var a=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[a]===14){var i=t.indexOf(`
|
|
766
|
+
`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=t.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new Sn(a,new bn(this,n,this.tokenRegex.lastIndex))}}class iS{constructor(t,n){t===void 0&&(t={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Te("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var n in t)t.hasOwnProperty(n)&&(t[n]==null?delete this.current[n]:this.current[n]=t[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,n,r){if(r===void 0&&(r=!1),r){for(var a=0;a<this.undefStack.length;a++)delete this.undefStack[a][t];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][t]=n)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(t)&&(i[t]=this.current[t])}n==null?delete this.current[t]:this.current[t]=n}}var sS=dx;z("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}});z("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});z("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});z("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});z("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}});z("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");z("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var wm={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};z("\\char",function(e){var t=e.popToken(),n,r=0;if(t.text==="'")n=8,t=e.popToken();else if(t.text==='"')n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")r=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new Te("\\char` missing argument");r=t.text.charCodeAt(0)}else n=10;if(n){if(r=wm[t.text],r==null||r>=n)throw new Te("Invalid base-"+n+" digit "+t.text);for(var a;(a=wm[e.future().text])!=null&&a<n;)r*=n,r+=a,e.popToken()}return"\\@char{"+r+"}"});var Td=(e,t,n,r)=>{var a=e.consumeArg().tokens;if(a.length!==1)throw new Te("\\newcommand's first argument must be a macro name");var i=a[0].text,s=e.isDefined(i);if(s&&!t)throw new Te("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!s&&!n)throw new Te("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(a=e.consumeArg().tokens,a.length===1&&a[0].text==="["){for(var l="",u=e.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Te("Invalid number of arguments: "+l);o=parseInt(l),a=e.consumeArg().tokens}return s&&r||e.macros.set(i,{tokens:a,numArgs:o}),""};z("\\newcommand",e=>Td(e,!1,!0,!1));z("\\renewcommand",e=>Td(e,!0,!1,!1));z("\\providecommand",e=>Td(e,!0,!0,!0));z("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(n=>n.text).join("")),""});z("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(n=>n.text).join("")),""});z("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),Pr[n],At.math[n],At.text[n]),""});z("\\bgroup","{");z("\\egroup","}");z("~","\\nobreakspace");z("\\lq","`");z("\\rq","'");z("\\aa","\\r a");z("\\AA","\\r A");z("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");z("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");z("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");z("ℬ","\\mathscr{B}");z("ℰ","\\mathscr{E}");z("ℱ","\\mathscr{F}");z("ℋ","\\mathscr{H}");z("ℐ","\\mathscr{I}");z("ℒ","\\mathscr{L}");z("ℳ","\\mathscr{M}");z("ℛ","\\mathscr{R}");z("ℭ","\\mathfrak{C}");z("ℌ","\\mathfrak{H}");z("ℨ","\\mathfrak{Z}");z("\\Bbbk","\\Bbb{k}");z("\\llap","\\mathllap{\\textrm{#1}}");z("\\rlap","\\mathrlap{\\textrm{#1}}");z("\\clap","\\mathclap{\\textrm{#1}}");z("\\mathstrut","\\vphantom{(}");z("\\underbar","\\underline{\\text{#1}}");z("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');z("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");z("\\ne","\\neq");z("≠","\\neq");z("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");z("∉","\\notin");z("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");z("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");z("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");z("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");z("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");z("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");z("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");z("⟂","\\perp");z("‼","\\mathclose{!\\mkern-0.8mu!}");z("∌","\\notni");z("⌜","\\ulcorner");z("⌝","\\urcorner");z("⌞","\\llcorner");z("⌟","\\lrcorner");z("©","\\copyright");z("®","\\textregistered");z("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');z("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');z("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');z("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');z("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");z("⋮","\\vdots");z("\\varGamma","\\mathit{\\Gamma}");z("\\varDelta","\\mathit{\\Delta}");z("\\varTheta","\\mathit{\\Theta}");z("\\varLambda","\\mathit{\\Lambda}");z("\\varXi","\\mathit{\\Xi}");z("\\varPi","\\mathit{\\Pi}");z("\\varSigma","\\mathit{\\Sigma}");z("\\varUpsilon","\\mathit{\\Upsilon}");z("\\varPhi","\\mathit{\\Phi}");z("\\varPsi","\\mathit{\\Psi}");z("\\varOmega","\\mathit{\\Omega}");z("\\substack","\\begin{subarray}{c}#1\\end{subarray}");z("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");z("\\boxed","\\fbox{$\\displaystyle{#1}$}");z("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");z("\\implies","\\DOTSB\\;\\Longrightarrow\\;");z("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");z("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");z("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var km={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},oS=new Set(["bin","rel"]);z("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in km?t=km[n]:(n.slice(0,4)==="\\not"||n in At.math&&oS.has(At.math[n].group))&&(t="\\dotsb"),t});var Ed={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};z("\\dotso",function(e){var t=e.future().text;return t in Ed?"\\ldots\\,":"\\ldots"});z("\\dotsc",function(e){var t=e.future().text;return t in Ed&&t!==","?"\\ldots\\,":"\\ldots"});z("\\cdots",function(e){var t=e.future().text;return t in Ed?"\\@cdots\\,":"\\@cdots"});z("\\dotsb","\\cdots");z("\\dotsm","\\cdots");z("\\dotsi","\\!\\cdots");z("\\dotsx","\\ldots\\,");z("\\DOTSI","\\relax");z("\\DOTSB","\\relax");z("\\DOTSX","\\relax");z("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");z("\\,","\\tmspace+{3mu}{.1667em}");z("\\thinspace","\\,");z("\\>","\\mskip{4mu}");z("\\:","\\tmspace+{4mu}{.2222em}");z("\\medspace","\\:");z("\\;","\\tmspace+{5mu}{.2777em}");z("\\thickspace","\\;");z("\\!","\\tmspace-{3mu}{.1667em}");z("\\negthinspace","\\!");z("\\negmedspace","\\tmspace-{4mu}{.2222em}");z("\\negthickspace","\\tmspace-{5mu}{.277em}");z("\\enspace","\\kern.5em ");z("\\enskip","\\hskip.5em\\relax");z("\\quad","\\hskip1em\\relax");z("\\qquad","\\hskip2em\\relax");z("\\tag","\\@ifstar\\tag@literal\\tag@paren");z("\\tag@paren","\\tag@literal{({#1})}");z("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Te("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});z("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");z("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");z("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");z("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");z("\\newline","\\\\\\relax");z("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Tx=Se(ar["Main-Regular"][84][1]-.7*ar["Main-Regular"][65][1]);z("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+Tx+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");z("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+Tx+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");z("\\hspace","\\@ifstar\\@hspacer\\@hspace");z("\\@hspace","\\hskip #1\\relax");z("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");z("\\ordinarycolon",":");z("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");z("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');z("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');z("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');z("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');z("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');z("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');z("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');z("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');z("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');z("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');z("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');z("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');z("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');z("∷","\\dblcolon");z("∹","\\eqcolon");z("≔","\\coloneqq");z("≕","\\eqqcolon");z("⩴","\\Coloneqq");z("\\ratio","\\vcentcolon");z("\\coloncolon","\\dblcolon");z("\\colonequals","\\coloneqq");z("\\coloncolonequals","\\Coloneqq");z("\\equalscolon","\\eqqcolon");z("\\equalscoloncolon","\\Eqqcolon");z("\\colonminus","\\coloneq");z("\\coloncolonminus","\\Coloneq");z("\\minuscolon","\\eqcolon");z("\\minuscoloncolon","\\Eqcolon");z("\\coloncolonapprox","\\Colonapprox");z("\\coloncolonsim","\\Colonsim");z("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");z("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");z("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");z("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");z("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");z("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");z("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");z("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");z("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");z("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");z("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");z("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");z("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");z("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");z("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");z("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");z("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");z("\\nleqq","\\html@mathml{\\@nleqq}{≰}");z("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");z("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");z("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");z("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");z("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");z("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");z("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");z("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");z("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");z("\\imath","\\html@mathml{\\@imath}{ı}");z("\\jmath","\\html@mathml{\\@jmath}{ȷ}");z("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");z("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");z("⟦","\\llbracket");z("⟧","\\rrbracket");z("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");z("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");z("⦃","\\lBrace");z("⦄","\\rBrace");z("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");z("⦵","\\minuso");z("\\darr","\\downarrow");z("\\dArr","\\Downarrow");z("\\Darr","\\Downarrow");z("\\lang","\\langle");z("\\rang","\\rangle");z("\\uarr","\\uparrow");z("\\uArr","\\Uparrow");z("\\Uarr","\\Uparrow");z("\\N","\\mathbb{N}");z("\\R","\\mathbb{R}");z("\\Z","\\mathbb{Z}");z("\\alef","\\aleph");z("\\alefsym","\\aleph");z("\\Alpha","\\mathrm{A}");z("\\Beta","\\mathrm{B}");z("\\bull","\\bullet");z("\\Chi","\\mathrm{X}");z("\\clubs","\\clubsuit");z("\\cnums","\\mathbb{C}");z("\\Complex","\\mathbb{C}");z("\\Dagger","\\ddagger");z("\\diamonds","\\diamondsuit");z("\\empty","\\emptyset");z("\\Epsilon","\\mathrm{E}");z("\\Eta","\\mathrm{H}");z("\\exist","\\exists");z("\\harr","\\leftrightarrow");z("\\hArr","\\Leftrightarrow");z("\\Harr","\\Leftrightarrow");z("\\hearts","\\heartsuit");z("\\image","\\Im");z("\\infin","\\infty");z("\\Iota","\\mathrm{I}");z("\\isin","\\in");z("\\Kappa","\\mathrm{K}");z("\\larr","\\leftarrow");z("\\lArr","\\Leftarrow");z("\\Larr","\\Leftarrow");z("\\lrarr","\\leftrightarrow");z("\\lrArr","\\Leftrightarrow");z("\\Lrarr","\\Leftrightarrow");z("\\Mu","\\mathrm{M}");z("\\natnums","\\mathbb{N}");z("\\Nu","\\mathrm{N}");z("\\Omicron","\\mathrm{O}");z("\\plusmn","\\pm");z("\\rarr","\\rightarrow");z("\\rArr","\\Rightarrow");z("\\Rarr","\\Rightarrow");z("\\real","\\Re");z("\\reals","\\mathbb{R}");z("\\Reals","\\mathbb{R}");z("\\Rho","\\mathrm{P}");z("\\sdot","\\cdot");z("\\sect","\\S");z("\\spades","\\spadesuit");z("\\sub","\\subset");z("\\sube","\\subseteq");z("\\supe","\\supseteq");z("\\Tau","\\mathrm{T}");z("\\thetasym","\\vartheta");z("\\weierp","\\wp");z("\\Zeta","\\mathrm{Z}");z("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");z("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");z("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");z("\\bra","\\mathinner{\\langle{#1}|}");z("\\ket","\\mathinner{|{#1}\\rangle}");z("\\braket","\\mathinner{\\langle{#1}\\rangle}");z("\\Bra","\\left\\langle#1\\right|");z("\\Ket","\\left|#1\\right\\rangle");var Ex=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,a=t.consumeArg().tokens,i=t.consumeArg().tokens,s=t.macros.get("|"),o=t.macros.get("\\|");t.macros.beginGroup();var l=h=>m=>{e&&(m.macros.set("|",s),a.length&&m.macros.set("\\|",o));var d=h;if(!h&&a.length){var p=m.future();p.text==="|"&&(m.popToken(),d=!0)}return{tokens:d?a:r,numArgs:0}};t.macros.set("|",l(!1)),a.length&&t.macros.set("\\|",l(!0));var u=t.consumeArg().tokens,c=t.expandTokens([...i,...u,...n]);return t.macros.endGroup(),{tokens:c.reverse(),numArgs:0}};z("\\bra@ket",Ex(!1));z("\\bra@set",Ex(!0));z("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");z("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");z("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");z("\\angln","{\\angl n}");z("\\blue","\\textcolor{##6495ed}{#1}");z("\\orange","\\textcolor{##ffa500}{#1}");z("\\pink","\\textcolor{##ff00af}{#1}");z("\\red","\\textcolor{##df0030}{#1}");z("\\green","\\textcolor{##28ae7b}{#1}");z("\\gray","\\textcolor{gray}{#1}");z("\\purple","\\textcolor{##9d38bd}{#1}");z("\\blueA","\\textcolor{##ccfaff}{#1}");z("\\blueB","\\textcolor{##80f6ff}{#1}");z("\\blueC","\\textcolor{##63d9ea}{#1}");z("\\blueD","\\textcolor{##11accd}{#1}");z("\\blueE","\\textcolor{##0c7f99}{#1}");z("\\tealA","\\textcolor{##94fff5}{#1}");z("\\tealB","\\textcolor{##26edd5}{#1}");z("\\tealC","\\textcolor{##01d1c1}{#1}");z("\\tealD","\\textcolor{##01a995}{#1}");z("\\tealE","\\textcolor{##208170}{#1}");z("\\greenA","\\textcolor{##b6ffb0}{#1}");z("\\greenB","\\textcolor{##8af281}{#1}");z("\\greenC","\\textcolor{##74cf70}{#1}");z("\\greenD","\\textcolor{##1fab54}{#1}");z("\\greenE","\\textcolor{##0d923f}{#1}");z("\\goldA","\\textcolor{##ffd0a9}{#1}");z("\\goldB","\\textcolor{##ffbb71}{#1}");z("\\goldC","\\textcolor{##ff9c39}{#1}");z("\\goldD","\\textcolor{##e07d10}{#1}");z("\\goldE","\\textcolor{##a75a05}{#1}");z("\\redA","\\textcolor{##fca9a9}{#1}");z("\\redB","\\textcolor{##ff8482}{#1}");z("\\redC","\\textcolor{##f9685d}{#1}");z("\\redD","\\textcolor{##e84d39}{#1}");z("\\redE","\\textcolor{##bc2612}{#1}");z("\\maroonA","\\textcolor{##ffbde0}{#1}");z("\\maroonB","\\textcolor{##ff92c6}{#1}");z("\\maroonC","\\textcolor{##ed5fa6}{#1}");z("\\maroonD","\\textcolor{##ca337c}{#1}");z("\\maroonE","\\textcolor{##9e034e}{#1}");z("\\purpleA","\\textcolor{##ddd7ff}{#1}");z("\\purpleB","\\textcolor{##c6b9fc}{#1}");z("\\purpleC","\\textcolor{##aa87ff}{#1}");z("\\purpleD","\\textcolor{##7854ab}{#1}");z("\\purpleE","\\textcolor{##543b78}{#1}");z("\\mintA","\\textcolor{##f5f9e8}{#1}");z("\\mintB","\\textcolor{##edf2df}{#1}");z("\\mintC","\\textcolor{##e0e5cc}{#1}");z("\\grayA","\\textcolor{##f6f7f7}{#1}");z("\\grayB","\\textcolor{##f0f1f2}{#1}");z("\\grayC","\\textcolor{##e3e5e6}{#1}");z("\\grayD","\\textcolor{##d6d8da}{#1}");z("\\grayE","\\textcolor{##babec2}{#1}");z("\\grayF","\\textcolor{##888d93}{#1}");z("\\grayG","\\textcolor{##626569}{#1}");z("\\grayH","\\textcolor{##3b3e40}{#1}");z("\\grayI","\\textcolor{##21242c}{#1}");z("\\kaBlue","\\textcolor{##314453}{#1}");z("\\kaGreen","\\textcolor{##71B307}{#1}");var Sx={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class lS{constructor(t,n,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=n,this.expansionCount=0,this.feed(t),this.macros=new iS(sS,n.macros),this.mode=r,this.stack=[]}feed(t){this.lexer=new vm(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var n,r,a;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:a,end:r}=this.consumeArg(["]"])}else({tokens:a,start:n,end:r}=this.consumeArg());return this.pushToken(new Sn("EOF",r.loc)),this.pushTokens(a),new Sn("",bn.range(n,r))}consumeSpaces(){for(;;){var t=this.future();if(t.text===" ")this.stack.pop();else break}}consumeArg(t){var n=[],r=t&&t.length>0;r||this.consumeSpaces();var a=this.future(),i,s=0,o=0;do{if(i=this.popToken(),n.push(i),i.text==="{")++s;else if(i.text==="}"){if(--s,s===-1)throw new Te("Extra }",i)}else if(i.text==="EOF")throw new Te("Unexpected end of input in a macro argument, expected '"+(t&&r?t[o]:"}")+"'",i);if(t&&r)if((s===0||s===1&&t[o]==="{")&&i.text===t[o]){if(++o,o===t.length){n.splice(-o,o);break}}else o=0}while(s!==0||r);return a.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:a,end:i}}consumeArgs(t,n){if(n){if(n.length!==t+1)throw new Te("The length of delimiters doesn't match the number of args!");for(var r=n[0],a=0;a<r.length;a++){var i=this.popToken();if(r[a]!==i.text)throw new Te("Use of the macro doesn't match its definition",i)}}for(var s=[],o=0;o<t;o++)s.push(this.consumeArg(n&&n[o+1]).tokens);return s}countExpansion(t){if(this.expansionCount+=t,this.expansionCount>this.settings.maxExpand)throw new Te("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var n=this.popToken(),r=n.text,a=n.noexpand?null:this._getExpansion(r);if(a==null||t&&a.unexpandable){if(t&&a==null&&r[0]==="\\"&&!this.isDefined(r))throw new Te("Undefined control sequence: "+r);return this.pushToken(n),!1}this.countExpansion(1);var i=a.tokens,s=this.consumeArgs(a.numArgs,a.delimiters);if(a.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var l=i[o];if(l.text==="#"){if(o===0)throw new Te("Incomplete placeholder at end of macro body",l);if(l=i[--o],l.text==="#")i.splice(o+1,1);else if(/^[1-9]$/.test(l.text))i.splice(o,2,...s[+l.text-1]);else throw new Te("Not a valid argument number",l)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}}expandMacro(t){return this.macros.has(t)?this.expandTokens([new Sn(t)]):void 0}expandTokens(t){var n=[],r=this.stack.length;for(this.pushTokens(t);this.stack.length>r;)if(this.expandOnce(!0)===!1){var a=this.stack.pop();a.treatAsRelax&&(a.noexpand=!1,a.treatAsRelax=!1),n.push(a)}return this.countExpansion(n.length),n}expandMacroAsText(t){var n=this.expandMacro(t);return n&&n.map(r=>r.text).join("")}_getExpansion(t){var n=this.macros.get(t);if(n==null)return n;if(t.length===1){var r=this.lexer.catcodes[t];if(r!=null&&r!==13)return}var a=typeof n=="function"?n(this):n;if(typeof a=="string"){var i=0;if(a.includes("#"))for(var s=a.replace(/##/g,"");s.includes("#"+(i+1));)++i;for(var o=new vm(a,this.settings),l=[],u=o.lex();u.text!=="EOF";)l.push(u),u=o.lex();l.reverse();var c={tokens:l,numArgs:i};return c}return a}isDefined(t){return this.macros.has(t)||Pr.hasOwnProperty(t)||At.math.hasOwnProperty(t)||At.text.hasOwnProperty(t)||Sx.hasOwnProperty(t)}isExpandable(t){var n=this.macros.get(t);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:Pr.hasOwnProperty(t)&&!Pr[t].primitive}}var Tm=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Gs=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),_u={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},Em={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let Ax=class Cx{constructor(t,n){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new lS(t,n,this.mode),this.settings=n,this.leftrightDepth=0,this.nextToken=null}expect(t,n){if(n===void 0&&(n=!0),this.fetch().text!==t)throw new Te("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var n=this.nextToken;this.consume(),this.gullet.pushToken(new Sn("}")),this.gullet.pushTokens(t);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,r}parseExpression(t,n){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var a=this.fetch();if(Cx.endOfExpression.has(a.text)||n&&a.text===n||t&&Pr[a.text]&&Pr[a.text].infix)break;var i=this.parseAtom(n);if(i){if(i.type==="internal")continue}else break;r.push(i)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(t){for(var n=-1,r,a=0;a<t.length;a++){var i=t[a];if(i.type==="infix"){if(n!==-1)throw new Te("only one infix operator per group",i.token);n=a,r=i.replaceWith}}if(n!==-1&&r){var s,o,l=t.slice(0,n),u=t.slice(n+1);l.length===1&&l[0].type==="ordgroup"?s=l[0]:s={type:"ordgroup",mode:this.mode,body:l},u.length===1&&u[0].type==="ordgroup"?o=u[0]:o={type:"ordgroup",mode:this.mode,body:u};var c;return r==="\\\\abovefrac"?c=this.callFunction(r,[s,t[n],o],[]):c=this.callFunction(r,[s,o],[]),[c]}else return t}handleSupSubscript(t){var n=this.fetch(),r=n.text;this.consume(),this.consumeSpaces();var a;do{var i;a=this.parseGroup(t)}while(((i=a)==null?void 0:i.type)==="internal");if(!a)throw new Te("Expected group after '"+r+"'",n);return a}formatUnsupportedCmd(t){for(var n=[],r=0;r<t.length;r++)n.push({type:"textord",mode:"text",text:t[r]});var a={type:"text",mode:this.mode,body:n},i={type:"color",mode:this.mode,color:this.settings.errorColor,body:[a]};return i}parseAtom(t){var n=this.parseGroup("atom",t);if((n==null?void 0:n.type)==="internal"||this.mode==="text")return n;for(var r,a;;){this.consumeSpaces();var i=this.fetch();if(i.text==="\\limits"||i.text==="\\nolimits"){if(n&&n.type==="op"){var s=i.text==="\\limits";n.limits=s,n.alwaysHandleSupSub=!0}else if(n&&n.type==="operatorname")n.alwaysHandleSupSub&&(n.limits=i.text==="\\limits");else throw new Te("Limit controls must follow a math operator",i);this.consume()}else if(i.text==="^"){if(r)throw new Te("Double superscript",i);r=this.handleSupSubscript("superscript")}else if(i.text==="_"){if(a)throw new Te("Double subscript",i);a=this.handleSupSubscript("subscript")}else if(i.text==="'"){if(r)throw new Te("Double superscript",i);var o={type:"textord",mode:this.mode,text:"\\prime"},l=[o];for(this.consume();this.fetch().text==="'";)l.push(o),this.consume();this.fetch().text==="^"&&l.push(this.handleSupSubscript("superscript")),r={type:"ordgroup",mode:this.mode,body:l}}else if(Gs[i.text]){var u=Tm.test(i.text),c=[];for(c.push(new Sn(Gs[i.text])),this.consume();;){var h=this.fetch().text;if(!Gs[h]||Tm.test(h)!==u)break;c.unshift(new Sn(Gs[h])),this.consume()}var m=this.subparse(c);u?a={type:"ordgroup",mode:"math",body:m}:r={type:"ordgroup",mode:"math",body:m}}else break}return r||a?{type:"supsub",mode:this.mode,base:n,sup:r,sub:a}:n}parseFunction(t,n){var r=this.fetch(),a=r.text,i=Pr[a];if(!i)return null;if(this.consume(),n&&n!=="atom"&&!i.allowedInArgument)throw new Te("Got function '"+a+"' with no arguments"+(n?" as "+n:""),r);if(this.mode==="text"&&!i.allowedInText)throw new Te("Can't use function '"+a+"' in text mode",r);if(this.mode==="math"&&i.allowedInMath===!1)throw new Te("Can't use function '"+a+"' in math mode",r);var{args:s,optArgs:o}=this.parseArguments(a,i);return this.callFunction(a,s,o,r,t)}callFunction(t,n,r,a,i){var s={funcName:t,parser:this,token:a,breakOnTokenText:i},o=Pr[t];if(o&&o.handler)return o.handler(s,n,r);throw new Te("No function handler for "+t)}parseArguments(t,n){var r=n.numArgs+n.numOptionalArgs;if(r===0)return{args:[],optArgs:[]};for(var a=[],i=[],s=0;s<r;s++){var o=n.argTypes&&n.argTypes[s],l=s<n.numOptionalArgs;("primitive"in n&&n.primitive&&o==null||n.type==="sqrt"&&s===1&&i[0]==null)&&(o="primitive");var u=this.parseGroupOfType("argument to '"+t+"'",o,l);if(l)i.push(u);else if(u!=null)a.push(u);else throw new Te("Null argument, please report this as a bug")}return{args:a,optArgs:i}}parseGroupOfType(t,n,r){switch(n){case"color":return this.parseColorGroup(r);case"size":return this.parseSizeGroup(r);case"url":return this.parseUrlGroup(r);case"math":case"text":return this.parseArgumentGroup(r,n);case"hbox":{var a=this.parseArgumentGroup(r,"text");return a!=null?{type:"styling",mode:a.mode,body:[a],style:"text",resetFont:!0}:null}case"raw":{var i=this.parseStringGroup("raw",r);return i!=null?{type:"raw",mode:"text",string:i.text}:null}case"primitive":{if(r)throw new Te("A primitive argument cannot be optional");var s=this.parseGroup(t);if(s==null)throw new Te("Expected group as "+t,this.fetch());return s}case"original":case null:case void 0:return this.parseArgumentGroup(r);default:throw new Te("Unknown group type as "+t,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(t,n){var r=this.gullet.scanArgument(n);if(r==null)return null;for(var a="",i;(i=this.fetch()).text!=="EOF";)a+=i.text,this.consume();return this.consume(),r.text=a,r}parseRegexGroup(t,n){for(var r=this.fetch(),a=r,i="",s;(s=this.fetch()).text!=="EOF"&&t.test(i+s.text);)a=s,i+=a.text,this.consume();if(i==="")throw new Te("Invalid "+n+": '"+r.text+"'",r);return r.range(a,i)}parseColorGroup(t){var n=this.parseStringGroup("color",t);if(n==null)return null;var r=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(n.text);if(!r)throw new Te("Invalid color: '"+n.text+"'",n);var a=r[0];return/^[0-9a-f]{6}$/i.test(a)&&(a="#"+a),{type:"color-token",mode:this.mode,color:a}}parseSizeGroup(t){var n,r=!1;if(this.gullet.consumeSpaces(),!t&&this.gullet.future().text!=="{"?n=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):n=this.parseStringGroup("size",t),!n)return null;!t&&n.text.length===0&&(n.text="0pt",r=!0);var a=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n.text);if(!a)throw new Te("Invalid size: '"+n.text+"'",n);var i={number:+(a[1]+a[2]),unit:a[3]};if(!L2(i))throw new Te("Invalid unit: '"+i.unit+"'",n);return{type:"size",mode:this.mode,value:i,isBlank:r}}parseUrlGroup(t){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var n=this.parseStringGroup("url",t);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),n==null)return null;var r=n.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:r}}parseArgumentGroup(t,n){var r=this.gullet.scanArgument(t);if(r==null)return null;var a=this.mode;n&&this.switchMode(n),this.gullet.beginGroup();var i=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var s={type:"ordgroup",mode:this.mode,loc:r.loc,body:i};return n&&this.switchMode(a),s}parseGroup(t,n){var r=this.fetch(),a=r.text,i;if(a==="{"||a==="\\begingroup"){this.consume();var s=a==="{"?"}":"\\endgroup";this.gullet.beginGroup();var o=this.parseExpression(!1,s),l=this.fetch();this.expect(s),this.gullet.endGroup(),i={type:"ordgroup",mode:this.mode,loc:bn.range(r,l),body:o,semisimple:a==="\\begingroup"||void 0}}else if(i=this.parseFunction(n,t)||this.parseSymbol(),i==null&&a[0]==="\\"&&!Sx.hasOwnProperty(a)){if(this.settings.throwOnError)throw new Te("Undefined control sequence: "+a,r);i=this.formatUnsupportedCmd(a),this.consume()}return i}formLigatures(t){for(var n=t.length-1,r=0;r<n;++r){var a=t[r];if(a.type==="textord"){var i=a.text,s=t[r+1];if(!(!s||s.type!=="textord")){if(i==="-"&&s.text==="-"){var o=t[r+2];r+1<n&&o&&o.type==="textord"&&o.text==="-"?(t.splice(r,3,{type:"textord",mode:"text",loc:bn.range(a,o),text:"---"}),n-=2):(t.splice(r,2,{type:"textord",mode:"text",loc:bn.range(a,s),text:"--"}),n-=1)}(i==="'"||i==="`")&&s.text===i&&(t.splice(r,2,{type:"textord",mode:"text",loc:bn.range(a,s),text:i+i}),n-=1)}}}}parseSymbol(){var t=this.fetch(),n=t.text;if(/^\\verb[^a-zA-Z]/.test(n)){this.consume();var r=n.slice(5),a=r.charAt(0)==="*";if(a&&(r=r.slice(1)),r.length<2||r.charAt(0)!==r.slice(-1))throw new Te(`\\verb assertion failed --
|
|
767
|
+
please report what input caused this bug`);return r=r.slice(1,-1),{type:"verb",mode:"text",body:r,star:a}}Em.hasOwnProperty(n[0])&&!At[this.mode][n[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+n[0]+'" used in math mode',t),n=Em[n[0]]+n.slice(1));var i=rS.exec(n);i&&(n=n.substring(0,i.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var s;if(At[this.mode][n]){this.settings.strict&&this.mode==="math"&&Bc.includes(n)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',t);var o=At[this.mode][n].group,l=bn.range(t),u;EE(o)?u={type:"atom",mode:this.mode,family:o,loc:l,text:n}:u={type:o,mode:this.mode,loc:l,text:n},s=u}else if(n.charCodeAt(0)>=128)this.settings.strict&&(R2(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),t)),s={type:"textord",mode:"text",loc:bn.range(t),text:n};else return null;if(this.consume(),i)for(var c=0;c<i[0].length;c++){var h=i[0][c];if(!_u[h])throw new Te("Unknown accent ' "+h+"'",t);var m=_u[h][this.mode]||_u[h].text;if(!m)throw new Te("Accent "+h+" unsupported in "+this.mode+" mode",t);s={type:"accent",mode:this.mode,loc:bn.range(t),label:m,isStretchy:!1,isShifty:!0,base:s}}return s}};Ax.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var Sd=function(t,n){if(!(typeof t=="string"||t instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var r=new Ax(t,n);delete r.gullet.macros.current["\\df@tag"];var a=r.parse();if(delete r.gullet.macros.current["\\current@color"],delete r.gullet.macros.current["\\color"],r.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new Te("\\tag works only in display equations");a=[{type:"tag",mode:"text",body:a,tag:r.subparse([new Sn("\\df@tag")])}]}return a},Nx=function(t,n,r){n.textContent="";var a=Ad(t,r).toNode();n.appendChild(a)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),Nx=function(){throw new Te("KaTeX doesn't work in quirks mode.")});var uS=function(t,n){var r=Ad(t,n).toMarkup();return r},cS=function(t,n){var r=new dd(n);return Sd(t,r)},Mx=function(t,n,r){if(r.throwOnError||!(t instanceof Te))throw t;var a=ve(["katex-error"],[new Cn(n)]);return a.setAttribute("title",t.toString()),a.setAttribute("style","color:"+r.errorColor),a},Ad=function(t,n){var r=new dd(n);try{var a=Sd(t,r);return gE(a,t,r)}catch(i){return Mx(i,t,r)}},dS=function(t,n){var r=new dd(n);try{var a=Sd(t,r);return xE(a,t,r)}catch(i){return Mx(i,t,r)}},hS="0.16.47",fS={Span:si,Anchor:hl,SymbolNode:Cn,SvgNode:wr,PathNode:Fr,LineNode:jc},Sm={version:hS,render:Nx,renderToString:uS,ParseError:Te,SETTINGS_SCHEMA:Dc,__parse:cS,__renderToDomTree:Ad,__renderToHTMLTree:dS,__setFontMetrics:QT,__defineSymbol:E,__defineFunction:Le,__defineMacro:z,__domTree:fS};const mS={},pS=[];function Ix(e){const t=e||mS;return function(n,r){id(n,"element",function(a,i){const s=Array.isArray(a.properties.className)?a.properties.className:pS,o=s.includes("language-math"),l=s.includes("math-display"),u=s.includes("math-inline");let c=l;if(!o&&!l&&!u)return;let h=i[i.length-1],m=a;if(a.tagName==="code"&&o&&h&&h.type==="element"&&h.tagName==="pre"&&(m=h,h=i[i.length-2],c=!0),!h)return;const d=cT(m,{whitespace:"pre"});let p;try{p=Sm.renderToString(d,{...t,displayMode:c,throwOnError:!0})}catch(x){const b=x,v=b.name.toLowerCase();r.message("Could not render math with KaTeX",{ancestors:[...i,a],cause:b,place:a.position,ruleId:v,source:"rehype-katex"});try{p=Sm.renderToString(d,{...t,displayMode:c,strict:"ignore",throwOnError:!1})}catch{p=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(t.errorColor||"#cc0000"),title:String(x)},children:[{type:"text",value:d}]}]}}typeof p=="string"&&(p=nT(p).children);const g=h.children.indexOf(m);return h.children.splice(g,1,...p),Gg})}}function gS(e){const t=String(e),n=[];return{toOffset:a,toPoint:r};function r(i){if(typeof i=="number"&&i>-1&&i<=t.length){let s=0;for(;;){let o=n[s];if(o===void 0){const l=Am(t,n[s-1]);o=l===-1?t.length+1:l+1,n[s]=o}if(o>i)return{line:s+1,column:i-(s>0?n[s-1]:0)+1,offset:i};s++}}}function a(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],l=Am(t,o),u=l===-1?t.length+1:l+1;if(o===u)break;n.push(u)}const s=(i.line>1?n[i.line-2]:0)+i.column-1;if(s<n[i.line-1])return s}}}function Am(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
|
|
768
|
+
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const _x={}.hasOwnProperty,xS=Object.prototype;function bS(e,t){const n=t||{};return Cd({file:n.file||void 0,location:!1,schema:n.space==="svg"?Vr:gs,verbose:n.verbose||!1},e)}function Cd(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},fo(e,r,n),n}case"#document":case"#document-fragment":{const r=t,a="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:Rx(e,t.childNodes),data:{quirksMode:a}},e.file&&e.location){const i=String(e.file),s=gS(i),o=s.toPoint(0),l=s.toPoint(i.length);n.position={start:o,end:l}}return n}case"#documentType":{const r=t;return n={type:"doctype"},fo(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},fo(e,r,n),n}default:return n=yS(e,t),n}}function Rx(e,t){let n=-1;const r=[];for(;++n<t.length;){const a=Cd(e,t[n]);r.push(a)}return r}function yS(e,t){const n=e.schema;e.schema=t.namespaceURI===rr.svg?Vr:gs;let r=-1;const a={};for(;++r<t.attrs.length;){const o=t.attrs[r],l=(o.prefix?o.prefix+":":"")+o.name;_x.call(xS,l)||(a[l]=o.value)}const s=(e.schema.space==="svg"?S2:E2)(t.tagName,a,Rx(e,t.childNodes));if(fo(e,t,s),s.tagName==="template"){const o=t,l=o.sourceCodeLocation,u=l&&l.startTag&&Fa(l.startTag),c=l&&l.endTag&&Fa(l.endTag),h=Cd(e,o.content);u&&c&&e.file&&(h.position={start:u.end,end:c.start}),s.content=h}return e.schema=n,s}function fo(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=vS(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function vS(e,t,n){const r=Fa(n);if(t.type==="element"){const a=t.children[t.children.length-1];if(r&&!n.endTag&&a&&a.position&&a.position.end&&(r.end=Object.assign({},a.position.end)),e.verbose){const i={};let s;if(n.attrs)for(s in n.attrs)_x.call(n.attrs,s)&&(i[il(e.schema,s).property]=Fa(n.attrs[s]));n.startTag;const o=Fa(n.startTag),l=n.endTag?Fa(n.endTag):void 0,u={opening:o};l&&(u.closing=l),u.properties=i,t.data={position:u}}}return r}function Fa(e){const t=Cm({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=Cm({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function Cm(e){return e.line&&e.column?e:void 0}const wS={},kS={}.hasOwnProperty,Lx=e2("type",{handlers:{root:ES,element:MS,text:CS,comment:NS,doctype:AS}});function TS(e,t){const r=(t||wS).space;return Lx(e,r==="svg"?Vr:gs)}function ES(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Nd(e.children,n,t),ui(e,n),n}function SS(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Nd(e.children,n,t),ui(e,n),n}function AS(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return ui(e,t),t}function CS(e){const t={nodeName:"#text",value:e.value,parentNode:null};return ui(e,t),t}function NS(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return ui(e,t),t}function MS(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=Vr);const a=[];let i;if(e.properties){for(i in e.properties)if(i!=="children"&&kS.call(e.properties,i)){const l=IS(r,i,e.properties[i]);l&&a.push(l)}}const s=r.space,o={nodeName:e.tagName,tagName:e.tagName,attrs:a,namespaceURI:rr[s],childNodes:[],parentNode:null};return o.childNodes=Nd(e.children,o,r),ui(e,o),e.tagName==="template"&&e.content&&(o.content=SS(e.content,r)),o}function IS(e,t,n){const r=il(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?dg(n):yg(n));const a={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const i=a.name.indexOf(":");i<0?a.prefix="":(a.name=a.name.slice(i+1),a.prefix=r.attribute.slice(0,i)),a.namespace=rr[r.space]}return a}function Nd(e,t,n){let r=-1;const a=[];if(e)for(;++r<e.length;){const i=Lx(e[r],n);i.parentNode=t,a.push(i)}return a}function ui(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 _S=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],RS=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]),St="�";var U;(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"})(U||(U={}));const gn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function Dx(e){return e>=55296&&e<=57343}function LS(e){return e>=56320&&e<=57343}function DS(e,t){return(e-55296)*1024+9216+t}function Px(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function Ox(e){return e>=64976&&e<=65007||RS.has(e)}var ue;(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"})(ue||(ue={}));const PS=65536;class OS{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=PS,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:a,offset:i}=this,s=a+n,o=i+n;return{code:t,startLine:r,endLine:r,startCol:s,endCol:s,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(LS(n))return this.pos++,this._addGap(),DS(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,U.EOF;return this._err(ue.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,U.EOF;const r=this.html.charCodeAt(n);return r===U.CARRIAGE_RETURN?U.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,U.EOF;let t=this.html.charCodeAt(this.pos);return t===U.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,U.LINE_FEED):t===U.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Dx(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===U.LINE_FEED||t===U.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){Px(t)?this._err(ue.controlCharacterInInputStream):Ox(t)&&this._err(ue.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var at;(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"})(at||(at={}));function jx(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 jS=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))),BS=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 FS(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=BS.get(e))!==null&&t!==void 0?t:e}var Gt;(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"})(Gt||(Gt={}));const zS=32;var Or;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Or||(Or={}));function Jc(e){return e>=Gt.ZERO&&e<=Gt.NINE}function HS(e){return e>=Gt.UPPER_A&&e<=Gt.UPPER_F||e>=Gt.LOWER_A&&e<=Gt.LOWER_F}function US(e){return e>=Gt.UPPER_A&&e<=Gt.UPPER_Z||e>=Gt.LOWER_A&&e<=Gt.LOWER_Z||Jc(e)}function qS(e){return e===Gt.EQUALS||US(e)}var Wt;(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"})(Wt||(Wt={}));var br;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(br||(br={}));class VS{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Wt.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=br.Strict}startEntity(t){this.decodeMode=t,this.state=Wt.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Wt.EntityStart:return t.charCodeAt(n)===Gt.NUM?(this.state=Wt.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Wt.NamedEntity,this.stateNamedEntity(t,n));case Wt.NumericStart:return this.stateNumericStart(t,n);case Wt.NumericDecimal:return this.stateNumericDecimal(t,n);case Wt.NumericHex:return this.stateNumericHex(t,n);case Wt.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|zS)===Gt.LOWER_X?(this.state=Wt.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Wt.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,a){if(n!==r){const i=r-n;this.result=this.result*Math.pow(a,i)+Number.parseInt(t.substr(n,i),a),this.consumed+=i}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const a=t.charCodeAt(n);if(Jc(a)||HS(a))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(a,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const a=t.charCodeAt(n);if(Jc(a))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(a,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===Gt.SEMI)this.consumed+=1;else if(this.decodeMode===br.Strict)return 0;return this.emitCodePoint(FS(this.result),this.consumed),this.errors&&(t!==Gt.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let a=r[this.treeIndex],i=(a&Or.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const s=t.charCodeAt(n);if(this.treeIndex=$S(r,a,this.treeIndex+Math.max(1,i),s),this.treeIndex<0)return this.result===0||this.decodeMode===br.Attribute&&(i===0||qS(s))?0:this.emitNotTerminatedNamedEntity();if(a=r[this.treeIndex],i=(a&Or.VALUE_LENGTH)>>14,i!==0){if(s===Gt.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==br.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,a=(r[n]&Or.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,a,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:a}=this;return this.emitCodePoint(n===1?a[t]&~Or.VALUE_LENGTH:a[t+1],r),n===3&&this.emitCodePoint(a[t+2],r),r}end(){var t;switch(this.state){case Wt.NamedEntity:return this.result!==0&&(this.decodeMode!==br.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Wt.NumericDecimal:return this.emitNumericEntity(0,2);case Wt.NumericHex:return this.emitNumericEntity(0,3);case Wt.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Wt.EntityStart:return 0}}}function $S(e,t,n,r){const a=(t&Or.BRANCH_LENGTH)>>7,i=t&Or.JUMP_TABLE;if(a===0)return i!==0&&r===i?n:-1;if(i){const l=r-i;return l<0||l>=a?-1:e[n+l]-1}let s=n,o=s+a-1;for(;s<=o;){const l=s+o>>>1,u=e[l];if(u<r)s=l+1;else if(u>r)o=l-1;else return e[l+a]}return-1}var be;(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/"})(be||(be={}));var ga;(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"})(ga||(ga={}));var Dn;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Dn||(Dn={}));var se;(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"})(se||(se={}));var y;(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"})(y||(y={}));const WS=new Map([[se.A,y.A],[se.ADDRESS,y.ADDRESS],[se.ANNOTATION_XML,y.ANNOTATION_XML],[se.APPLET,y.APPLET],[se.AREA,y.AREA],[se.ARTICLE,y.ARTICLE],[se.ASIDE,y.ASIDE],[se.B,y.B],[se.BASE,y.BASE],[se.BASEFONT,y.BASEFONT],[se.BGSOUND,y.BGSOUND],[se.BIG,y.BIG],[se.BLOCKQUOTE,y.BLOCKQUOTE],[se.BODY,y.BODY],[se.BR,y.BR],[se.BUTTON,y.BUTTON],[se.CAPTION,y.CAPTION],[se.CENTER,y.CENTER],[se.CODE,y.CODE],[se.COL,y.COL],[se.COLGROUP,y.COLGROUP],[se.DD,y.DD],[se.DESC,y.DESC],[se.DETAILS,y.DETAILS],[se.DIALOG,y.DIALOG],[se.DIR,y.DIR],[se.DIV,y.DIV],[se.DL,y.DL],[se.DT,y.DT],[se.EM,y.EM],[se.EMBED,y.EMBED],[se.FIELDSET,y.FIELDSET],[se.FIGCAPTION,y.FIGCAPTION],[se.FIGURE,y.FIGURE],[se.FONT,y.FONT],[se.FOOTER,y.FOOTER],[se.FOREIGN_OBJECT,y.FOREIGN_OBJECT],[se.FORM,y.FORM],[se.FRAME,y.FRAME],[se.FRAMESET,y.FRAMESET],[se.H1,y.H1],[se.H2,y.H2],[se.H3,y.H3],[se.H4,y.H4],[se.H5,y.H5],[se.H6,y.H6],[se.HEAD,y.HEAD],[se.HEADER,y.HEADER],[se.HGROUP,y.HGROUP],[se.HR,y.HR],[se.HTML,y.HTML],[se.I,y.I],[se.IMG,y.IMG],[se.IMAGE,y.IMAGE],[se.INPUT,y.INPUT],[se.IFRAME,y.IFRAME],[se.KEYGEN,y.KEYGEN],[se.LABEL,y.LABEL],[se.LI,y.LI],[se.LINK,y.LINK],[se.LISTING,y.LISTING],[se.MAIN,y.MAIN],[se.MALIGNMARK,y.MALIGNMARK],[se.MARQUEE,y.MARQUEE],[se.MATH,y.MATH],[se.MENU,y.MENU],[se.META,y.META],[se.MGLYPH,y.MGLYPH],[se.MI,y.MI],[se.MO,y.MO],[se.MN,y.MN],[se.MS,y.MS],[se.MTEXT,y.MTEXT],[se.NAV,y.NAV],[se.NOBR,y.NOBR],[se.NOFRAMES,y.NOFRAMES],[se.NOEMBED,y.NOEMBED],[se.NOSCRIPT,y.NOSCRIPT],[se.OBJECT,y.OBJECT],[se.OL,y.OL],[se.OPTGROUP,y.OPTGROUP],[se.OPTION,y.OPTION],[se.P,y.P],[se.PARAM,y.PARAM],[se.PLAINTEXT,y.PLAINTEXT],[se.PRE,y.PRE],[se.RB,y.RB],[se.RP,y.RP],[se.RT,y.RT],[se.RTC,y.RTC],[se.RUBY,y.RUBY],[se.S,y.S],[se.SCRIPT,y.SCRIPT],[se.SEARCH,y.SEARCH],[se.SECTION,y.SECTION],[se.SELECT,y.SELECT],[se.SOURCE,y.SOURCE],[se.SMALL,y.SMALL],[se.SPAN,y.SPAN],[se.STRIKE,y.STRIKE],[se.STRONG,y.STRONG],[se.STYLE,y.STYLE],[se.SUB,y.SUB],[se.SUMMARY,y.SUMMARY],[se.SUP,y.SUP],[se.TABLE,y.TABLE],[se.TBODY,y.TBODY],[se.TEMPLATE,y.TEMPLATE],[se.TEXTAREA,y.TEXTAREA],[se.TFOOT,y.TFOOT],[se.TD,y.TD],[se.TH,y.TH],[se.THEAD,y.THEAD],[se.TITLE,y.TITLE],[se.TR,y.TR],[se.TRACK,y.TRACK],[se.TT,y.TT],[se.U,y.U],[se.UL,y.UL],[se.SVG,y.SVG],[se.VAR,y.VAR],[se.WBR,y.WBR],[se.XMP,y.XMP]]);function ci(e){var t;return(t=WS.get(e))!==null&&t!==void 0?t:y.UNKNOWN}const we=y,GS={[be.HTML]:new Set([we.ADDRESS,we.APPLET,we.AREA,we.ARTICLE,we.ASIDE,we.BASE,we.BASEFONT,we.BGSOUND,we.BLOCKQUOTE,we.BODY,we.BR,we.BUTTON,we.CAPTION,we.CENTER,we.COL,we.COLGROUP,we.DD,we.DETAILS,we.DIR,we.DIV,we.DL,we.DT,we.EMBED,we.FIELDSET,we.FIGCAPTION,we.FIGURE,we.FOOTER,we.FORM,we.FRAME,we.FRAMESET,we.H1,we.H2,we.H3,we.H4,we.H5,we.H6,we.HEAD,we.HEADER,we.HGROUP,we.HR,we.HTML,we.IFRAME,we.IMG,we.INPUT,we.LI,we.LINK,we.LISTING,we.MAIN,we.MARQUEE,we.MENU,we.META,we.NAV,we.NOEMBED,we.NOFRAMES,we.NOSCRIPT,we.OBJECT,we.OL,we.P,we.PARAM,we.PLAINTEXT,we.PRE,we.SCRIPT,we.SECTION,we.SELECT,we.SOURCE,we.STYLE,we.SUMMARY,we.TABLE,we.TBODY,we.TD,we.TEMPLATE,we.TEXTAREA,we.TFOOT,we.TH,we.THEAD,we.TITLE,we.TR,we.TRACK,we.UL,we.WBR,we.XMP]),[be.MATHML]:new Set([we.MI,we.MO,we.MN,we.MS,we.MTEXT,we.ANNOTATION_XML]),[be.SVG]:new Set([we.TITLE,we.FOREIGN_OBJECT,we.DESC]),[be.XLINK]:new Set,[be.XML]:new Set,[be.XMLNS]:new Set},e0=new Set([we.H1,we.H2,we.H3,we.H4,we.H5,we.H6]);se.STYLE,se.SCRIPT,se.XMP,se.IFRAME,se.NOEMBED,se.NOFRAMES,se.PLAINTEXT;var $;(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"})($||($={}));const Pt={DATA:$.DATA,RCDATA:$.RCDATA,RAWTEXT:$.RAWTEXT,SCRIPT_DATA:$.SCRIPT_DATA,PLAINTEXT:$.PLAINTEXT,CDATA_SECTION:$.CDATA_SECTION};function YS(e){return e>=U.DIGIT_0&&e<=U.DIGIT_9}function Li(e){return e>=U.LATIN_CAPITAL_A&&e<=U.LATIN_CAPITAL_Z}function KS(e){return e>=U.LATIN_SMALL_A&&e<=U.LATIN_SMALL_Z}function Ir(e){return KS(e)||Li(e)}function Nm(e){return Ir(e)||YS(e)}function Ys(e){return e+32}function Bx(e){return e===U.SPACE||e===U.LINE_FEED||e===U.TABULATION||e===U.FORM_FEED}function Mm(e){return Bx(e)||e===U.SOLIDUS||e===U.GREATER_THAN_SIGN}function XS(e){return e===U.NULL?ue.nullCharacterReference:e>1114111?ue.characterReferenceOutsideUnicodeRange:Dx(e)?ue.surrogateCharacterReference:Ox(e)?ue.noncharacterCharacterReference:Px(e)||e===U.CARRIAGE_RETURN?ue.controlCharacterReference:null}class QS{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=$.DATA,this.returnState=$.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new OS(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new VS(jS,(r,a)=>{this.preprocessor.pos=this.entityStartPos+a-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ue.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(ue.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const a=XS(r);a&&this._err(a,1)}}:void 0)}_err(t,n=0){var r,a;(a=(r=this.handler).onParseError)===null||a===void 0||a.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:at.START_TAG,tagName:"",tagID:y.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:at.END_TAG,tagName:"",tagID:y.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:at.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:at.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(jx(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const a=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);a[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(ue.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=ci(t.tagName),t.type===at.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(ue.endTagWithAttributes),t.selfClosing&&this._err(ue.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 at.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case at.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case at.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:at.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=Bx(t)?at.WHITESPACE_CHARACTER:t===U.NULL?at.NULL_CHARACTER:at.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(at.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=$.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?br.Attribute:br.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===$.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===$.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===$.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case $.DATA:{this._stateData(t);break}case $.RCDATA:{this._stateRcdata(t);break}case $.RAWTEXT:{this._stateRawtext(t);break}case $.SCRIPT_DATA:{this._stateScriptData(t);break}case $.PLAINTEXT:{this._statePlaintext(t);break}case $.TAG_OPEN:{this._stateTagOpen(t);break}case $.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case $.TAG_NAME:{this._stateTagName(t);break}case $.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case $.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case $.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case $.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case $.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case $.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case $.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case $.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case $.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case $.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case $.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case $.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case $.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case $.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case $.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case $.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case $.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case $.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case $.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case $.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case $.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case $.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case $.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case $.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case $.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case $.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case $.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case $.BOGUS_COMMENT:{this._stateBogusComment(t);break}case $.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case $.COMMENT_START:{this._stateCommentStart(t);break}case $.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case $.COMMENT:{this._stateComment(t);break}case $.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case $.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case $.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case $.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case $.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case $.COMMENT_END:{this._stateCommentEnd(t);break}case $.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case $.DOCTYPE:{this._stateDoctype(t);break}case $.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case $.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case $.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case $.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case $.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case $.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case $.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case $.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case $.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case $.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case $.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case $.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case $.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case $.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case $.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case $.CDATA_SECTION:{this._stateCdataSection(t);break}case $.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case $.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case $.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case $.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case U.LESS_THAN_SIGN:{this.state=$.TAG_OPEN;break}case U.AMPERSAND:{this._startCharacterReference();break}case U.NULL:{this._err(ue.unexpectedNullCharacter),this._emitCodePoint(t);break}case U.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case U.AMPERSAND:{this._startCharacterReference();break}case U.LESS_THAN_SIGN:{this.state=$.RCDATA_LESS_THAN_SIGN;break}case U.NULL:{this._err(ue.unexpectedNullCharacter),this._emitChars(St);break}case U.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case U.LESS_THAN_SIGN:{this.state=$.RAWTEXT_LESS_THAN_SIGN;break}case U.NULL:{this._err(ue.unexpectedNullCharacter),this._emitChars(St);break}case U.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case U.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_LESS_THAN_SIGN;break}case U.NULL:{this._err(ue.unexpectedNullCharacter),this._emitChars(St);break}case U.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case U.NULL:{this._err(ue.unexpectedNullCharacter),this._emitChars(St);break}case U.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Ir(t))this._createStartTagToken(),this.state=$.TAG_NAME,this._stateTagName(t);else switch(t){case U.EXCLAMATION_MARK:{this.state=$.MARKUP_DECLARATION_OPEN;break}case U.SOLIDUS:{this.state=$.END_TAG_OPEN;break}case U.QUESTION_MARK:{this._err(ue.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=$.BOGUS_COMMENT,this._stateBogusComment(t);break}case U.EOF:{this._err(ue.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ue.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=$.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Ir(t))this._createEndTagToken(),this.state=$.TAG_NAME,this._stateTagName(t);else switch(t){case U.GREATER_THAN_SIGN:{this._err(ue.missingEndTagName),this.state=$.DATA;break}case U.EOF:{this._err(ue.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(ue.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=$.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:{this.state=$.BEFORE_ATTRIBUTE_NAME;break}case U.SOLIDUS:{this.state=$.SELF_CLOSING_START_TAG;break}case U.GREATER_THAN_SIGN:{this.state=$.DATA,this.emitCurrentTagToken();break}case U.NULL:{this._err(ue.unexpectedNullCharacter),n.tagName+=St;break}case U.EOF:{this._err(ue.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Li(t)?Ys(t):t)}}_stateRcdataLessThanSign(t){t===U.SOLIDUS?this.state=$.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=$.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){Ir(t)?(this.state=$.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=$.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 U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=$.BEFORE_ATTRIBUTE_NAME,!1;case U.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=$.SELF_CLOSING_START_TAG,!1;case U.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=$.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=$.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===U.SOLIDUS?this.state=$.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=$.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){Ir(t)?(this.state=$.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=$.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=$.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case U.SOLIDUS:{this.state=$.SCRIPT_DATA_END_TAG_OPEN;break}case U.EXCLAMATION_MARK:{this.state=$.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=$.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){Ir(t)?(this.state=$.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=$.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=$.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===U.HYPHEN_MINUS?(this.state=$.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=$.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===U.HYPHEN_MINUS?(this.state=$.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=$.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case U.HYPHEN_MINUS:{this.state=$.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case U.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case U.NULL:{this._err(ue.unexpectedNullCharacter),this._emitChars(St);break}case U.EOF:{this._err(ue.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case U.HYPHEN_MINUS:{this.state=$.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case U.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case U.NULL:{this._err(ue.unexpectedNullCharacter),this.state=$.SCRIPT_DATA_ESCAPED,this._emitChars(St);break}case U.EOF:{this._err(ue.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case U.HYPHEN_MINUS:{this._emitChars("-");break}case U.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case U.GREATER_THAN_SIGN:{this.state=$.SCRIPT_DATA,this._emitChars(">");break}case U.NULL:{this._err(ue.unexpectedNullCharacter),this.state=$.SCRIPT_DATA_ESCAPED,this._emitChars(St);break}case U.EOF:{this._err(ue.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===U.SOLIDUS?this.state=$.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Ir(t)?(this._emitChars("<"),this.state=$.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=$.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Ir(t)?(this.state=$.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=$.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=$.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(gn.SCRIPT,!1)&&Mm(this.preprocessor.peek(gn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<gn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=$.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case U.HYPHEN_MINUS:{this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case U.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case U.NULL:{this._err(ue.unexpectedNullCharacter),this._emitChars(St);break}case U.EOF:{this._err(ue.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case U.HYPHEN_MINUS:{this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case U.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case U.NULL:{this._err(ue.unexpectedNullCharacter),this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(St);break}case U.EOF:{this._err(ue.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case U.HYPHEN_MINUS:{this._emitChars("-");break}case U.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case U.GREATER_THAN_SIGN:{this.state=$.SCRIPT_DATA,this._emitChars(">");break}case U.NULL:{this._err(ue.unexpectedNullCharacter),this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(St);break}case U.EOF:{this._err(ue.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===U.SOLIDUS?(this.state=$.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(gn.SCRIPT,!1)&&Mm(this.preprocessor.peek(gn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<gn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=$.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:break;case U.SOLIDUS:case U.GREATER_THAN_SIGN:case U.EOF:{this.state=$.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case U.EQUALS_SIGN:{this._err(ue.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=$.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=$.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:case U.SOLIDUS:case U.GREATER_THAN_SIGN:case U.EOF:{this._leaveAttrName(),this.state=$.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case U.EQUALS_SIGN:{this._leaveAttrName(),this.state=$.BEFORE_ATTRIBUTE_VALUE;break}case U.QUOTATION_MARK:case U.APOSTROPHE:case U.LESS_THAN_SIGN:{this._err(ue.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case U.NULL:{this._err(ue.unexpectedNullCharacter),this.currentAttr.name+=St;break}default:this.currentAttr.name+=String.fromCodePoint(Li(t)?Ys(t):t)}}_stateAfterAttributeName(t){switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:break;case U.SOLIDUS:{this.state=$.SELF_CLOSING_START_TAG;break}case U.EQUALS_SIGN:{this.state=$.BEFORE_ATTRIBUTE_VALUE;break}case U.GREATER_THAN_SIGN:{this.state=$.DATA,this.emitCurrentTagToken();break}case U.EOF:{this._err(ue.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=$.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:break;case U.QUOTATION_MARK:{this.state=$.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case U.APOSTROPHE:{this.state=$.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case U.GREATER_THAN_SIGN:{this._err(ue.missingAttributeValue),this.state=$.DATA,this.emitCurrentTagToken();break}default:this.state=$.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case U.QUOTATION_MARK:{this.state=$.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case U.AMPERSAND:{this._startCharacterReference();break}case U.NULL:{this._err(ue.unexpectedNullCharacter),this.currentAttr.value+=St;break}case U.EOF:{this._err(ue.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case U.APOSTROPHE:{this.state=$.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case U.AMPERSAND:{this._startCharacterReference();break}case U.NULL:{this._err(ue.unexpectedNullCharacter),this.currentAttr.value+=St;break}case U.EOF:{this._err(ue.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:{this._leaveAttrValue(),this.state=$.BEFORE_ATTRIBUTE_NAME;break}case U.AMPERSAND:{this._startCharacterReference();break}case U.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=$.DATA,this.emitCurrentTagToken();break}case U.NULL:{this._err(ue.unexpectedNullCharacter),this.currentAttr.value+=St;break}case U.QUOTATION_MARK:case U.APOSTROPHE:case U.LESS_THAN_SIGN:case U.EQUALS_SIGN:case U.GRAVE_ACCENT:{this._err(ue.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case U.EOF:{this._err(ue.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:{this._leaveAttrValue(),this.state=$.BEFORE_ATTRIBUTE_NAME;break}case U.SOLIDUS:{this._leaveAttrValue(),this.state=$.SELF_CLOSING_START_TAG;break}case U.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=$.DATA,this.emitCurrentTagToken();break}case U.EOF:{this._err(ue.eofInTag),this._emitEOFToken();break}default:this._err(ue.missingWhitespaceBetweenAttributes),this.state=$.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case U.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=$.DATA,this.emitCurrentTagToken();break}case U.EOF:{this._err(ue.eofInTag),this._emitEOFToken();break}default:this._err(ue.unexpectedSolidusInTag),this.state=$.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case U.GREATER_THAN_SIGN:{this.state=$.DATA,this.emitCurrentComment(n);break}case U.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case U.NULL:{this._err(ue.unexpectedNullCharacter),n.data+=St;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(gn.DASH_DASH,!0)?(this._createCommentToken(gn.DASH_DASH.length+1),this.state=$.COMMENT_START):this._consumeSequenceIfMatch(gn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(gn.DOCTYPE.length+1),this.state=$.DOCTYPE):this._consumeSequenceIfMatch(gn.CDATA_START,!0)?this.inForeignNode?this.state=$.CDATA_SECTION:(this._err(ue.cdataInHtmlContent),this._createCommentToken(gn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=$.BOGUS_COMMENT):this._ensureHibernation()||(this._err(ue.incorrectlyOpenedComment),this._createCommentToken(2),this.state=$.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case U.HYPHEN_MINUS:{this.state=$.COMMENT_START_DASH;break}case U.GREATER_THAN_SIGN:{this._err(ue.abruptClosingOfEmptyComment),this.state=$.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=$.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case U.HYPHEN_MINUS:{this.state=$.COMMENT_END;break}case U.GREATER_THAN_SIGN:{this._err(ue.abruptClosingOfEmptyComment),this.state=$.DATA,this.emitCurrentComment(n);break}case U.EOF:{this._err(ue.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=$.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case U.HYPHEN_MINUS:{this.state=$.COMMENT_END_DASH;break}case U.LESS_THAN_SIGN:{n.data+="<",this.state=$.COMMENT_LESS_THAN_SIGN;break}case U.NULL:{this._err(ue.unexpectedNullCharacter),n.data+=St;break}case U.EOF:{this._err(ue.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case U.EXCLAMATION_MARK:{n.data+="!",this.state=$.COMMENT_LESS_THAN_SIGN_BANG;break}case U.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=$.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===U.HYPHEN_MINUS?this.state=$.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=$.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===U.HYPHEN_MINUS?this.state=$.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=$.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==U.GREATER_THAN_SIGN&&t!==U.EOF&&this._err(ue.nestedComment),this.state=$.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case U.HYPHEN_MINUS:{this.state=$.COMMENT_END;break}case U.EOF:{this._err(ue.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=$.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case U.GREATER_THAN_SIGN:{this.state=$.DATA,this.emitCurrentComment(n);break}case U.EXCLAMATION_MARK:{this.state=$.COMMENT_END_BANG;break}case U.HYPHEN_MINUS:{n.data+="-";break}case U.EOF:{this._err(ue.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=$.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case U.HYPHEN_MINUS:{n.data+="--!",this.state=$.COMMENT_END_DASH;break}case U.GREATER_THAN_SIGN:{this._err(ue.incorrectlyClosedComment),this.state=$.DATA,this.emitCurrentComment(n);break}case U.EOF:{this._err(ue.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=$.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:{this.state=$.BEFORE_DOCTYPE_NAME;break}case U.GREATER_THAN_SIGN:{this.state=$.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case U.EOF:{this._err(ue.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ue.missingWhitespaceBeforeDoctypeName),this.state=$.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Li(t))this._createDoctypeToken(String.fromCharCode(Ys(t))),this.state=$.DOCTYPE_NAME;else switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:break;case U.NULL:{this._err(ue.unexpectedNullCharacter),this._createDoctypeToken(St),this.state=$.DOCTYPE_NAME;break}case U.GREATER_THAN_SIGN:{this._err(ue.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=$.DATA;break}case U.EOF:{this._err(ue.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=$.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:{this.state=$.AFTER_DOCTYPE_NAME;break}case U.GREATER_THAN_SIGN:{this.state=$.DATA,this.emitCurrentDoctype(n);break}case U.NULL:{this._err(ue.unexpectedNullCharacter),n.name+=St;break}case U.EOF:{this._err(ue.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Li(t)?Ys(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:break;case U.GREATER_THAN_SIGN:{this.state=$.DATA,this.emitCurrentDoctype(n);break}case U.EOF:{this._err(ue.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(gn.PUBLIC,!1)?this.state=$.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(gn.SYSTEM,!1)?this.state=$.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(ue.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:{this.state=$.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case U.QUOTATION_MARK:{this._err(ue.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=$.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case U.APOSTROPHE:{this._err(ue.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=$.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case U.GREATER_THAN_SIGN:{this._err(ue.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=$.DATA,this.emitCurrentDoctype(n);break}case U.EOF:{this._err(ue.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ue.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:break;case U.QUOTATION_MARK:{n.publicId="",this.state=$.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case U.APOSTROPHE:{n.publicId="",this.state=$.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case U.GREATER_THAN_SIGN:{this._err(ue.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=$.DATA,this.emitCurrentDoctype(n);break}case U.EOF:{this._err(ue.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ue.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case U.QUOTATION_MARK:{this.state=$.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case U.NULL:{this._err(ue.unexpectedNullCharacter),n.publicId+=St;break}case U.GREATER_THAN_SIGN:{this._err(ue.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=$.DATA;break}case U.EOF:{this._err(ue.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 U.APOSTROPHE:{this.state=$.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case U.NULL:{this._err(ue.unexpectedNullCharacter),n.publicId+=St;break}case U.GREATER_THAN_SIGN:{this._err(ue.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=$.DATA;break}case U.EOF:{this._err(ue.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 U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:{this.state=$.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case U.GREATER_THAN_SIGN:{this.state=$.DATA,this.emitCurrentDoctype(n);break}case U.QUOTATION_MARK:{this._err(ue.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case U.APOSTROPHE:{this._err(ue.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case U.EOF:{this._err(ue.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ue.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:break;case U.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=$.DATA;break}case U.QUOTATION_MARK:{n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case U.APOSTROPHE:{n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case U.EOF:{this._err(ue.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ue.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:{this.state=$.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case U.QUOTATION_MARK:{this._err(ue.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case U.APOSTROPHE:{this._err(ue.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case U.GREATER_THAN_SIGN:{this._err(ue.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=$.DATA,this.emitCurrentDoctype(n);break}case U.EOF:{this._err(ue.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ue.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:break;case U.QUOTATION_MARK:{n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case U.APOSTROPHE:{n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case U.GREATER_THAN_SIGN:{this._err(ue.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=$.DATA,this.emitCurrentDoctype(n);break}case U.EOF:{this._err(ue.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ue.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case U.QUOTATION_MARK:{this.state=$.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case U.NULL:{this._err(ue.unexpectedNullCharacter),n.systemId+=St;break}case U.GREATER_THAN_SIGN:{this._err(ue.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=$.DATA;break}case U.EOF:{this._err(ue.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 U.APOSTROPHE:{this.state=$.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case U.NULL:{this._err(ue.unexpectedNullCharacter),n.systemId+=St;break}case U.GREATER_THAN_SIGN:{this._err(ue.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=$.DATA;break}case U.EOF:{this._err(ue.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 U.SPACE:case U.LINE_FEED:case U.TABULATION:case U.FORM_FEED:break;case U.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=$.DATA;break}case U.EOF:{this._err(ue.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ue.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case U.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=$.DATA;break}case U.NULL:{this._err(ue.unexpectedNullCharacter);break}case U.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case U.RIGHT_SQUARE_BRACKET:{this.state=$.CDATA_SECTION_BRACKET;break}case U.EOF:{this._err(ue.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===U.RIGHT_SQUARE_BRACKET?this.state=$.CDATA_SECTION_END:(this._emitChars("]"),this.state=$.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case U.GREATER_THAN_SIGN:{this.state=$.DATA;break}case U.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=$.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(U.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Nm(this.preprocessor.peek(1))?$.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){Nm(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===U.SEMICOLON&&this._err(ue.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const Fx=new Set([y.DD,y.DT,y.LI,y.OPTGROUP,y.OPTION,y.P,y.RB,y.RP,y.RT,y.RTC]),Im=new Set([...Fx,y.CAPTION,y.COLGROUP,y.TBODY,y.TD,y.TFOOT,y.TH,y.THEAD,y.TR]),Fo=new Set([y.APPLET,y.CAPTION,y.HTML,y.MARQUEE,y.OBJECT,y.TABLE,y.TD,y.TEMPLATE,y.TH]),ZS=new Set([...Fo,y.OL,y.UL]),JS=new Set([...Fo,y.BUTTON]),_m=new Set([y.ANNOTATION_XML,y.MI,y.MN,y.MO,y.MS,y.MTEXT]),Rm=new Set([y.DESC,y.FOREIGN_OBJECT,y.TITLE]),eA=new Set([y.TR,y.TEMPLATE,y.HTML]),tA=new Set([y.TBODY,y.TFOOT,y.THEAD,y.TEMPLATE,y.HTML]),nA=new Set([y.TABLE,y.TEMPLATE,y.HTML]),rA=new Set([y.TD,y.TH]);class aA{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=y.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===y.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===be.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 a=this._indexOf(t)+1;this.items.splice(a,0,n),this.tagIDs.splice(a,0,r),this.stackTop++,a===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,a===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])!==be.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(e0,be.HTML)}popUntilTableCellPopped(){this.popUntilPopped(rA,be.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(nA,be.HTML)}clearBackToTableBodyContext(){this.clearBackTo(tA,be.HTML)}clearBackToTableRowContext(){this.clearBackTo(eA,be.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]===y.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]===y.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const a=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case be.HTML:{if(a===t)return!0;if(n.has(a))return!1;break}case be.SVG:{if(Rm.has(a))return!1;break}case be.MATHML:{if(_m.has(a))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Fo)}hasInListItemScope(t){return this.hasInDynamicScope(t,ZS)}hasInButtonScope(t){return this.hasInDynamicScope(t,JS)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case be.HTML:{if(e0.has(n))return!0;if(Fo.has(n))return!1;break}case be.SVG:{if(Rm.has(n))return!1;break}case be.MATHML:{if(_m.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===be.HTML)switch(this.tagIDs[n]){case t:return!0;case y.TABLE:case y.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===be.HTML)switch(this.tagIDs[t]){case y.TBODY:case y.THEAD:case y.TFOOT:return!0;case y.TABLE:case y.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===be.HTML)switch(this.tagIDs[n]){case t:return!0;case y.OPTION:case y.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Fx.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Im.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&Im.has(this.currentTagId);)this.pop()}}const Ru=3;var er;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(er||(er={}));const Lm={type:er.Marker};class iA{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],a=n.length,i=this.treeAdapter.getTagName(t),s=this.treeAdapter.getNamespaceURI(t);for(let o=0;o<this.entries.length;o++){const l=this.entries[o];if(l.type===er.Marker)break;const{element:u}=l;if(this.treeAdapter.getTagName(u)===i&&this.treeAdapter.getNamespaceURI(u)===s){const c=this.treeAdapter.getAttrList(u);c.length===a&&r.push({idx:o,attrs:c})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<Ru)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<Ru)return;const a=new Map(n.map(s=>[s.name,s.value]));let i=0;for(let s=0;s<r.length;s++){const o=r[s];o.attrs.every(l=>a.get(l.name)===l.value)&&(i+=1,i>=Ru&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(Lm)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:er.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:er.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(Lm);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===er.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===er.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===er.Element&&n.element===t)}}const _r={createDocument(){return{nodeName:"#document",mode:Dn.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 a=e.childNodes.find(i=>i.nodeName==="#documentType");if(a)a.name=t,a.publicId=n,a.systemId=r;else{const i={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};_r.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(_r.isTextNode(n)){n.value+=t;return}}_r.appendChild(e,_r.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&_r.isTextNode(r)?r.value+=t:_r.insertBefore(e,_r.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}}},zx="html",sA="about:legacy-compat",oA="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",Hx=["+//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//"],lA=[...Hx,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],uA=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Ux=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],cA=[...Ux,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Dm(e,t){return t.some(n=>e.startsWith(n))}function dA(e){return e.name===zx&&e.publicId===null&&(e.systemId===null||e.systemId===sA)}function hA(e){if(e.name!==zx)return Dn.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===oA)return Dn.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),uA.has(n))return Dn.QUIRKS;let r=t===null?lA:Hx;if(Dm(n,r))return Dn.QUIRKS;if(r=t===null?Ux:cA,Dm(n,r))return Dn.LIMITED_QUIRKS}return Dn.NO_QUIRKS}const Pm={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},fA="definitionurl",mA="definitionURL",pA=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])),gA=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:be.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:be.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:be.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:be.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:be.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:be.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:be.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:be.XML}],["xml:space",{prefix:"xml",name:"space",namespace:be.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:be.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:be.XMLNS}]]),xA=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])),bA=new Set([y.B,y.BIG,y.BLOCKQUOTE,y.BODY,y.BR,y.CENTER,y.CODE,y.DD,y.DIV,y.DL,y.DT,y.EM,y.EMBED,y.H1,y.H2,y.H3,y.H4,y.H5,y.H6,y.HEAD,y.HR,y.I,y.IMG,y.LI,y.LISTING,y.MENU,y.META,y.NOBR,y.OL,y.P,y.PRE,y.RUBY,y.S,y.SMALL,y.SPAN,y.STRONG,y.STRIKE,y.SUB,y.SUP,y.TABLE,y.TT,y.U,y.UL,y.VAR]);function yA(e){const t=e.tagID;return t===y.FONT&&e.attrs.some(({name:r})=>r===ga.COLOR||r===ga.SIZE||r===ga.FACE)||bA.has(t)}function qx(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===fA){e.attrs[t].name=mA;break}}function Vx(e){for(let t=0;t<e.attrs.length;t++){const n=pA.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function Md(e){for(let t=0;t<e.attrs.length;t++){const n=gA.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 vA(e){const t=xA.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=ci(e.tagName))}function wA(e,t){return t===be.MATHML&&(e===y.MI||e===y.MO||e===y.MN||e===y.MS||e===y.MTEXT)}function kA(e,t,n){if(t===be.MATHML&&e===y.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===ga.ENCODING){const a=n[r].value.toLowerCase();return a===Pm.TEXT_HTML||a===Pm.APPLICATION_XML}}return t===be.SVG&&(e===y.FOREIGN_OBJECT||e===y.DESC||e===y.TITLE)}function TA(e,t,n,r){return(!r||r===be.HTML)&&kA(e,t,n)||(!r||r===be.MATHML)&&wA(e,t)}const EA="hidden",SA=8,AA=3;var Y;(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"})(Y||(Y={}));const CA={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},$x=new Set([y.TABLE,y.TBODY,y.TFOOT,y.THEAD,y.TR]),Om={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:_r,onParseError:null};class jm{constructor(t,n,r=null,a=null){this.fragmentContext=r,this.scriptHandler=a,this.currentToken=null,this.stopped=!1,this.insertionMode=Y.INITIAL,this.originalInsertionMode=Y.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={...Om,...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 QS(this.options,this),this.activeFormattingElements=new iA(this.treeAdapter),this.fragmentContextID=r?ci(this.treeAdapter.getTagName(r)):y.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new aA(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={...Om,...n};t??(t=r.treeAdapter.createElement(se.TEMPLATE,be.HTML,[]));const a=r.treeAdapter.createElement("documentmock",be.HTML,[]),i=new this(r,a,t);return i.fragmentContextID===y.TEMPLATE&&i.tmplInsertionModeStack.unshift(Y.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 a;if(!this.onParseError)return;const i=(a=t.location)!==null&&a!==void 0?a:CA,s={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(s)}onItemPush(t,n,r){var a,i;(i=(a=this.treeAdapter).onItemPush)===null||i===void 0||i.call(a,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,a;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(a=(r=this.treeAdapter).onItemPop)===null||a===void 0||a.call(r,t,this.openElements.current),n){let i,s;this.openElements.stackTop===0&&this.fragmentContext?(i=this.fragmentContext,s=this.fragmentContextID):{current:i,currentTagId:s}=this.openElements,this._setContextModes(i,s)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===be.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,be.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=Y.TEXT}switchToPlaintextParsing(){this.insertionMode=Y.TEXT,this.originalInsertionMode=Y.IN_BODY,this.tokenizer.state=Pt.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)===se.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==be.HTML))switch(this.fragmentContextID){case y.TITLE:case y.TEXTAREA:{this.tokenizer.state=Pt.RCDATA;break}case y.STYLE:case y.XMP:case y.IFRAME:case y.NOEMBED:case y.NOFRAMES:case y.NOSCRIPT:{this.tokenizer.state=Pt.RAWTEXT;break}case y.SCRIPT:{this.tokenizer.state=Pt.SCRIPT_DATA;break}case y.PLAINTEXT:{this.tokenizer.state=Pt.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",a=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,a),t.location){const s=this.treeAdapter.getChildNodes(this.document).find(o=>this.treeAdapter.isDocumentTypeNode(o));s&&this.treeAdapter.setNodeSourceCodeLocation(s,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,be.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,be.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(se.HTML,be.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,y.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 a=this.treeAdapter.getChildNodes(n),i=r?a.lastIndexOf(r):a.length,s=a[i-1];if(this.treeAdapter.getNodeSourceCodeLocation(s)){const{endLine:l,endCol:u,endOffset:c}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(s,{endLine:l,endCol:u,endOffset:c})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,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,a=this.treeAdapter.getTagName(t),i=n.type===at.END_TAG&&a===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===y.SVG&&this.treeAdapter.getTagName(n)===se.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===be.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===y.MGLYPH||t.tagID===y.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,be.HTML)}_processToken(t){switch(t.type){case at.CHARACTER:{this.onCharacter(t);break}case at.NULL_CHARACTER:{this.onNullCharacter(t);break}case at.COMMENT:{this.onComment(t);break}case at.DOCTYPE:{this.onDoctype(t);break}case at.START_TAG:{this._processStartTag(t);break}case at.END_TAG:{this.onEndTag(t);break}case at.EOF:{this.onEof(t);break}case at.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const a=this.treeAdapter.getNamespaceURI(n),i=this.treeAdapter.getAttrList(n);return TA(t,a,i,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(a=>a.type===er.Marker||this.openElements.contains(a.element)),r=n===-1?t-1:n-1;for(let a=r;a>=0;a--){const i=this.activeFormattingElements.entries[a];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=Y.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(y.P),this.openElements.popUntilTagNamePopped(y.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case y.TR:{this.insertionMode=Y.IN_ROW;return}case y.TBODY:case y.THEAD:case y.TFOOT:{this.insertionMode=Y.IN_TABLE_BODY;return}case y.CAPTION:{this.insertionMode=Y.IN_CAPTION;return}case y.COLGROUP:{this.insertionMode=Y.IN_COLUMN_GROUP;return}case y.TABLE:{this.insertionMode=Y.IN_TABLE;return}case y.BODY:{this.insertionMode=Y.IN_BODY;return}case y.FRAMESET:{this.insertionMode=Y.IN_FRAMESET;return}case y.SELECT:{this._resetInsertionModeForSelect(t);return}case y.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case y.HTML:{this.insertionMode=this.headElement?Y.AFTER_HEAD:Y.BEFORE_HEAD;return}case y.TD:case y.TH:{if(t>0){this.insertionMode=Y.IN_CELL;return}break}case y.HEAD:{if(t>0){this.insertionMode=Y.IN_HEAD;return}break}}this.insertionMode=Y.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===y.TEMPLATE)break;if(r===y.TABLE){this.insertionMode=Y.IN_SELECT_IN_TABLE;return}}this.insertionMode=Y.IN_SELECT}_isElementCausesFosterParenting(t){return $x.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 y.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===be.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case y.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 GS[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){rN(this,t);return}switch(this.insertionMode){case Y.INITIAL:{Si(this,t);break}case Y.BEFORE_HTML:{Ui(this,t);break}case Y.BEFORE_HEAD:{qi(this,t);break}case Y.IN_HEAD:{Vi(this,t);break}case Y.IN_HEAD_NO_SCRIPT:{$i(this,t);break}case Y.AFTER_HEAD:{Wi(this,t);break}case Y.IN_BODY:case Y.IN_CAPTION:case Y.IN_CELL:case Y.IN_TEMPLATE:{Gx(this,t);break}case Y.TEXT:case Y.IN_SELECT:case Y.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case Y.IN_TABLE:case Y.IN_TABLE_BODY:case Y.IN_ROW:{Lu(this,t);break}case Y.IN_TABLE_TEXT:{Jx(this,t);break}case Y.IN_COLUMN_GROUP:{zo(this,t);break}case Y.AFTER_BODY:{Ho(this,t);break}case Y.AFTER_AFTER_BODY:{mo(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){nN(this,t);return}switch(this.insertionMode){case Y.INITIAL:{Si(this,t);break}case Y.BEFORE_HTML:{Ui(this,t);break}case Y.BEFORE_HEAD:{qi(this,t);break}case Y.IN_HEAD:{Vi(this,t);break}case Y.IN_HEAD_NO_SCRIPT:{$i(this,t);break}case Y.AFTER_HEAD:{Wi(this,t);break}case Y.TEXT:{this._insertCharacters(t);break}case Y.IN_TABLE:case Y.IN_TABLE_BODY:case Y.IN_ROW:{Lu(this,t);break}case Y.IN_COLUMN_GROUP:{zo(this,t);break}case Y.AFTER_BODY:{Ho(this,t);break}case Y.AFTER_AFTER_BODY:{mo(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){t0(this,t);return}switch(this.insertionMode){case Y.INITIAL:case Y.BEFORE_HTML:case Y.BEFORE_HEAD:case Y.IN_HEAD:case Y.IN_HEAD_NO_SCRIPT:case Y.AFTER_HEAD:case Y.IN_BODY:case Y.IN_TABLE:case Y.IN_CAPTION:case Y.IN_COLUMN_GROUP:case Y.IN_TABLE_BODY:case Y.IN_ROW:case Y.IN_CELL:case Y.IN_SELECT:case Y.IN_SELECT_IN_TABLE:case Y.IN_TEMPLATE:case Y.IN_FRAMESET:case Y.AFTER_FRAMESET:{t0(this,t);break}case Y.IN_TABLE_TEXT:{Ai(this,t);break}case Y.AFTER_BODY:{DA(this,t);break}case Y.AFTER_AFTER_BODY:case Y.AFTER_AFTER_FRAMESET:{PA(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case Y.INITIAL:{OA(this,t);break}case Y.BEFORE_HEAD:case Y.IN_HEAD:case Y.IN_HEAD_NO_SCRIPT:case Y.AFTER_HEAD:{this._err(t,ue.misplacedDoctype);break}case Y.IN_TABLE_TEXT:{Ai(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,ue.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?aN(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case Y.INITIAL:{Si(this,t);break}case Y.BEFORE_HTML:{jA(this,t);break}case Y.BEFORE_HEAD:{FA(this,t);break}case Y.IN_HEAD:{Kn(this,t);break}case Y.IN_HEAD_NO_SCRIPT:{UA(this,t);break}case Y.AFTER_HEAD:{VA(this,t);break}case Y.IN_BODY:{on(this,t);break}case Y.IN_TABLE:{Ja(this,t);break}case Y.IN_TABLE_TEXT:{Ai(this,t);break}case Y.IN_CAPTION:{zC(this,t);break}case Y.IN_COLUMN_GROUP:{Rd(this,t);break}case Y.IN_TABLE_BODY:{Al(this,t);break}case Y.IN_ROW:{Cl(this,t);break}case Y.IN_CELL:{qC(this,t);break}case Y.IN_SELECT:{n4(this,t);break}case Y.IN_SELECT_IN_TABLE:{$C(this,t);break}case Y.IN_TEMPLATE:{GC(this,t);break}case Y.AFTER_BODY:{KC(this,t);break}case Y.IN_FRAMESET:{XC(this,t);break}case Y.AFTER_FRAMESET:{ZC(this,t);break}case Y.AFTER_AFTER_BODY:{eN(this,t);break}case Y.AFTER_AFTER_FRAMESET:{tN(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?iN(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case Y.INITIAL:{Si(this,t);break}case Y.BEFORE_HTML:{BA(this,t);break}case Y.BEFORE_HEAD:{zA(this,t);break}case Y.IN_HEAD:{HA(this,t);break}case Y.IN_HEAD_NO_SCRIPT:{qA(this,t);break}case Y.AFTER_HEAD:{$A(this,t);break}case Y.IN_BODY:{Sl(this,t);break}case Y.TEXT:{IC(this,t);break}case Y.IN_TABLE:{ss(this,t);break}case Y.IN_TABLE_TEXT:{Ai(this,t);break}case Y.IN_CAPTION:{HC(this,t);break}case Y.IN_COLUMN_GROUP:{UC(this,t);break}case Y.IN_TABLE_BODY:{n0(this,t);break}case Y.IN_ROW:{t4(this,t);break}case Y.IN_CELL:{VC(this,t);break}case Y.IN_SELECT:{r4(this,t);break}case Y.IN_SELECT_IN_TABLE:{WC(this,t);break}case Y.IN_TEMPLATE:{YC(this,t);break}case Y.AFTER_BODY:{i4(this,t);break}case Y.IN_FRAMESET:{QC(this,t);break}case Y.AFTER_FRAMESET:{JC(this,t);break}case Y.AFTER_AFTER_BODY:{mo(this,t);break}}}onEof(t){switch(this.insertionMode){case Y.INITIAL:{Si(this,t);break}case Y.BEFORE_HTML:{Ui(this,t);break}case Y.BEFORE_HEAD:{qi(this,t);break}case Y.IN_HEAD:{Vi(this,t);break}case Y.IN_HEAD_NO_SCRIPT:{$i(this,t);break}case Y.AFTER_HEAD:{Wi(this,t);break}case Y.IN_BODY:case Y.IN_TABLE:case Y.IN_CAPTION:case Y.IN_COLUMN_GROUP:case Y.IN_TABLE_BODY:case Y.IN_ROW:case Y.IN_CELL:case Y.IN_SELECT:case Y.IN_SELECT_IN_TABLE:{Qx(this,t);break}case Y.TEXT:{_C(this,t);break}case Y.IN_TABLE_TEXT:{Ai(this,t);break}case Y.IN_TEMPLATE:{a4(this,t);break}case Y.AFTER_BODY:case Y.IN_FRAMESET:case Y.AFTER_FRAMESET:case Y.AFTER_AFTER_BODY:case Y.AFTER_AFTER_FRAMESET:{_d(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===U.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 Y.IN_HEAD:case Y.IN_HEAD_NO_SCRIPT:case Y.AFTER_HEAD:case Y.TEXT:case Y.IN_COLUMN_GROUP:case Y.IN_SELECT:case Y.IN_SELECT_IN_TABLE:case Y.IN_FRAMESET:case Y.AFTER_FRAMESET:{this._insertCharacters(t);break}case Y.IN_BODY:case Y.IN_CAPTION:case Y.IN_CELL:case Y.IN_TEMPLATE:case Y.AFTER_BODY:case Y.AFTER_AFTER_BODY:case Y.AFTER_AFTER_FRAMESET:{Wx(this,t);break}case Y.IN_TABLE:case Y.IN_TABLE_BODY:case Y.IN_ROW:{Lu(this,t);break}case Y.IN_TABLE_TEXT:{Zx(this,t);break}}}}function NA(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):Xx(e,t),n}function MA(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const a=e.openElements.items[r];if(a===t.element)break;e._isSpecialElement(a,e.openElements.tagIDs[r])&&(n=a)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function IA(e,t,n){let r=t,a=e.openElements.getCommonAncestor(t);for(let i=0,s=a;s!==n;i++,s=a){a=e.openElements.getCommonAncestor(s);const o=e.activeFormattingElements.getElementEntry(s),l=o&&i>=AA;!o||l?(l&&e.activeFormattingElements.removeEntry(o),e.openElements.remove(s)):(s=_A(e,o),r===t&&(e.activeFormattingElements.bookmark=o),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(s,r),r=s)}return r}function _A(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 RA(e,t,n){const r=e.treeAdapter.getTagName(t),a=ci(r);if(e._isElementCausesFosterParenting(a))e._fosterParentElement(n);else{const i=e.treeAdapter.getNamespaceURI(t);a===y.TEMPLATE&&i===be.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function LA(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:a}=n,i=e.treeAdapter.createElement(a.tagName,r,a.attrs);e._adoptNodes(t,i),e.treeAdapter.appendChild(t,i),e.activeFormattingElements.insertElementAfterBookmark(i,a),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,i,a.tagID)}function Id(e,t){for(let n=0;n<SA;n++){const r=NA(e,t);if(!r)break;const a=MA(e,r);if(!a)break;e.activeFormattingElements.bookmark=r;const i=IA(e,a,r.element),s=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(i),s&&RA(e,s,i),LA(e,a,r)}}function t0(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function DA(e,t){e._appendCommentNode(t,e.openElements.items[0])}function PA(e,t){e._appendCommentNode(t,e.document)}function _d(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],a=e.treeAdapter.getNodeSourceCodeLocation(r);if(a&&!a.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const i=e.openElements.items[1],s=e.treeAdapter.getNodeSourceCodeLocation(i);s&&!s.endTag&&e._setEndLocation(i,t)}}}}function OA(e,t){e._setDocumentType(t);const n=t.forceQuirks?Dn.QUIRKS:hA(t);dA(t)||e._err(t,ue.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=Y.BEFORE_HTML}function Si(e,t){e._err(t,ue.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Dn.QUIRKS),e.insertionMode=Y.BEFORE_HTML,e._processToken(t)}function jA(e,t){t.tagID===y.HTML?(e._insertElement(t,be.HTML),e.insertionMode=Y.BEFORE_HEAD):Ui(e,t)}function BA(e,t){const n=t.tagID;(n===y.HTML||n===y.HEAD||n===y.BODY||n===y.BR)&&Ui(e,t)}function Ui(e,t){e._insertFakeRootElement(),e.insertionMode=Y.BEFORE_HEAD,e._processToken(t)}function FA(e,t){switch(t.tagID){case y.HTML:{on(e,t);break}case y.HEAD:{e._insertElement(t,be.HTML),e.headElement=e.openElements.current,e.insertionMode=Y.IN_HEAD;break}default:qi(e,t)}}function zA(e,t){const n=t.tagID;n===y.HEAD||n===y.BODY||n===y.HTML||n===y.BR?qi(e,t):e._err(t,ue.endTagWithoutMatchingOpenElement)}function qi(e,t){e._insertFakeElement(se.HEAD,y.HEAD),e.headElement=e.openElements.current,e.insertionMode=Y.IN_HEAD,e._processToken(t)}function Kn(e,t){switch(t.tagID){case y.HTML:{on(e,t);break}case y.BASE:case y.BASEFONT:case y.BGSOUND:case y.LINK:case y.META:{e._appendElement(t,be.HTML),t.ackSelfClosing=!0;break}case y.TITLE:{e._switchToTextParsing(t,Pt.RCDATA);break}case y.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Pt.RAWTEXT):(e._insertElement(t,be.HTML),e.insertionMode=Y.IN_HEAD_NO_SCRIPT);break}case y.NOFRAMES:case y.STYLE:{e._switchToTextParsing(t,Pt.RAWTEXT);break}case y.SCRIPT:{e._switchToTextParsing(t,Pt.SCRIPT_DATA);break}case y.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Y.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Y.IN_TEMPLATE);break}case y.HEAD:{e._err(t,ue.misplacedStartTagForHeadElement);break}default:Vi(e,t)}}function HA(e,t){switch(t.tagID){case y.HEAD:{e.openElements.pop(),e.insertionMode=Y.AFTER_HEAD;break}case y.BODY:case y.BR:case y.HTML:{Vi(e,t);break}case y.TEMPLATE:{Aa(e,t);break}default:e._err(t,ue.endTagWithoutMatchingOpenElement)}}function Aa(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==y.TEMPLATE&&e._err(t,ue.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(y.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,ue.endTagWithoutMatchingOpenElement)}function Vi(e,t){e.openElements.pop(),e.insertionMode=Y.AFTER_HEAD,e._processToken(t)}function UA(e,t){switch(t.tagID){case y.HTML:{on(e,t);break}case y.BASEFONT:case y.BGSOUND:case y.HEAD:case y.LINK:case y.META:case y.NOFRAMES:case y.STYLE:{Kn(e,t);break}case y.NOSCRIPT:{e._err(t,ue.nestedNoscriptInHead);break}default:$i(e,t)}}function qA(e,t){switch(t.tagID){case y.NOSCRIPT:{e.openElements.pop(),e.insertionMode=Y.IN_HEAD;break}case y.BR:{$i(e,t);break}default:e._err(t,ue.endTagWithoutMatchingOpenElement)}}function $i(e,t){const n=t.type===at.EOF?ue.openElementsLeftAfterEof:ue.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=Y.IN_HEAD,e._processToken(t)}function VA(e,t){switch(t.tagID){case y.HTML:{on(e,t);break}case y.BODY:{e._insertElement(t,be.HTML),e.framesetOk=!1,e.insertionMode=Y.IN_BODY;break}case y.FRAMESET:{e._insertElement(t,be.HTML),e.insertionMode=Y.IN_FRAMESET;break}case y.BASE:case y.BASEFONT:case y.BGSOUND:case y.LINK:case y.META:case y.NOFRAMES:case y.SCRIPT:case y.STYLE:case y.TEMPLATE:case y.TITLE:{e._err(t,ue.abandonedHeadElementChild),e.openElements.push(e.headElement,y.HEAD),Kn(e,t),e.openElements.remove(e.headElement);break}case y.HEAD:{e._err(t,ue.misplacedStartTagForHeadElement);break}default:Wi(e,t)}}function $A(e,t){switch(t.tagID){case y.BODY:case y.HTML:case y.BR:{Wi(e,t);break}case y.TEMPLATE:{Aa(e,t);break}default:e._err(t,ue.endTagWithoutMatchingOpenElement)}}function Wi(e,t){e._insertFakeElement(se.BODY,y.BODY),e.insertionMode=Y.IN_BODY,El(e,t)}function El(e,t){switch(t.type){case at.CHARACTER:{Gx(e,t);break}case at.WHITESPACE_CHARACTER:{Wx(e,t);break}case at.COMMENT:{t0(e,t);break}case at.START_TAG:{on(e,t);break}case at.END_TAG:{Sl(e,t);break}case at.EOF:{Qx(e,t);break}}}function Wx(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function Gx(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function WA(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function GA(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function YA(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,be.HTML),e.insertionMode=Y.IN_FRAMESET)}function KA(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._insertElement(t,be.HTML)}function XA(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&e0.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,be.HTML)}function QA(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._insertElement(t,be.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function ZA(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._insertElement(t,be.HTML),n||(e.formElement=e.openElements.current))}function JA(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const a=e.openElements.tagIDs[r];if(n===y.LI&&a===y.LI||(n===y.DD||n===y.DT)&&(a===y.DD||a===y.DT)){e.openElements.generateImpliedEndTagsWithExclusion(a),e.openElements.popUntilTagNamePopped(a);break}if(a!==y.ADDRESS&&a!==y.DIV&&a!==y.P&&e._isSpecialElement(e.openElements.items[r],a))break}e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._insertElement(t,be.HTML)}function eC(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._insertElement(t,be.HTML),e.tokenizer.state=Pt.PLAINTEXT}function tC(e,t){e.openElements.hasInScope(y.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(y.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,be.HTML),e.framesetOk=!1}function nC(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(se.A);n&&(Id(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,be.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function rC(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,be.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function aC(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(y.NOBR)&&(Id(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,be.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function iC(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,be.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function sC(e,t){e.treeAdapter.getDocumentMode(e.document)!==Dn.QUIRKS&&e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._insertElement(t,be.HTML),e.framesetOk=!1,e.insertionMode=Y.IN_TABLE}function Yx(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,be.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Kx(e){const t=jx(e,ga.TYPE);return t!=null&&t.toLowerCase()===EA}function oC(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,be.HTML),Kx(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function lC(e,t){e._appendElement(t,be.HTML),t.ackSelfClosing=!0}function uC(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._appendElement(t,be.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function cC(e,t){t.tagName=se.IMG,t.tagID=y.IMG,Yx(e,t)}function dC(e,t){e._insertElement(t,be.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Pt.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Y.TEXT}function hC(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Pt.RAWTEXT)}function fC(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Pt.RAWTEXT)}function Bm(e,t){e._switchToTextParsing(t,Pt.RAWTEXT)}function mC(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,be.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===Y.IN_TABLE||e.insertionMode===Y.IN_CAPTION||e.insertionMode===Y.IN_TABLE_BODY||e.insertionMode===Y.IN_ROW||e.insertionMode===Y.IN_CELL?Y.IN_SELECT_IN_TABLE:Y.IN_SELECT}function pC(e,t){e.openElements.currentTagId===y.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,be.HTML)}function gC(e,t){e.openElements.hasInScope(y.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,be.HTML)}function xC(e,t){e.openElements.hasInScope(y.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(y.RTC),e._insertElement(t,be.HTML)}function bC(e,t){e._reconstructActiveFormattingElements(),qx(t),Md(t),t.selfClosing?e._appendElement(t,be.MATHML):e._insertElement(t,be.MATHML),t.ackSelfClosing=!0}function yC(e,t){e._reconstructActiveFormattingElements(),Vx(t),Md(t),t.selfClosing?e._appendElement(t,be.SVG):e._insertElement(t,be.SVG),t.ackSelfClosing=!0}function Fm(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,be.HTML)}function on(e,t){switch(t.tagID){case y.I:case y.S:case y.B:case y.U:case y.EM:case y.TT:case y.BIG:case y.CODE:case y.FONT:case y.SMALL:case y.STRIKE:case y.STRONG:{rC(e,t);break}case y.A:{nC(e,t);break}case y.H1:case y.H2:case y.H3:case y.H4:case y.H5:case y.H6:{XA(e,t);break}case y.P:case y.DL:case y.OL:case y.UL:case y.DIV:case y.DIR:case y.NAV:case y.MAIN:case y.MENU:case y.ASIDE:case y.CENTER:case y.FIGURE:case y.FOOTER:case y.HEADER:case y.HGROUP:case y.DIALOG:case y.DETAILS:case y.ADDRESS:case y.ARTICLE:case y.SEARCH:case y.SECTION:case y.SUMMARY:case y.FIELDSET:case y.BLOCKQUOTE:case y.FIGCAPTION:{KA(e,t);break}case y.LI:case y.DD:case y.DT:{JA(e,t);break}case y.BR:case y.IMG:case y.WBR:case y.AREA:case y.EMBED:case y.KEYGEN:{Yx(e,t);break}case y.HR:{uC(e,t);break}case y.RB:case y.RTC:{gC(e,t);break}case y.RT:case y.RP:{xC(e,t);break}case y.PRE:case y.LISTING:{QA(e,t);break}case y.XMP:{hC(e,t);break}case y.SVG:{yC(e,t);break}case y.HTML:{WA(e,t);break}case y.BASE:case y.LINK:case y.META:case y.STYLE:case y.TITLE:case y.SCRIPT:case y.BGSOUND:case y.BASEFONT:case y.TEMPLATE:{Kn(e,t);break}case y.BODY:{GA(e,t);break}case y.FORM:{ZA(e,t);break}case y.NOBR:{aC(e,t);break}case y.MATH:{bC(e,t);break}case y.TABLE:{sC(e,t);break}case y.INPUT:{oC(e,t);break}case y.PARAM:case y.TRACK:case y.SOURCE:{lC(e,t);break}case y.IMAGE:{cC(e,t);break}case y.BUTTON:{tC(e,t);break}case y.APPLET:case y.OBJECT:case y.MARQUEE:{iC(e,t);break}case y.IFRAME:{fC(e,t);break}case y.SELECT:{mC(e,t);break}case y.OPTION:case y.OPTGROUP:{pC(e,t);break}case y.NOEMBED:case y.NOFRAMES:{Bm(e,t);break}case y.FRAMESET:{YA(e,t);break}case y.TEXTAREA:{dC(e,t);break}case y.NOSCRIPT:{e.options.scriptingEnabled?Bm(e,t):Fm(e,t);break}case y.PLAINTEXT:{eC(e,t);break}case y.COL:case y.TH:case y.TD:case y.TR:case y.HEAD:case y.FRAME:case y.TBODY:case y.TFOOT:case y.THEAD:case y.CAPTION:case y.COLGROUP:break;default:Fm(e,t)}}function vC(e,t){if(e.openElements.hasInScope(y.BODY)&&(e.insertionMode=Y.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function wC(e,t){e.openElements.hasInScope(y.BODY)&&(e.insertionMode=Y.AFTER_BODY,i4(e,t))}function kC(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function TC(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(y.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(y.FORM):n&&e.openElements.remove(n))}function EC(e){e.openElements.hasInButtonScope(y.P)||e._insertFakeElement(se.P,y.P),e._closePElement()}function SC(e){e.openElements.hasInListItemScope(y.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(y.LI),e.openElements.popUntilTagNamePopped(y.LI))}function AC(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function CC(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function NC(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function MC(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(se.BR,y.BR),e.openElements.pop(),e.framesetOk=!1}function Xx(e,t){const n=t.tagName,r=t.tagID;for(let a=e.openElements.stackTop;a>0;a--){const i=e.openElements.items[a],s=e.openElements.tagIDs[a];if(r===s&&(r!==y.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=a&&e.openElements.shortenToLength(a);break}if(e._isSpecialElement(i,s))break}}function Sl(e,t){switch(t.tagID){case y.A:case y.B:case y.I:case y.S:case y.U:case y.EM:case y.TT:case y.BIG:case y.CODE:case y.FONT:case y.NOBR:case y.SMALL:case y.STRIKE:case y.STRONG:{Id(e,t);break}case y.P:{EC(e);break}case y.DL:case y.UL:case y.OL:case y.DIR:case y.DIV:case y.NAV:case y.PRE:case y.MAIN:case y.MENU:case y.ASIDE:case y.BUTTON:case y.CENTER:case y.FIGURE:case y.FOOTER:case y.HEADER:case y.HGROUP:case y.DIALOG:case y.ADDRESS:case y.ARTICLE:case y.DETAILS:case y.SEARCH:case y.SECTION:case y.SUMMARY:case y.LISTING:case y.FIELDSET:case y.BLOCKQUOTE:case y.FIGCAPTION:{kC(e,t);break}case y.LI:{SC(e);break}case y.DD:case y.DT:{AC(e,t);break}case y.H1:case y.H2:case y.H3:case y.H4:case y.H5:case y.H6:{CC(e);break}case y.BR:{MC(e);break}case y.BODY:{vC(e,t);break}case y.HTML:{wC(e,t);break}case y.FORM:{TC(e);break}case y.APPLET:case y.OBJECT:case y.MARQUEE:{NC(e,t);break}case y.TEMPLATE:{Aa(e,t);break}default:Xx(e,t)}}function Qx(e,t){e.tmplInsertionModeStack.length>0?a4(e,t):_d(e,t)}function IC(e,t){var n;t.tagID===y.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function _C(e,t){e._err(t,ue.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Lu(e,t){if(e.openElements.currentTagId!==void 0&&$x.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=Y.IN_TABLE_TEXT,t.type){case at.CHARACTER:{Jx(e,t);break}case at.WHITESPACE_CHARACTER:{Zx(e,t);break}}else ks(e,t)}function RC(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,be.HTML),e.insertionMode=Y.IN_CAPTION}function LC(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,be.HTML),e.insertionMode=Y.IN_COLUMN_GROUP}function DC(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(se.COLGROUP,y.COLGROUP),e.insertionMode=Y.IN_COLUMN_GROUP,Rd(e,t)}function PC(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,be.HTML),e.insertionMode=Y.IN_TABLE_BODY}function OC(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(se.TBODY,y.TBODY),e.insertionMode=Y.IN_TABLE_BODY,Al(e,t)}function jC(e,t){e.openElements.hasInTableScope(y.TABLE)&&(e.openElements.popUntilTagNamePopped(y.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function BC(e,t){Kx(t)?e._appendElement(t,be.HTML):ks(e,t),t.ackSelfClosing=!0}function FC(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,be.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Ja(e,t){switch(t.tagID){case y.TD:case y.TH:case y.TR:{OC(e,t);break}case y.STYLE:case y.SCRIPT:case y.TEMPLATE:{Kn(e,t);break}case y.COL:{DC(e,t);break}case y.FORM:{FC(e,t);break}case y.TABLE:{jC(e,t);break}case y.TBODY:case y.TFOOT:case y.THEAD:{PC(e,t);break}case y.INPUT:{BC(e,t);break}case y.CAPTION:{RC(e,t);break}case y.COLGROUP:{LC(e,t);break}default:ks(e,t)}}function ss(e,t){switch(t.tagID){case y.TABLE:{e.openElements.hasInTableScope(y.TABLE)&&(e.openElements.popUntilTagNamePopped(y.TABLE),e._resetInsertionMode());break}case y.TEMPLATE:{Aa(e,t);break}case y.BODY:case y.CAPTION:case y.COL:case y.COLGROUP:case y.HTML:case y.TBODY:case y.TD:case y.TFOOT:case y.TH:case y.THEAD:case y.TR:break;default:ks(e,t)}}function ks(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,El(e,t),e.fosterParentingEnabled=n}function Zx(e,t){e.pendingCharacterTokens.push(t)}function Jx(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Ai(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)ks(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const e4=new Set([y.CAPTION,y.COL,y.COLGROUP,y.TBODY,y.TD,y.TFOOT,y.TH,y.THEAD,y.TR]);function zC(e,t){const n=t.tagID;e4.has(n)?e.openElements.hasInTableScope(y.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(y.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Y.IN_TABLE,Ja(e,t)):on(e,t)}function HC(e,t){const n=t.tagID;switch(n){case y.CAPTION:case y.TABLE:{e.openElements.hasInTableScope(y.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(y.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Y.IN_TABLE,n===y.TABLE&&ss(e,t));break}case y.BODY:case y.COL:case y.COLGROUP:case y.HTML:case y.TBODY:case y.TD:case y.TFOOT:case y.TH:case y.THEAD:case y.TR:break;default:Sl(e,t)}}function Rd(e,t){switch(t.tagID){case y.HTML:{on(e,t);break}case y.COL:{e._appendElement(t,be.HTML),t.ackSelfClosing=!0;break}case y.TEMPLATE:{Kn(e,t);break}default:zo(e,t)}}function UC(e,t){switch(t.tagID){case y.COLGROUP:{e.openElements.currentTagId===y.COLGROUP&&(e.openElements.pop(),e.insertionMode=Y.IN_TABLE);break}case y.TEMPLATE:{Aa(e,t);break}case y.COL:break;default:zo(e,t)}}function zo(e,t){e.openElements.currentTagId===y.COLGROUP&&(e.openElements.pop(),e.insertionMode=Y.IN_TABLE,e._processToken(t))}function Al(e,t){switch(t.tagID){case y.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,be.HTML),e.insertionMode=Y.IN_ROW;break}case y.TH:case y.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(se.TR,y.TR),e.insertionMode=Y.IN_ROW,Cl(e,t);break}case y.CAPTION:case y.COL:case y.COLGROUP:case y.TBODY:case y.TFOOT:case y.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE,Ja(e,t));break}default:Ja(e,t)}}function n0(e,t){const n=t.tagID;switch(t.tagID){case y.TBODY:case y.TFOOT:case y.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE);break}case y.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE,ss(e,t));break}case y.BODY:case y.CAPTION:case y.COL:case y.COLGROUP:case y.HTML:case y.TD:case y.TH:case y.TR:break;default:ss(e,t)}}function Cl(e,t){switch(t.tagID){case y.TH:case y.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,be.HTML),e.insertionMode=Y.IN_CELL,e.activeFormattingElements.insertMarker();break}case y.CAPTION:case y.COL:case y.COLGROUP:case y.TBODY:case y.TFOOT:case y.THEAD:case y.TR:{e.openElements.hasInTableScope(y.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE_BODY,Al(e,t));break}default:Ja(e,t)}}function t4(e,t){switch(t.tagID){case y.TR:{e.openElements.hasInTableScope(y.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE_BODY);break}case y.TABLE:{e.openElements.hasInTableScope(y.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE_BODY,n0(e,t));break}case y.TBODY:case y.TFOOT:case y.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(y.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE_BODY,n0(e,t));break}case y.BODY:case y.CAPTION:case y.COL:case y.COLGROUP:case y.HTML:case y.TD:case y.TH:break;default:ss(e,t)}}function qC(e,t){const n=t.tagID;e4.has(n)?(e.openElements.hasInTableScope(y.TD)||e.openElements.hasInTableScope(y.TH))&&(e._closeTableCell(),Cl(e,t)):on(e,t)}function VC(e,t){const n=t.tagID;switch(n){case y.TD:case y.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Y.IN_ROW);break}case y.TABLE:case y.TBODY:case y.TFOOT:case y.THEAD:case y.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),t4(e,t));break}case y.BODY:case y.CAPTION:case y.COL:case y.COLGROUP:case y.HTML:break;default:Sl(e,t)}}function n4(e,t){switch(t.tagID){case y.HTML:{on(e,t);break}case y.OPTION:{e.openElements.currentTagId===y.OPTION&&e.openElements.pop(),e._insertElement(t,be.HTML);break}case y.OPTGROUP:{e.openElements.currentTagId===y.OPTION&&e.openElements.pop(),e.openElements.currentTagId===y.OPTGROUP&&e.openElements.pop(),e._insertElement(t,be.HTML);break}case y.HR:{e.openElements.currentTagId===y.OPTION&&e.openElements.pop(),e.openElements.currentTagId===y.OPTGROUP&&e.openElements.pop(),e._appendElement(t,be.HTML),t.ackSelfClosing=!0;break}case y.INPUT:case y.KEYGEN:case y.TEXTAREA:case y.SELECT:{e.openElements.hasInSelectScope(y.SELECT)&&(e.openElements.popUntilTagNamePopped(y.SELECT),e._resetInsertionMode(),t.tagID!==y.SELECT&&e._processStartTag(t));break}case y.SCRIPT:case y.TEMPLATE:{Kn(e,t);break}}}function r4(e,t){switch(t.tagID){case y.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===y.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===y.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===y.OPTGROUP&&e.openElements.pop();break}case y.OPTION:{e.openElements.currentTagId===y.OPTION&&e.openElements.pop();break}case y.SELECT:{e.openElements.hasInSelectScope(y.SELECT)&&(e.openElements.popUntilTagNamePopped(y.SELECT),e._resetInsertionMode());break}case y.TEMPLATE:{Aa(e,t);break}}}function $C(e,t){const n=t.tagID;n===y.CAPTION||n===y.TABLE||n===y.TBODY||n===y.TFOOT||n===y.THEAD||n===y.TR||n===y.TD||n===y.TH?(e.openElements.popUntilTagNamePopped(y.SELECT),e._resetInsertionMode(),e._processStartTag(t)):n4(e,t)}function WC(e,t){const n=t.tagID;n===y.CAPTION||n===y.TABLE||n===y.TBODY||n===y.TFOOT||n===y.THEAD||n===y.TR||n===y.TD||n===y.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(y.SELECT),e._resetInsertionMode(),e.onEndTag(t)):r4(e,t)}function GC(e,t){switch(t.tagID){case y.BASE:case y.BASEFONT:case y.BGSOUND:case y.LINK:case y.META:case y.NOFRAMES:case y.SCRIPT:case y.STYLE:case y.TEMPLATE:case y.TITLE:{Kn(e,t);break}case y.CAPTION:case y.COLGROUP:case y.TBODY:case y.TFOOT:case y.THEAD:{e.tmplInsertionModeStack[0]=Y.IN_TABLE,e.insertionMode=Y.IN_TABLE,Ja(e,t);break}case y.COL:{e.tmplInsertionModeStack[0]=Y.IN_COLUMN_GROUP,e.insertionMode=Y.IN_COLUMN_GROUP,Rd(e,t);break}case y.TR:{e.tmplInsertionModeStack[0]=Y.IN_TABLE_BODY,e.insertionMode=Y.IN_TABLE_BODY,Al(e,t);break}case y.TD:case y.TH:{e.tmplInsertionModeStack[0]=Y.IN_ROW,e.insertionMode=Y.IN_ROW,Cl(e,t);break}default:e.tmplInsertionModeStack[0]=Y.IN_BODY,e.insertionMode=Y.IN_BODY,on(e,t)}}function YC(e,t){t.tagID===y.TEMPLATE&&Aa(e,t)}function a4(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(y.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):_d(e,t)}function KC(e,t){t.tagID===y.HTML?on(e,t):Ho(e,t)}function i4(e,t){var n;if(t.tagID===y.HTML){if(e.fragmentContext||(e.insertionMode=Y.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===y.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 Ho(e,t)}function Ho(e,t){e.insertionMode=Y.IN_BODY,El(e,t)}function XC(e,t){switch(t.tagID){case y.HTML:{on(e,t);break}case y.FRAMESET:{e._insertElement(t,be.HTML);break}case y.FRAME:{e._appendElement(t,be.HTML),t.ackSelfClosing=!0;break}case y.NOFRAMES:{Kn(e,t);break}}}function QC(e,t){t.tagID===y.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==y.FRAMESET&&(e.insertionMode=Y.AFTER_FRAMESET))}function ZC(e,t){switch(t.tagID){case y.HTML:{on(e,t);break}case y.NOFRAMES:{Kn(e,t);break}}}function JC(e,t){t.tagID===y.HTML&&(e.insertionMode=Y.AFTER_AFTER_FRAMESET)}function eN(e,t){t.tagID===y.HTML?on(e,t):mo(e,t)}function mo(e,t){e.insertionMode=Y.IN_BODY,El(e,t)}function tN(e,t){switch(t.tagID){case y.HTML:{on(e,t);break}case y.NOFRAMES:{Kn(e,t);break}}}function nN(e,t){t.chars=St,e._insertCharacters(t)}function rN(e,t){e._insertCharacters(t),e.framesetOk=!1}function s4(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==be.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function aN(e,t){if(yA(t))s4(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===be.MATHML?qx(t):r===be.SVG&&(vA(t),Vx(t)),Md(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function iN(e,t){if(t.tagID===y.P||t.tagID===y.BR){s4(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)===be.HTML){e._endTagOutsideForeignContent(t);break}const a=e.treeAdapter.getTagName(r);if(a.toLowerCase()===t.tagName){t.tagName=a,e.openElements.shortenToLength(n);break}}}se.AREA,se.BASE,se.BASEFONT,se.BGSOUND,se.BR,se.COL,se.EMBED,se.FRAME,se.HR,se.IMG,se.INPUT,se.KEYGEN,se.LINK,se.META,se.PARAM,se.SOURCE,se.TRACK,se.WBR;const sN=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,oN=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),zm={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function o4(e,t){const n=xN(e),r=e2("type",{handlers:{root:lN,element:uN,text:cN,comment:u4,doctype:dN,raw:fN},unknown:mN}),a={parser:n?new jm(zm):jm.getFragmentParser(void 0,zm),handle(o){r(o,a)},stitches:!1,options:t||{}};r(e,a),di(a,lr());const i=n?a.parser.document:a.parser.getFragment(),s=bS(i,{file:a.options.file});return a.stitches&&dl(s,"comment",function(o,l,u){const c=o;if(c.value.stitch&&u&&l!==void 0){const h=u.children;return h[l]=c.value.stitch,l}}),s.type==="root"&&s.children.length===1&&s.children[0].type===e.type?s.children[0]:s}function l4(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function lN(e,t){l4(e.children,t)}function uN(e,t){pN(e,t),l4(e.children,t),gN(e,t)}function cN(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:at.CHARACTER,chars:e.value,location:Ts(e)};di(t,lr(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function dN(e,t){const n={type:at.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Ts(e)};di(t,lr(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function hN(e,t){t.stitches=!0;const n=bN(e);if("children"in e&&"children"in n){const r=o4({type:"root",children:e.children},t.options);n.children=r.children}u4({type:"comment",value:{stitch:n}},t)}function u4(e,t){const n=e.value,r={type:at.COMMENT,data:n,location:Ts(e)};di(t,lr(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function fN(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,c4(t,lr(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(sN,"<$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 mN(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))hN(n,t);else{let r="";throw oN.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 di(e,t){c4(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=Pt.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 c4(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 pN(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Pt.PLAINTEXT)return;di(t,lr(e));const r=t.parser.openElements.current;let a="namespaceURI"in r?r.namespaceURI:rr.html;a===rr.html&&n==="svg"&&(a=rr.svg);const i=TS({...e,children:[]},{space:a===rr.svg?"svg":"html"}),s={type:at.START_TAG,tagName:n,tagID:ci(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in i?i.attrs:[],location:Ts(e)};t.parser.currentToken=s,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function gN(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&_S.includes(n)||t.parser.tokenizer.state===Pt.PLAINTEXT)return;di(t,sl(e));const r={type:at.END_TAG,tagName:n,tagID:ci(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Ts(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Pt.RCDATA||t.parser.tokenizer.state===Pt.RAWTEXT||t.parser.tokenizer.state===Pt.SCRIPT_DATA)&&(t.parser.tokenizer.state=Pt.DATA)}function xN(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Ts(e){const t=lr(e)||{line:void 0,column:void 0,offset:void 0},n=sl(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 bN(e){return"children"in e?ka({...e,children:[]}):ka(e)}function d4(e){return function(t,n){return o4(t,{...e,file:n})}}const ra=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],Gi={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...ra,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...ra],h2:[["className","sr-only"]],img:[...ra,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...ra,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...ra],table:[...ra],ul:[...ra,["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"]},Lr={}.hasOwnProperty;function yN(e,t){let n={type:"root",children:[]};const r={schema:t?{...Gi,...t}:Gi,stack:[]},a=h4(r,e);return a&&(Array.isArray(a)?a.length===1?n=a[0]:n.children=a:n=a),n}function h4(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return vN(e,n);case"doctype":return wN(e,n);case"element":return kN(e,n);case"root":return TN(e,n);case"text":return EN(e,n)}}}function vN(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 Es(i,t),i}}function wN(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return Es(n,t),n}}function kN(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=f4(e,t.children),a=SN(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&&Lr.call(e.schema.ancestors,n))){const o=e.schema.ancestors[n];let l=-1;for(i=!1;++l<o.length;)e.stack.includes(o[l])&&(i=!0)}if(!i)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const s={type:"element",tagName:n,properties:a,children:r};return Es(s,t),s}function TN(e,t){const r={type:"root",children:f4(e,t.children)};return Es(r,t),r}function EN(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return Es(r,t),r}function f4(e,t){const n=[];if(Array.isArray(t)){const r=t;let a=-1;for(;++a<r.length;){const i=h4(e,r[a]);i&&(Array.isArray(i)?n.push(...i):n.push(i))}}return n}function SN(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,a=e.schema.required,i=r&&Lr.call(r,n)?r[n]:void 0,s=r&&Lr.call(r,"*")?r["*"]:void 0,o=t&&typeof t=="object"?t:{},l={};let u;for(u in o)if(Lr.call(o,u)){const c=o[u];let h=Hm(e,Um(i,u),u,c);h==null&&(h=Hm(e,Um(s,u),u,c)),h!=null&&(l[u]=h)}if(a&&Lr.call(a,n)){const c=a[n];for(u in c)Lr.call(c,u)&&!Lr.call(l,u)&&(l[u]=c[u])}return l}function Hm(e,t,n,r){return t?Array.isArray(r)?AN(e,t,n,r):m4(e,t,n,r):void 0}function AN(e,t,n,r){let a=-1;const i=[];for(;++a<r.length;){const s=m4(e,t,n,r[a]);(typeof s=="number"||typeof s=="string")&&i.push(s)}return i}function m4(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&CN(e,n,r)){if(typeof t=="object"&&t.length>1){let a=!1,i=0;for(;++i<t.length;){const s=t[i];if(s&&typeof s=="object"&&"flags"in s){if(s.test(String(r))){a=!0;break}}else if(s===r){a=!0;break}}if(!a)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function CN(e,t,n){const r=e.schema.protocols&&Lr.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const a=String(n),i=a.indexOf(":"),s=a.indexOf("?"),o=a.indexOf("#"),l=a.indexOf("/");if(i<0||l>-1&&i>l||s>-1&&i>s||o>-1&&i>o)return!0;let u=-1;for(;++u<r.length;){const c=r[u];if(i===c.length&&a.slice(0,c.length)===c)return!0}return!1}function Es(e,t){const n=wg(t);t.data&&(e.data=ka(t.data)),n&&(e.position=n)}function Um(e,t){let n,r=-1;if(e)for(;++r<e.length;){const a=e[r],i=typeof a=="string"?a:a[0];if(i===t)return a;i==="data*"&&(n=a)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function p4(e){return function(t){return yN(t,e)}}var Op;const g4={...Gi,protocols:{...Gi.protocols,src:[...((Op=Gi.protocols)==null?void 0:Op.src)??["http","https","mailto"],"data"]}};function NN({retry:e}){const t=$e();return f.jsxs("div",{className:"text-body text-warning p-4 flex items-start gap-2",children:[f.jsx(vr,{className:"w-4 h-4 shrink-0 mt-0.5"}),f.jsxs("span",{children:[t("error.renderFailed")," ",f.jsx("button",{className:"underline ml-1",onClick:e,children:t("error.retry")})]})]})}class MN extends w.Component{constructor(){super(...arguments);Fl(this,"state",{error:null});Fl(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):f.jsx(NN,{error:this.state.error,retry:this.retry}):this.props.children}}function IN({nodeId:e,onRated:t}){const n=$e(),[r,a]=w.useState(!1),[i,s]=w.useState(!1),o=async l=>{if(!(r||i)){a(!0);try{await ae.recordReview(e,l),s(!0),t==null||t(),ha(l>=4?"correct":"wrong")}catch{}finally{a(!1)}}};return i?f.jsx("div",{className:"text-center text-body text-brand py-2","data-testid":"self-rated",children:n("review.selfrated")}):f.jsxs("div",{className:"border-t border-[var(--border-faint)] pt-3 mt-3","data-testid":"self-rating",children:[f.jsx("div",{className:"text-caption font-bold text-ink-muted uppercase tracking-wider mb-2 text-center",children:n("review.selfrate.title")}),f.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[f.jsxs("button",{onClick:()=>o(1),disabled:r,"data-testid":"rate-again",className:"py-2 rounded-lg border border-warning/40 text-warning hover:bg-warning/10 transition-colors disabled:opacity-40 flex flex-col items-center gap-0.5",children:[f.jsx("span",{className:"text-body font-bold",children:n("review.selfrate.again")}),f.jsx("span",{className:"text-caption opacity-70",children:n("review.selfrate.again.hint")})]}),f.jsxs("button",{onClick:()=>o(4),disabled:r,"data-testid":"rate-remembered",className:"py-2 rounded-lg border border-accent/40 text-accent hover:bg-accent/10 transition-colors disabled:opacity-40 flex flex-col items-center gap-0.5",children:[f.jsx("span",{className:"text-body font-bold",children:n("review.selfrate.remembered")}),f.jsx("span",{className:"text-caption opacity-70",children:n("review.selfrate.remembered.hint")})]}),f.jsxs("button",{onClick:()=>o(5),disabled:r,"data-testid":"rate-mastered",className:"py-2 rounded-lg border border-brand/40 text-brand hover:bg-brand/10 transition-colors disabled:opacity-40 flex flex-col items-center gap-0.5",children:[f.jsx("span",{className:"text-body font-bold",children:n("review.selfrate.mastered")}),f.jsx("span",{className:"text-caption opacity-70",children:n("review.selfrate.mastered.hint")})]})]})]})}function os(e,t,n){const r=[];let a="";const i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode(o){const l=o.parentElement;if(!l)return NodeFilter.FILTER_REJECT;const u=l.tagName;return u==="SCRIPT"||u==="STYLE"||l.closest(".katex-html")||l.closest(".katex-mathml")&&!l.closest("annotation")||!(n!=null&&n.includeMarks)&&l.closest("mark.lookatstudy-underline")||t&&!l.closest(t)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});let s;for(;s=i.nextNode();){const o=s,l=o.textContent??"",u=a.length;a+=l,r.push({node:o,start:u,end:a.length})}return{text:a,nodes:r}}function x4(e,t){const n=qm(e.startContainer,e.startOffset,t,"start"),r=qm(e.endContainer,e.endOffset,t,"end");return n==null||r==null||r<=n?null:{start:n,end:r}}function qm(e,t,n,r){var a,i,s;if(e.nodeType===Node.TEXT_NODE){for(const o of n.nodes)if(o.node===e)return o.start+Math.min(t,((a=o.node.textContent)==null?void 0:a.length)??0);return r==="start"?((i=n.nodes[0])==null?void 0:i.start)??null:((s=n.nodes[n.nodes.length-1])==null?void 0:s.end)??null}if(e instanceof Element){const o=Array.from(e.childNodes);if(r==="end"){for(let u=t;u<o.length;u++){const c=b4(o[u],n);if(c!=null)return c}const l=n.nodes[n.nodes.length-1];return l?l.end:null}else{for(let u=t;u>=0;u--){const c=y4(o[u],n);if(c!=null)return c}const l=n.nodes[0];return l?l.start:null}}return null}function b4(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=b4(n,t);if(r!=null)return r}return null}function y4(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 a=y4(r,t);a!=null&&(n=a)}return n}return null}function v4(e,t,n){var o,l,u,c;if(n<=t)return null;let r=null,a=0,i=null,s=0;for(const h of e.nodes)if(!r&&t>=h.start&&t<h.end&&(r=h.node,a=t-h.start),!i&&n>h.start&&n<=h.end&&(i=h.node,s=n-h.start),r&&i)break;if(!r&&e.nodes.length>0){const h=e.nodes[e.nodes.length-1];r=h.node,a=((o=h.node.textContent)==null?void 0:o.length)??0}if(!i&&e.nodes.length>0){const h=e.nodes[e.nodes.length-1];i=h.node,s=((l=h.node.textContent)==null?void 0:l.length)??0}if(!r||!i)return null;try{const h=document.createRange();return h.setStart(r,Math.min(a,((u=r.textContent)==null?void 0:u.length)??0)),h.setEnd(i,Math.min(s,((c=i.textContent)==null?void 0:c.length)??0)),h}catch{return null}}function w4(e,t){e.querySelectorAll("mark.lookatstudy-underline").forEach(i=>{const s=i.parentNode;if(s){for(;i.firstChild;)s.insertBefore(i.firstChild,i);s.removeChild(i)}}),e.normalize();const n=new Map;if(t.length===0)return n;const r=os(e),a=[];for(const i of t){const s=_N(r.text,i.text,i.surrounding);s>=0&&a.push({noteId:i.noteId,start:s,end:s+i.text.length})}a.sort((i,s)=>s.start-i.start);for(const i of a){const s=v4(r,i.start,i.end);if(!s)continue;const o=RN(s,i.noteId);o&&n.set(i.noteId,o)}return n}function _N(e,t,n){if(!t)return-1;let r=e.indexOf(t);if(r<0){const a=t.replace(/\s+/g," ").trim();if(r=e.replace(/\s+/g," ").indexOf(a),r<0)return-1;const s=t.slice(0,Math.min(15,t.length));return e.indexOf(s)}if(n&&n.length>5){const a=e.indexOf(n.slice(0,20));if(a>=0){let i=r,s=Math.abs(r-a),o=r+1;for(;;){const l=e.indexOf(t,o);if(l<0)break;const u=Math.abs(l-a);u<s&&(i=l,s=u),o=l+1}return i}}return r}function RN(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,k4(e,r)}function k4(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=[],a=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=a.nextNode();)r.push(i);if(r.length===0)return null;let s=null;for(const o of r){let l=o;if(o===e.startContainer&&e.startOffset>0&&(l=o.splitText(e.startOffset)),o===e.endContainer||l===e.endContainer){const c=l===e.endContainer?e.endOffset:e.endOffset-(o===e.startContainer?e.startOffset:0);c<l.textContent.length&&l.splitText(c)}if(!l.textContent)continue;const u=s?t.cloneNode(!1):t;(n=l.parentNode)==null||n.insertBefore(u,l),u.appendChild(l),s||(s=u)}return s}catch{return null}}const T4="cp-reading-mark",E4="cp-reading";function xa(e){var n;const t=CSS;try{(n=t.highlights)==null||n.delete(E4)}catch{}Ld=null,e.querySelectorAll(`.${T4}`).forEach(r=>{const a=r.parentNode;if(a){for(;r.firstChild;)a.insertBefore(r.firstChild,r);a.removeChild(r)}}),e.normalize()}const LN=/[0-9A-Za-z\u00C0-\u024F\u0370-\u03FF\u0400-\u04FF\u4E00-\u9FFF\u3040-\u30FF\uAC00-\uD7AF]/,DN=`「『(([【<《"'“‘`,PN=`。』」))]】>》"'”’!!??…,,、;;::`;function S4(e){const t=e.codePointAt(0);let n=e;return t>=65281&&t<=65374&&(n=String.fromCharCode(t-65248)),LN.test(n)?n.toLowerCase():null}function ON(e){let t="";const n=[];for(let r=0;r<e.length;r++){const a=S4(e[r]);a!==null&&(t+=a,n.push(r))}return{canon:t,map:n}}function jN(e,t){if(t<=0)return 0;let n=0,r=e.length;for(;n<r;){const a=n+r>>1;e[a]<t?n=a+1:r=a}return n}function Vm(e,t,n){const{canon:r,map:a}=ON(e),i=t.trim().split(/\s+/).map(p=>[...p].map(S4).filter(Boolean).join("")).filter(p=>p.length>0);if(i.length===0||r.length===0){const p=t.trim();if(!p)return null;const g=e.indexOf(p,Math.max(0,n));return g>=0?{start:g,end:g+p.length}:null}const s=jN(a,Math.max(0,n)),o=i.join("");let l=-1,u=-1;const c=r.indexOf(o,s);if(c>=0)l=c,u=c+o.length-1;else{let p=s;for(const g of i){const x=r.indexOf(g,p);if(x<0)return null;l<0&&(l=x),u=x+g.length-1,p=u+1}if(l<0||u-l+1>o.length*3+40)return null}if(u>=a.length||l<0)return null;let h=a[l],m=a[u]+1;const d=n>0?n:0;for(let p=0;p<3&&h-1>=d&&DN.includes(e[h-1]);p++)h--;for(let p=0;p<4&&m<e.length&&PN.includes(e[m]);p++)m++;return{start:h,end:m}}const r0=new WeakMap;function A4(e){r0.delete(e)}function C4(e,t,n){xa(e);const r=t.trim();if(!r)return null;const a=os(e,n==null?void 0:n.within,{includeMarks:!0}),i=r0.get(e)??0;let s=Vm(a.text,r,i);if(!s&&i>0&&(s=Vm(a.text,r,0)),!s)return null;r0.set(e,s.end);const o=v4(a,s.start,s.end);if(!o)return null;const l=CSS;if(typeof Highlight<"u"&&l.highlights)try{return l.highlights.set(E4,new Highlight(o)),Ld=o,o}catch{}const u=document.createElement("span");return u.className=T4,k4(o,u)?o:null}let Ld=null;function BN(){return Ld}function N4(e,t){var s,o,l;const n=e.getClientRects(),r=n.length>0&&n[0].height>0?n[0]:(s=e.startContainer.parentElement??e.startContainer)==null?void 0:s.getBoundingClientRect();if(!r||r.height<=0)return;if(!t){(l=(o=e.startContainer.parentElement??e.startContainer)==null?void 0:o.scrollIntoView)==null||l.call(o,{behavior:"smooth",block:"center"});return}const a=t.getBoundingClientRect();if(r.top>=a.top+48&&r.bottom<=a.bottom-48)return;const i=t.scrollTop+(r.top+r.height/2)-(a.top+a.height/2);t.scrollTo({top:Math.max(0,i),behavior:"smooth"})}let po=null,a0=null;function FN(e){po=e,a0=(e==null?void 0:e.textContent)??null}function zN(){if(HN(po))return po;if(a0){for(const e of document.querySelectorAll("mark.lookatstudy-underline"))if(e.textContent===a0)return po=e,e}return null}function HN(e){return!!e&&e.isConnected}function M4(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 I4(e){const t=[];let n=!1;for(const r of e.split(`
|
|
769
|
+
`)){if(/^[ \t]*(?:```|~~~)/.test(r)){t.push(r),n=!n;continue}t.push(n?r:r.replace(/\\\[|\\\]|\\\(|\\\)/g,a=>a==="\\["||a==="\\]"?"$$":"$"))}return t.join(`
|
|
770
|
+
`)}const go=new Set(["。","!","?","!","?",";",";","…"]),UN=new Set([",",",","、",":",":"," "," "]),qN=/[\u{1F000}-\u{1FAFF}\u{2600}-\u{27BF}\u{2B00}-\u{2BFF}]/u;function $m(e){return e!=null&&qN.test(String.fromCodePoint(e))}const VN=/(?:[\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,i0=new Set(["”",'"',"」","』","》",")","】","])".slice(0,1)]);function $N(e){let t=e;return t=t.replace(/\r\n?/g,`
|
|
771
|
+
`),t=t.replace(/(?:^|\n)[ \t]*(?:```|~~~)[^\n]*\n[\s\S]*?(?:\n[ \t]*(?:```|~~~)[^\n]*|\n?$)/g,`
|
|
772
|
+
`),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,`
|
|
773
|
+
|
|
774
|
+
`),t.trim()}function WN(e){return GN($N(e),{flush:!0}).sentences}function _4(e,t){if(t<0||t>=e.length)return"";let n=t;for(;n>0&&!YN(e[n-1]??"");)n--;const r=[];for(let a=n;a<=t;a++){const i=e[a];i&&i.trim()&&r.push(i)}return r.join(" ")}function GN(e,t={}){const n=Math.max(8,t.maxBuffer??120),r=t.flush??!1,a=[],i=e.length;let s=0,o=0,l=-1;const u=h=>{const m=e.slice(s,h).trim();m&&a.push(m),s=h,l=-1};for(;o<i;){const h=e[o],m=e.codePointAt(o);if($m(m)){let d=o+(m>65535?2:1);for(;d<i;){const p=e.codePointAt(d),g=p>65535?2:1;if(p===65039||p===8205||p>=127995&&p<=127999||$m(p)){d+=g;continue}break}u(d),o=d;continue}if(h===`
|
|
775
|
+
`){const d=e.slice(s,o+1).replace(/[^\S\n]+$/,"");d.trim()&&a.push(d),s=o+1,l=-1,o++;continue}if(go.has(h)){let d=o+1;for(;d<i&&(go.has(e[d])||i0.has(e[d]));)d++;u(d),o=d;continue}if(h==="."){const d=o>0?e[o-1]:"",p=o+1<i?e[o+1]:"";if((p===""||/\s/.test(p))&&!/\d/.test(d)){let g=o+1;for(;g<i&&(i0.has(e[g])||go.has(e[g]));)g++;u(g),o=g;continue}}if(UN.has(h)&&(l=o),o-s+1>n)if(l>s){const d=l;u(d),s=d+1}else{u(o+1),o++;continue}o++}const c=e.slice(s).trim();return r&&c&&a.push(c),{sentences:a,rest:r?"":c}}function YN(e){if(/\n\s*$/.test(e))return!0;const t=e.trimEnd();if(!t)return!0;let n=t.length-1;for(;n>=0&&i0.has(t[n]);)n--;if(n<0)return!0;const r=t[n];return go.has(r)||r==="."||r===`
|
|
776
|
+
`?!0:VN.test(t)}function R4(e,t,n){const a=e.top+e.height/2;return e.right+8+n<=t?{left:e.right+8,top:a,transform:"translate(0, -50%)"}:e.left-8-n>=0?{left:e.left-8,top:a,transform:"translate(-100%, -50%)"}:{left:e.left,top:e.bottom+8,transform:"translate(0, 0)"}}function Nl({title:e,onClose:t,children:n}){const r=$e(),a=w.useRef(null);return ni(a,!0),w.useEffect(()=>{const i=s=>{s.key==="Escape"&&t()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[t]),$0.createPortal(f.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col bg-black/80","data-testid":"diagram-viewer-modal","data-noswipe":"",role:"dialog","aria-modal":"true","aria-label":e,children:[f.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2.5 shrink-0",onClick:i=>i.stopPropagation(),children:[f.jsx("h3",{className:"text-body font-bold text-white truncate",children:e}),f.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[f.jsx("span",{className:"text-caption text-white/50 hidden sm:inline",children:r("artifact.viewer.hint")}),f.jsx("button",{onClick:t,"data-testid":"diagram-viewer-close","aria-label":r("action.close"),"data-tooltip":r("action.close"),className:"text-white/70 hover:text-white w-9 h-9 flex items-center justify-center rounded-lg hover:bg-white/10 transition-colors",children:f.jsx(Bn,{className:"w-5 h-5"})})]})]}),f.jsx("div",{className:"flex-1 min-h-0 px-2 pb-2",onClick:t,children:f.jsx("div",{ref:a,className:"h-full w-full",onClick:i=>i.stopPropagation(),children:n})})]}),document.body)}function KN(e,t,n,r,a=24){if(e<=0||t<=0||n<=0||r<=0)return 1;const i=Math.min((n-a*2)/e,(r-a*2)/t,1);return Math.max(.02,i)}function XN(e,t,n,r,a=24){const i=KN(e,t,n,r,a);return{scale:i,x:(n-e*i)/2,y:(r-t*i)/2}}function QN(e,t,n,r){return{scale:e.scale*t,x:n-(n-e.x)*t,y:r-(r-e.y)*t}}function Di(e,t,n,r,a,i=64){const s=t*e.scale,o=n*e.scale;let{x:l,y:u}=e;return s<=r?l=(r-s)/2:l=Math.min(Math.max(l,r-s-i),i),o<=a?u=(a-o)/2:u=Math.min(Math.max(u,a-o-i),i),{x:l,y:u,scale:e.scale}}function ZN(e,t,n,r,a){const i=e.scale*t,s=Math.min(Math.max(i,a.min),a.max)/e.scale;return s===1?e:Di(QN(e,s,n,r),a.contentW,a.contentH,a.viewW,a.viewH)}const Wm=.05,Gm=4,Ks=1.25;function Ss({children:e,grid:t=!0,testid:n}){const r=$e(),a=w.useRef(null),i=w.useRef(null),[s,o]=w.useState({x:0,y:0,scale:1}),[l,u]=w.useState(null),[c,h]=w.useState(!1),m=w.useRef("mouse"),d=w.useRef(!0),p=w.useRef({pointers:new Map,pinchBase:null,lastMid:null,panning:!1,moved:!1}),g=w.useRef(null),x=w.useCallback(()=>{const S=a.current,I=i.current;return{min:Wm,max:Gm,contentW:(I==null?void 0:I.offsetWidth)??0,contentH:(I==null?void 0:I.offsetHeight)??0,viewW:(S==null?void 0:S.clientWidth)??0,viewH:(S==null?void 0:S.clientHeight)??0}},[]),b=w.useCallback(()=>{const S=x();!S.contentW||!S.viewW||(o(XN(S.contentW,S.contentH,S.viewW,S.viewH)),d.current=!0)},[x]);w.useEffect(()=>{const S=a.current,I=i.current;if(!S||!I)return;const C=()=>{u({w:I.offsetWidth,h:I.offsetHeight}),b()};C();const D=new ResizeObserver(C);return D.observe(I),D.observe(S),()=>D.disconnect()},[b]);const v=w.useCallback((S,I,C)=>{const D=x(),L=I??D.viewW/2,F=C??D.viewH/2;o(O=>ZN(O,S,L,F,D)),d.current=!1},[x]),T=w.useCallback(S=>{var D,L;if((L=(D=S.target).closest)!=null&&L.call(D,"[data-testid=canvas-zoom-controls]"))return;const I=S.currentTarget;try{I.setPointerCapture(S.pointerId)}catch{}const C=p.current;if(m.current=S.pointerType,C.pointers.size===0&&h(!0),C.pointers.set(S.pointerId,{x:S.clientX,y:S.clientY}),C.pointers.size===2){const[F,O]=[...C.pointers.values()];C.pinchBase={dist:Math.hypot(F.x-O.x,F.y-O.y),factorAcc:1},C.lastMid={x:(F.x+O.x)/2,y:(F.y+O.y)/2},C.panning=!1}else C.pointers.size===1&&(C.panning=!0,C.moved=!1,C.lastMid={x:S.clientX,y:S.clientY})},[]),N=w.useCallback(S=>{const I=p.current;if(!I.pointers.has(S.pointerId))return;I.pointers.set(S.pointerId,{x:S.clientX,y:S.clientY});const C=a.current;if(!C)return;const D=C.getBoundingClientRect();if(I.pointers.size>=2&&I.pinchBase){const[L,F]=[...I.pointers.values()],O=Math.hypot(L.x-F.x,L.y-F.y),R={x:(L.x+F.x)/2,y:(L.y+F.y)/2};if(I.pinchBase.dist>0){const H=O/I.pinchBase.dist/I.pinchBase.factorAcc;I.pinchBase.factorAcc*=H,v(H,R.x-D.left,R.y-D.top)}if(I.lastMid){const H=R.x-I.lastMid.x,V=R.y-I.lastMid.y,q=x();o(Z=>Di({...Z,x:Z.x+H,y:Z.y+V},q.contentW,q.contentH,q.viewW,q.viewH))}I.lastMid=R;return}if(I.panning&&I.lastMid){const L=S.clientX-I.lastMid.x,F=S.clientY-I.lastMid.y;Math.abs(L)+Math.abs(F)>2&&(I.moved=!0);const O=x();o(R=>Di({...R,x:R.x+L,y:R.y+F},O.contentW,O.contentH,O.viewW,O.viewH)),I.lastMid={x:S.clientX,y:S.clientY}}},[x,v]),k=w.useCallback(S=>{const I=p.current,C=I.pointers.size===1;if(I.pointers.delete(S.pointerId),I.pointers.size<2&&(I.pinchBase=null),I.pointers.size===0){if(I.panning=!1,I.lastMid=null,h(!1),C&&!I.moved&&S.pointerType!=="mouse"){const D=performance.now(),L=g.current;if(L&&D-L.t<320&&Math.hypot(S.clientX-L.x,S.clientY-L.y)<32){const F=x();d.current?(o(Di({x:(F.viewW-F.contentW)/2,y:Math.max(24,(F.viewH-F.contentH)/2),scale:1},F.contentW,F.contentH,F.viewW,F.viewH)),d.current=!1):b(),g.current=null}else g.current={t:D,x:S.clientX,y:S.clientY}}}else if(I.pointers.size===1){const D=[...I.pointers.values()][0];I.lastMid={x:D.x,y:D.y},I.panning=!0}},[x,b]),A=w.useCallback(S=>{var C;S.preventDefault();const I=(C=a.current)==null?void 0:C.getBoundingClientRect();I&&v(S.deltaY<0?Ks:1/Ks,S.clientX-I.left,S.clientY-I.top)},[v]),_=w.useCallback(()=>{if(m.current!=="mouse")return;const S=x();d.current?(o(Di({x:(S.viewW-S.contentW)/2,y:Math.max(24,(S.viewH-S.contentH)/2),scale:1},S.contentW,S.contentH,S.viewW,S.viewH)),d.current=!1):b()},[x,b]);return f.jsxs("div",{ref:a,"data-testid":n,"data-noswipe":"",className:`relative h-full w-full overflow-hidden select-none touch-none ${t?"canvas-grid":""}`,style:{touchAction:"none"},onPointerDown:T,onPointerMove:N,onPointerUp:k,onPointerCancel:k,onWheel:A,onDoubleClick:_,children:[f.jsx("div",{ref:i,className:`absolute top-0 left-0 canvas-stage-gesture ${c?"":"motion-safe:transition-transform motion-safe:duration-150 motion-safe:ease-out"}`,style:{transform:`translate(${s.x}px, ${s.y}px) scale(${s.scale})`,transformOrigin:"0 0"},children:e}),f.jsxs("div",{className:"absolute bottom-3 left-1/2 -translate-x-1/2 z-10 flex items-center gap-0.5 p-1 rounded-xl bg-surface-0/90 backdrop-blur border border-[var(--border)] shadow-elevated","data-testid":"canvas-zoom-controls",children:[f.jsx("button",{onClick:()=>v(1/Ks),disabled:s.scale<=Wm+1e-6,"aria-label":r("artifact.zoomOut"),"data-tooltip":r("artifact.zoomOut"),"data-testid":"canvas-zoom-out",className:"w-8 h-8 rounded-lg flex items-center justify-center text-ink-muted hover:bg-ink/5 hover:text-ink-strong disabled:opacity-30 disabled:pointer-events-none transition-colors",children:f.jsx(Oy,{className:"w-4 h-4"})}),f.jsxs("span",{className:"text-label font-bold tabular-nums text-ink-muted min-w-[3.25rem] text-center select-none","data-testid":"canvas-zoom-pct",children:[Math.round(s.scale*100),"%"]}),f.jsx("button",{onClick:()=>v(Ks),disabled:s.scale>=Gm-1e-6,"aria-label":r("artifact.zoomIn"),"data-tooltip":r("artifact.zoomIn"),"data-testid":"canvas-zoom-in",className:"w-8 h-8 rounded-lg flex items-center justify-center text-ink-muted hover:bg-ink/5 hover:text-ink-strong disabled:opacity-30 disabled:pointer-events-none transition-colors",children:f.jsx(el,{className:"w-4 h-4"})}),f.jsx("button",{onClick:b,"aria-label":r("artifact.canvas.fit"),"data-tooltip":r("artifact.canvas.fit"),"data-testid":"canvas-zoom-fit",className:"w-8 h-8 rounded-lg flex items-center justify-center text-ink-muted hover:bg-ink/5 hover:text-ink-strong transition-colors",children:f.jsx(fs,{className:"w-4 h-4"})})]}),f.jsx("span",{"data-testid":"canvas-natural-size",className:"hidden",children:l?`${l.w}x${l.h}`:""})]})}function qn(e,t=13){let n=0;for(const r of e)n+=/[\u2e80-\u9fff\uf900-\ufaff\uff00-\uffef\u3000-\u303f]/.test(r)?t:t*.58;return n}const La=118;function JN(e){if(qn(e)<=La)return[e];const t=[];for(let l=0;l<e.length;l++)/[\s/\-—·]/.test(e[l]??"")&&t.push(l);const n=e.length/2;let r=-1,a=1/0;for(const l of t){const u=Math.abs(l+1-n);u<a&&(a=u,r=l)}let i,s;if(r>=0)i=e.slice(0,r+1).trim(),s=e.slice(r+1).trim();else{let l=0,u=0;for(const c of e)if(l+=qn(c),u++,l>=qn(e)/2)break;i=e.slice(0,u),s=e.slice(u)}if(qn(i)<=La&&qn(s)<=La)return[i,s];const o=l=>{let u="";for(const c of l){if(qn(u+c+"…")>La)break;u+=c}return u+"…"};return[qn(i)>La?o(i):i,qn(s)>La?o(s):s]}function eM(e,t){const n=JN(e),r=t?14:13,a=Math.max(...n.map(l=>qn(l,r))),i=t?32:24,s=17,o=t?20:16;return{width:Math.min(t?196:170,Math.max(t?92:76,a+i)),height:o+n.length*s,lines:n,hub:t}}const tM=28,nM=52,Ym=34;function L4(e,t){var L,F,O;const n=e.map(R=>R.id),r=new Set(n),a=new Map;for(const R of e)a.set(R.id,new Set);const i=new Set,s=[];for(const R of t){if(!r.has(R.from)||!r.has(R.to)||R.from===R.to)continue;s.push(R);const H=[R.from,R.to].sort().join("→");i.has(H)||(i.add(H),a.get(R.from).add(R.to),a.get(R.to).add(R.from))}const o=R=>{var H;return((H=a.get(R))==null?void 0:H.size)??0};let l=((L=e[0])==null?void 0:L.id)??"";for(const R of e)o(R.id)>o(l)&&(l=R.id);const u=new Map(n.map((R,H)=>[R,H])),c=new Map,h=new Map;for(const R of e)h.set(R.id,[]);const m=new Map;if(l){m.set(l,0);const R=[l];for(;R.length;){const H=R.shift();for(const V of[...a.get(H)??[]].sort((q,Z)=>(u.get(q)??0)-(u.get(Z)??0)))m.has(V)||(m.set(V,(m.get(H)??0)+1),c.set(V,H),h.get(H).push(V),R.push(V))}}let d=0;for(const R of m.values())d=Math.max(d,R);const p=e.filter(R=>!m.has(R.id)).map(R=>R.id);for(const R of p)m.set(R,d+1),c.set(R,l),h.get(l).push(R);for(const R of m.values())d=Math.max(d,R);const g=new Map,x=R=>{const H=g.get(R);if(H!=null)return H;const V=h.get(R)??[],q=V.length===0?1:V.reduce((Z,B)=>Z+x(B),0);return g.set(R,q),q};l&&x(l);const b=new Map,v=(R,H,V)=>{const q=h.get(R)??[];if(q.length===0)return;const Z=q.reduce((Q,ne)=>Q+(g.get(ne)??1),0);let B=H;for(const Q of q){const ne=(g.get(Q)??1)/Z*V;b.set(Q,B+ne/2),v(Q,B,ne),B+=ne}};l&&v(l,-Math.PI/2,Math.PI*2);const T=new Map;for(const R of e)T.set(R.id,eM(R.label,R.id===l||o(R.id)>=4));const N=new Map;for(const R of e){const H=m.get(R.id)??0;N.has(H)||N.set(H,[]),N.get(H).push(R.id)}const k=new Map;k.set(0,0);for(let R=1;R<=d;R++){const H=N.get(R)??[];if(H.length===0){k.set(R,k.get(R-1)??0);continue}const q=H.reduce((K,X)=>{var ce;return K+(((ce=T.get(X))==null?void 0:ce.width)??0)+Ym},0)/(Math.PI*2),Z=H.map(K=>({id:K,a:b.get(K)??0})).sort((K,X)=>K.a-X.a);let B=0;if(Z.length>1)for(let K=0;K<Z.length;K++){const X=Z[K],ce=Z[(K+1)%Z.length];let le=ce.a-X.a;if(K===Z.length-1&&(le+=Math.PI*2),le<=.01)continue;const ee=((((F=T.get(X.id))==null?void 0:F.width)??0)+(((O=T.get(ce.id))==null?void 0:O.width)??0))/2+Ym;B=Math.max(B,ee/(2*Math.sin(Math.min(Math.PI,le)/2)))}const Q=k.get(R-1)??0,ne=Math.max(...(N.get(R-1)??[]).map(K=>{var X;return(((X=T.get(K))==null?void 0:X.height)??0)/2}),0),j=Math.max(...H.map(K=>{var X;return(((X=T.get(K))==null?void 0:X.height)??0)/2})),re=H.length===1?60:0;k.set(R,Math.max(Q+ne+j+nM,q,B+re))}const A=new Map;for(const R of e){const H=m.get(R.id)??0,V=k.get(H)??0,q=H===0?0:b.get(R.id)??0;A.set(R.id,{id:R.id,center:{x:V*Math.cos(q),y:V*Math.sin(q)},box:T.get(R.id),degree:o(R.id),depth:H})}let _=0;for(const R of A.values())_=Math.max(_,Math.abs(R.center.x)+R.box.width/2,Math.abs(R.center.y)+R.box.height/2);const S=Math.ceil(2*(_+tM)),I=S/2;for(const R of A.values())R.center={x:R.center.x+I,y:R.center.y+I};const C=[],D=[];for(const R of s){const H=A.get(R.from),V=A.get(R.to);if(!H||!V)continue;const q=Km(H,V.center),Z=Km(V,H.center),B={x:(q.x+Z.x)/2,y:(q.y+Z.y)/2},Q=Z.x-q.x,ne=Z.y-q.y,j=Math.hypot(Q,ne)||1,re=Math.min(34,Math.max(10,j*.16)),K={x:B.x+ne/j*re,y:B.y-Q/j*re};let X={x:(q.x+2*K.x+Z.x)/4,y:(q.y+2*K.y+Z.y)/4};if(R.label){const ce=qn(R.label,12)+14;for(const le of D)if(Math.hypot(X.x-le.pt.x,X.y-le.pt.y)<(ce+le.w)/2+6){X={x:X.x+ne/j*22,y:X.y-Q/j*22};break}D.push({pt:X,w:ce})}C.push({edge:R,d:`M ${q.x.toFixed(1)} ${q.y.toFixed(1)} Q ${K.x.toFixed(1)} ${K.y.toFixed(1)} ${Z.x.toFixed(1)} ${Z.y.toFixed(1)}`,labelPt:X})}return{nodes:A,edges:C,rootId:l,width:Math.ceil(S),height:Math.ceil(S)}}function Km(e,t){const n=t.x-e.center.x,r=t.y-e.center.y,a=e.box.width/2+3,i=e.box.height/2+3;if(n===0&&r===0)return{x:e.center.x,y:e.center.y-i};const s=n===0?1/0:a/Math.abs(n),o=r===0?1/0:i/Math.abs(r),l=Math.min(s,o);return{x:e.center.x+n*l,y:e.center.y+r*l}}function rM(e){return{width:qn(e,12)+16,height:19}}const Xs=.4,Du=2.5,Qs=.2;function Xm({data:e}){const t=w.useMemo(()=>L4(e.nodes,e.edges),[e.nodes,e.edges]);return f.jsxs("svg",{width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,style:{display:"block"},"data-testid":"conceptmap-svg",children:[f.jsx("defs",{children:f.jsx("marker",{id:"cm-arrow",viewBox:"0 0 10 10",refX:9,refY:5,markerWidth:6.5,markerHeight:6.5,orient:"auto-start-reverse",children:f.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",className:"fill-ink-faint"})})}),t.edges.map(({edge:n,d:r,labelPt:a},i)=>{const s=n.label?rM(n.label):null;return f.jsxs("g",{children:[f.jsx("path",{d:r,className:"fill-none stroke-ink-faint/70",strokeWidth:1.6,markerEnd:"url(#cm-arrow)"}),n.label&&s&&f.jsxs("g",{children:[f.jsx("rect",{x:a.x-s.width/2,y:a.y-s.height/2,width:s.width,height:s.height,rx:s.height/2,className:"fill-surface-0 stroke-[var(--border-faint)]",strokeWidth:1}),f.jsx("text",{x:a.x,y:a.y+3.5,textAnchor:"middle",className:"fill-ink-muted text-caption font-medium",children:n.label})]})]},`e-${i}`)}),[...t.nodes.values()].map(n=>{const r=n.center.x-n.box.width/2,a=n.center.y-n.box.height/2,i=n.box.hub?14:13;return f.jsxs("g",{children:[f.jsx("rect",{x:r,y:a,width:n.box.width,height:n.box.height,rx:n.box.hub?13:11,className:n.box.hub?"fill-accent/10 stroke-accent/80":"fill-surface-3 stroke-[var(--border)]",strokeWidth:n.box.hub?1.6:1.1}),n.box.lines.map((s,o)=>f.jsx("text",{x:n.center.x,y:n.center.y+(o-(n.box.lines.length-1)/2)*17+4.5,textAnchor:"middle",fontSize:i,className:n.box.hub?"fill-ink-strong font-bold":"fill-ink",children:s},o))]},n.id)})]})}function D4({data:e,variant:t="card"}){const n=e,r=$e(),a=w.useMemo(()=>L4(n.nodes,n.edges),[n.nodes,n.edges]),[i,s]=w.useState(1),[o,l]=w.useState(!1),u=w.useRef(null);w.useEffect(()=>{const p=u.current;if(!p)return;const g=()=>{const b=(p.clientWidth-16)/a.width;b<1&&s(Math.max(Xs,+b.toFixed(2)))};g();const x=new ResizeObserver(g);return x.observe(p),()=>x.disconnect()},[a.width]);const c=w.useCallback(()=>s(p=>Math.min(Du,+(p+Qs).toFixed(2))),[]),h=w.useCallback(()=>s(p=>Math.max(Xs,+(p-Qs).toFixed(2))),[]),m=w.useCallback(()=>s(1),[]),d=w.useCallback(p=>{if(!p.ctrlKey&&!p.metaKey)return;p.preventDefault();const g=p.deltaY>0?-Qs:Qs;s(x=>Math.min(Du,Math.max(Xs,+(x+g).toFixed(2))))},[]);return t==="canvas"?f.jsx("div",{"data-testid":"conceptmap-canvas-content",children:f.jsx(Xm,{data:n})}):f.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-concept-map",children:[f.jsxs("div",{className:"flex items-center justify-between mb-3 gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[f.jsx(q0,{className:"w-4 h-4 text-ink-muted shrink-0"}),f.jsx("h3",{className:"text-body font-bold text-ink truncate",children:n.title})]}),f.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[f.jsxs("div",{className:"flex items-center gap-1","data-testid":"conceptmap-zoom-controls",children:[f.jsx("button",{onClick:h,disabled:i<=Xs,className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 disabled:opacity-30 text-label font-bold flex items-center justify-center",title:r("artifact.zoomOut"),children:"−"}),f.jsxs("button",{onClick:m,className:"px-1.5 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 text-caption font-bold tabular-nums",title:r("artifact.zoomReset"),children:[Math.round(i*100),"%"]}),f.jsx("button",{onClick:c,disabled:i>=Du,className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 disabled:opacity-30 text-label font-bold flex items-center justify-center",title:r("artifact.zoomIn"),children:"+"})]}),f.jsx("button",{onClick:()=>l(!0),"data-testid":"conceptmap-expand","aria-label":r("artifact.viewer.open"),"data-tooltip":r("artifact.viewer.open"),className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 flex items-center justify-center",children:f.jsx(fs,{className:"w-3.5 h-3.5"})})]})]}),f.jsx("div",{ref:u,onClick:()=>l(!0),onWheel:d,className:"bg-surface-0/40 rounded-lg p-2 overflow-auto min-h-[160px] max-h-[500px] select-none",style:{touchAction:"pan-x pan-y"},"data-testid":"conceptmap-render-area","data-noswipe":"",children:f.jsx("div",{style:{width:a.width*i,height:a.height*i,margin:"0 auto"},children:f.jsx("div",{style:{transform:`scale(${i})`,transformOrigin:"top left",width:a.width,height:a.height},children:f.jsx(Xm,{data:n})})})}),f.jsx("div",{className:"mt-1.5 flex items-center justify-between text-caption text-ink-muted",children:f.jsx("span",{children:r("artifact.conceptmap.stats",{nodes:n.nodes.length,edges:n.edges.length})})}),n.warnings&&n.warnings.length>0&&f.jsxs("div",{className:"mt-1 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[f.jsx(vr,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),f.jsx("span",{children:n.warnings.join("; ")})]}),o&&f.jsx(Nl,{title:n.title,onClose:()=>l(!1),children:f.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:f.jsx(Ss,{testid:"conceptmap-modal-stage",children:f.jsx(D4,{data:e,variant:"canvas"})})})})]})}function aM(e,t){const{correct:n,total:r}=e,a=r>0&&n===r,i=r>0&&n<r,s=t!=null&&t>=a5,o=t!=null&&t>=i5;return i?[{id:"explain-wrong"},{id:"retry"}]:a&&s?[{id:"next-topic"},{id:"go-deeper"}]:a&&o?[{id:"mark-mastered",advancesMastery:!0},{id:"next-topic"},{id:"go-deeper"}]:[{id:"go-deeper"},{id:"retry"}]}const iM="ls-quiz-progress:";function sM(e){const t=e.questions.map(r=>`${r.prompt}|${(r.options??[]).join("/")}#${r.answer??""}`).join(`
|
|
777
|
+
`);let n=2166136261;for(let r=0;r<t.length;r++)n^=t.charCodeAt(r),n=Math.imul(n,16777619);return`${iM}${(n>>>0).toString(36)}`}function oM(e){var t,n;try{const r=localStorage.getItem(e);if(!r)return null;const a=JSON.parse(r);return typeof(a==null?void 0:a.current)=="number"&&a.current>=0&&typeof((t=a==null?void 0:a.score)==null?void 0:t.correct)=="number"&&typeof((n=a==null?void 0:a.score)==null?void 0:n.total)=="number"?a:null}catch{return null}}function lM(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}const uM={"explain-wrong":{icon:vy,labelKey:"quiz.action.explainWrong",message:"我刚才有题答错了,帮我讲讲为什么错、正确的思路是什么。"},retry:{icon:ji,labelKey:"quiz.action.retry",message:"再来一组类似的题巩固一下。"},"go-deeper":{icon:pc,labelKey:"quiz.action.goDeeper",message:"这组我答得不错,帮我深入讲讲背后的原理和容易混淆的地方。"},"mark-mastered":{icon:Wn,labelKey:"quiz.action.markMastered",message:"这课我觉得掌握了,帮我确认一下——出个综合题检验,通过了就标记为掌握。"},"next-topic":{icon:fc,labelKey:"quiz.action.nextTopic",message:"进入下一个知识点。"}};function cM({data:e,onAnswered:t,quizMastery:n,onPickAction:r,onQuizCompleted:a}){const i=e,s=$e(),o=w.useMemo(()=>sM(i),[i]),l=w.useMemo(()=>oM(o),[o]),[u,c]=w.useState((l==null?void 0:l.current)??0),[h,m]=w.useState(null),[d,p]=w.useState(!1),[g,x]=w.useState((l==null?void 0:l.score)??{correct:0,total:0}),b=w.useRef([]);w.useEffect(()=>{lM(o,{current:u,score:g})},[o,u,g]);const[v,T]=w.useState(!1);if(u>=i.questions.length){const S=!!r&&!a;if(a)return f.jsxs("div",{className:"surface-card p-4 text-center","data-testid":"artifact-quiz-done",children:[f.jsx("div",{className:"text-2xl mb-2",children:g.correct===g.total?"🎉":"📚"}),f.jsx("div",{className:"text-body font-bold text-ink",children:s("quiz.scoreSummary",{correct:g.correct,total:g.total})}),v?f.jsx("div",{className:"text-label text-ink-muted mt-1","data-testid":"quiz-hook-sent",children:s("quiz.hook.sent")}):f.jsx("button",{onClick:()=>{T(!0),a({title:i.title??"",correct:g.correct,total:g.total,detail:[...b.current]})},"data-testid":"quiz-hook-finish",className:"btn-3d-brand mt-3 px-5 py-2 text-body",children:s("quiz.hook.finish")})]});const I=S?aM(g,n??null):[];return f.jsxs("div",{className:"surface-card p-4 text-center","data-testid":"artifact-quiz-done",children:[f.jsx("div",{className:"text-2xl mb-2",children:g.correct===g.total?"🎉":"📚"}),f.jsx("div",{className:"text-body font-bold text-ink",children:s("quiz.scoreSummary",{correct:g.correct,total:g.total})}),f.jsx("div",{className:"text-label text-ink-muted mt-1",children:g.correct===g.total?s("quiz.allCorrectHint"):s("quiz.tryAgainHint")}),I.length>0&&f.jsxs("div",{className:"mt-3 space-y-2 text-left","data-testid":"quiz-next-actions",children:[f.jsx("div",{className:"text-label text-ink-muted",children:s("quiz.action.nextPrompt")}),I.map((C,D)=>{const L=uM[C.id],F=L.icon;return f.jsxs("button",{onClick:()=>r==null?void 0:r(L.message),"data-testid":`quiz-action-${C.id}`,className:`${D===0?"btn-3d-brand":"btn-3d-neutral"} w-full py-2 text-body flex items-center justify-center gap-1.5`,children:[f.jsx(F,{className:"w-4 h-4"}),s(L.labelKey)]},C.id)})]})]})}const N=i.questions[u],k=d&&h===N.answer,A=()=>{if(h===null)return;p(!0);const S=h===N.answer;x(I=>({correct:I.correct+(S?1:0),total:I.total+1})),t==null||t(N,h,S),b.current.push({prompt:N.prompt,chosen:N.options[h]??"?",answerText:N.options[N.answer]??"?",correct:S}),ha(S?"correct":"wrong")},_=()=>{u===i.questions.length-1&&a&&!v&&(T(!0),a({title:i.title??"",correct:g.correct,total:g.total,detail:[...b.current]})),c(S=>S+1),m(null),p(!1)};return f.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-quiz",children:[f.jsxs("div",{className:"flex items-center justify-between mb-3",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(z0,{className:"w-4 h-4 text-brand"}),f.jsx("span",{className:"text-label font-bold text-brand",children:s("quiz.questionProgress",{cur:u+1,total:i.questions.length})})]}),f.jsx("span",{className:"text-label text-ink-muted",children:s("quiz.answeredCorrect",{n:g.correct})})]}),f.jsx("div",{className:"text-body text-ink font-medium mb-3 leading-relaxed",children:N.prompt}),f.jsx("div",{className:"space-y-2 mb-3",children:N.options.map((S,I)=>{const C=h===I,D=d&&I===N.answer,L=d&&C&&!D;return f.jsxs("button",{onClick:()=>!d&&m(I),disabled:d,"data-testid":`quiz-option-${I}`,className:`w-full text-left text-body p-2.5 rounded-lg border-2 font-medium transition-colors ${D?"border-brand bg-brand/10 text-brand animate-answer-correct":L?"border-warning bg-warning/10 text-warning animate-answer-wrong":C?"border-accent bg-accent/10 text-accent":"border-[var(--border)] text-ink-muted hover:border-[var(--border)]"} ${d?"cursor-default":"cursor-pointer"}`,children:[f.jsx("span",{className:"font-bold mr-2",children:String.fromCharCode(65+I)}),S,D&&f.jsx("span",{className:"float-right",children:f.jsx(Tn,{className:"w-4 h-4 inline-block"})}),L&&f.jsx("span",{className:"float-right",children:f.jsx(Bn,{className:"w-4 h-4 inline-block"})})]},I)})}),d&&f.jsxs("div",{className:`rounded-lg p-3 mb-3 text-body leading-relaxed animate-artifact-render ${k?"bg-brand/10 border border-brand/30 text-brand":"bg-warning/10 border border-warning/30 text-warning"}`,"data-testid":"quiz-explanation",children:[f.jsxs("div",{className:"font-bold mb-1 flex items-center gap-1.5",children:[k?f.jsx(Tn,{className:"w-4 h-4"}):f.jsx(Bn,{className:"w-4 h-4"}),f.jsx("span",{children:s(k?"quiz.correct":"quiz.wrong")})]}),f.jsx("div",{className:"text-ink-muted",children:N.explanation})]}),d?f.jsx("button",{onClick:_,"data-testid":"quiz-next",className:"btn-3d-brand w-full py-2 text-body",children:u+1<i.questions.length?s("exercise.next"):s("quiz.finish")}):f.jsx("button",{onClick:A,disabled:h===null,"data-testid":"quiz-submit",className:"btn-3d-brand w-full py-2 text-body disabled:opacity-40",children:s("exercise.submit")}),i.warnings&&i.warnings.length>0&&f.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[f.jsx(vr,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),f.jsx("span",{children:i.warnings.join("; ")})]})]})}function P4({data:e,variant:t="card"}){const n=e,r=$e(),[a,i]=w.useState(!1),s=f.jsxs("table",{className:"text-body",style:{width:"max-content",minWidth:"100%"},children:[f.jsx("thead",{children:f.jsx("tr",{className:"bg-surface-3/60",children:n.headers.map((o,l)=>f.jsx("th",{className:`px-3 py-2.5 text-left font-bold border-b border-[var(--border)] ${l===0?"text-ink-strong":"text-ink"}`,children:o},l))})}),f.jsx("tbody",{children:n.rows.map((o,l)=>f.jsx("tr",{className:l%2===0?"bg-surface-0/40":"",children:o.map((u,c)=>f.jsx("td",{className:`px-3 py-2.5 border-b border-[var(--border-faint)] align-top leading-relaxed ${c===0?"font-bold text-ink-strong whitespace-nowrap bg-surface-1/40":"text-ink-muted"}`,style:c===0?void 0:{maxWidth:260,overflowWrap:"anywhere"},children:u},c))},l))})]});return t==="canvas"?f.jsx("div",{className:"w-fit","data-testid":"comparetable-canvas-content",children:s}):f.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-compare-table",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2 mb-3",children:[f.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[f.jsx(Kp,{className:"w-4 h-4 text-ink-muted shrink-0"}),f.jsx("h3",{className:"text-body font-bold text-ink truncate",children:n.title})]}),f.jsx("button",{onClick:()=>i(!0),"data-testid":"comparetable-expand","aria-label":r("artifact.viewer.open"),"data-tooltip":r("artifact.viewer.open"),className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 flex items-center justify-center shrink-0",children:f.jsx(fs,{className:"w-3.5 h-3.5"})})]}),f.jsx("div",{className:"overflow-x-auto rounded-lg border border-[var(--border-faint)]",onClick:()=>i(!0),style:{touchAction:"pan-x pan-y"},"data-noswipe":"",children:s}),n.warnings&&n.warnings.length>0&&f.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[f.jsx(vr,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),f.jsx("span",{children:n.warnings.join("; ")})]}),a&&f.jsx(Nl,{title:n.title,onClose:()=>i(!1),children:f.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:f.jsx(Ss,{testid:"comparetable-modal-stage",children:f.jsx("div",{className:"p-2 surface-card",children:f.jsx(P4,{data:e,variant:"canvas"})})})})})]})}let xo=null;function dM(){return xo||(xo=Ao(()=>import("./mermaid.core-BnzH2M4g.js").then(e=>e.bp),__vite__mapDeps([0,1,2]),import.meta.url).then(e=>{const t=e.default;return t.initialize({startOnLoad:!1,theme:"base",securityLevel:"loose",themeVariables:hM(),flowchart:{useMaxWidth:!0,htmlLabels:!0,curve:"basis",nodeSpacing:42,rankSpacing:54,padding:10},sequence:{useMaxWidth:!0,boxMargin:8,noteMargin:8,messageMargin:32}}),t})),xo}function hM(){const e=(n,r)=>{if(typeof document>"u")return r;const a=getComputedStyle(document.documentElement).getPropertyValue(n).trim();return a?`rgb(${a})`:r};return{background:"transparent",fontFamily:typeof document<"u"&&getComputedStyle(document.body).fontFamily||"ui-sans-serif, system-ui, sans-serif",fontSize:"14px",primaryColor:e("--surface-3-rgb","rgb(42 43 46)"),primaryBorderColor:e("--border-rgb","rgb(37 38 41)"),primaryTextColor:e("--ink-strong-rgb","rgb(250 250 250)"),secondaryColor:e("--surface-2-rgb","rgb(32 33 36)"),secondaryBorderColor:e("--border-faint-rgb","rgb(26 26 29)"),secondaryTextColor:e("--ink-rgb","rgb(245 245 250)"),tertiaryColor:e("--surface-1-rgb","rgb(24 25 27)"),tertiaryBorderColor:e("--border-faint-rgb","rgb(26 26 29)"),tertiaryTextColor:e("--ink-rgb","rgb(245 245 250)"),lineColor:e("--ink-faint-rgb","rgb(117 117 126)"),textColor:e("--ink-rgb","rgb(245 245 250)"),edgeLabelBackground:e("--surface-0-rgb","rgb(12 13 15)"),clusterBkg:e("--surface-1-rgb","rgb(24 25 27)"),clusterBorder:e("--border-faint-rgb","rgb(26 26 29)"),nodeBorder:e("--border-rgb","rgb(37 38 41)"),mainBkg:e("--surface-3-rgb","rgb(42 43 46)"),nodeTextColor:e("--ink-rgb","rgb(245 245 250)"),arrowheadColor:e("--ink-faint-rgb","rgb(117 117 126)"),actorBkg:e("--surface-3-rgb","rgb(42 43 46)"),actorBorder:e("--border-rgb","rgb(37 38 41)"),actorTextColor:e("--ink-strong-rgb","rgb(250 250 250)"),activationBkgColor:e("--surface-3-rgb","rgb(42 43 46)"),activationBorderColor:e("--border-rgb","rgb(37 38 41)"),signalColor:e("--ink-rgb","rgb(245 245 250)"),signalTextColor:e("--ink-rgb","rgb(245 245 250)"),labelBoxBkgColor:e("--surface-2-rgb","rgb(32 33 36)"),labelBoxBorderColor:e("--border-rgb","rgb(37 38 41)"),labelTextColor:e("--ink-rgb","rgb(245 245 250)"),loopTextColor:e("--ink-strong-rgb","rgb(250 250 250)"),noteBkgColor:"rgb(255 200 0 / 0.12)",noteBorderColor:"rgb(255 200 0 / 0.4)",noteTextColor:e("--ink-rgb","rgb(245 245 250)")}}typeof window<"u"&&window.addEventListener("theme-changed",()=>{xo=null});async function fM(e,t){const n=await dM();try{await n.parse(t)}catch(a){throw new Error(`mermaid 语法校验失败: ${a instanceof Error?a.message:String(a)}`)}const{svg:r}=await n.render(e,t);if(r.includes('aria-roledescription="error"')||r.includes('class="error-text"')||r.includes("Syntax error"))throw new Error("mermaid 渲染失败(语法错误或节点 label 含未转义特殊字符)");return r}const Pu=.3,Ou=3,Zs=.2;function O4({data:e,variant:t="card"}){const n=e,r=$e(),a={flowchart:r("artifact.diagram.flowchart"),sequence:r("artifact.diagram.sequence"),state:r("artifact.diagram.state")},i=w.useId().replace(/[:]/g,"_"),[s,o]=w.useState({status:"loading"}),[l,u]=w.useState(0);w.useEffect(()=>{const A=()=>u(_=>_+1);return window.addEventListener("theme-changed",A),()=>window.removeEventListener("theme-changed",A)},[]);const[c,h]=w.useState(null),[m,d]=w.useState(1),[p,g]=w.useState(!1);w.useEffect(()=>{let A=!1;return o({status:"loading"}),h(null),fM(`mmd-${i}`,n.mermaid).then(_=>{A||o({status:"rendered",svg:_})}).catch(_=>{A||(console.error("[MermaidArtifact] render failed:",_),o({status:"error",message:_ instanceof Error?_.message:String(_)}))}),()=>{A=!0}},[n.mermaid,i,l]);const x=`https://mermaid.live/edit#${encodeURIComponent(n.mermaid)}`,b=w.useCallback(()=>d(A=>Math.min(Ou,+(A+Zs).toFixed(2))),[]),v=w.useCallback(()=>d(A=>Math.max(Pu,+(A-Zs).toFixed(2))),[]),T=w.useCallback(()=>d(1),[]),N=w.useCallback(A=>{if(!A.ctrlKey&&!A.metaKey)return;A.preventDefault();const _=A.deltaY>0?-Zs:Zs;d(S=>Math.min(Ou,Math.max(Pu,+(S+_).toFixed(2))))},[]),k=s.status==="rendered"?f.jsx("div",{ref:A=>{var _;if(A&&!c){const S=A.querySelector("svg");if(S){const I=S.getBoundingClientRect(),C=(_=S.viewBox)==null?void 0:_.baseVal,D=C&&C.width?C.width:I.width,L=C&&C.height?C.height:I.height;D>0&&L>0&&h({width:D,height:L})}}},style:{width:(c==null?void 0:c.width)??void 0,height:(c==null?void 0:c.height)??void 0},dangerouslySetInnerHTML:{__html:s.svg},"data-testid":"mermaid-svg"}):null;return t==="canvas"?f.jsx("div",{"data-testid":"mermaid-canvas-content",children:k}):f.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-mermaid",children:[f.jsxs("div",{className:"flex items-center justify-between mb-3 gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[f.jsx(e5,{className:"w-4 h-4 text-ink-muted shrink-0"}),f.jsx("h3",{className:"text-body font-bold text-ink truncate",children:n.title}),f.jsx("span",{className:"text-caption font-bold px-1.5 py-0.5 rounded bg-accent/15 text-accent shrink-0",children:a[n.diagramType]??n.diagramType})]}),f.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[s.status==="rendered"&&f.jsxs("div",{className:"flex items-center gap-1","data-testid":"mermaid-zoom-controls",children:[f.jsx("button",{onClick:v,disabled:m<=Pu,className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-1 hover:bg-surface-3 disabled:opacity-30 text-label font-bold flex items-center justify-center",title:r("artifact.zoomOut"),"data-testid":"mermaid-zoom-out",children:"−"}),f.jsxs("button",{onClick:T,className:"px-1.5 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-1 hover:bg-surface-3 text-caption font-bold tabular-nums",title:r("artifact.zoomReset"),"data-testid":"mermaid-zoom-reset",children:[Math.round(m*100),"%"]}),f.jsx("button",{onClick:b,disabled:m>=Ou,className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-1 hover:bg-surface-3 disabled:opacity-30 text-label font-bold flex items-center justify-center",title:r("artifact.zoomIn"),"data-testid":"mermaid-zoom-in",children:"+"})]}),s.status==="rendered"&&f.jsx("button",{onClick:()=>g(!0),"data-testid":"mermaid-expand","aria-label":r("artifact.viewer.open"),"data-tooltip":r("artifact.viewer.open"),className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 flex items-center justify-center",children:f.jsx(fs,{className:"w-3.5 h-3.5"})})]}),f.jsx("button",{onClick:()=>window.open(x,"_blank"),className:"text-caption text-accent hover:underline font-bold shrink-0","data-testid":"mermaid-open-live",title:r("artifact.mermaid.openLive"),children:"mermaid.live ↗"})]}),f.jsxs("div",{onClick:()=>{s.status==="rendered"&&g(!0)},onWheel:N,className:"bg-surface-0/40 rounded-lg p-3 overflow-auto min-h-[120px] max-h-[500px] select-none",style:{touchAction:"pan-x pan-y"},"data-testid":"mermaid-render-area","data-noswipe":"",children:[s.status==="loading"&&f.jsxs("div",{className:"flex items-center gap-2 text-body text-ink-muted my-8 justify-center","data-testid":"mermaid-loading",children:[f.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-accent rounded-full inline-block"}),f.jsx("span",{children:r("artifact.mermaid.rendering")})]}),s.status==="rendered"&&f.jsx("div",{style:{width:c?c.width*m:"auto",height:c?c.height*m:"auto",margin:"0 auto"},children:f.jsx("div",{style:{transform:`scale(${m})`,transformOrigin:"top left"},children:k})}),s.status==="error"&&f.jsxs("div",{className:"w-full text-center my-4","data-testid":"mermaid-fallback",children:[f.jsxs("div",{className:"text-body text-warning mb-2 flex items-center justify-center gap-1.5",children:[f.jsx(vr,{className:"w-4 h-4 shrink-0"}),f.jsx("span",{children:r("artifact.mermaid.renderFailed")})]}),f.jsx("pre",{className:"text-label bg-surface-1/60 rounded p-2 overflow-x-auto text-ink-muted font-mono text-left",children:n.mermaid}),f.jsx("div",{className:"text-caption text-ink-muted mt-2",children:r("artifact.mermaid.errorPrefix",{msg:s.message})})]})]}),s.status==="rendered"&&f.jsx("div",{className:"mt-1.5 text-caption text-ink-muted flex items-center gap-2",children:f.jsx("span",{children:r("artifact.mermaid.hint")})}),p&&s.status==="rendered"&&f.jsx(Nl,{title:n.title,onClose:()=>g(!1),children:f.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:f.jsx(Ss,{testid:"mermaid-modal-stage",children:f.jsx(O4,{data:e,variant:"canvas"})})})}),n.warnings&&n.warnings.length>0&&f.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[f.jsx(vr,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),f.jsx("span",{children:n.warnings.join("; ")})]})]})}function j4({data:e,variant:t="card"}){const n=e,r=$e(),[a,i]=w.useState(null),[s,o]=w.useState(!1),l=w.useRef([]),u=w.useRef([]),c=n.code.split(`
|
|
778
|
+
`),h=g=>{if(a===null)return!1;const x=n.annotations[a];return x&&g>=x.lineStart&&g<=x.lineEnd},m=g=>{const x=a===g?null:g;if(i(x),x!==null){const b=n.annotations[x],v=(s?u:l).current[b.lineStart-1];v==null||v.scrollIntoView({behavior:"smooth",block:"center"})}},d=g=>f.jsx("div",{className:"bg-neutral-950 rounded-lg overflow-hidden border border-neutral-800 max-h-[420px] overflow-y-auto",children:f.jsx("pre",{className:"text-label font-mono leading-relaxed overflow-x-auto",children:f.jsx("code",{children:c.map((x,b)=>{const v=b+1;return f.jsxs("div",{ref:T=>{g.current[b]=T},className:`flex ${h(v)?"bg-brand/15":""}`,children:[f.jsx("span",{className:"select-none text-neutral-600 pr-3 pl-3 text-right w-10 shrink-0 border-r border-neutral-800 tabular-nums",children:v}),f.jsx("span",{className:"text-neutral-200 pl-3 whitespace-pre",children:x||" "})]},b)})})})}),p=f.jsxs("div",{className:"space-y-2",children:[f.jsx("div",{className:"text-caption font-bold text-ink-muted",children:r("artifact.codewalk.sectionLabel")}),n.annotations.map((g,x)=>f.jsxs("button",{onClick:()=>m(x),"data-testid":`annotation-${x}`,className:`w-full text-left p-2.5 rounded-lg border transition-colors ${a===x?"border-brand bg-brand/10":"border-[var(--border-faint)] hover:border-[var(--border)]"}`,children:[f.jsx("div",{className:"text-caption font-bold text-brand mb-0.5",children:g.lineEnd!==g.lineStart?r("artifact.codewalk.lineRange",{a:g.lineStart,b:g.lineEnd}):r("artifact.codewalk.lineSingle",{n:g.lineStart})}),f.jsx("div",{className:"text-body text-ink-muted leading-relaxed",children:g.note})]},x))]});return t==="canvas"?f.jsx("div",{className:"w-fit","data-testid":"codewalk-canvas-content",children:d(u)}):f.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-code-walkthrough",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2 mb-3",children:[f.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[f.jsx(Up,{className:"w-4 h-4 text-ink-muted shrink-0"}),f.jsx("h3",{className:"text-body font-bold text-ink truncate",children:n.title}),f.jsx("span",{className:"text-caption font-bold px-1.5 py-0.5 rounded bg-surface-3 text-ink-muted font-mono shrink-0",children:n.language})]}),f.jsx("button",{onClick:()=>o(!0),"data-testid":"codewalk-expand","aria-label":r("artifact.viewer.open"),"data-tooltip":r("artifact.viewer.open"),className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 flex items-center justify-center shrink-0",children:f.jsx(fs,{className:"w-3.5 h-3.5"})})]}),f.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:[f.jsx("div",{onClick:()=>{s||o(!0)},style:{touchAction:"pan-x pan-y"},"data-noswipe":"",children:d(l)}),p]}),n.warnings&&n.warnings.length>0&&f.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[f.jsx(vr,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),f.jsx("span",{children:n.warnings.join("; ")})]}),s&&f.jsx(Nl,{title:n.title,onClose:()=>o(!1),children:f.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:f.jsx(Ss,{testid:"codewalk-modal-stage",children:f.jsx(j4,{data:e,variant:"canvas"})})})})]})}function mM({data:e,onPickAction:t}){const n=e,r=$e(),[a,i]=w.useState(null),s=o=>{a||(i(o.id),t==null||t(`${r("guess.pickedPrefix")}${o.label}`))};return f.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-guess",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[f.jsx(Ty,{className:"w-4 h-4 text-accent"}),f.jsx("span",{className:"text-label font-bold text-accent",children:r("guess.header")})]}),f.jsx("div",{className:"text-body text-ink font-medium mb-3 leading-relaxed",children:n.prompt}),f.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 mb-2",children:n.options.map(o=>{const l=a===o.id,u=a!==null;return f.jsxs("button",{onClick:()=>s(o),disabled:u,"data-testid":`guess-option-${o.id}`,className:`text-body p-2.5 rounded-lg border-2 font-medium transition-colors text-left flex items-center justify-between gap-2 ${l?"border-accent bg-accent/10 text-accent":u?"border-[var(--border-faint)] text-ink-faint cursor-default":"border-[var(--border)] text-ink-muted hover:border-accent hover:text-accent cursor-pointer"}`,children:[f.jsx("span",{children:o.label}),l&&f.jsx(Tn,{className:"w-4 h-4 shrink-0"})]},o.id)})}),a&&f.jsx("div",{className:"text-label text-ink-muted mt-1","data-testid":"guess-picked-hint",children:r("guess.waitReveal")}),n.warnings&&n.warnings.length>0&&f.jsx("div",{className:"mt-2 text-caption text-warning","data-testid":"artifact-warnings",children:n.warnings.join("; ")})]})}function Dd({data:e,onQuizAnswered:t,quizMastery:n,onPickAction:r,onQuizCompleted:a,variant:i="card"}){const s=e;if(!s||!s.artifactType)return f.jsx(Qm,{data:e});switch(s.artifactType){case"concept_map":return f.jsx(D4,{data:e,variant:i});case"quiz":return f.jsx(cM,{data:e,onAnswered:t,quizMastery:n,onPickAction:r,onQuizCompleted:a});case"compare_table":return f.jsx(P4,{data:e,variant:i});case"diagram":return f.jsx(O4,{data:e,variant:i});case"code_walkthrough":return f.jsx(j4,{data:e,variant:i});case"guess":return f.jsx(mM,{data:e,onPickAction:r});default:return f.jsx(Qm,{data:e})}}function Qm({data:e}){var n;const t=$e();return f.jsxs("div",{className:"surface-card p-4 text-body text-ink-muted","data-testid":"artifact-unknown",children:[f.jsxs("div",{className:"font-bold mb-1 flex items-center gap-1.5",children:[f.jsx(Yp,{className:"w-4 h-4"}),t("artifact.unknownHeader")]}),f.jsx("pre",{className:"text-caption overflow-x-auto text-ink-muted",children:(n=JSON.stringify(e,null,2))==null?void 0:n.slice(0,200)})]})}const s0="lookatstudy-tts-settings-changed";function o0(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 Zm(e,t){if(e.length===0)return null;const n=t==null?void 0:t.trim();if(n){const i=e.find(s=>s.name===n);if(i)return i}const r=o0(e.filter(i=>i.default));return r.length>0&&pM(r[0].lang)?r[0]:o0(e)[0]??null}function pM(e){return e.toLowerCase().startsWith("zh")}function gM(e){return`${e.name} · ${e.lang}`}const xM=[["\\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","点点点"]],bM={alpha:"阿尔法",beta:"贝塔",gamma:"伽马",delta:"德尔塔",epsilon:"艾普西隆",zeta:"泽塔",eta:"伊塔",theta:"西塔",iota:"约塔",kappa:"卡帕",lambda:"拉姆达",mu:"缪",nu:"纽",xi:"克西",pi:"派",rho:"柔",sigma:"西格马",tau:"陶",phi:"斐",chi:"凯",psi:"普西",omega:"欧米伽"};function yM(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 Ci(e,t){const n=yM(e,t);return n||{body:e[t]??"",end:t+1}}function vM(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 a;for(;(a=r.indexOf("\\frac"))>=0;){const i=Ci(r,a+5),s=Ci(r,i.end);r=r.slice(0,a)+`${i.body} 分之 ${s.body} `+r.slice(s.end)}}{let a;for(;(a=r.indexOf("\\binom"))>=0;){const i=Ci(r,a+6),s=Ci(r,i.end);r=r.slice(0,a)+`${i.body} 取 ${s.body} `+r.slice(s.end)}}r=r.replace(/\\sqrt\s*\[( {[^{}]*} |[^\s\\]+)\s*\]\s*/g,(a,i)=>`${i.trim()} 次根号 `);{let a;for(;(a=r.indexOf("\\sqrt"))>=0;){const i=Ci(r,a+5);r=r.slice(0,a)+`根号 ${i.body} `+r.slice(i.end)}}if(r=r.replace(/\\(?:mathbf|mathbb|mathrm|mathit|boldsymbol|text|operatorname)\s*/g,a=>a.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,(a,i,s,o,l)=>s!==void 0?`${i} 的 ${s.replace(/[{}]/g,"")} 次方`:`${o} 下标 ${l.replace(/[{}]/g,"")}`);if(r===t)break;t=r}for(const[n,r]of xM)t=t.split(n).join(` ${r} `);return t=t.replace(/\\([A-Za-z]+)\b/g,(n,r)=>` ${bM[r]??r} `),t=t.replace(/[{}]/g," "),t.replace(/\s+/g," ").trim()}function wM(e){return e.replace(/\$\$([^$]+)\$\$|\$([^$]+)\$/g,(t,n,r)=>{const a=vM(n??r??"");return a?` ${a} `:""})}const Jm=new WeakMap;let B4=null;function ju(e){B4=e}function kM(){return B4}const F4=1024;function z4(e){let t=Jm.get(e);return t||(t=e.createAnalyser(),t.fftSize=F4,t.smoothingTimeConstant=.55,Jm.set(e,t)),t}function TM(e,t){try{const n=z4(e);t.connect(n),n.connect(e.destination)}catch{try{t.connect(e.destination)}catch{}}}const $a=1024,e1=512,EM=3500,SM=7500,AM=.3,CM=.16,NM=1400,MM=2800,Js=70,H4=new Float64Array($a);for(let e=0;e<$a;e++)H4[e]=.5*(1-Math.cos(2*Math.PI*e/($a-1)));function IM(e,t){const n=e.length;for(let r=1,a=0;r<n;r++){let i=n>>1;for(;a&i;i>>=1)a^=i;if(a|=i,r<a){const s=e[r];e[r]=e[a],e[a]=s;const o=t[r];t[r]=t[a],t[a]=o}}for(let r=2;r<=n;r<<=1){const a=-2*Math.PI/r,i=Math.cos(a),s=Math.sin(a),o=r>>1;for(let l=0;l<n;l+=r){let u=1,c=0;for(let h=0;h<o;h++){const m=e[l+h],d=t[l+h],p=e[l+h+o],g=t[l+h+o],x=p*u-g*c,b=p*c+g*u;e[l+h]=m+x,t[l+h]=d+b,e[l+h+o]=m-x,t[l+h+o]=d-b;const v=u*i-c*s;c=u*s+c*i,u=v}}}}function _M(e,t){const n=e.length;let r=0;const a=new Float64Array(n),i=new Float64Array(n);for(let g=0;g<n;g++){const x=e[g];r+=Math.abs(x),a[g]=x*H4[g]}IM(a,i);const s=n>>1,o=t/n,l=new Float64Array(s);let u=0,c=0,h=0,m=0,d=0,p=0;for(let g=0;g<s;g++){const x=g*o;if(x>=t/2-o)break;const b=Math.hypot(a[g],i[g])/s;l[g]=b,u+=b,x>=EM&&x<SM&&(c+=b),x>=gh.lo&&x<gh.hi?(h+=b,m+=b*x):x>=xh.lo&&x<xh.hi&&(d+=b,p+=b*x)}return{level:n>0?Math.min(1,r/n/.22):0,f1:h>0?m/h:400,f2:d>0?p/d:800,hfRatio:u>0?c/u:0}}function RM(e,t){return e.level<=F3?"closed":e.hfRatio>=AM?"SS":e.hfRatio>=CM&&e.level<.45?"FV":t==="closed"&&e.f2>=NM&&e.f2<=MM?"L":z3(e.f1,e.f2,e.level)}function LM(e,t){const n=[],r=(c,h,m,d)=>{if(h<=0)return;const p=n[n.length-1];if(p&&p.viseme===m&&Math.abs(p.t+p.dur-c)<1e-9){p.dur+=h,p.level=Math.max(p.level,d);return}n.push({t:c,dur:h,viseme:m,level:d})};if(e.length<$a)return{cues:[{t:0,dur:Math.max(0,e.length/t),viseme:"closed",level:0}],duration:Math.max(0,e.length/t)};let a="closed";const i=e1/t;for(let c=0;c+$a<=e.length;c+=e1){const h=e.subarray(c,c+$a),m=_M(h,t),d=RM(m,a);r(c/t,i,d,m.level),a=d}const s=e.length/t,o=n.length>0?n[n.length-1].t+n[n.length-1].dur:0;o<s-1e-9&&r(o,s-o,"closed",0);const l=n[0];if(l&&l.viseme!=="closed")if(l.dur<=Js/1e3)l.viseme="closed";else{const c=Math.min(l.dur*.5,Js/1e3);l.dur-=c,l.t+=c,n.unshift({t:0,dur:c,viseme:"closed",level:0})}const u=n[n.length-1];if(u&&u.viseme!=="closed"){const c=Math.min(u.dur*.5,Js/1e3);u.dur-=c,n.push({t:u.t+u.dur,dur:c,viseme:"closed",level:0})}for(let c=n.length-1;c>=1;c--){const h=n[c];if(h.viseme!=="closed"&&h.dur<Js/1e3){const m=n[c-1];m.dur+=h.dur,n.splice(c,1)}}return{cues:n,duration:s}}function DM(e){const t=[...e].filter(a=>a.dur>0&&Number.isFinite(a.t)).sort((a,i)=>a.t-i.t),n=[];let r=0;for(const a of t){const i=Math.max(0,a.t/1e3),s=a.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===a.viseme&&Math.abs(o.t+o.dur-i)<1e-9?(o.dur+=s,o.level=Math.max(o.level,Math.min(1,Math.max(0,a.level)))):n.push({t:i,dur:s,viseme:a.viseme,level:Math.min(1,Math.max(0,a.level))}),r=i+s}return{cues:n,duration:r}}function PM(e,t){const n=e.cues;if(n.length===0||t<0)return null;let r=0,a=n.length-1;for(;r<a;){const s=r+a+1>>1;n[s].t<=t?r=s:a=s-1}const i=n[r];return t<=i.t+i.dur+1e-9?i:null}function U4(){const[e,t]=w.useState(null),[n,r]=w.useState(null),[a,i]=w.useState(null),[s,o]=w.useState([]),l=w.useRef([]),[u,c]=w.useState(null),[h,m]=w.useState(!1),d=w.useRef(null),p=w.useRef(new Map),g=w.useRef(new Map),x=w.useRef(0),b=w.useRef(!1),v=w.useRef([]),T=w.useRef(0),N=w.useRef(0),k=w.useRef(!1),A=w.useRef(null),_=w.useRef(0),S=w.useRef(null),I=w.useRef(null),C=w.useRef(null);C.current||(C.current=()=>{const q=I.current,Z=typeof window<"u"?window.speechSynthesis:void 0;if(!q||q.stopped||!Z)return;if(q.i>=q.sentences.length){I.current=null,A.current=null,t(null),r(null),i(null);return}const B=q.i,Q=wM(q.sentences[B]),ne=new SpeechSynthesisUtterance(Q);q.voice&&(ne.voice=q.voice,ne.lang=q.voice.lang),ne.rate=q.rate,ne.onstart=()=>{!I.current||I.current.stopped||i({index:B,total:q.sentences.length,text:Q})};const j=()=>{var re;!I.current||I.current.stopped||(I.current.i+=1,(re=C.current)==null||re.call(C))};ne.onend=j,ne.onerror=j,Z.speak(ne)});const D=w.useCallback((q,Z)=>{var j;if(typeof window>"u"||!("speechSynthesis"in window)){c("engine-unavailable");return}const B=WN(Z);if(B.length===0){c("empty-text");return}l.current=B.slice(),o(B.slice()),_.current=B.length,r({index:0,total:B.length,text:B[0]??""});const Q=S.current,ne=Zm(window.speechSynthesis.getVoices(),(Q==null?void 0:Q.systemVoice)??null);I.current={messageId:q,sentences:B,i:0,stopped:!1,voice:ne,rate:t1(Q==null?void 0:Q.speed)},window.speechSynthesis.cancel(),(j=C.current)==null||j.call(C)},[]),L=()=>{if(!d.current){const q=window.AudioContext??window.webkitAudioContext;d.current=new q}return d.current.resume(),d.current},F=w.useCallback(()=>{k.current&&N.current>=T.current&&!b.current&&(A.current=null,t(null),r(null),i(null))},[]),O=w.useCallback(()=>{const q=d.current;if(!q||b.current)return;const Z=p.current.get(x.current);if(!Z){F();return}const B=x.current;p.current.delete(B),b.current=!0,i({index:B,total:_.current,text:l.current[B]??""}),x.current+=1;const Q=q.createBufferSource();Q.buffer=Z,TM(q,Q),ju({ctx:q,timeline:g.current.get(B)??null,startedAtCtxTime:q.currentTime,analyser:z4(q)}),Q.onended=()=>{N.current+=1,b.current=!1,ju(null),O()},v.current.push(Q),Q.start()},[F]),R=w.useCallback(()=>{for(const q of v.current)try{q.onended=null,q.stop()}catch{}v.current=[],p.current.clear(),g.current.clear(),ju(null),b.current=!1,T.current=0,N.current=0,k.current=!1,A.current=null,x.current=0,_.current=0,l.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(()=>{R(),window.api.ttsStop().catch(()=>{})},[R]),V=w.useCallback((q,Z)=>{var B;if(A.current===q){H();return}if(R(),window.dispatchEvent(new CustomEvent("lookatstudy-speech-start",{detail:q})),c(null),A.current=q,T.current=0,N.current=0,k.current=!1,x.current=0,_.current=0,t(q),r({index:0,total:0,text:""}),((B=S.current)==null?void 0:B.engine)==="system"){D(q,Z);return}L(),window.api.ttsSpeak(Z,q).then(Q=>{if(Q.ok){Q.firstUse&&m(!0);return}R(),Q.reason!=="empty-text"&&c(Q.reason)}).catch(()=>R())},[D,H,R]);return w.useEffect(()=>{const q=window.api.on("speech:ttsAudio",Q=>{if(Q.messageId!==A.current)return;const ne=L();T.current+=1,_.current=Q.sentenceTotal,r({index:Q.sentenceIndex,total:Q.sentenceTotal,text:Q.sentence??""}),Q.sentence!=null&&(l.current[Q.sentenceIndex]=Q.sentence,o(l.current.slice())),ne.decodeAudioData(Q.wavBytes).then(j=>{var re;if(Q.messageId===A.current){p.current.set(Q.sentenceIndex,j);try{const K=(re=Q.visemeCues)!=null&&re.length?DM(Q.visemeCues):LM(OM(j),j.sampleRate);K&&g.current.set(Q.sentenceIndex,K)}catch{}O()}},()=>{Q.messageId===A.current&&(T.current-=1,O())})}),Z=window.api.on("speech:ttsDone",Q=>{Q.messageId===A.current&&(k.current=!0,F())}),B=window.api.on("speech:ttsError",()=>R());return()=>{q(),Z(),B()}},[F,O,R]),w.useEffect(()=>R,[R]),w.useEffect(()=>{const q=Z=>{const B=Z.detail;A.current&&B!==A.current&&R()};return window.addEventListener("lookatstudy-speech-start",q),()=>window.removeEventListener("lookatstudy-speech-start",q)},[R]),w.useEffect(()=>{let q=!0;const Z=()=>{Promise.all([window.api.getSetting("tts_engine"),window.api.getSetting("tts_system_voice"),window.api.getSetting("tts_speed")]).then(([B,Q,ne])=>{q&&(S.current={engine:(B??"").trim(),systemVoice:Q??null,speed:t1(ne)})}).catch(()=>{})};return Z(),window.addEventListener(s0,Z),()=>{q=!1,window.removeEventListener(s0,Z)}},[]),w.useEffect(()=>{if(typeof window>"u"||!("speechSynthesis"in window))return;const q=()=>{var B;const Z=I.current;!Z||Z.voice||(Z.voice=Zm(window.speechSynthesis.getVoices(),((B=S.current)==null?void 0:B.systemVoice)??null))};return window.speechSynthesis.addEventListener("voiceschanged",q),()=>window.speechSynthesis.removeEventListener("voiceschanged",q)},[]),w.useEffect(()=>{H3(e!==null)},[e]),{speakingMessageId:e,speakingSentence:n,playingSentence:a,streamTexts:s,failReason:u,clearFailReason:()=>c(null),onlineNotice:h,clearOnlineNotice:()=>m(!1),speak:V,stop:H}}function OM(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 a=0;a<t.length;a++)r[a]=(t[a]+n[a])/2;return r}function t1(e){const t=typeof e=="number"?e:Number.parseFloat(e??"");return Number.isFinite(t)?Math.min(2,Math.max(.5,t)):1}const q4=w.createContext(null);let jM=0;const BM={default:4e3,success:4e3,info:4e3,warning:5e3,error:6e3},FM={default:null,success:f.jsx(Wn,{className:"w-4 h-4 text-brand shrink-0"}),error:f.jsx(mc,{className:"w-4 h-4 text-warning shrink-0"}),warning:f.jsx(vr,{className:"w-4 h-4 text-review shrink-0"}),info:f.jsx(Iy,{className:"w-4 h-4 text-accent shrink-0"})};function zM({children:e}){const[t,n]=w.useState([]),r=w.useCallback(s=>{n(o=>o.filter(l=>l.id!==s))},[]),a=w.useCallback(s=>{n(o=>o.map(l=>l.id===s?{...l,exiting:!0}:l))},[]),i=w.useCallback((s,o)=>{const l=++jM,u=(o==null?void 0:o.severity)??"default",c=(o==null?void 0:o.duration)??BM[u],h={id:l,message:s,action:o==null?void 0:o.action,duration:c,severity:u,exiting:!1};n(m=>[...m,h]),window.setTimeout(()=>a(l),c)},[a]);return f.jsxs(q4.Provider,{value:{show:i},children:[e,f.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(s=>f.jsx(HM,{item:s,onAction:()=>{s.action.onClick(),a(s.id)},onDismiss:()=>a(s.id),onExitDone:()=>r(s.id)},s.id))})]})}function HM({item:e,onAction:t,onDismiss:n,onExitDone:r}){const a=$e(),i=FM[e.severity];return f.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,f.jsx("span",{className:"flex-1",children:e.message}),e.action&&f.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}),f.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":a("action.close"),children:f.jsx(Bn,{className:"w-3.5 h-3.5"})})]})}function Pd(){const e=w.useContext(q4);return e||{show:()=>{}}}const UM={concept_map:q0,quiz:z0,compare_table:Kp,diagram:Ay,code_walkthrough:Up},qM=new Set(["concept_map","quiz","compare_table","diagram","code_walkthrough"]);function VM(e,t){return qM.has(t)?e(`artifact.type.${t}`):e("artifact.type.unknown")}function $M({selectedNode:e,items:t,loading:n,forceTab:r,canvasArtifact:a,isReviewing:i,onReviewDone:s,onUserTabChange:o,onRemove:l,onTogglePin:u,onRecordQuizResult:c,onSaveContentNote:h,onUpdateNoteComment:m,onJumpToSource:d,onQuoteToChat:p,locale:g}){var _;const x=$e(),[b,v]=w.useState("content"),T=r??b,N=S=>{v(S),o==null||o()},k=e?t.filter(S=>S.nodeId===e.id):[],A=w.useRef(null);return w.useEffect(()=>{var S;(S=A.current)==null||S.scrollTo({top:0})},[e==null?void 0:e.id]),f.jsxs("div",{className:"relative h-full flex flex-col bg-surface-2","data-testid":"notebook-panel",children:[f.jsx("div",{className:"px-3 pt-3 pb-1 shrink-0","data-testid":"notebook-tabs",children:f.jsxs("div",{className:"flex p-1 rounded-lg gap-1 bg-ink/[0.08]",role:"tablist","aria-label":"Notebook",children:[f.jsx(Hu,{label:x("notebook.tab.explain"),icon:sr,active:T==="content",onClick:()=>N("content"),testid:"tab-content"}),f.jsx(Hu,{label:x("notebook.tab.notes"),icon:jy,active:T==="notes",onClick:()=>{N("notes"),jp()},testid:"tab-notes",badge:k.length>0?String(k.length):void 0}),f.jsx(Hu,{label:x("notebook.tab.board"),icon:Hl,active:T==="board",onClick:()=>N("board"),testid:"tab-board"})]})}),f.jsx("div",{className:"flex-1 overflow-y-auto min-h-0 animate-tab-slide",ref:A,role:"tabpanel",children:T==="board"?f.jsx("div",{className:"h-full flex flex-col","data-testid":"board-tab-content",children:a?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"px-4 pt-3 pb-2 shrink-0 flex items-center gap-2 min-w-0",children:[f.jsx(Hl,{className:"w-4 h-4 text-ink-muted shrink-0"}),f.jsx("span",{className:"text-label font-bold text-ink truncate",children:((_=a.output)==null?void 0:_.title)??a.toolName})]}),f.jsx("div",{className:"flex-1 min-h-0 px-2 pb-2",children:f.jsx("div",{className:"h-full rounded-xl overflow-hidden bg-surface-0/60 border border-[var(--border-faint)]",children:f.jsx(Ss,{testid:"board-canvas-stage",children:f.jsx(Dd,{data:a.output,variant:"canvas"})})})})]}):f.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center px-6",children:[f.jsx(Hl,{className:"w-10 h-10 mb-3 text-ink-muted opacity-30"}),f.jsx("div",{className:"text-body text-ink-muted max-w-sm leading-relaxed",children:x("notebook.board.empty")})]})}):f.jsx(f.Fragment,{children:f.jsx("div",{className:"mx-auto w-full max-w-[960px] min-h-full flex flex-col",children:T==="content"?f.jsx(WM,{selectedNode:e,contentNotes:k.filter(S=>S.artifactType==="user_note"&&S.sourceAnchor),onQuoteToChat:p,onSaveContentNote:h,locale:g,isReviewing:i,onReviewDone:s}):f.jsx(GM,{items:k,loading:n,selectedNode:e,onRemove:l,onTogglePin:u,onRecordQuizResult:c,onUpdateNoteComment:m,onJumpToSource:d})})})},T)]})}function WM({selectedNode:e,contentNotes:t,onQuoteToChat:n,onSaveContentNote:r,locale:a,isReviewing:i,onReviewDone:s}){const o=$e(),l=Pd(),u=U4();w.useEffect(()=>{if(u.failReason){const F=u.failReason==="engine-unavailable"?"chat.speech.engine_unavailable":u.failReason==="azure-key-missing"?"chat.speech.azure_key_missing":u.failReason==="azure-region-missing"?"chat.speech.azure_region_missing":u.failReason==="edge-failed"?"chat.speech.edge_failed":"chat.speech.model_missing";l.show(o(F),{severity:"warning"}),u.clearFailReason()}else u.onlineNotice&&(l.show(o("chat.speech.edge_disclosed"),{severity:"info"}),u.clearOnlineNotice())},[u.failReason,u.onlineNotice,l,o,u]);const c=w.useRef(u.stop);c.current=u.stop;const h=e?`content-${e.id}`:null;w.useEffect(()=>()=>{c.current()},[h]);const[m,d]=w.useState(null),[p,g]=w.useState(!1),[x,b]=w.useState(!1),[v,T]=w.useState([]),[N,k]=w.useState(null),A=w.useRef(null),_=w.useRef(null);w.useEffect(()=>{if(!e){d(null),b(!1);return}let F=!1;return g(!0),b(!1),ae.getNodeContent(e.id,a??void 0).then(O=>{F||d(O)}).catch(()=>{F||(d(null),b(!0))}).finally(()=>{F||g(!1)}),()=>{F=!0}},[e==null?void 0:e.id,a]),w.useEffect(()=>{if(!e){T([]);return}let F=!1;return ae.listAssetsByNode(e.id).then(O=>{F||T(O)}).catch(()=>{F||T([])}),()=>{F=!0}},[e==null?void 0:e.id]),w.useEffect(()=>{if(!m||!A.current)return;const F=[];for(const R of t)try{const H=JSON.parse(R.sourceAnchor);if(H.type==="content"){const V=JSON.parse(R.data).text??"";V&&F.push({noteId:R.id,text:V,surrounding:H.surroundingText})}}catch{}const O=setTimeout(()=>{_.current&&w4(_.current,F)},80);return()=>clearTimeout(O)},[m,t]),w.useEffect(()=>{const F=O=>{var V;const R=O.detail;if(!R)return;const H=(V=_.current)==null?void 0:V.querySelector(`mark[data-note-id="${R}"]`);H&&M4(H)};return window.addEventListener("lookatstudy-jump-to-note",F),()=>window.removeEventListener("lookatstudy-jump-to-note",F)},[]);const S=u.speakingMessageId===h&&u.playingSentence!=null?u.playingSentence.index:null;w.useEffect(()=>{const F=_.current;if(!F)return;if(S==null){xa(F);return}const O=_4(u.streamTexts,S);if(!O)return;S===0&&A4(F);const R=setTimeout(()=>{const H=C4(F,O);H&&N4(H,F.closest(".overflow-y-auto"))},30);return()=>clearTimeout(R)},[S,u.streamTexts,h]),w.useEffect(()=>{S==null&&_.current&&xa(_.current)},[S]);const I=w.useRef(!1);I.current=S!=null,w.useEffect(()=>()=>{I.current&&xa(document.body)},[]);const C=w.useCallback(()=>{var re;if(!n&&!r)return;const F=window.getSelection(),O=(F==null?void 0:F.toString().trim())??"";if(O.length<2||O.length>500){k(null);return}const R=F==null?void 0:F.getRangeAt(0);if(!R||!((re=A.current)!=null&&re.contains(R.commonAncestorContainer))){k(null);return}const H=R.getBoundingClientRect(),V=A.current.getBoundingClientRect(),q=_.current;let Z=null;if(q&&q.contains(R.commonAncestorContainer)){const K=os(q);Z=x4(R,K)}const B=q?os(q).text:O,Q=Z?Z.start:B.indexOf(O),ne=Q>=0?B.slice(Math.max(0,Q-30),Q+O.length+30):O,j=R4({left:H.left-V.left,top:H.top-V.top,right:H.right-V.left,bottom:H.bottom-V.top,width:H.width,height:H.height},V.width,n?150:100);k({x:j.left,y:j.top,transform:j.transform,text:O,surrounding:ne,offsets:Z??void 0})},[n,r]);w.useEffect(()=>{let F=null,O=null;const R=()=>{F||(F=setTimeout(()=>{var V;F=null,(((V=window.getSelection())==null?void 0:V.toString().trim().length)??0)>=2?(O&&(clearTimeout(O),O=null),C()):O||(O=setTimeout(()=>k(q=>q&&null),250))},80))};return document.addEventListener("selectionchange",R),()=>{document.removeEventListener("selectionchange",R),F&&clearTimeout(F),O&&clearTimeout(O)}},[C]);const D=w.useCallback(()=>{var O;if(!N||!n)return;const F=N.text.length>200?N.text.slice(0,200)+"…":N.text;n(o("notebook.quote.template",{text:F})),k(null),(O=window.getSelection())==null||O.removeAllRanges()},[N,n,o]),L=w.useCallback(()=>{var O,R,H;if(!N||!r||!e)return;const F=N.text.length>200?N.text.slice(0,200)+"…":N.text;r(F,{type:"content",surroundingText:N.surrounding,startOffset:(O=N.offsets)==null?void 0:O.start,endOffset:(R=N.offsets)==null?void 0:R.end}),jp(),setTimeout(()=>{var Z;const V=(Z=_.current)==null?void 0:Z.querySelectorAll("mark.lookatstudy-underline"),q=V&&V.length>0?V[V.length-1]:null;q&&FN(q)},200),k(null),(H=window.getSelection())==null||H.removeAllRanges()},[N,r,e]);return e?f.jsxs("div",{className:"p-5 relative","data-testid":"node-content",ref:A,onMouseUp:C,children:[!p&&!x&&m&&f.jsx("div",{className:"sticky top-0 z-20 flex justify-end -mt-2 pointer-events-none",children:f.jsx("button",{onClick:()=>u.speak(h??"content",m),"data-tooltip":u.speakingMessageId===h?o("chat.speech.stop"):o("chat.speech.read_aloud_node"),"aria-label":u.speakingMessageId===h?o("chat.speech.stop"):o("chat.speech.read_aloud_node"),"data-testid":u.speakingMessageId===h?"node-content-speak-active":"node-content-speak",className:`pointer-events-auto shrink-0 rounded-full p-2 bg-surface-2 shadow-elevated transition-colors ${u.speakingMessageId===h?"text-brand animate-pulse":"text-ink-muted hover:text-ink-strong"}`,children:u.speakingMessageId===h?f.jsx(V0,{className:"w-4 h-4"}):f.jsx(Qp,{className:"w-4 h-4"})})}),f.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")}),f.jsx("div",{className:"flex items-start justify-between gap-3 mb-4",children:f.jsx("h2",{className:"text-title font-extrabold text-ink-strong tracking-tight","data-testid":"node-content-title",children:e.title})}),p?f.jsxs("div",{className:"text-body text-ink-muted flex items-center gap-2",children:[f.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),o("notebook.content.loading")]}):x?f.jsxs("div",{className:"text-body text-warning",children:[o("notebook.content.load_failed"),f.jsx("button",{className:"underline ml-1",onClick:()=>{b(!1),g(!0),ae.getNodeContent(e.id,a??void 0).then(d).catch(()=>b(!0)).finally(()=>g(!1))},children:o("notebook.content.retry")})]}):m?f.jsx(MN,{fallback:(F,O)=>f.jsxs("div",{className:"prose prose-sm max-w-[80ch] leading-relaxed [&_pre]:max-w-full [&_pre]:overflow-x-auto",children:[f.jsx("div",{className:"text-body text-warning mb-2",children:o("notebook.content.render_failed")}),f.jsxs("pre",{className:"text-caption text-ink-muted whitespace-pre-wrap break-words bg-surface-1 p-3 rounded",children:[m.slice(0,500),m.length>500?`
|
|
779
|
+
`+o("notebook.content.truncated"):""]}),f.jsx("div",{className:"flex gap-2 mt-2",children:f.jsx("button",{className:"text-caption underline text-accent",onClick:O,children:o("notebook.content.retry_render")})})]}),children:f.jsx("div",{ref:_,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:f.jsx(Kg,{remarkPlugins:[w2,k2],rehypePlugins:[d4,[p4,g4],Ix],urlTransform:F=>F,components:{a({children:F,...O}){return f.jsx("a",{...O,target:"_blank",rel:"noopener noreferrer",children:F})},img({src:F,alt:O,...R}){return f.jsx(YM,{src:F,alt:O,assets:v,...R})},table({children:F}){return f.jsx("div",{className:"overflow-x-auto my-4",children:f.jsx("table",{children:F})})}},children:I4(m)})})},`${e.id}-${a??"orig"}`):f.jsx("div",{className:"text-body text-ink-muted",children:o("notebook.content.empty")}),v.length>0&&f.jsxs("div",{className:"mt-6 pt-4 border-t border-[var(--border-faint)]",children:[f.jsxs("div",{className:"text-label font-bold text-ink-muted mb-2 flex items-center gap-1",children:[f.jsx(My,{className:"w-3.5 h-3.5"}),f.jsx("span",{children:o("notebook.images.heading",{n:v.length})})]}),f.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:v.map(F=>f.jsx(KM,{asset:F},F.id))})]}),N&&f.jsxs("div",{style:{left:N.x,top:N.y,transform:N.transform},className:"absolute z-20 flex items-center gap-0.5 msg-enter",children:[n&&f.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:[f.jsx(Gp,{className:"w-3 h-3"}),o("notebook.quote.ask")]}),f.jsxs("button",{onClick:L,"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:[f.jsx(Ji,{className:"w-3.5 h-3.5"}),o("notebook.quote.add_note")]})]}),e.sourcePath&&f.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})}),f.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:[f.jsx(Co,{className:"w-3.5 h-3.5 shrink-0 mt-0.5 text-accent"}),f.jsx("span",{children:o("notebook.quote.hint")})]}),i&&e&&f.jsx(IN,{nodeId:e.id,onRated:s})]}):f.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center px-6",children:[f.jsx("div",{className:"text-4xl mb-3 opacity-30",children:"📖"}),f.jsx("div",{className:"text-body text-ink-muted max-w-xs",children:o("notebook.empty.select_node")})]})}function GM({items:e,loading:t,selectedNode:n,onRemove:r,onTogglePin:a,onRecordQuizResult:i,onUpdateNoteComment:s,onJumpToSource:o}){const l=$e();if(!n)return f.jsx(n1,{message:l("notebook.empty.notes.title"),icon:"📓"});if(t)return f.jsxs("div",{className:"flex-1 flex items-center justify-center gap-2 text-body text-ink-muted",children:[f.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),l("notebook.empty.notes.title")]});const u=e.filter(g=>["concept_map","compare_table","diagram","code_walkthrough"].includes(g.artifactType)),c=e.filter(g=>g.artifactType==="user_note"),h=e.filter(g=>g.artifactType==="quiz"),m=e.length,d=h.filter(g=>g.lastResult==="correct").length,p=h.filter(g=>g.lastResult==="wrong").length;return m===0?f.jsx(n1,{message:l("notebook.empty.no_notes_message"),icon:"🧩"}):f.jsxs("div",{className:"p-4 space-y-3","data-testid":"notes-list",children:[f.jsx(Bu,{title:l("notebook.zone.understand"),icon:f.jsx(q0,{className:"w-4 h-4"}),subtitle:l("notebook.zone.understand.subtitle"),count:u.length,testid:"zone-understand",defaultOpen:!1,children:u.length===0?f.jsx(Fu,{hint:l("notebook.zone.understand.empty_hint")}):u.map(g=>f.jsx(zu,{item:g,onRemove:r,onTogglePin:a,onRecordQuizResult:i,onUpdateNoteComment:s,onJumpToSource:o},g.id))}),f.jsx(Bu,{title:l("notebook.zone.note"),icon:f.jsx(Ji,{className:"w-4 h-4"}),subtitle:l("notebook.zone.note.subtitle"),count:c.length,testid:"zone-note",defaultOpen:!1,children:c.length===0?f.jsx(Fu,{hint:l("notebook.zone.note.empty_hint")}):c.map(g=>f.jsx(zu,{item:g,onRemove:r,onTogglePin:a,onRecordQuizResult:i,onUpdateNoteComment:s,onJumpToSource:o},g.id))}),f.jsx(Bu,{title:l("notebook.zone.practice"),icon:f.jsx(z0,{className:"w-4 h-4"}),subtitle:h.length>0?l("notebook.zone.practice.subtitle_stats",{total:h.length,correct:d,wrong:p}):l("notebook.zone.practice.subtitle_empty"),count:h.length,testid:"zone-practice",defaultOpen:!1,children:h.length===0?f.jsx(Fu,{hint:l("notebook.zone.practice.empty_hint")}):h.map(g=>f.jsx(zu,{item:g,onRemove:r,onTogglePin:a,onRecordQuizResult:i,onUpdateNoteComment:s,onJumpToSource:o},g.id))})]})}function Bu({title:e,icon:t,subtitle:n,count:r,testid:a,defaultOpen:i=!0,children:s}){const[o,l]=w.useState(i),u=w.useRef(!0),c=w.useRef(r);return w.useEffect(()=>{if(u.current){u.current=!1,c.current=r;return}r>c.current&&l(!0),c.current=r},[r]),f.jsxs("section",{className:"rounded-xl bg-surface-1 overflow-hidden","data-testid":a,children:[f.jsxs("button",{onClick:()=>l(h=>!h),"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":`${a}-toggle`,children:[f.jsx(F0,{className:`w-4 h-4 text-ink-muted transition-transform duration-200 ease-out-back ${o?"":"-rotate-90"}`}),f.jsx("span",{className:"text-body text-ink-strong flex items-center",children:t}),f.jsx("span",{className:"text-body font-bold text-ink",children:e}),f.jsx("span",{className:"text-caption font-bold px-1.5 py-0.5 rounded-full bg-brand/15 text-brand",children:r}),f.jsx("span",{className:"text-label text-ink-muted ml-auto truncate",children:n})]}),f.jsx("div",{className:"grid transition-all duration-200 ease-out-expo",style:{gridTemplateRows:o?"1fr":"0fr"},children:f.jsx("div",{className:"overflow-hidden",children:f.jsx("div",{className:"p-3 space-y-3",children:s})})})]})}function Fu({hint:e}){return f.jsx("div",{className:"text-center py-3 text-body text-ink-muted",children:e})}function zu({item:e,onRemove:t,onTogglePin:n,onRecordQuizResult:r,onUpdateNoteComment:a,onJumpToSource:i}){const s=$e(),[o,l]=w.useState(!1),[u,c]=w.useState(e.notes??""),h=w.useCallback((T,N,k)=>{e.nodeId&&ae.recordQuizAnswer(e.nodeId,k).catch(()=>{}),r(e.id,k)},[e.nodeId,e.id,r]),m=e.artifactType==="user_note";let d="",p=null;if(m){try{d=JSON.parse(e.data).text??""}catch{d=e.title??""}try{e.sourceAnchor&&(p=JSON.parse(e.sourceAnchor))}catch{p=null}}let g=null;if(!m)try{g=JSON.parse(e.data)}catch{g=null}const x=new Date(e.createdAt),b=`${x.getMonth()+1}/${x.getDate()} ${x.getHours().toString().padStart(2,"0")}:${x.getMinutes().toString().padStart(2,"0")}`;if(m){const T=e.notes&&e.notes.trim().length>0?e.notes:null,N=()=>{c(T??""),l(!0)},k=()=>{c(T??""),l(!1)},A=()=>{a==null||a(e.id,u),l(!1)};return f.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:f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx(Uy,{className:"w-4 h-4 text-accent shrink-0 mt-0.5"}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"text-body text-ink leading-relaxed whitespace-pre-wrap",children:d}),a&&o?f.jsxs("div",{className:"mt-2 space-y-1.5","data-testid":`note-comment-edit-${e.id.slice(0,8)}`,children:[f.jsx("textarea",{value:u,onChange:_=>c(_.target.value),rows:2,placeholder:s(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)}`}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("button",{onClick:A,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:[f.jsx(Tn,{className:"w-3 h-3"})," ",s("notebook.action.save")]}),f.jsxs("button",{onClick:k,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:[f.jsx(Bn,{className:"w-3 h-3"})," ",s("notebook.action.cancel")]})]})]}):T?f.jsxs("div",{className:"mt-2 px-2.5 py-1.5 rounded-lg bg-ink/5",children:[f.jsx("div",{className:"text-label text-ink-muted italic leading-relaxed whitespace-pre-wrap",children:T}),a&&f.jsxs("button",{onClick:N,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:s("notebook.note.edit_comment"),children:[f.jsx(Ji,{className:"w-2.5 h-2.5"})," ",s("notebook.note.edit_comment")]})]}):a?f.jsxs("button",{onClick:N,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:s("notebook.note.add_comment"),children:[f.jsx(Ji,{className:"w-2.5 h-2.5"})," ",s("notebook.note.add_comment")]}):null,p&&i&&f.jsx("button",{onClick:()=>i(p,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:p.type==="content"?f.jsxs(f.Fragment,{children:[f.jsx(sr,{className:"w-3 h-3"}),s("notebook.source.jump_content")]}):f.jsxs(f.Fragment,{children:[f.jsx(Gp,{className:"w-3 h-3"}),s("notebook.source.jump_chat")]})}),f.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[f.jsx("span",{className:"text-caption text-ink-muted",children:b}),f.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:s("notebook.note.delete"),children:f.jsx(gc,{className:"w-3 h-3"})})]})]})]})})}const v=UM[e.artifactType]??Yp;return f.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:[f.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[f.jsx("span",{className:"text-body inline-flex items-center text-ink-strong",children:f.jsx(v,{className:"w-4 h-4"})}),f.jsx("span",{className:"text-label font-bold text-ink-muted flex-1 truncate",children:e.title??VM(s,e.artifactType)}),e.artifactType==="quiz"&&e.lastResult&&f.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"?s("notebook.quiz.last_correct"):s("notebook.quiz.last_wrong")}),e.pinned?f.jsxs("span",{className:"text-caption text-brand font-bold flex items-center gap-0.5",children:[f.jsx(Nh,{className:"w-2.5 h-2.5"}),s("notebook.note.pinned")]}):null,f.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?s("notebook.note.unpin"):s("notebook.note.pin"),children:f.jsx(Nh,{className:"w-3 h-3"})}),f.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:s("notebook.note.delete"),children:f.jsx(gc,{className:"w-3 h-3"})})]}),f.jsx("div",{className:"text-label",children:g?f.jsx(Dd,{data:g,onQuizAnswered:h}):f.jsx("div",{className:"text-ink-muted",children:s("notebook.artifact.broken")})}),f.jsx("div",{className:"text-caption text-ink-muted mt-2",children:b})]})}function n1({message:e,icon:t}){return f.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center px-6","data-testid":"empty-notebook",children:[f.jsx("div",{className:"text-4xl mb-3 opacity-30",children:t}),f.jsx("div",{className:"text-body text-ink-muted max-w-xs leading-relaxed",children:e})]})}function Hu({label:e,icon:t,active:n,onClick:r,testid:a,badge:i}){return f.jsxs("button",{onClick:r,"data-testid":a,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:[f.jsx(t,{className:"w-3 h-3"}),f.jsx("span",{children:e}),i&&f.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 YM({src:e,alt:t,assets:n,...r}){const[a,i]=w.useState(null),s=e??"",o=w.useMemo(()=>{if(!s||s.startsWith("http")||s.startsWith("data:"))return null;const u=s.split("/").pop()??s;return n.find(c=>{var h;return(h=c.sourcePath)==null?void 0:h.endsWith(u)})??n.find(c=>c.filename===u)??null},[s,n]);if(w.useEffect(()=>{if(!o){i(null);return}let u=!1;return ae.getAssetDataUrl(o.id).then(c=>{u||i(c)}),()=>{u=!0}},[o]),!s)return null;const l=a??s;return f.jsx("img",{src:l,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 KM({asset:e}){const t=$e(),[n,r]=w.useState(null),[a,i]=w.useState(!1);return w.useEffect(()=>{let s=!1;return ae.getAssetDataUrl(e.id).then(o=>{s||r(o)}),()=>{s=!0}},[e.id]),f.jsxs(f.Fragment,{children:[f.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?f.jsx("img",{src:n,alt:e.altText??e.filename,"data-asset-id":e.id,className:"w-full h-24 object-cover",loading:"lazy"}):f.jsx("div",{className:"w-full h-24 flex items-center justify-center text-ink-faint text-caption",children:t("notebook.asset.loading")})}),a&&n&&f.jsxs("div",{className:"fixed inset-0 z-50 bg-black/80 flex items-center justify-center p-8 cursor-pointer",onClick:()=>i(!1),children:[f.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"}),f.jsx("button",{className:"absolute top-4 right-4 text-white/70 hover:text-white","aria-label":t("action.close"),onClick:s=>{s.stopPropagation(),i(!1)},children:f.jsx(Bn,{className:"w-6 h-6"})})]})]})}function XM(e){const[t,n]=w.useState([]),[r,a]=w.useState(!0),i=w.useCallback(async()=>{if(!e){n([]),a(!1);return}try{const p=await ae.canvasList(e);n(p)}catch{n([])}finally{a(!1)}},[e]);w.useEffect(()=>{i()},[i]);const s=w.useCallback(async p=>{if(!e)return null;try{const g=await ae.canvasSave({...p,courseId:e});return n(x=>x.some(b=>b.id===g.id)?x:[g,...x]),g}catch{return null}},[e]),o=w.useCallback(async p=>{if(!e)return null;try{const g=await ae.canvasSaveUserNote({...p,courseId:e});return n(x=>[g,...x]),g}catch{return null}},[e]),l=w.useCallback(async(p,g)=>{try{const x=await ae.canvasRecordQuizResult(p,g);return x&&n(b=>b.map(v=>v.id===p?x:v)),x}catch{return null}},[]),u=w.useCallback(async(p,g)=>{try{const x=await ae.canvasUpdateUserNoteComment(p,g);return x&&n(b=>b.map(v=>v.id===p?x:v)),x}catch{return null}},[]),c=w.useCallback(async p=>{try{await ae.canvasDelete(p),n(g=>g.filter(x=>x.id!==p))}catch{}},[]),h=w.useCallback(async p=>{try{const g=await ae.canvasTogglePin(p);g&&n(x=>x.map(v=>v.id===p?g:v).sort((v,T)=>T.pinned!==v.pinned?T.pinned-v.pinned:T.createdAt.localeCompare(v.createdAt)))}catch{}},[]),m=w.useCallback(p=>p===null?t:t.filter(g=>g.nodeId===p),[t]),d=w.useCallback((p,g)=>{const x=p===null?t:t.filter(b=>b.nodeId===p);return g==="note"?x.filter(b=>b.artifactType==="user_note"):g==="practice"?x.filter(b=>b.artifactType==="quiz"):x.filter(b=>["concept_map","compare_table","diagram","code_walkthrough"].includes(b.artifactType))},[t]);return{items:t,loading:r,reload:i,save:s,saveUserNote:o,recordQuizResult:l,updateUserNoteComment:u,remove:c,togglePin:h,byNode:m,byZone:d}}const r1={small:16,medium:17,large:18},a1="lookatstudy-font-size",QM="medium";function ZM(){const[e,t]=w.useState(()=>{if(typeof localStorage<"u"){const r=localStorage.getItem(a1);if(r&&r in r1)return r}return QM});w.useEffect(()=>{document.documentElement.style.fontSize=`${r1[e]}px`,localStorage.setItem(a1,e)},[e]);const n=w.useCallback(r=>{t(a=>{const i=["small","medium","large"],s=i.indexOf(a),o=r==="up"?Math.min(s+1,i.length-1):Math.max(s-1,0);return i[o]})},[]);return{size:e,bump:n}}const Uu=new Map;function JM({ref_:e,onOpen:t}){const n=$e(),[r,a]=w.useState(e.previewUrl??(e.file?Uu.get(e.file)??null:null));return w.useEffect(()=>{if(r||!e.file)return;let i=!1;return(async()=>{const s=Uu.get(e.file);if(s){i||a(s);return}const o=await ae.getAttachmentDataUrl(e.file);o&&!i&&(Uu.set(e.file,o),a(o))})(),()=>{i=!0}},[e.file,r]),r?f.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:f.jsx("img",{src:r,alt:e.name,className:"w-full h-full object-cover"})}):f.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 eI({src:e,name:t,onClose:n}){return w.useEffect(()=>{const r=a=>{a.key==="Escape"&&n()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[n]),f.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:[f.jsx("img",{src:e,alt:t,className:"max-w-full max-h-full object-contain rounded-lg shadow-elevated"}),f.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:f.jsx(Bn,{className:"w-4 h-4"})})]})}function tI({parts:e}){const t=$e(),[n,r]=w.useState(null),a=e.filter(o=>o.type==="attachment").map(o=>o.attachment);if(a.length===0)return null;const i=a.filter(o=>o.kind==="image"),s=a.filter(o=>o.kind==="text");return f.jsxs("div",{className:"flex flex-col gap-1.5 mb-1","data-testid":"message-attachments",children:[i.length>0&&f.jsx("div",{className:"flex gap-1.5 flex-wrap",children:i.map((o,l)=>f.jsx(JM,{ref_:o,onOpen:u=>r({src:u,name:o.name})},o.file??o.previewUrl??`${o.name}:${l}`))}),s.length>0&&f.jsx("div",{className:"flex gap-1.5 flex-wrap",children:s.map((o,l)=>f.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:[f.jsx(hs,{className:"w-3 h-3 shrink-0"}),f.jsx("span",{className:"truncate max-w-[12rem]",children:o.name})]},`${o.name}:${l}`))}),n&&f.jsx(eI,{src:n.src,name:n.name,onClose:()=>r(null)})]})}function nI({messages:e,streaming:t,onApplyProposal:n,onRejectProposal:r,summary:a,onStartLearning:i,agentReady:s=!0,onGotoSettings:o,hasNode:l=!0,selectedNodeId:u,threadId:c,onSaveChatNote:h,chatNotes:m,onPickQuizAction:d,onQuizCompleted:p,cardMode:g=!1}){const x=$e(),b=Pd(),v=U4();w.useEffect(()=>{if(v.failReason){const V=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";b.show(x(V),{severity:"warning"}),v.clearFailReason()}},[v.failReason,b,x,v]),w.useEffect(()=>{v.onlineNotice&&(b.show(x("chat.speech.edge_disclosed"),{severity:"info"}),v.clearOnlineNotice())},[v.onlineNotice,b,x,v]);const T=w.useCallback((V,q,Z)=>{u&&ae.recordQuizAnswer(u,Z,V.kc).catch(()=>{})},[u]),[N,k]=w.useState(null);w.useEffect(()=>{if(!u){k(null);return}let V=!1;const q=()=>ae.getProgress(u).then(B=>{V||k((B==null?void 0:B.mastery)??null)}).catch(()=>{});q();const Z=ae.on("state:changed",B=>{B==="mastery"&&q()});return()=>{V=!0,Z()}},[u]);const A=w.useRef(null),_=w.useRef(!0),[S,I]=w.useState(!1);w.useEffect(()=>{const V=q=>{const Z=q.detail;if(!(Z!=null&&Z.msgId))return;const B=document.querySelector(`[data-msg-id="${Z.msgId}"]`);B&&(B.scrollIntoView({behavior:"smooth",block:"center"}),B.classList.add("ring-2","ring-accent","rounded-lg"),setTimeout(()=>B.classList.remove("ring-2","ring-accent","rounded-lg"),2500))};return window.addEventListener("lookatstudy-highlight-message",V),()=>window.removeEventListener("lookatstudy-highlight-message",V)},[]),w.useEffect(()=>{if(t||!A.current||!m||m.length===0)return;const V=setTimeout(()=>{if(!A.current)return;const q=new Map;for(const Z of m)try{const B=JSON.parse(Z.sourceAnchor);if(B.type==="chat"&&B.msgId){const Q=JSON.parse(Z.data).text??"";if(Q){const ne=q.get(B.msgId)??[];ne.push({noteId:Z.id,text:Q}),q.set(B.msgId,ne)}}}catch{}for(const[Z,B]of q){const Q=A.current.querySelector(`[data-msg-id="${Z}"]`);Q&&w4(Q,B)}},150);return()=>clearTimeout(V)},[e,m,t]),w.useEffect(()=>{const V=q=>{var Q;const Z=q.detail;if(!Z)return;const B=(Q=A.current)==null?void 0:Q.querySelector(`mark[data-note-id="${Z}"]`);B&&M4(B)};return window.addEventListener("lookatstudy-jump-to-chat-note",V),()=>window.removeEventListener("lookatstudy-jump-to-chat-note",V)},[]);const[C,D]=w.useState(null),L=w.useCallback(()=>{if(!h||!c)return;const V=window.getSelection(),q=(V==null?void 0:V.toString().trim())??"";if(q.length<2||q.length>500){D(null);return}const Z=V==null?void 0:V.getRangeAt(0);if(!Z){D(null);return}const B=A.current;if(!(B!=null&&B.contains(Z.commonAncestorContainer))){D(null);return}let Q=Z.commonAncestorContainer,ne=null;for(;Q&&Q!==B;){if(Q instanceof HTMLElement&&Q.dataset.msgId){ne=Q;break}Q=Q.parentNode}if(!ne){D(null);return}const j=ne.dataset.msgId,re=os(ne),K=x4(Z,re),X=Z.getBoundingClientRect(),ce=B.getBoundingClientRect(),le=R4({left:X.left-ce.left,top:X.top-ce.top,right:X.right-ce.left,bottom:X.bottom-ce.top,width:X.width,height:X.height},ce.width,110);D({x:le.left,y:le.top,transform:le.transform,text:q,msgId:j,startOffset:K==null?void 0:K.start,endOffset:K==null?void 0:K.end})},[h,c]);w.useEffect(()=>{let V=null,q=null;const Z=()=>{V&&clearTimeout(V),V=setTimeout(()=>{var Q;(((Q=window.getSelection())==null?void 0:Q.toString().trim().length)??0)>=2?(q&&(clearTimeout(q),q=null),L()):q||(q=setTimeout(()=>D(ne=>ne&&null),250))},250)};return document.addEventListener("selectionchange",Z),()=>{document.removeEventListener("selectionchange",Z),V&&clearTimeout(V),q&&clearTimeout(q)}},[L]);const F=w.useCallback(()=>{var q;if(!C||!h)return;const V=C.text.length>200?C.text.slice(0,200)+"…":C.text;h(V,C.msgId,C.startOffset,C.endOffset),D(null),(q=window.getSelection())==null||q.removeAllRanges()},[C,h]),O=w.useCallback(()=>{const V=A.current;if(!V)return;const q=V.scrollHeight-V.scrollTop-V.clientHeight<80;_.current=q,I(Z=>Z===!q?Z:!q)},[]);w.useEffect(()=>{if(!_.current)return;const V=A.current;V&&(V.scrollTop=V.scrollHeight)},[e,t]);const R=e.length>0&&e[e.length-1].role==="user";w.useEffect(()=>{if(!R)return;_.current=!0,I(!1);const V=A.current;V&&(V.scrollTop=V.scrollHeight)},[R]);const H=w.useCallback(()=>{const V=A.current;V&&(V.scrollTop=V.scrollHeight,_.current=!0,I(!1))},[]);return f.jsxs("div",{className:"relative flex-1 min-h-0",children:[f.jsxs("div",{ref:A,onScroll:O,onMouseUp:L,className:`h-full overflow-y-auto px-3 py-4 space-y-2 relative ${g?"":"px-5 py-6 space-y-6"}`,"data-testid":"chat-stream",children:[e.length===0&&f.jsx("div",{className:"mt-10 mx-auto max-w-md","data-testid":"chat-empty-state",children:l?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"text-center mb-4",children:[f.jsx("div",{className:"text-4xl mb-2 opacity-30",children:"📖"}),f.jsx("div",{className:"text-body font-bold text-ink-muted mb-1",children:x("chat.empty.greeting")}),f.jsx("div",{className:"text-ink-muted text-label",children:x("chat.empty.overview")})]}),a?f.jsxs("div",{className:"surface-card p-4 mb-4",children:[f.jsx("div",{className:"text-caption font-bold text-brand uppercase tracking-wider mb-2",children:x("chat.empty.summary.title")}),f.jsx("div",{className:"text-body text-ink-muted leading-relaxed whitespace-pre-wrap",children:a})]}):f.jsx("div",{className:"surface-card p-4 mb-4 text-center",children:f.jsx("div",{className:"text-body text-ink-muted",children:x("chat.empty.summary.none")})}),s?f.jsx(f.Fragment,{children:i&&f.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:[f.jsx(qy,{className:"w-4 h-4"}),f.jsx("span",{children:x("chat.empty.start")})]})}):f.jsxs("div",{className:"surface-card p-4 mb-2","data-testid":"keyless-card",children:[f.jsx("div",{className:"text-body font-bold text-ink-muted mb-1",children:x("chat.empty.keyless.title")}),f.jsx("div",{className:"text-label text-ink-muted mb-3",children:x("chat.empty.keyless.desc")}),f.jsxs("button",{onClick:o,className:"btn-3d-brand w-full py-2 text-body font-bold flex items-center justify-center gap-2",children:[f.jsx(No,{className:"w-4 h-4"}),f.jsx("span",{children:x("chat.empty.keyless.btn")})]})]})]}):f.jsxs("div",{className:"text-center mt-16","data-testid":"no-node-selected",children:[f.jsx("div",{className:"text-5xl mb-3 opacity-25",children:"🗺️"}),f.jsx("div",{className:"text-body font-bold text-ink-muted mb-1",children:x("chat.empty.no_node.title")}),f.jsx("div",{className:"text-body text-ink-muted max-w-xs mx-auto",children:x("chat.empty.no_node.desc")})]})}),e.map(V=>f.jsx("div",{className:g?"":"contents",children:f.jsx("div",{className:g&&V.role==="assistant"?"surface-card p-4 rounded-2xl shadow-card":void 0,children:f.jsx(rI,{msg:V,onApplyProposal:n,onRejectProposal:r,onQuizAnswered:T,quizMastery:N,onPickAction:d,onQuizCompleted:p,speakingMessageId:v.speakingMessageId,speakingSentence:v.speakingSentence,playingSentence:v.playingSentence,streamTexts:v.streamTexts,onSpeak:v.speak})})},V.id)),t&&f.jsxs("div",{className:"flex items-center gap-1.5 text-body text-brand",children:[f.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),f.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),f.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"})]})]}),S&&e.length>0&&f.jsxs("button",{onClick:H,"data-testid":"scroll-to-bottom","aria-label":x("chat.scroll.bottom"),title:x("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:[f.jsx(F0,{className:"w-5 h-5"}),t&&f.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"})]}),C&&f.jsxs("button",{onClick:F,"data-testid":"save-chat-note-btn",style:{left:C.x,top:C.y,transform:C.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",title:x("chat.note.add.title"),children:[f.jsx(Ji,{className:"w-3 h-3"})," ",x("chat.note.add")]})]})}function i1(e){const t=[];for(const n of e)if(n.role==="assistant")for(let r=0;r<n.parts.length;r++){const a=n.parts[r];a.type==="tool-call"&&a.state==="output-available"&&a.output&&typeof a.output=="object"&&"artifactType"in a.output&&t.push({id:`${n.id}-${r}`,toolName:a.toolName,output:a.output})}return t}function rI({msg:e,onApplyProposal:t,onRejectProposal:n,onQuizAnswered:r,quizMastery:a,onPickAction:i,onQuizCompleted:s,speakingMessageId:o,speakingSentence:l,playingSentence:u,streamTexts:c,onSpeak:h}){const m=$e(),d=w.useRef(null),p=e.parts.map(v=>v.type==="text"?v.text:"").join("").trim(),g=o===e.id,x=g&&u!=null?u.index:null;w.useEffect(()=>{const v=d.current;if(!v)return;if(x==null){xa(v);return}const T=_4(c??[],x);if(!T)return;x===0&&A4(v);const N=setTimeout(()=>{const k=C4(v,T,{within:'[data-testid="part-text"]'});k&&N4(k,v.closest(".overflow-y-auto"))},30);return()=>clearTimeout(N)},[x,c]),w.useEffect(()=>{x==null&&d.current&&xa(d.current)},[x]);const b=w.useRef(!1);return b.current=x!=null,w.useEffect(()=>()=>{b.current&&xa(document.body)},[]),e.role==="user"?f.jsx("div",{className:"msg-enter flex justify-end","data-testid":"msg-user","data-msg-id":e.id,children:f.jsxs("div",{className:"max-w-[85%] bg-ink/[0.04] rounded-2xl rounded-br-md px-4 py-2.5",children:[f.jsx(tI,{parts:e.parts}),f.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"?f.jsx("span",{children:v.text},T):null)})]})}):f.jsxs("div",{className:"msg-enter",ref:d,"data-testid":"msg-assistant","data-msg-id":e.id,children:[f.jsx("div",{className:"min-w-0 space-y-2.5",children:e.parts.map((v,T)=>f.jsx(aI,{part:v,msgId:e.id,toolCallIdx:T,onApplyProposal:t,onRejectProposal:n,onQuizAnswered:r,quizMastery:a,onPickAction:i,onQuizCompleted:s},T))}),h&&p&&f.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[f.jsx("button",{onClick:()=>h(e.id,p),"data-testid":g?"speech-stop-btn":"speech-speak-btn","aria-label":m(g?"chat.speech.stop":"chat.speech.speak"),title:m(g?"chat.speech.stop":"chat.speech.speak"),className:`w-7 h-7 rounded-lg flex items-center justify-center transition ${g?"bg-brand/15 text-brand":"text-ink-muted hover:bg-ink/[0.06] hover:text-ink"}`,children:g?f.jsx(V0,{className:"w-3.5 h-3.5"}):f.jsx(Qp,{className:"w-4 h-4"})}),g&&l&&l.total>0&&f.jsx("span",{className:"text-caption text-ink-muted",children:m("chat.speech.progress").replace("{n}",String(l.index+1)).replace("{total}",String(l.total))})]})]})}function aI({part:e,msgId:t,toolCallIdx:n,onApplyProposal:r,onRejectProposal:a,onQuizAnswered:i,quizMastery:s,onPickAction:o,onQuizCompleted:l}){if(e.type==="text")return f.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:f.jsx(Kg,{remarkPlugins:[w2,k2],rehypePlugins:[d4,[p4,g4],Ix],urlTransform:d=>d,components:oI,children:I4(e.text)})});if(e.type==="reasoning")return f.jsx(iI,{text:e.text});if(e.type!=="tool-call")return null;const{toolName:u,state:c,output:h,error:m}=e;return f.jsx(sI,{toolName:u,state:c,output:h,error:m,msgId:t,toolCallIdx:n,onApplyProposal:r,onRejectProposal:a,onQuizAnswered:i,quizMastery:s,onPickAction:o,onQuizCompleted:l})}function iI({text:e}){const t=$e(),[n,r]=w.useState(!1);return f.jsxs("div",{className:"rounded-lg bg-surface-1/60 border border-[var(--border-faint)]","data-testid":"part-reasoning",children:[f.jsxs("button",{onClick:()=>r(a=>!a),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:[f.jsxs("span",{children:[n?"▾":"▸"," ",t("chat.reasoning.label")]}),f.jsx("span",{className:"text-ink-muted font-normal",children:t("chat.reasoning.chars",{n:e.length})})]}),n&&f.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 sI({toolName:e,state:t,output:n,error:r,msgId:a,toolCallIdx:i,onApplyProposal:s,onRejectProposal:o,onQuizAnswered:l,quizMastery:u,onPickAction:c,onQuizCompleted:h}){const m=$e(),p=(e==="record_answer"||e==="mark_mastered")&&t==="output-available"&&typeof n=="object"&&n!==null?n:null;if(p!=null&&p.proposalId){const b=p.status;return b==="applied"?f.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:[f.jsx(Wn,{className:"w-4 h-4 text-gold shrink-0"}),f.jsx("span",{className:"text-body font-bold text-ink",children:m("chat.proposal.applied")})]}):b==="rejected"?f.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:[f.jsx(wy,{className:"w-4 h-4 text-ink-muted shrink-0"}),f.jsx("span",{className:"text-body text-ink-muted",children:m("chat.proposal.rejected")})]}):f.jsxs("div",{className:"proposal-card relative rounded-xl border border-brand/30 bg-brand/5 overflow-hidden","data-testid":"part-proposal",children:[f.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-1 bg-brand"}),f.jsxs("div",{className:"pl-4 pr-3 py-3",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[f.jsx("span",{className:"flex items-center justify-center w-7 h-7 rounded-lg bg-brand/15 text-brand shrink-0",children:f.jsx(Wp,{className:"w-4 h-4"})}),f.jsx("span",{className:"text-lead font-bold text-ink",children:m("chat.proposal.mastered.title")})]}),p.message&&f.jsx("div",{className:"text-body text-ink mb-2 leading-relaxed",children:p.message}),f.jsx("div",{className:"text-caption text-ink-muted mb-3",children:m("chat.proposal.mastered.hint")}),f.jsxs("div",{className:"flex gap-2",children:[f.jsxs("button",{onClick:()=>s==null?void 0:s(p.proposalId,a,i),"data-testid":"proposal-apply",className:"btn-3d-brand px-4 py-1.5 text-body",children:[f.jsx(Tn,{className:"w-3.5 h-3.5 inline"}),m("chat.proposal.confirm")]}),f.jsx("button",{onClick:()=>o==null?void 0:o(p.proposalId,a,i),"data-testid":"proposal-reject",className:"btn-3d-neutral px-4 py-1.5 text-body",children:m("chat.proposal.later")})]})]})]})}if(t==="output-available"&&n&&typeof n=="object"&&"artifactType"in n){const b=n.artifactType;return f.jsx("div",{className:"my-1 max-w-full","data-testid":`inline-artifact-${b}`,"data-tool":e,children:f.jsx(Dd,{data:n,onQuizAnswered:l,quizMastery:u,onPickAction:c,onQuizCompleted:h})})}const x=uI(e,m);return f.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"?f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),f.jsxs("span",{className:"text-ink-muted",children:[x,"…"]})]}):t==="output-error"?f.jsxs(f.Fragment,{children:[f.jsx(va,{className:"w-3.5 h-3.5 text-warning shrink-0"}),f.jsxs("span",{className:"text-warning",children:[x,": ",r]})]}):f.jsxs(f.Fragment,{children:[f.jsx(ms,{className:"w-3.5 h-3.5 text-ink-faint shrink-0"}),f.jsx("span",{className:"text-ink-muted",children:x})]})})}const oI={pre({children:e,...t}){return f.jsx(lI,{...t,children:e})},a({children:e,...t}){return f.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",children:e})},table({children:e}){return f.jsx("div",{className:"overflow-x-auto my-4",children:f.jsx("table",{children:e})})}};function lI({children:e,...t}){const n=$e(),[r,a]=w.useState(!1),i=Array.isArray(e)?e[0]:e,s=(i==null?void 0:i.props)??{},o=/language-(\w+)/.exec(s.className??""),l=(o==null?void 0:o[1])??"",u=()=>{var m;const c=s.children,h=typeof c=="string"?c:Array.isArray(c)?c.join(""):"";(m=navigator.clipboard)==null||m.writeText(h).then(()=>{a(!0),setTimeout(()=>a(!1),1500)})};return f.jsxs("div",{className:"relative group my-3","data-testid":"md-codeblock",children:[f.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:[f.jsx("span",{className:"text-caption font-mono text-ink-faint uppercase tracking-wider",children:l||"code"}),f.jsx("button",{onClick:u,"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?f.jsxs(f.Fragment,{children:[f.jsx(Tn,{className:"w-3 h-3 inline"}),n("chat.copied")]}):f.jsxs(f.Fragment,{children:[f.jsx(ky,{className:"w-3 h-3 inline"}),n("chat.copy")]})})]}),f.jsx("pre",{...t,className:"!mt-0 !rounded-t-none !border-t-0",children:e})]})}function uI(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 Yi={maxPerMessage:4,maxImageBytes:5*1024*1024,maxTextBytes:256*1024},cI=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 s1(e){const t=e.lastIndexOf(".");return t<=0||t===e.length-1?"":e.slice(t+1).toLowerCase()}function dI(e,t,n){return t&&t.startsWith("image/")||["png","jpg","jpeg","webp","gif","bmp"].includes(s1(e))?n>Yi.maxImageBytes?{ok:!1,reason:"tooLargeImage"}:{ok:!0,kind:"image"}:cI.has(s1(e))?n>Yi.maxTextBytes?{ok:!1,reason:"tooLargeText"}:{ok:!0,kind:"text"}:{ok:!1,reason:"unsupported"}}function hI(e,t){const n=e.length,r=n*2,a=new ArrayBuffer(44+r),i=new DataView(a),s=(l,u)=>{for(let c=0;c<u.length;c++)i.setUint8(l+c,u.charCodeAt(c))};s(0,"RIFF"),i.setUint32(4,36+r,!0),s(8,"WAVE"),s(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),s(36,"data"),i.setUint32(40,r,!0);let o=44;for(let l=0;l<n;l++){const u=e[l]<=-1?-1:e[l]>=1?1:e[l];i.setInt16(o,Math.round(u*32767),!0),o+=2}return a}function fI(e,t){const n=Math.floor(e.length/t),r=new Float32Array(n);for(let a=0;a<n;a++){const i=a*t,s=Math.floor(i),o=i-s,l=e[s]??0,u=e[s+1]??l;r[a]=l+(u-l)*o}return r}function mI(e,t,n={}){if(e.length===0||e.length!==t.length)return e;const r=n.threshold??.012;let a=0;for(;a<e.length-1&&t[a]<r;)a+=1;let i=e.length;for(;i>a+1&&t[i-1]<r;)i-=1;return e.slice(a,i)}function pI(e={}){const t=e.rmsThreshold??.015,n=e.minSpeechMs??300,r=e.silenceMs??1200,a=e.maxMs??6e4,i=e.autoStop!==!1;let s=null,o=0,l=null,u=null,c=!1;return{feed(h,m){s==null&&(s=m);const d=u==null?0:Math.max(0,m-u);if(u=m,h>=t)o+=d,o>=n&&(c=!0,l=m);else if(i&&c&&l!=null&&m-l>=r)return"auto-stop";return i&&m-s>=a?"auto-stop":"listening"},hadSpeech(){return c}}}const qu=16e3;function gI(e,t={}){const[n,r]=w.useState(!1),[a,i]=w.useState(!1),[s,o]=w.useState(0),[l,u]=w.useState(null),[c,h]=w.useState(null),m=w.useRef(null),d=w.useRef(null),p=w.useRef(null),g=w.useRef([]),x=w.useRef([]),b=w.useRef(!1),v=w.useRef(null),T=w.useRef(0),N=w.useRef(e);N.current=e;const k=w.useRef(t);k.current=t;const A=w.useRef(!1),_=w.useRef(!1),S=w.useCallback(()=>{var F,O,R;b.current=!1,(F=p.current)==null||F.disconnect(),p.current=null,(O=d.current)==null||O.getTracks().forEach(H=>H.stop()),d.current=null,(R=m.current)==null||R.close().catch(()=>{}),m.current=null,g.current=[],x.current=[],v.current=null,o(0)},[]),I=w.useCallback(()=>{var ne;const F=g.current,O=x.current,R=((ne=v.current)==null?void 0:ne.hadSpeech())??!1;g.current=[],x.current=[];let H=0;for(const j of F)H+=j.length;if(S(),r(!1),H===0)return;if(!R){h("no-speech");return}const V=mI(F,O);let q=0;for(const j of V)q+=j.length;const Z=new Float32Array(q);let B=0;for(const j of V)Z.set(j,B),B+=j.length;const Q=hI(Z,qu);i(!0),h(null),window.api.asrTranscribe(Q,k.current.locale).then(j=>{j.ok?N.current(j.text):h(j.reason)}).catch(()=>h("asr-failed")).finally(()=>i(!1))},[S]),C=w.useCallback(()=>{b.current&&I()},[I]),D=w.useCallback(()=>{b.current||A.current||(u(null),A.current=!0,(async()=>{var F;try{if(((F=navigator.mediaDevices)==null?void 0:F.getUserMedia)==null){u(window.isSecureContext?"mic-unavailable":"mic-insecure-context");return}const O=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0}}),R=window.AudioContext??window.webkitAudioContext;let H;try{H=new R({sampleRate:qu})}catch{H=new R}m.current=H,d.current=O,b.current=!0,v.current=pI({autoStop:k.current.autoStop!==!1});const V=H.createMediaStreamSource(O),q=H.createScriptProcessor(4096,1,1);p.current=q;const Z=H.sampleRate/qu;q.onaudioprocess=Q=>{var ce;if(!b.current)return;const ne=Q.inputBuffer.getChannelData(0),j=Z===1?new Float32Array(ne):fI(ne,Z);g.current.push(j);let re=0;for(let le=0;le<j.length;le++)re+=j[le]*j[le];const K=Math.sqrt(re/j.length);x.current.push(K),T.current=T.current*.7+K*.3,o(Math.min(1,T.current*8)),U3(Math.min(1,T.current*8)),((ce=v.current)==null?void 0:ce.feed(K,performance.now()))==="auto-stop"&&b.current&&I()},V.connect(q);const B=H.createGain();B.gain.value=0,q.connect(B),B.connect(H.destination),r(!0),_.current&&(_.current=!1,I())}catch(O){S(),r(!1),u(O instanceof Error?O.message:String(O))}finally{A.current=!1}})())},[S,I]),L=w.useCallback(()=>{b.current?C():A.current&&(_.current=!0)},[C]);return w.useEffect(()=>()=>{b.current&&S()},[S]),{listening:n,transcribing:a,level:s,startError:l,transcribeError:c,clearTranscribeError:()=>h(null),beginHold:D,endHold:L}}function xI({onGotoSettings:e}){var g;const t=$e(),[n,r]=w.useState(!1),[a,i]=w.useState(null),[s,o]=w.useState(""),[l,u]=w.useState(""),c=w.useRef(null),h=w.useCallback(async()=>{var x,b;try{const[v,T,N,k]=await Promise.all([ae.getProviderPresets(),ae.listCustomProviders(),ae.getSetting("active_provider"),ae.getSetting("active_model")]),A=N??"glm",_=await Promise.all(v.map(async F=>await ae.getSetting(F.apiKeySetting)!=null)),S=new Set;v.forEach((F,O)=>{(_[O]||F.id===A)&&S.add(F.id)});const I=[],C=(F,O,R)=>{for(const H of R)I.push({providerId:F,providerLabel:O,modelId:H.id,modelLabel:H.label,vision:(H.capabilities??[]).includes("vision"),contextWindow:H.contextWindow})};for(const F of v)S.has(F.id)&&C(F.id,F.label,F.models);const D=T.filter(F=>F.kind==="llm");for(const F of D)C(F.id,F.label,F.models);const L=k??"";if(L&&!I.some(F=>F.providerId===A&&F.modelId===L)){const F=((x=v.find(O=>O.id===A))==null?void 0:x.label)??((b=D.find(O=>O.id===A))==null?void 0:b.label)??A;I.unshift({providerId:A,providerLabel:F,modelId:L,modelLabel:L,vision:!0,contextWindow:null})}i(I),o(A),u(L)}catch{i([])}},[]);w.useEffect(()=>{h();const x=()=>void h();return window.addEventListener("llm-config-changed",x),()=>window.removeEventListener("llm-config-changed",x)},[h]),w.useEffect(()=>{if(!n)return;const x=v=>{var T;v.target instanceof Node&&((T=c.current)==null?void 0:T.contains(v.target))!==!0&&r(!1)},b=v=>{v.key==="Escape"&&r(!1)};return document.addEventListener("pointerdown",x),document.addEventListener("keydown",b),()=>{document.removeEventListener("pointerdown",x),document.removeEventListener("keydown",b)}},[n]);const m=async x=>{if(r(!1),!(x.providerId===s&&x.modelId===l))try{await ae.setSetting("active_provider",x.providerId),await ae.setSetting("active_model",x.modelId),o(x.providerId),u(x.modelId),window.dispatchEvent(new Event("llm-config-changed"))}catch{}},d=((g=a==null?void 0:a.find(x=>x.providerId===s&&x.modelId===l))==null?void 0:g.modelLabel)??l??t("model.picker.label"),p=[];for(const x of a??[]){const b=p[p.length-1];b&&b.label===x.providerLabel?b.rows.push(x):p.push({label:x.providerLabel,rows:[x]})}return f.jsxs("div",{ref:c,className:"relative","data-testid":"composer-model",children:[f.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:[f.jsx(gy,{className:"w-3 h-3 shrink-0 coarse-only","aria-hidden":!0}),f.jsx("span",{className:"truncate tb-label",children:d}),f.jsx(Hp,{className:`w-3 h-3 shrink-0 tb-chevron transition-transform ${n?"":"rotate-180"}`})]}),n&&f.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-h-72 overflow-y-auto bg-surface-0 rounded-xl shadow-elevated border border-[var(--border)] py-1.5",children:[p.length===0&&f.jsx("div",{className:"px-3 py-2 text-caption text-ink-faint",children:t("model.picker.noneConfigured")}),p.map(x=>f.jsxs("div",{role:"group","aria-label":x.label,children:[f.jsx("div",{className:"px-3 pt-1.5 pb-0.5 text-caption font-bold text-ink-faint",children:x.label}),x.rows.map(b=>{const v=b.providerId===s&&b.modelId===l;return f.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":v,onClick:()=>void m(b),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:[f.jsx(Tn,{className:`w-3.5 h-3.5 shrink-0 ${v?"opacity-100":"opacity-0"}`}),f.jsx("span",{className:"flex-1 truncate text-label",children:b.modelLabel}),b.vision&&f.jsx(Ey,{className:"w-3 h-3 shrink-0 text-ink-faint","aria-label":t("model.picker.vision")})]},`${b.providerId}:${b.modelId}`)})]},x.label)),f.jsx("div",{className:"border-t border-[var(--border)] mt-1 pt-1",children:f.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:[f.jsx(Gy,{className:"w-3.5 h-3.5"}),t("model.picker.manage")]})})]})]})}const l0=5.5,o1=2*Math.PI*l0,Da=["system","node","learner","history","draft"],l1={system:"bg-accent",node:"bg-brand",learner:"bg-gold",history:"bg-ink/50",draft:"bg-exam"};function bI({info:e,historyTokens:t,draftTokens:n}){const r=$e(),[a,i]=w.useState(!1),s=w.useRef(null);if(w.useEffect(()=>{!(e!=null&&e.contextWindow)&&a&&i(!1)},[e==null?void 0:e.contextWindow,a]),w.useEffect(()=>{if(!a)return;const m=p=>{var g;p.target instanceof Node&&((g=s.current)==null?void 0:g.contains(p.target))!==!0&&i(!1)},d=p=>{p.key==="Escape"&&i(!1)};return document.addEventListener("pointerdown",m),document.addEventListener("keydown",d),()=>{document.removeEventListener("pointerdown",m),document.removeEventListener("keydown",d)}},[a]),!e)return null;const o={system:e.systemTokens,node:e.nodeTokens,learner:e.learnerTokens,history:t,draft:n},l=Da.reduce((m,d)=>m+o[d],0),u=n5(l,e.contextWindow),c=u!==null&&u>=85,h=r5(Da.map(m=>o[m]),u??0);return f.jsxs("span",{ref:s,className:"relative inline-flex items-center","data-testid":"composer-context",children:[f.jsxs("button",{type:"button",onClick:()=>i(!a),disabled:e.contextWindow===null,"aria-label":r("context.aria",{p:u!==null?`${u}%`:Ma(l)}),"aria-haspopup":"dialog","aria-expanded":a,"data-testid":"composer-context-trigger","data-tooltip":e.contextWindow===null?`${r("context.label")} ~${Ma(l)} · ${r("context.unknownWindow")}`:r("context.aria",{p:`${u}%`}),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:[f.jsxs("svg",{viewBox:"0 0 14 14",width:"14",height:"14","aria-hidden":!0,className:"shrink-0",children:[f.jsx("circle",{cx:"7",cy:"7",r:l0,fill:"none",strokeWidth:"2",className:"stroke-ink/20"}),f.jsx("circle",{cx:"7",cy:"7",r:l0,fill:"none",strokeWidth:"2",stroke:"currentColor",strokeLinecap:"round",strokeDasharray:`${o1*(u??100)/100} ${o1}`,transform:"rotate(-90 7 7)"})]}),u!==null?f.jsxs("span",{className:"tb-label",children:[u,"%"]}):f.jsxs("span",{className:"tb-label",children:["~",Ma(l)]})]}),a&&e.contextWindow!==null&&f.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 bg-surface-0 rounded-xl shadow-elevated border border-[var(--border)] p-3",children:[f.jsxs("div",{className:"flex items-baseline justify-between mb-2",children:[f.jsx("span",{className:"text-label font-bold text-ink-strong",children:r("context.label")}),f.jsxs("span",{className:`text-caption ${c?"text-warning":"text-ink-muted"}`,children:[r("context.approx")," ",Ma(l)," / ",Ma(e.contextWindow)]})]}),f.jsx("div",{className:"flex h-2 rounded-full overflow-hidden bg-ink/10 mb-2",role:"img","aria-label":`${u}%`,children:Da.map(m=>h[Da.indexOf(m)]>0?f.jsx("div",{className:l1[m],style:{width:`${h[Da.indexOf(m)]}%`}},m):null)}),f.jsx("dl",{className:"space-y-1",children:Da.map(m=>f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("dt",{className:"flex items-center gap-1.5 text-caption text-ink-muted",children:[f.jsx("span",{className:`w-2 h-2 rounded-sm ${l1[m]}`,"aria-hidden":!0}),r(`context.${m}`)]}),f.jsxs("dd",{className:"text-caption text-ink-strong tabular-nums",children:["~",Ma(o[m])]})]},m))})]})]})}const u0={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 yI(e,t,n){if(e==="openai"||e in u0)return e;const r=(t??"").toLowerCase(),a=(n??"").toLowerCase();return r.includes("bigmodel.cn")||r.includes("z.ai")||a.startsWith("glm")?"glm":r.includes("dashscope")||a.startsWith("qwen")?"qwen":r.includes("siliconflow")?"siliconcloud":e}function vI(e,t,n){return t==="anthropic"||t==="google"||e==="openai"||e in u0?!0:yI(e,n==null?void 0:n.baseUrl,n==null?void 0:n.model)in u0}const Vu=[{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 wI(){const e=$e(),[t,n]=w.useState(!1),[r,a]=w.useState(""),[i,s]=w.useState(!0),o=w.useRef(null),l=w.useRef(null),[u,c]=w.useState("right"),[h,m]=w.useState(0),d=w.useRef(0),[p,g]=w.useState(0);w.useLayoutEffect(()=>{if(!t){g(0),d.current=0,m(0);return}const T=l.current;if(!T)return;const N=T.getBoundingClientRect(),k=N.left-d.current,A=N.right-d.current,_=window.innerWidth;if(p===0){if(k<8&&A<=_-8){c("left"),g(1);return}if(A>_-8&&k>=8){c("right"),g(1);return}g(1)}const S=Math.min(0,_-8-A)+Math.max(0,8-k);S!==d.current&&(d.current=S,m(S))},[t,p]);const x=w.useCallback(async()=>{var T;try{const[N,k,A,_,S]=await Promise.all([ae.getSetting("active_provider"),ae.getSetting("reasoning_effort"),ae.getProviderPresets(),ae.listCustomProviders(),ae.getSetting("active_model")]),I=N??"glm",C=_.find(F=>F.id===I),D=((T=A.find(F=>F.id===I))==null?void 0:T.protocol)??(C==null?void 0:C.protocol)??"openai-compatible";s(vI(I,D,{baseUrl:C==null?void 0:C.baseUrl,model:S??(C==null?void 0:C.defaultModel)}));const L=k??"";a(L==="fast"||L==="deep"?L:"")}catch{s(!1)}},[]);w.useEffect(()=>{x();const T=()=>void x();return window.addEventListener("llm-config-changed",T),()=>window.removeEventListener("llm-config-changed",T)},[x]),w.useEffect(()=>{if(!t)return;const T=k=>{var A;k.target instanceof Node&&((A=o.current)==null?void 0:A.contains(k.target))!==!0&&n(!1)},N=k=>{k.key==="Escape"&&n(!1)};return document.addEventListener("pointerdown",T),document.addEventListener("keydown",N),()=>{document.removeEventListener("pointerdown",T),document.removeEventListener("keydown",N)}},[t]);const b=async T=>{if(n(!1),T!==r){a(T);try{await ae.setSetting("reasoning_effort",T)}catch{a(r)}}},v=Vu.find(T=>T.value===r)??Vu[0];return f.jsxs("div",{ref:o,className:"relative","data-testid":"composer-effort",children:[f.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:[f.jsx(xy,{className:"w-3 h-3 shrink-0"}),f.jsx("span",{className:"truncate tb-label",children:e(v.labelKey)}),f.jsx(Hp,{className:`w-3 h-3 shrink-0 tb-chevron transition-transform ${t?"":"rotate-180"}`})]}),t&&f.jsx("div",{ref:l,role:"menu","aria-label":e("effort.label"),"data-testid":"composer-effort-menu",style:{transform:h?`translateX(${h}px)`:void 0},className:`absolute bottom-full ${u==="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:Vu.map(T=>{const N=T.value===r;return f.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":N,onClick:()=>void b(T.value),className:`w-full flex items-start gap-1.5 px-3 py-1.5 text-left transition-colors ${N?"text-brand":"text-ink-strong hover:bg-ink/[0.06]"}`,children:[f.jsx(Tn,{className:`w-3.5 h-3.5 shrink-0 mt-0.5 ${N?"opacity-100":"opacity-0"}`}),f.jsxs("span",{className:"flex-1",children:[f.jsx("span",{className:"block text-label font-bold",children:e(T.labelKey)}),f.jsx("span",{className:"block text-caption text-ink-faint",children:e(T.descKey)})]})]},T.value||"auto")})})]})}function kI(e){const t=Math.floor(e/1e3),n=Math.floor(t/60);return`${String(n).padStart(2,"0")}:${String(t%60).padStart(2,"0")}`}function TI({view:e,level:t,text:n,onTextChange:r,onSend:a,onRerecord:i,errorMessage:s,sendDisabled:o}){const l=$e(),[u,c]=w.useState(0),h=w.useRef(performance.now());return w.useEffect(()=>{h.current=performance.now(),c(0)},[e]),w.useEffect(()=>{if(e!=="recording")return;const m=window.setInterval(()=>c(performance.now()-h.current),250);return()=>window.clearInterval(m)},[e]),f.jsxs("div",{className:"absolute bottom-full left-0 right-0 mb-2 z-20 rounded-2xl bg-surface-0 shadow-elevated p-4 flex flex-col gap-3",role:"status","aria-live":"polite","data-testid":e==="recording"?"voice-panel-recording":e==="transcribing"?"voice-panel-transcribing":e==="review"?"voice-panel-review":"voice-panel-error",children:[e==="recording"&&f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("span",{className:"w-11 h-11 shrink-0 rounded-full bg-warning/15 text-warning flex items-center justify-center",children:f.jsx(Oi,{className:"w-5 h-5 animate-pulse"})}),f.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-1.5",children:[f.jsxs("div",{className:"flex items-center justify-between text-label text-ink-muted",children:[f.jsx("span",{children:l("chat.speech.recording_hint")}),f.jsx("span",{className:"tabular-nums",children:kI(u)})]}),f.jsx("span",{className:"block h-2 rounded-full bg-ink/[0.08] overflow-hidden","data-testid":"voice-level",children:f.jsx("span",{className:"block h-full bg-warning transition-[width] duration-100",style:{width:`${Math.round(Math.min(1,t)*100)}%`}})})]})]}),e==="transcribing"&&f.jsxs("div",{className:"flex items-center justify-center gap-2 py-2 text-body text-ink-muted",children:[f.jsx(Ly,{className:"w-4 h-4 animate-spin"}),f.jsx("span",{children:l("chat.speech.transcribing")})]}),e==="review"&&f.jsxs(f.Fragment,{children:[f.jsx("textarea",{value:n,onChange:m=>r(m.target.value),autoFocus:!0,rows:4,"data-testid":"voice-result-text",className:"w-full bg-ink/[0.05] text-body text-ink-strong rounded-xl px-3 py-2 resize-none focus:outline-none focus:bg-ink/[0.08]"}),f.jsxs("div",{className:"flex items-center justify-end gap-2",children:[f.jsx("button",{type:"button",onClick:i,"data-testid":"voice-rerecord",className:"btn-3d-neutral px-4 py-1.5 text-body",children:l("chat.speech.rerecord")}),f.jsxs("button",{type:"button",onClick:a,disabled:o,"data-testid":"voice-send",className:"btn-3d-brand px-4 py-1.5 text-body flex items-center gap-1.5 disabled:opacity-40",children:[f.jsx(Wy,{className:"w-3.5 h-3.5"}),l("chat.send")]})]})]}),e==="error"&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"text-body text-warning py-1",children:s??l("chat.speech.asr_failed")}),f.jsx("div",{className:"flex items-center justify-end",children:f.jsxs("button",{type:"button",onClick:i,"data-testid":"voice-rerecord",className:"btn-3d-neutral px-4 py-1.5 text-body flex items-center gap-1.5",children:[f.jsx(ji,{className:"w-3.5 h-3.5"}),l("chat.speech.retry")]})})]})]})}const EI={direct:"soul.direct",guide:"soul.guide",practice:"soul.practice"},SI={direct:sr,guide:qp,practice:Ny},AI={direct:"soul.direct.desc",guide:"soul.guide.desc",practice:"soul.practice.desc"},CI=["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 u1=0;function NI({nodeId:e,agentReady:t,streaming:n,souls:r,activeSoul:a,starterPrompts:i,onPickSoul:s,onSend:o,onStop:l,onLogFriction:u,onGotoSettings:c,insertText:h,historyTokens:m}){const d=$e(),p=ng(),[g,x]=w.useState(""),[b,v]=w.useState([]),[T,N]=w.useState(null),[k,A]=w.useState(null),[_,S]=w.useState(!1),I=w.useRef(null),C=w.useRef(0),[D,L]=w.useState(!0);w.useEffect(()=>{ae.getSetting("asr_auto_stop").then(me=>L(me!=="0"))},[]);const[F,O]=w.useState(!1);w.useEffect(()=>(bh(F),()=>bh(!1)),[F]);const[R,H]=w.useState(""),[V,q]=w.useState(!1),[Z,B]=w.useState(null),Q=gI(me=>{H(me),q(!0)},{locale:p,autoStop:D}),ne=Q.startError??Q.transcribeError;w.useEffect(()=>{if(!ne)return;B(d(ne==="no-speech"?"chat.speech.no_speech":ne==="model-missing"?"chat.speech.asr_model_missing":ne==="engine-unavailable"?"chat.speech.engine_unavailable":ne==="custom-provider-missing"?"chat.speech.custom_provider_missing":ne==="groq-key-missing"?"chat.speech.groq_key_missing":ne==="azure-key-missing"?"chat.speech.azure_stt_key_missing":ne==="azure-region-missing"?"chat.speech.azure_stt_region_missing":ne==="mic-insecure-context"?"chat.speech.asr_insecure_context":ne==="mic-unavailable"?"chat.speech.asr_start_fail":"chat.speech.asr_failed")),Q.clearTranscribeError()},[ne,Q,d]);const j=Z?"error":Q.listening?"recording":Q.transcribing?"transcribing":V?"review":"idle",re=(me,Ue,ct)=>{q3(),o(me,Ue,ct)},K=w.useCallback(()=>{H(""),q(!1),B(null)},[]),X=w.useCallback(()=>{O(!1),K()},[K]),ce=()=>{const me=R.trim();!me||n||!e||(re(me),X())};w.useEffect(()=>{h&&x(me=>me.trim()?`${me}
|
|
780
|
+
|
|
781
|
+
${h}`:h)},[h]),w.useEffect(()=>{if(!e){A(null);return}let me=!1;(async()=>{try{const ct=await ae.getContextUsage(e,p);me||A(ct)}catch{me||A(null)}})();const Ue=()=>{ae.getContextUsage(e,p).then(ct=>{me||A(ct)}).catch(()=>{})};return window.addEventListener("llm-config-changed",Ue),()=>{me=!0,window.removeEventListener("llm-config-changed",Ue)}},[e,p]),w.useEffect(()=>{if(!T)return;const me=setTimeout(()=>N(null),3e3);return()=>clearTimeout(me)},[T]);const le=w.useRef(new Set);w.useEffect(()=>()=>{for(const me of le.current)URL.revokeObjectURL(me)},[]);const ee=w.useCallback(me=>{v(Ue=>{const ct=Ue.find(tt=>tt.id===me);return ct!=null&&ct.previewUrl&&(URL.revokeObjectURL(ct.previewUrl),le.current.delete(ct.previewUrl)),Ue.filter(tt=>tt.id!==me)})},[]),Ie=w.useCallback(async me=>{if(me.length===0)return;const Ue=Yi.maxPerMessage-b.length;if(Ue<=0){N(d("chat.attach.tooMany",{n:Yi.maxPerMessage}));return}const ct=me.length>Ue?me.slice(0,Ue):me;me.length>Ue&&N(d("chat.attach.tooMany",{n:Yi.maxPerMessage}));const tt=[],ft=[];for(const Xe of ct){const Pe=dI(Xe.name,Xe.type,Xe.size);if(!Pe.ok){N(Pe.reason==="unsupported"?d("chat.attach.unsupported",{name:Xe.name}):Pe.reason==="tooLargeImage"?d("chat.attach.tooLargeImage",{name:Xe.name}):d("chat.attach.tooLargeText",{name:Xe.name}));continue}if(Pe.kind==="image"){if((k==null?void 0:k.visionCapable)===!1){N(d("chat.attach.visionUnsupported"));continue}const oe=await new Promise(_e=>{const Ae=new FileReader;Ae.onload=()=>{const ze=Ae.result;_e(typeof ze=="string"?ze.slice(ze.indexOf(",")+1):null)},Ae.onerror=()=>_e(null),Ae.readAsDataURL(Xe)});if(oe===null)continue;const ge=URL.createObjectURL(Xe);ft.push(ge),tt.push({id:++u1,kind:"image",name:Xe.name,mime:Xe.type||"image/png",size:Xe.size,previewUrl:ge,base64:oe})}else try{const oe=await Xe.text();tt.push({id:++u1,kind:"text",name:Xe.name,mime:Xe.type||"text/plain",size:Xe.size,text:oe})}catch{}}if(tt.length>0){for(const Xe of ft)le.current.add(Xe);v(Xe=>[...Xe,...tt])}else for(const Xe of ft)URL.revokeObjectURL(Xe)},[b.length,k==null?void 0:k.visionCapable,d]),de=me=>{const Ue=me.trim();if(n||!e||!Ue&&b.length===0)return;const ct=Ue||W0("chat.attach.imageOnlyText"),tt=b.map(ft=>({kind:ft.kind,name:ft.name,mime:ft.mime,size:ft.size,data:ft.kind==="image"?ft.base64??"":ft.text??"",...ft.kind==="image"&&ft.previewUrl?{previewUrl:ft.previewUrl}:{}}));re(ct,void 0,tt.length>0?tt:void 0),x(""),v([])},he=()=>de(g),pe=me=>{n||(re(me.message,me.label),me.frictionCategory&&(u==null||u(me.frictionCategory,null)))},Ce=me=>{const Ue=Array.from(me.clipboardData.files??[]);Ue.length>0&&(me.preventDefault(),Ie(Ue))},Oe=me=>{me.dataTransfer.types.includes("Files")&&(me.preventDefault(),C.current+=1,S(!0))},st=me=>{me.dataTransfer.types.includes("Files")&&(C.current=Math.max(0,C.current-1),C.current===0&&S(!1))},Be=me=>{me.dataTransfer.types.includes("Files")&&(me.preventDefault(),C.current=0,S(!1),Ie(Array.from(me.dataTransfer.files??[])))},ut=w.useMemo(()=>Zp(g),[g]);return t?f.jsxs("div",{className:"px-5 pb-4 pt-1 shrink-0","data-testid":"composer",children:[!F&&i.length>0&&e&&f.jsx("div",{className:"flex items-center gap-1.5 overflow-x-auto pb-2","data-testid":"starter-prompts",children:i.map((me,Ue)=>f.jsx("button",{onClick:()=>pe(me),disabled:n,"data-testid":`starter-prompt-${Ue}`,"data-tooltip":me.hint??me.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:me.label},Ue))}),f.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:Oe,onDragOver:me=>{me.dataTransfer.types.includes("Files")&&me.preventDefault()},onDragLeave:st,onDrop:Be,"data-testid":"composer-card",children:F?f.jsxs(f.Fragment,{children:[j!=="idle"&&f.jsx(TI,{view:j,level:Q.level,text:R,onTextChange:H,onSend:ce,onRerecord:K,errorMessage:Z,sendDisabled:n||!e||!R.trim()}),f.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[f.jsxs("span",{className:"flex items-center gap-1.5 text-label text-ink-muted font-medium",children:[f.jsx(Oi,{className:"w-3.5 h-3.5 text-accent"}),d("chat.speech.dictation")]}),f.jsxs("button",{type:"button",onClick:X,"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:[f.jsx(_y,{className:"w-3.5 h-3.5"}),f.jsx("span",{children:d("chat.speech.keyboard")})]})]}),f.jsxs("button",{type:"button",onPointerDown:me=>{me.preventDefault(),Q.beginHold()},onPointerUp:Q.endHold,onPointerLeave:Q.endHold,onPointerCancel:Q.endHold,onContextMenu:me=>me.preventDefault(),disabled:!e||j!=="idle","data-testid":Q.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 ${Q.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:[f.jsx(Oi,{className:"w-5 h-5"}),Q.listening?d("chat.speech.release_to_stop"):d("chat.speech.hold_to_talk")]})]}):f.jsxs(f.Fragment,{children:[r.length>0&&f.jsxs("div",{className:"flex items-center gap-1 overflow-x-auto mb-1","data-testid":"soul-picker",children:[f.jsx("span",{className:"text-body text-ink-faint shrink-0",children:d("chat.soul.label")}),r.map(me=>{const Ue=a===me.name,ct=SI[me.name]??qp,tt=d(AI[me.name]??"soul.direct.desc");return f.jsxs("button",{onClick:()=>s(me.name),"data-testid":`soul-pill-${me.name}`,"data-tooltip":tt,className:`shrink-0 flex items-center gap-1 px-2 py-0.5 rounded-full text-body font-medium transition-colors ${Ue?"bg-brand/15 text-brand":"text-ink-muted hover:text-ink-strong hover:bg-ink/5"}`,children:[f.jsx(ct,{className:"w-3.5 h-3.5"}),f.jsx("span",{children:d(EI[me.name]??"soul.direct")})]},me.id)})]}),b.length>0&&f.jsxs("div",{className:"flex gap-1.5 flex-wrap mb-1.5","data-testid":"composer-attachments",children:[(k==null?void 0:k.visionBridgeModel)&&b.some(me=>me.kind==="image")&&f.jsxs("div",{className:"w-full flex items-center gap-1 text-caption text-ink-muted","data-testid":"vision-bridge-chip",children:[f.jsx($y,{className:"w-3.5 h-3.5 shrink-0"}),f.jsx("span",{children:d("chat.attach.bridgeChip",{model:k.visionBridgeModel})})]}),b.map(me=>me.kind==="image"?f.jsxs("div",{className:"relative w-16 h-16 shrink-0",children:[f.jsx("img",{src:me.previewUrl,alt:me.name,className:"w-16 h-16 object-cover rounded-lg border border-[var(--border)]"}),f.jsx("button",{type:"button",onClick:()=>ee(me.id),"aria-label":d("chat.attach.remove",{name:me.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:f.jsx(Bn,{className:"w-3 h-3"})})]},me.id):f.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:[f.jsx(hs,{className:"w-3 h-3 shrink-0 text-ink-faint"}),f.jsx("span",{className:"truncate max-w-[10rem]",children:me.name}),f.jsx("button",{type:"button",onClick:()=>ee(me.id),"aria-label":d("chat.attach.remove",{name:me.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:f.jsx(Bn,{className:"w-2.5 h-2.5"})})]},me.id))]}),T&&f.jsx("div",{className:"text-caption text-warning pb-1",role:"status","data-testid":"composer-notice",children:T}),f.jsxs("div",{className:"flex gap-2 items-end",children:[f.jsx("textarea",{value:g,onChange:me=>x(me.target.value),onFocus:()=>yh(!0),onBlur:()=>yh(!1),onKeyDown:me=>{me.key==="Enter"&&!me.shiftKey&&(me.preventDefault(),he())},onPaste:Ce,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?f.jsx("button",{onClick:l,"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:f.jsx(V0,{className:"w-3.5 h-3.5 fill-current"})}):f.jsx("button",{onClick:he,disabled:n||!g.trim()&&b.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:f.jsx(my,{className:"w-4 h-4"})})]}),f.jsxs("div",{className:"composer-toolbar flex flex-wrap items-center justify-between gap-x-0.5 gap-y-1 mt-0.5",children:[f.jsx("button",{type:"button",onClick:()=>{K(),O(!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:f.jsx(Oi,{className:"w-3.5 h-3.5"})}),f.jsx("button",{type:"button",onClick:()=>{var me;return(me=I.current)==null?void 0:me.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:f.jsx(zy,{className:"w-3 h-3"})}),f.jsx("input",{ref:I,type:"file",multiple:!0,accept:CI,className:"hidden",onChange:me=>{Ie(Array.from(me.target.files??[])),me.target.value=""}}),f.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-0.5",children:[f.jsx(wI,{}),f.jsx(bI,{info:k,historyTokens:m,draftTokens:ut}),f.jsx(xI,{onGotoSettings:c})]})]})]})})]}):f.jsx("div",{className:"px-5 pb-4 shrink-0","data-testid":"composer-nokey",children:f.jsxs("div",{className:"flex items-center justify-center gap-3 py-3 text-body text-ink-muted",children:[f.jsx("span",{children:d("chat.no_key.short")}),f.jsx("button",{onClick:c,className:"text-brand hover:underline font-bold",children:d("chat.no_key.cta")})]})})}const c1={viseme:"closed",open:0};function MI(e){const[t,n]=w.useState(c1);return w.useEffect(()=>{if(!e){n(c1);return}const r=new Uint8Array(256),a=new Uint8Array(F4/2);let i=0,s="",o=null,l=0;const u=()=>{const c=kM();if(c){let h,m;if(c.timeline&&c.timeline.cues.length>0){const g=Math.max(0,c.ctx.currentTime-c.startedAtCtxTime),x=PM(c.timeline,g);h=(x==null?void 0:x.viseme)??"closed",m=(x==null?void 0:x.level)??0}else if(c.analyser){const g=c.analyser;g.getByteTimeDomainData(r),g.getByteFrequencyData(a);const x=V3(r,a,g.context.sampleRate,g.fftSize);h=x.viseme,h!==s.split(":")[0]?(h==="closed"||h===o?h===o&&l++:(o=h,l=1),h!=="closed"&&!(h===o&&l>=2)&&(h=s.split(":")[0]||"closed")):(o=null,l=0),m=x.level}else h="closed",m=0;const d=$3(h,m),p=h+":"+d;p!==s&&(s=p,n({viseme:h,open:d}))}i=requestAnimationFrame(u)};return i=requestAnimationFrame(u),()=>cancelAnimationFrame(i)},[e]),t}const II=22,_I=35e-5,d1=.012,h1=.12,f1=.3,RI=16.667,$u=12,LI=3.2,m1=56,Pa=.6;function DI(e,t,n,r,a=0,i=0){let s=0,o=0;for(const u of r){const c=e-u.x,h=t-u.y,m=Math.hypot(c,h),d=u.r+n,p=d+m1;if(m>=p)continue;if(m<1e-4){o-=Pa;continue}const g=c/m,x=h/m,b=Math.min(1.6,Math.max(0,1-(m-d)/m1)),v=a*g+i*x,T=v<0?1+Math.min(1.6,-v/4):1;s+=g*Pa*b*T,o+=x*Pa*b*T}const l=Math.hypot(s,o);return l>Pa*2&&(s=s/l*Pa*2,o=o/l*Pa*2),{x:s,y:o}}function PI(e,t,n,r=34){const a=n*.001;return{x:e.x+Math.sin(a*.31+t*2.1)*r,y:e.y+Math.sin(a*.47+t*4.7)*(r*.55)+Math.sin(a*1.7+t)*4}}function OI(e,t,n,r,a=RI){const i=Math.max(64,a*a),s=c0((n.x-e.x)*d1-t.x*h1,f1),o=c0((n.y-e.y)*d1-t.y*h1,f1);return{fx:s*r/i,fy:o*r/i-r*.001}}function c0(e,t){return e>t?t:e<-t?-t:e}function jI(e,t,n,r,a,i,s,o,l,u){const c=e-i,h=t-s,m=Math.hypot(c,h),d=a+u;if(m>=d||m<1e-4)return null;const p=c/m,g=h/m,x=n-o,b=r-l,v=x*p+b*g,T=d-m,N=v<0?-v*.9:0;return{nx:p,ny:g,dvx:p*(T*.55+N*.85),dvy:g*(T*.55+N*.85),bfx:-p*N*.02,bfy:-g*N*.02,hitSpeed:-v}}function BI(e,t){return Math.hypot(e,t)<.35?0:c0(e*.06,.5)}function FI(e,t,n,r=0){const a=[.14,.32,.5,.68,.86],i=[.38,.5,.62],s=(r%15+15)%15;let o={x:e*.5,y:t*.5},l=-1/0;for(let u=0;u<15;u++){const c=(s+u)%15,h=e*a[c%5],m=t*i[Math.floor(c/5)];let d=1/0;for(const p of n){const g=Math.hypot(h-p.x,m-p.y)-p.r;g<d&&(d=g)}d>l+1e-9&&(l=d,o={x:h,y:m})}return o}function zI(e,t,n=220){let r=null,a=n;for(const i of t){const s=Math.hypot(i.x-e.x,i.y-e.y);s<a&&(a=s,r={x:i.x,y:i.y})}return r}function HI(e){const t=e.radius??II,{Bodies:n,Body:r,Composite:a,Engine:i}=Dr,s=i.create();s.gravity.y=1,s.positionIterations=4,s.velocityIterations=3;const o=n.circle(e.width*.7,120,t,{restitution:.55,friction:.02,frictionAir:.028,density:_I});a.add(s.world,o);const l=240;let u=[];const c=(d,p)=>{for(const x of u)a.remove(s.world,x);const g=(x,b,v,T)=>n.rectangle(x,b,v,T,{isStatic:!0,restitution:.5});u=[g(-l/2,p/2-160,l,p+640),g(d+l/2,p/2-160,l,p+640),g(d/2,p+l/2,d+l*2,l),g(d/2,-320-l/2,d+l*2,l)];for(const x of u)a.add(s.world,x)};c(e.width,e.height);let h=0,m=e.width;return{body:o,resize(d,p){m=d,c(d,p)},step(d,p,g,x,b){const v=x<h;i.update(s,Math.min(33,Math.max(8,d)));let T=!1;if(!v&&p){const F=b!=null&&b.settle?{x:p.x,y:p.y+Math.sin(x*.0012)*2}:PI(p,Math.floor(x/4200),x),O=Math.max(64,d*d),R=OI({x:o.position.x,y:o.position.y},{x:o.velocity.x,y:o.velocity.y},F,o.mass,d),H=DI(o.position.x,o.position.y,t,g,o.velocity.x,o.velocity.y);r.applyForce(o,o.position,{x:R.fx+H.x*o.mass/O,y:R.fy+H.y*o.mass/O}),r.setAngularVelocity(o,o.angularVelocity-o.angle*.06-o.angularVelocity*.08)}{const F=o.velocity,O=Math.hypot(F.x,F.y);O>$u&&r.setVelocity(o,{x:F.x/O*$u,y:F.y/O*$u})}let N=0,k=0,A=0,_=0,S=0;for(const F of g){const O=jI(o.position.x,o.position.y,o.velocity.x,o.velocity.y,t,F.x,F.y,F.vx,F.vy,F.r);O&&(k+=O.nx*Math.min(4,O.dvx),A+=O.ny*Math.min(4,O.dvy),_+=O.dvx*.9,S+=O.dvy*.9,F.isStatic||F.push(O.bfx,O.bfy),O.hitSpeed>N&&(N=O.hitSpeed))}const I=Math.hypot(k,A);I>4&&(k=k/I*4,A=A/I*4);const C=Math.hypot(_,S);C>7&&(_=_/C*7,S=S/C*7),(I>0||C>0)&&(r.setPosition(o,{x:o.position.x+k,y:o.position.y+A}),r.setVelocity(o,{x:o.velocity.x+_,y:o.velocity.y+S})),N>=LI&&!v&&(h=x+900,T=!0);const D=o.position;D.x<t&&(r.setPosition(o,{x:t,y:D.y}),o.velocity.x<0&&r.setVelocity(o,{x:-o.velocity.x*.5,y:o.velocity.y})),D.x>m-t&&(r.setPosition(o,{x:m-t,y:D.y}),o.velocity.x>0&&r.setVelocity(o,{x:-o.velocity.x*.5,y:o.velocity.y}));const L=b==null?void 0:b.ceilY;return L!==void 0&&D.y<L+t&&(r.setPosition(o,{x:D.x,y:L+t}),o.velocity.y<0&&r.setVelocity(o,{x:o.velocity.x,y:-o.velocity.y*.5})),T},dizzyRemaining(d){return Math.max(0,h-d)},throwDizzy(d){h=d+900},dispose(){a.clear(s.world,!1),i.clear(s)}}}const wn={rail:76,chat:96,notebook:120};function p1(){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 UI(){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 qI({courseId:e}){const t=w.useSyncExternalStore(Bp,hc),n=MI(t.state.talking),r=j0(),[a,i]=w.useState(!1),[s,o]=w.useState(null),[l,u]=w.useState("rail"),c=w.useRef("rail"),h=w.useRef(null),[m,d]=w.useState(!1),p=w.useRef(!1),g=w.useRef(null),x=w.useRef(null),b=w.useRef(null),v=w.useRef(null),T=w.useRef(t.state.zone),N=w.useRef(!1),k=w.useRef(0),A=w.useRef(null),[_,S]=w.useState(null),I=w.useRef(0),C=w.useRef(null),D=w.useRef(null),L=w.useRef(0),F=w.useRef(null),O=w.useRef(0),R=w.useRef({pane:"rail",bucket:-1}),H=w.useRef(null),V=w.useRef(null);w.useEffect(()=>{var ne,j,re;if(l===T.current||(T.current=l,r))return;i(!0),(j=(ne=g.current)==null?void 0:ne.animate)==null||j.call(ne,[{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"}),(re=g.current)==null||re.classList.add("cp-takeoff"),setTimeout(()=>{var K;return(K=g.current)==null?void 0:K.classList.remove("cp-takeoff")},650);const Q=[setTimeout(()=>i(!1),950),setTimeout(()=>{var X;const K=g.current;!K||l==="rail"||(W3(),(X=K.animate)==null||X.call(K,[{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 K of Q)clearTimeout(K)}},[l,r]),w.useEffect(()=>{if(!e)return;let Q=!0;return window.api.getDashboard(e).then(ne=>{var X,ce;if(!Q)return;const j=(X=ne==null?void 0:ne.frictionByNode)==null?void 0:X[0];if(!(j!=null&&j.nodeId))return;V.current=j.nodeId;const re=kh(),K=(ce=re.nav)==null?void 0:ce.getBoundingClientRect();if(K)for(const{island:le,container:ee}of re.sections.values()){const Ie=le.ball(j.nodeId);if(!Ie)continue;const de=ee.getBoundingClientRect(),he=de.left-K.left+Ie.body.position.x,pe=de.top-K.top+Ie.body.position.y;D.current={x:he,y:Math.max(40,pe-92)},L.current=performance.now()+8e3,setTimeout(()=>{Q&&Th()},1200);return}}).catch(()=>{}),()=>{Q=!1}},[e]),w.useEffect(()=>{const Q=ne=>{const j=ne.detail,re=V.current;j!=="mastery"||!re||!e||window.api.getDashboard(e).then(K=>{var ce;((ce=K==null?void 0:K.frictionByNode)==null?void 0:ce.some(le=>le.nodeId===re))||(V.current=null,L.current=0,Y3())}).catch(()=>{})};return window.addEventListener("companion-state-changed",Q),()=>window.removeEventListener("companion-state-changed",Q)},[e]),w.useEffect(()=>{const Q=j=>{const re=F.current;if(!re)return;const K=performance.now(),X=Math.max(8,K-re.t);F.current={x:j.clientX,y:j.clientY,vx:(j.clientX-re.x)/X*16.7,vy:(j.clientY-re.y)/X*16.7,t:K}},ne=()=>{const j=F.current;if(!j)return;F.current=null;const re=Math.hypot(j.vx,j.vy),K=x.current;K&&re>=2.5&&(Dr.Body.setVelocity(K.body,{x:j.vx*.9,y:j.vy*.9}),K.throwDizzy(performance.now())),vh(!1,re)};return window.addEventListener("pointermove",Q,{passive:!0}),window.addEventListener("pointerup",ne,{passive:!0}),window.addEventListener("pointercancel",ne,{passive:!0}),()=>{window.removeEventListener("pointermove",Q),window.removeEventListener("pointerup",ne),window.removeEventListener("pointercancel",ne)}},[]),w.useEffect(()=>{if(!t.enabledLoaded||!t.enabled||t.petMode)return;const Q=g.current;if(!Q)return;let ne=0,j=performance.now(),re=0,K=0,X=0,ce=-1e9,le=null,ee=null,Ie=0,de=0;const he=pe=>{var Ze,Yr,ie,nt,Tt,tn,Xn,Ar;ne=requestAnimationFrame(he);const Ce=Math.min(50,pe-j);j=pe;const Oe=kh(),st=Oe.nav,Be=(st==null?void 0:st.getBoundingClientRect())??null,ut=hc().state,me=!!F.current,Ue=!!Be&&Be.width>40&&(Oe.visible||ut.importing);pe-ce>150&&(ce=pe,le=((Ze=document.querySelector('[data-testid="chat-panel"]'))==null?void 0:Ze.getBoundingClientRect())??null,ee=((Yr=document.querySelector('[data-testid="notebook-panel"]'))==null?void 0:Yr.getBoundingClientRect())??null,Ie=((ie=document.querySelector("header.app-header"))==null?void 0:ie.getBoundingClientRect().bottom)??0,de=((nt=document.querySelector('[data-testid="map-rail-topbar"]'))==null?void 0:nt.getBoundingClientRect().bottom)??0);const ct=le,tt=ee,ft=()=>Math.max(Ie,de)-((Be==null?void 0:Be.top)??0),Xe=Math.floor(pe/X3);if(R.current.bucket!==Xe){const Ge=[];if(Ue&&Ge.push("rail"),ct&&Ge.push("chat"),tt&&Ge.push("notebook"),R.current={pane:K3(R.current.pane,Xe,Ge),bucket:Xe},Ue&&ut.zone==="roam"){const et=document.querySelector('[data-testid="map-review-badge"]'),Lt=!!et&&et.className.includes("bg-review/20");let Et=null;for(const{island:Qe,container:rt}of Oe.sections.values()){const ln=Qe.balls.find(ht=>!ht.body.isStatic);if(ln){const ht=rt.getBoundingClientRect();Et={x:ht.left+ln.body.position.x,y:ht.top+ln.body.position.y};break}}const Yt=L.current>pe?D.current:null,ot=ey(Xe,{hasReview:Lt,hasNext:!!Et,hasFriction:!!Yt});if(ot==="review"&&et){const Qe=et.getBoundingClientRect();H.current={kind:ot,until:pe+zl,pos:{x:Qe.right+44,y:Qe.bottom+64},fired:!1},R.current.pane="rail"}else ot==="inspect"&&Et?(H.current={kind:ot,until:pe+zl,pos:{x:Et.x+34,y:Et.y-66},fired:!1},R.current.pane="rail"):ot==="friction"&&Yt&&(H.current={kind:ot,until:pe+zl,pos:{x:Yt.x,y:Yt.y},fired:!1},R.current.pane="rail")}}const Pe=H.current&&pe<H.current.until?H.current:null;H.current&&!Pe&&(H.current=null);const oe=ty();if(oe&&oe.seq!==k.current&&!ut.examActive){k.current=oe.seq;let Ge=oe.x,et=oe.y;if((Ge==null||et==null)&&Ue)for(const{island:Lt,container:Et}of Oe.sections.values()){const Yt=Lt.ball(oe.nodeId);if(Yt){const ot=Et.getBoundingClientRect();Ge=ot.left+Yt.body.position.x,et=ot.top+Yt.body.position.y;break}}Ue&&Ge!=null&&et!=null?(A.current={nodeId:oe.nodeId,x:Ge,y:et,until:pe+2400,fired:!1,fly:!0},S({until:pe+2400})):(A.current={nodeId:oe.nodeId,x:0,y:0,until:pe+1600,fired:!0,fly:!1},S({until:pe+1600}))}const ge=!!A.current&&pe<A.current.until;if(A.current&&!ge&&(A.current=null,S(null)),ge&&A.current&&!A.current.fired){const Ge=A.current;if(Ge.fired=!0,Ge.fly&&Be)for(const{island:et}of Oe.sections.values()){const Lt=et.ball(Ge.nodeId);if(Lt&&!Lt.body.isStatic){Dr.Body.applyForce(Lt.body,Lt.body.position,{x:.0035,y:-.005});break}}}const _e=ny();if(_e&&_e.seq!==I.current&&!ut.examActive&&(I.current=_e.seq,Ue&&Be)){const Ge=ft();C.current={x:Math.min(Be.width-44,Math.max(44,_e.x-Be.left)),y:Math.min(Be.height-44,Math.max(Ge+52,_e.y-Be.top)),until:pe+3200}}const Ae=!!C.current&&pe<C.current.until;C.current&&!Ae&&(C.current=null);const ze=BN(),ye=ze?ze.startContainer.parentElement??null:null;let Re=null,He=R.current.pane;const dt=ut.examActive?(Tt=document.querySelector('[data-testid="exam-timer"]'))==null?void 0:Tt.getBoundingClientRect():void 0;if(dt){x.current=null,F.current=null,He="chat";const Ge={x:Math.min(dt.right+64,window.innerWidth-70),y:Math.min(dt.bottom+56,window.innerHeight-90)},et=b.current??Ge;Re=zn(et,Ge,Ce,xi),X=Math.max(-.15,Math.min(.15,(Re.x-et.x)*.008))}else if(me){const Ge=F.current;x.current=null,Re={x:Ge.x,y:Ge.y},X=Math.max(-.5,Math.min(.5,Ge.vx*.04)),He=c.current}else if(ye&&ze){const Ge=ye.closest('[data-testid="notebook-panel"], [data-testid="chat-stream"]'),et=Ge==null?void 0:Ge.getBoundingClientRect(),Lt=ze.getClientRects(),Et=[];for(let ht=0;ht<Lt.length;ht++){const Nt=Lt[ht];Nt.width>1&&Nt.height>1&&Et.push({left:Nt.left,right:Nt.right,top:Nt.top,bottom:Nt.bottom})}const Yt=Et.length?Et[Et.length-1]:null,ot=Et.length?Et[0]:null,Qe=ze.getBoundingClientRect(),rt=!!(Ge!=null&&Ge.closest('[data-testid="chat-stream"]')),ln=rt?wn.chat:wn.notebook;if(He=rt?"chat":"notebook",et&&(Yt||Qe.width>0)){const ht=wh({left:Qe.left,right:Qe.right,top:Qe.top,bottom:Qe.bottom},et,ln,{first:ot??void 0,last:Yt??void 0},Et),Nt={dir:ht.dir,pane:He};if((((tn=h.current)==null?void 0:tn.dir)!==Nt.dir||((Xn=h.current)==null?void 0:Xn.pane)!==Nt.pane)&&(h.current=Nt,o(Nt)),p.current!==ht.occluding&&(p.current=ht.occluding,d(ht.occluding)),r)Re=ht,X=0;else{const $t=b.current??{x:ht.x,y:ht.y};Re=zn($t,ht,Ce,Z3,110),X=ht.dir==="left"?-.07:ht.dir==="right"?.07:0}}else{h.current!==null&&(h.current=null,o(null)),p.current&&(p.current=!1,d(!1));const ht=et?{left:et.left,top:et.top,right:et.right,bottom:et.bottom}:{left:8,top:8,right:window.innerWidth-8,bottom:window.innerHeight-8},Nt=Zr(ht,ln,pe),$t=b.current??{x:Nt.x,y:Nt.y};Re=zn($t,Nt,Ce,bi,140),X=Math.max(-.25,Math.min(.25,(Re.x-$t.x)*.01))}}else{h.current!==null&&(h.current=null,o(null)),p.current&&(p.current=!1,d(!1));const Ge=ut.pose==="writing"?zN():null,et=ut.zone,Lt=Ge?Ge.closest('[data-testid="notebook-panel"], [data-testid="chat-stream"]'):null,Et=Ge==null?void 0:Ge.getBoundingClientRect(),Yt=!!(Lt&&Et&&Et.width>0);if(Ge&&Yt){const ot=Lt,Qe=ot.getBoundingClientRect(),rt=Et,ln=!!ot.closest('[data-testid="chat-stream"]');He=ln?"chat":"notebook";{const ht=wh(rt,Qe,ln?wn.chat:wn.notebook);if(x.current=null,r)Re=ht,X=0;else{const Nt=b.current??{x:ht.x,y:ht.y};Re=zn(Nt,ht,Ce,xi),X=.08}}}else if(et==="chat"&&p1()){x.current=null,He="chat";const ot=p1();if(r)Re=ot,X=0;else{const Qe=Q3("chat",pe),rt=b.current??{x:ot.x,y:ot.y};Re=zn(rt,{x:ot.x+Qe.x,y:ot.y+Qe.y},Ce,xi),X=Math.max(-.35,Math.min(.35,(Re.x-rt.x)*.014))}}else if(et==="notebook"&&tt)if(x.current=null,He="notebook",r)Re=UI()??{x:tt.left+tt.width/2,y:tt.top+120},X=0;else{const ot=Zr(tt,wn.notebook,pe),Qe=b.current??{x:ot.x,y:ot.y};Re=zn(Qe,ot,Ce,xi),X=Math.max(-.3,Math.min(.3,(Re.x-Qe.x)*.012))}else if(Ue&&(ge||Ae||et==="rail"||et==="roam"&&(R.current.pane==="rail"||Pe))){const ot=Be.width,Qe=Be.height;if(He="rail",r)Re={x:Be.left+ot*.5,y:Be.top+Qe*.5},X=0;else{if((ot!==re||Qe!==K)&&(re=ot,K=Qe,(Ar=x.current)==null||Ar.resize(ot,Qe),D.current=null),!x.current){x.current=HI({width:ot,height:Qe});const Kt=b.current;Kt&&Dr.Body.setPosition(x.current.body,{x:Math.min(ot-30,Math.max(30,Kt.x-Be.left)),y:Math.min(Qe-30,Math.max(30,Kt.y-Be.top))})}const rt=x.current,ln=[],ht=[];for(const{island:Kt,container:Kr}of Oe.sections.values()){const Xr=Kr.getBoundingClientRect();if(Xr.bottom<Be.top-120||Xr.top>Be.bottom+120)continue;const gi=Xr.left-Be.left,Na=Xr.top-Be.top;for(const Xt of Kt.balls)ln.push({x:gi+Xt.body.position.x,y:Na+Xt.body.position.y,vx:Xt.body.velocity.x,vy:Xt.body.velocity.y,r:Rn,isStatic:Xt.body.isStatic,push:(Qr,Pl)=>Dr.Body.applyForce(Xt.body,Xt.body.position,{x:Qr,y:Pl})}),ht.push({x:gi+Xt.body.position.x,y:Na+Xt.body.position.y-Rn-20});for(const Xt of Kt.links)for(const Qr of Xt.particles)ht.push({x:gi+Qr.position.x,y:Na+Qr.position.y-8})}const Nt=et==="roam";let $t=D.current,Ca=!1;if(Ae&&C.current)$t={x:C.current.x+28,y:C.current.y-52},Ca=!1;else if(ge&&A.current&&A.current.fly)$t={x:A.current.x-Be.left+34,y:A.current.y-Be.top-46},Ca=!1;else if(Pe)$t={x:Pe.pos.x-Be.left,y:Pe.pos.y-Be.top},Pe.fired||(Pe.fired=!0,Th());else if(Nt){const Kt=Zr(Be,wn.rail,pe);$t={x:Kt.x-Be.left,y:Kt.y-Be.top}}else{if(ut.mode==="veil"){const Kt=zI({x:rt.body.position.x,y:rt.body.position.y},ht,220);Kt&&($t=Kt,Ca=!0)}(!$t||pe>L.current)&&(D.current=FI(ot,Qe,ln,Math.floor(pe/1e3)),L.current=pe+3e3,$t=D.current)}const Is=rt.step(Ce,$t,ut.mode==="veil"&&!Nt?[]:ln,pe,{settle:Ca,ceilY:ft()});if(Is&&!N.current&&J3(),N.current=Is||rt.dizzyRemaining(pe)>0,rt.dizzyRemaining(pe)===0){const Kt=sg(Oe.weather);if(Kt.wind>=.3){const Kr=rt.body.mass;Dr.Body.applyForce(rt.body,rt.body.position,{x:ig(rt.body.position.x,rt.body.position.y,pe)*Kt.wind*ag*Kr*2.2,y:0})}(Oe.weather==="rain"||Oe.weather==="storm")&&ut.mode!=="veil"&&pe>O.current&&(O.current=pe+6e3+Math.random()*4e3,Q.classList.add("cp-shiver"),setTimeout(()=>Q.classList.remove("cp-shiver"),460))}const nn=rt.body.position,pi={x:Be.left+nn.x,y:Be.top+nn.y},Dt=b.current??pi;Re=zn(Dt,pi,Ce,xi),X=rt.body.angle+BI(rt.body.velocity.x,rt.body.velocity.y)}}else{x.current=null;const ot=R.current.pane;if(ot==="chat"&&ct){He="chat";const Qe=Zr(ct,wn.chat,pe),rt=b.current??{x:Qe.x,y:Qe.y};Re=zn(rt,Qe,Ce,bi,140),X=Math.max(-.25,Math.min(.25,(Re.x-rt.x)*.01))}else if(ot==="notebook"&&tt){He="notebook";const Qe=Zr(tt,wn.notebook,pe),rt=b.current??{x:Qe.x,y:Qe.y};Re=zn(rt,Qe,Ce,bi,140),X=Math.max(-.25,Math.min(.25,(Re.x-rt.x)*.01))}else if(Ue){He="rail";const Qe=Zr(Be,wn.rail,pe),rt=b.current??{x:Qe.x,y:Qe.y};Re=zn(rt,Qe,Ce,bi,140),X=Math.max(-.25,Math.min(.25,(Re.x-rt.x)*.01))}else{He="chat";const Qe=Zr({left:8,top:8,right:window.innerWidth-8,bottom:window.innerHeight-8},wn.chat,pe),rt=b.current??{x:Qe.x,y:Qe.y};Re=zn(rt,Qe,Ce,bi,140),X=Math.max(-.25,Math.min(.25,(Re.x-rt.x)*.008))}}}if(c.current!==He&&(c.current=He,u(He)),!Re){Q.style.opacity="0",b.current=null,v.current=null;return}b.current=Re;const Jt=Q.offsetWidth||wn[He],Ot=He==="rail"?Math.max(Ie,de):Ie;Re.y<Ot+Jt/2+10&&(Re.y=Ot+Jt/2+10),Q.style.transform=`translate3d(${(Re.x-Jt/2).toFixed(1)}px, ${(Re.y-Jt/2).toFixed(1)}px, 0) rotate(${(X*57.2958).toFixed(1)}deg)`;const en=v.current;if(en){const Ge=Re.x-en.x,et=Re.y-en.y,Et=Math.hypot(Ge,et)/Math.max(1,Ce);if(Q.style.setProperty("--cp-speed",Math.min(1,Et/.45).toFixed(3)),Et>.02){const Yt=(Math.atan2(et,Ge)*57.2958+90+360)%360;Q.style.setProperty("--cp-thrust-deg",Yt.toFixed(1)+"deg")}}v.current={x:Re.x,y:Re.y}};return ne=requestAnimationFrame(he),()=>{var pe;cancelAnimationFrame(ne),(pe=x.current)==null||pe.dispose(),x.current=null}},[t.enabledLoaded,t.enabled,t.petMode,r]);const q=w.useRef(0);if(w.useEffect(()=>{const Q=g.current;if(!Q||t.state.keySeq===q.current||t.state.examActive)return;q.current=t.state.keySeq,Q.classList.remove("cp-keypress"),Q.offsetWidth,Q.classList.add("cp-keypress");const ne=setTimeout(()=>Q.classList.remove("cp-keypress"),160);return()=>clearTimeout(ne)},[t.state.keySeq]),!t.enabledLoaded||!t.enabled||t.petMode)return null;const Z=a?"flying":t.state.typing?"typing":_||(s==null?void 0:s.dir)==="left"?"point":(s==null?void 0:s.dir)==="right"?"pointr":(s==null?void 0:s.dir)==="up"?"pointu":(s==null?void 0:s.dir)==="down"?"pointd":t.state.pose,B=s?wn[s.pane]:wn[l];return f.jsx("div",{ref:g,className:`cp-creature fixed left-0 top-0 z-40 will-change-transform ${t.state.mode==="veil"?"cp-veil":""} ${m?"cp-occluding":""} ${t.state.grabbed?"cp-grabbed":""}`,"data-testid":"companion-creature","data-zone":t.state.zone==="roam"?l:t.state.zone,"data-mode":t.state.mode,children:f.jsx(Fp,{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:Z,viseme:n.viseme,openScale:n.open,energyRatio:t.energyRatio,streakLit:t.streakLit,size:B,interactive:!0,ariaLabel:"companion",onPoke:G3,onGrab:(Q,ne)=>{F.current||(F.current={x:Q,y:ne,vx:0,vy:0,t:performance.now()},vh(!0))},haloBadge:t.halo,testid:"companion-mascot",keySeq:t.state.keySeq,keySide:t.state.keySide})})}function Wu(e,t=4){const n=(e.match(/[\u2E80-\u9FFF\uF900-\uFAFF\uFF00-\uFFEF]/g)??[]).length,r=(e.match(/[A-Za-z]+/g)??[]).length;let a=45+Math.ceil(n/5)+Math.ceil(r/3)+Math.max(0,t)*8;return e.includes("```")&&(a+=25),/\$\$?[^$\n]+\$\$?/.test(e)&&(a+=25),Math.max(60,Math.min(300,Math.round(a)))}function VI(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function $I(e){let t=e>>>0;return()=>{t|=0,t=t+1831565813|0;let n=Math.imul(t^t>>>15,1|t);return n=n+Math.imul(n^n>>>7,61|n)^n,((n^n>>>14)>>>0)/4294967296}}function g1(e,t){const n=Array.from({length:e},(r,a)=>a);for(let r=e-1;r>0;r--){const a=Math.floor(t()*(r+1)),i=n[r];n[r]=n[a],n[a]=i}return n}function WI(e,t){const n=$I(VI(t)),r=g1(e.length,n),a={};for(const i of e)a[i.id]=g1(Math.max(1,i.optionCount),n);return{questionOrder:r,optionPerms:a}}function GI(e,t){const n=e[t];return String(n??t)}function YI({stars:e}){return f.jsx("div",{className:"flex gap-1","aria-label":`${e} stars`,children:[1,2,3].map(t=>f.jsx(Qy,{className:`w-7 h-7 ${t<=e?"text-gold fill-gold":"text-ink/20"}`},t))})}function KI({examNode:e,locale:t,onExamCompleted:n,onSessionChange:r,paused:a}){const i=$e(),[s,o]=w.useState("loading"),[l,u]=w.useState(null),[c,h]=w.useState([]),[m,d]=w.useState(null),[p,g]=w.useState(0),[x,b]=w.useState(null),[v,T]=w.useState(null),[N,k]=w.useState(""),[A,_]=w.useState(0),[S,I]=w.useState(null),C=w.useRef({}),D=w.useRef(null),L=w.useRef(null),F=w.useRef(null),O=m?c[m.questionOrder[p]]??null:null,R=O&&m?m.optionPerms[O.id]??[]:[],H=(O==null?void 0:O.options)??[],V=R.length===H.length?R:H.map((j,re)=>re);w.useEffect(()=>(Eh(!0),()=>Eh(!1)),[]),w.useEffect(()=>{let j=!1;return o("loading"),k(""),T(null),u(null),(async()=>{try{const re=await ae.examGetStatus(e.id);if(j)return;u(re),h(re.exercises),re.status==="generating"?o("generating"):re.status==="failed"?(k(re.error??i("exam.errorEmpty")),o("failed")):re.status==="ready"?re.latestAttempt&&re.latestAttempt.finishedAt?(T({correctCount:re.latestAttempt.correctCount,totalCount:re.latestAttempt.totalCount,stars:re.latestAttempt.stars,bestStars:re.bestStars,terminated:re.latestAttempt.terminated,perQuestion:re.latestAttempt.perQuestion??[]}),o("result")):o("ready"):(o("generating"),ae.examPrepare(e.id,t??null).catch(()=>{}))}catch(re){j||(k(re instanceof Error?re.message:String(re)),o("failed"))}})(),()=>{j=!0}},[e.id]),w.useEffect(()=>ae.on("exam:status",re=>{re.nodeId===e.id&&(re.status==="ready"?ae.examGetStatus(e.id).then(K=>{u(K),h(K.exercises),o(X=>X==="generating"?K.latestAttempt?"result":"ready":X)}).catch(()=>{}):re.status==="failed"?(k(re.error??i("exam.errorEmpty")),o("failed")):(u(K=>K&&{...K,...re}),o(K=>K==="loading"?"generating":K)))}),[e.id]);const q=w.useCallback(async()=>{var j,re,K;try{const X=await ae.examStartAttempt(e.id),ce=WI(X.exercises.map(le=>{var ee;return{id:le.id,optionCount:((ee=le.options)==null?void 0:ee.length)??0}}),X.attemptId);h(X.exercises),D.current=X.attemptId,d(ce),C.current={},g(0),b(null),T(null),L.current=null,o("answering"),_(Wu(((j=X.exercises[ce.questionOrder[0]])==null?void 0:j.prompt)??"",((K=(re=X.exercises[ce.questionOrder[0]])==null?void 0:re.options)==null?void 0:K.length)??4))}catch(X){k(X instanceof Error?X.message:String(X)),o("failed")}},[e.id]),Z=w.useCallback(()=>{I(null),T(null),o("generating"),u(j=>j&&{...j,status:"generating",done:0,total:0}),ae.examRegenerate(e.id,t??null).then(j=>{j.status==="failed"&&(k(j.error??i("exam.errorEmpty")),o("failed"))}).catch(j=>{k(j instanceof Error?j.message:String(j)),o("failed")})},[e.id,t,i]),B=f.jsxs(f.Fragment,{children:[f.jsxs("button",{className:"btn-3d-neutral px-4 py-1.5 text-body","data-testid":"exam-regen-btn",onClick:j=>I(j.currentTarget.getBoundingClientRect()),children:[f.jsx(ji,{className:"w-3.5 h-3.5 inline"}),i("exam.regenerate")]}),S&&f.jsx(tl,{anchorRect:S,message:i("exam.regenerate.confirmMsg"),confirmLabel:i("exam.regenerate"),onConfirm:Z,onCancel:()=>I(null)})]});w.useEffect(()=>{var j,re;s!=="answering"||!O||L.current!==O.id&&(_(Wu(O.prompt,((j=O.options)==null?void 0:j.length)??4)),b(null),(re=F.current)==null||re.scrollTo({top:0}))},[p,s]),w.useEffect(()=>{if(s!=="answering"||a)return;const j=setInterval(()=>{_(re=>re>0?re-1:0)},1e3);return()=>clearInterval(j)},[s,a]);const Q=w.useCallback(j=>{const re=O;if(!re||s!=="answering"||L.current===re.id)return;L.current=re.id;const K=j===null?"":GI(V,j),X={...C.current,[re.id]:K};C.current=X,D.current&&ae.examRecordAnswer(e.id,D.current,re.id,K).catch(()=>{}),p+1<c.length?g(p+1):(o("submitting"),(async()=>{try{const ce=await ae.examSubmitAttempt(e.id,D.current,X);T({correctCount:ce.correctCount,totalCount:ce.totalCount,stars:ce.stars,bestStars:ce.bestStars,terminated:ce.terminated,perQuestion:ce.perQuestion}),o("result"),n==null||n(),ce.stars>=1&&ha("exam-pass")}catch(ce){k(ce instanceof Error?ce.message:String(ce)),o("failed")}})())},[O,s,V,p,c.length,e.id,n]),ne=w.useCallback(()=>{x!==null&&Q(x)},[x,Q]);if(w.useEffect(()=>{s!=="answering"||A>0||a||Q(x)},[A,s,a]),w.useEffect(()=>{const j=async()=>{if(D.current)try{await ae.examSubmitAttempt(e.id,D.current,C.current,{terminated:!0}),n==null||n()}catch{}},re=s==="answering"||s==="submitting";return r==null||r(re?{active:!0,terminate:j}:{active:!1,terminate:null}),()=>r==null?void 0:r({active:!1,terminate:null})},[s,e.id,n,r]),s==="loading")return f.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6","data-testid":"exam-loading",children:[f.jsx(qa,{className:"w-12 h-12 text-accent mb-4 opacity-60"}),f.jsxs("div",{className:"flex gap-1",children:[f.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),f.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),f.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"})]})]});if(s==="generating"){const j=(l==null?void 0:l.done)??0,re=(l==null?void 0:l.total)??0,K=re>0?Math.round(j/re*100):0;return f.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6","data-testid":"exam-generating",children:[f.jsx(qa,{className:"w-12 h-12 text-accent mb-4 opacity-60"}),f.jsx("div",{className:"text-title font-bold text-ink mb-2",children:i("exam.generating.title")}),f.jsx("div",{className:"text-body text-ink-muted mb-4",children:i("exam.generating.stage")}),f.jsx("div",{className:"w-56 h-2.5 rounded-full bg-ink/10 overflow-hidden mb-2",role:"progressbar","aria-valuenow":K,"aria-valuemin":0,"aria-valuemax":100,children:f.jsx("div",{className:"h-full rounded-full bg-brand transition-all duration-500",style:{width:`${Math.max(4,K)}%`}})}),f.jsx("div",{className:"text-label text-ink-muted tabular-nums mb-6",children:re>0?i("exam.generating.kcProgress",{done:j,total:re}):i("exam.generating.preparing")}),f.jsx("div",{className:"text-caption text-ink-muted max-w-xs text-center",children:i("exam.generating.canLeave")})]})}if(s==="failed")return f.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6 text-center","data-testid":"exam-error",children:[f.jsx(mc,{className:"w-10 h-10 text-warning mb-3"}),f.jsx("div",{className:"text-body font-bold text-ink mb-1",children:i("exam.errorTitle")}),f.jsx("div",{className:"text-body text-ink-muted mb-4 max-w-xs break-words",children:N||i("exam.errorEmpty")}),f.jsxs("button",{className:"btn-3d-brand px-4 py-1.5 text-body",onClick:()=>{o("generating"),ae.examPrepare(e.id,t??null).catch(()=>{})},children:[f.jsx(ji,{className:"w-3.5 h-3.5 inline"}),i("exam.failed.retry")]})]});if(s==="ready"&&l){const j=l.exercises.reduce((K,X)=>{var ce;return K+Wu(X.prompt,((ce=X.options)==null?void 0:ce.length)??4)},0),re=Math.max(1,Math.round(j/60));return f.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6","data-testid":"exam-ready",children:[f.jsx("div",{className:"w-14 h-14 rounded-full bg-brand/15 flex items-center justify-center mb-4",children:f.jsx(qa,{className:"w-7 h-7 text-brand"})}),f.jsx("div",{className:"text-hero font-extrabold text-ink mb-1",children:i("exam.ready.title")}),f.jsx("div",{className:"text-body text-ink-muted mb-3 text-center",children:e.title}),f.jsx("div",{className:"text-label text-ink-muted mb-8",children:i("exam.ready.meta",{q:l.questionCount,kc:l.kcCount,min:re})}),f.jsxs("div",{className:"flex flex-col items-center gap-3",children:[f.jsxs("button",{className:"btn-3d-brand px-6 py-2 text-lead",onClick:q,"data-testid":"exam-start-btn",children:[i("exam.start"),f.jsx(fc,{className:"w-4 h-4 inline ml-1"})]}),B]})]})}if(s==="answering"||s==="submitting"){if(!O)return null;const j=A<=10;return f.jsxs("div",{className:"flex-1 flex flex-col min-h-0","data-testid":"exam-answering",children:[f.jsxs("div",{className:"px-6 pt-6 w-full max-w-2xl mx-auto shrink-0",children:[f.jsxs("div",{className:"flex items-center justify-between mb-3",children:[f.jsx("div",{className:"text-label text-ink-muted tabular-nums",children:i("exam.q.progress",{i:p+1,n:c.length})}),f.jsxs("div",{className:`flex items-center gap-1 text-label font-bold tabular-nums transition-colors ${j?"text-warning":"text-ink"}`,"data-testid":"exam-timer",children:[f.jsx(Zy,{className:"w-3.5 h-3.5"}),Math.floor(A/60),":",String(A%60).padStart(2,"0")]})]}),f.jsx("div",{className:"w-full h-1.5 rounded-full bg-ink/10 overflow-hidden mb-6",children:f.jsx("div",{className:"h-full bg-accent transition-all duration-300",style:{width:`${p/c.length*100}%`}})})]}),f.jsxs("div",{ref:F,className:"flex-1 min-h-0 overflow-y-auto px-6 pb-6 w-full max-w-2xl mx-auto",children:[O.kcTitle&&f.jsxs("div",{className:"inline-flex items-center gap-1 text-caption text-accent bg-accent/10 rounded-full px-2.5 py-1 mb-3 self-start",children:[f.jsx(Co,{className:"w-3 h-3"}),O.kcTitle]}),f.jsx("div",{className:"text-lead text-ink leading-relaxed mb-6 whitespace-pre-wrap break-words",children:O.prompt}),f.jsx("div",{className:"flex flex-col gap-2.5",children:V.map((re,K)=>f.jsx("button",{onClick:()=>b(K),"data-testid":`exam-option-${K}`,className:`text-left px-4 py-3 rounded-xl border transition-all duration-150 ${x===K?"border-accent bg-accent/15 text-ink":"border-ink/10 bg-ink/5 text-ink hover:border-ink/25"}`,children:f.jsx("span",{className:"text-body break-words",children:H[re]})},re))}),f.jsx("div",{className:"mt-6 flex justify-end",children:s==="submitting"?f.jsx("div",{className:"text-body text-ink-muted",children:i("exam.submitting")}):f.jsxs("button",{className:"btn-3d-brand px-5 py-2 text-body disabled:opacity-40 disabled:cursor-not-allowed",disabled:x===null,onClick:ne,"data-testid":"exam-next-btn",children:[p+1<c.length?i("exam.q.next"):i("exam.q.submit"),f.jsx(fc,{className:"w-3.5 h-3.5 inline ml-1"})]})})]})]})}if(s==="result"&&v){const j=v.totalCount>0?Math.round(v.correctCount/v.totalCount*100):0,re=new Map;for(const X of v.perQuestion){const ce=X.kcTitle??"";if(!ce)continue;const le=re.get(ce)??{correct:0,total:0};le.total++,X.correct&&le.correct++,re.set(ce,le)}const K=new Map(c.map(X=>[X.id,X]));return f.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-8 max-w-2xl w-full mx-auto","data-testid":"exam-result",children:[f.jsxs("div",{className:"flex flex-col items-center mb-6",children:[f.jsx(YI,{stars:v.stars}),f.jsx("div",{className:"text-hero font-extrabold text-ink mt-3",children:i("exam.result.score",{correct:v.correctCount,total:v.totalCount})}),f.jsx("div",{className:"text-body text-ink-muted mt-1",children:i("exam.result.accuracy",{pct:j})}),f.jsxs("div",{className:"flex items-center gap-3 text-label text-ink-muted mt-2",children:[f.jsx("span",{children:i("exam.result.best",{stars:v.bestStars})}),l&&l.attemptCount>1&&f.jsx("span",{children:i("exam.result.attempts",{n:l.attemptCount})})]})]}),v.terminated&&f.jsxs("div",{className:"rounded-xl border border-warning/40 bg-warning/10 px-4 py-3 mb-6 flex items-center gap-2",children:[f.jsx(mc,{className:"w-4 h-4 text-warning shrink-0"}),f.jsx("span",{className:"text-body text-ink",children:i("exam.terminated.banner")})]}),re.size>0&&f.jsxs("div",{className:"mb-8",children:[f.jsx("div",{className:"text-title font-bold text-ink mb-3",children:i("exam.result.kcBreakdown")}),f.jsx("div",{className:"flex flex-col gap-2",children:[...re.entries()].map(([X,ce])=>{const ee=(ce.total>0?ce.correct/ce.total:0)<.6;return f.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 rounded-xl bg-ink/5","data-testid":"exam-kc-row",children:[f.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[f.jsx(Co,{className:"w-3.5 h-3.5 text-accent shrink-0"}),f.jsx("span",{className:"text-body text-ink truncate",children:X})]}),f.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[ee&&f.jsx("span",{className:"text-caption text-warning",children:i("exam.result.weakKc")}),f.jsxs("span",{className:"text-label text-ink-muted tabular-nums",children:[ce.correct,"/",ce.total]})]})]},X)})})]}),f.jsxs("div",{className:"mb-8",children:[f.jsx("div",{className:"text-title font-bold text-ink mb-3",children:i("exam.result.review")}),f.jsx("div",{className:"flex flex-col gap-2",children:v.perQuestion.map((X,ce)=>{const le=K.get(X.exerciseId),ee=X.options??(le==null?void 0:le.options)??null,Ie=X.prompt??(le==null?void 0:le.prompt)??`#${ce+1}`,de=he=>ee&&he!==""&&ee[Number(he)]!==void 0?ee[Number(he)]:he;return f.jsx("div",{className:"px-4 py-3 rounded-xl bg-ink/5","data-testid":"exam-review-row",children:f.jsxs("div",{className:"flex items-start gap-2",children:[X.correct?f.jsx(Tn,{className:"w-4 h-4 text-brand shrink-0 mt-0.5"}):f.jsx(Bn,{className:`w-4 h-4 shrink-0 mt-0.5 ${X.answered?"text-warning":"text-ink-muted"}`}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"text-body text-ink mb-1",children:Ie}),f.jsx("div",{className:"text-caption text-ink-muted",children:X.answered?X.correct?f.jsx("span",{className:"text-brand",children:i("exam.result.correctLabel")}):f.jsxs(f.Fragment,{children:[i("exam.result.yourAnswer"),":",de(X.userAnswer),f.jsx("span",{className:"mx-1",children:"·"}),i("exam.result.correctAnswer"),":",de(X.correctAnswer)]}):i("exam.result.unanswered")}),X.explanation&&f.jsx("div",{className:"text-caption text-ink-muted mt-1 leading-relaxed",children:X.explanation})]})]})},X.exerciseId)})})]}),f.jsxs("div",{className:"flex justify-center items-center gap-3 pb-4",children:[f.jsxs("button",{className:"btn-3d-brand px-5 py-2 text-body",onClick:q,"data-testid":"exam-retry-btn",children:[f.jsx(ji,{className:"w-3.5 h-3.5 inline"}),i("exam.retryExam")]}),B]})]})}return null}const XI=[{id:"explain_simple",icon:Co,labelKey:"command.explain_simple",group:"command.group.node",requiresNode:!0},{id:"quiz_3",icon:hs,labelKey:"command.quiz_3",group:"command.group.node",requiresNode:!0},{id:"concept_map",icon:H0,labelKey:"command.concept_map",group:"command.group.node",requiresNode:!0},{id:"compare_prev",icon:by,labelKey:"command.compare_prev",group:"command.group.node",requiresNode:!0},{id:"socratic",icon:Wp,labelKey:"command.socratic",group:"command.group.mode"},{id:"exam_mode",icon:qa,labelKey:"command.exam_mode",group:"command.group.mode"}],QI=["command.group.node","command.group.mode","command.group.nav"];function ZI({onClose:e,onPick:t,hasNode:n}){const r=$e(),[a,i]=w.useState(""),[s,o]=w.useState(0),l=w.useRef(null),u=w.useRef(null);w.useEffect(()=>{var d;(d=l.current)==null||d.focus()},[]),ni(u,!0);const h=XI.filter(d=>r(d.labelKey).toLowerCase().includes(a.toLowerCase())).filter(d=>!d.requiresNode||n),m=d=>{d.key==="ArrowDown"?(d.preventDefault(),o(p=>Math.min(p+1,h.length-1))):d.key==="ArrowUp"?(d.preventDefault(),o(p=>Math.max(p-1,0))):d.key==="Enter"&&h[s]&&(d.preventDefault(),t(h[s].id))};return f.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[15vh] px-4","data-testid":"command-palette",children:[f.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:e}),f.jsxs("div",{ref:u,role:"dialog","aria-modal":"true","aria-label":r("command.footer.hint"),className:"relative w-full max-w-lg bg-surface-0 rounded-xl shadow-elevated overflow-hidden",children:[f.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-[var(--border-faint)]",children:[f.jsx(U0,{className:"w-4 h-4 text-ink-faint"}),f.jsx("input",{ref:l,value:a,onChange:d=>{i(d.target.value),o(0)},onKeyDown:m,placeholder:r("command.placeholder"),className:"flex-1 bg-transparent text-body text-ink-strong placeholder:text-ink-faint focus:outline-none","data-testid":"command-input"}),f.jsx("kbd",{className:"text-caption text-ink-faint px-1.5 py-0.5 rounded border border-[var(--border-faint)]",children:"ESC"})]}),f.jsx("div",{className:"max-h-80 overflow-y-auto py-2","data-testid":"command-list",children:h.length===0?f.jsx("div",{className:"px-4 py-6 text-center text-body text-ink-faint",children:r(n?"command.empty.node":"command.empty.nonode")}):QI.map(d=>{const p=h.filter(g=>g.group===d);return p.length===0?null:f.jsxs("div",{children:[f.jsx("div",{className:"px-4 pt-2 pb-1 text-caption font-bold text-ink-faint uppercase tracking-wider",children:r(d)}),p.map(g=>{const x=h.indexOf(g),b=g.icon;return f.jsxs("button",{onClick:()=>t(g.id),onMouseEnter:()=>o(x),"data-testid":`command-${g.id}`,className:`w-full flex items-center gap-3 px-4 py-2 text-left transition-colors ${x===s?"bg-brand/10 text-brand":"text-ink-muted hover:bg-surface-1 hover:bg-surface-3/50"}`,children:[f.jsx(b,{className:"w-4 h-4 shrink-0","aria-hidden":"true"}),f.jsx("span",{className:"text-body font-medium flex-1",children:r(g.labelKey)})]},g.id)})]},d)})}),f.jsxs("div",{className:"px-4 py-2 border-t border-[var(--border-faint)] flex items-center justify-between text-caption text-ink-faint",children:[f.jsx("span",{children:r("command.footer.hint")}),f.jsx("span",{children:r("command.footer.keys")})]})]})]})}const Ni="bg-ink/[0.04] text-ink-strong text-label rounded-lg border border-transparent focus:border-accent focus:bg-ink/[0.06] transition-colors placeholder:text-ink-faint";function Uo({kind:e,showProtocol:t=!0,testPrefix:n="custom",titleKey:r="settings.custom.form_title",modelPhKey:a="settings.custom.model_ph",testOverride:i,onSaved:s,onCancel:o}){const l=$e(),[u,c]=w.useState(""),[h,m]=w.useState("openai-compatible"),[d,p]=w.useState(""),[g,x]=w.useState(""),[b,v]=w.useState(""),[T,N]=w.useState(!1),[k,A]=w.useState(!1),[_,S]=w.useState(null),I=async()=>{if(!(!d.trim()||!b.trim()||k)){A(!0),S(null);try{const D=i?await i({baseUrl:d.trim(),apiKey:g.trim(),model:b.trim()}):await ae.testCustomProvider({label:u||l("settings.custom.test_label"),protocol:h,baseUrl:d.trim(),apiKey:g.trim()||void 0,defaultModel:b.trim()});S({ok:D.ok,detail:D.detail})}catch(D){S({ok:!1,detail:D instanceof Error?D.message:String(D)})}finally{A(!1)}}},C=async()=>{if(!(!u.trim()||!d.trim()||!b.trim()))try{const D=await ae.createCustomProvider({label:u.trim(),kind:e,protocol:t?h:"openai-compatible",baseUrl:d.trim(),apiKey:g.trim()||void 0,defaultModel:b.trim(),vision:e==="llm"?T:void 0});s(D)}catch{}};return f.jsxs("div",{className:"space-y-2.5","data-testid":`${n}-provider-form`,children:[f.jsx("div",{className:"text-label font-bold text-ink-strong",children:l(r)}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx("input",{type:"text",value:u,onChange:D=>c(D.target.value),placeholder:l("settings.custom.label_ph"),"data-testid":`${n}-label`,className:`${Ni} flex-1 px-2.5 py-1.5`}),t&&f.jsxs("select",{value:h,onChange:D=>m(D.target.value),"data-testid":`${n}-protocol`,className:`${Ni} px-2 py-1.5`,children:[f.jsx("option",{value:"openai-compatible",children:l("settings.proto.openai")}),f.jsx("option",{value:"anthropic",children:"Anthropic"}),f.jsx("option",{value:"google",children:"Google"})]})]}),f.jsx("input",{type:"text",value:d,onChange:D=>p(D.target.value),placeholder:l("settings.custom.baseurl_ph"),"data-testid":`${n}-baseurl`,className:`${Ni} w-full px-2.5 py-1.5 font-mono`}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx("input",{type:"text",value:b,onChange:D=>v(D.target.value),placeholder:l(a),"data-testid":`${n}-model`,className:`${Ni} flex-1 px-2.5 py-1.5 font-mono`}),f.jsx("input",{type:"password",value:g,onChange:D=>x(D.target.value),placeholder:l("settings.custom.apikey_ph"),"data-testid":`${n}-apikey`,className:`${Ni} flex-1 px-2.5 py-1.5`})]}),e==="llm"&&f.jsxs("label",{className:"inline-flex items-center gap-2 text-label cursor-pointer select-none","data-testid":`${n}-vision`,children:[f.jsx("input",{type:"checkbox",checked:T,onChange:D=>N(D.target.checked),className:"w-4 h-4 rounded accent-brand"}),f.jsx("span",{className:"text-ink-strong",children:l("settings.custom.vision")}),f.jsx("span",{className:"text-ink-faint",children:l("settings.custom.visionHint")})]}),_&&f.jsxs("div",{className:`text-label rounded p-2 inline-flex items-start gap-1.5 ${_.ok?"bg-brand/10 text-brand":"bg-warning/10 text-warning"}`,children:[_.ok?f.jsx(Wn,{className:"w-4 h-4 mt-px shrink-0","aria-hidden":"true"}):f.jsx(va,{className:"w-4 h-4 mt-px shrink-0","aria-hidden":"true"}),f.jsx("span",{className:"break-words",children:_.detail})]}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx("button",{onClick:()=>void I(),disabled:!d.trim()||!b.trim()||k,"data-testid":`${n}-test`,className:"btn-3d-neutral px-3 py-1.5 text-label disabled:opacity-40",children:l(k?"settings.testing":"settings.test")}),f.jsx("button",{onClick:()=>void C(),disabled:!u.trim()||!d.trim()||!b.trim(),"data-testid":`${n}-save`,className:"btn-3d-brand px-3 py-1.5 text-label disabled:opacity-40",children:l("settings.custom.save")}),o&&f.jsx("button",{onClick:o,className:"text-label text-ink-muted hover:text-ink-strong px-3 py-1.5 transition-colors",children:l("action.cancel")})]})]})}const V4="lookatstudy-theme",x1="auto",$4="(prefers-color-scheme: dark)";function Gu(){return typeof window>"u"||window.matchMedia($4).matches?"dark":"light"}function JI(){if(typeof localStorage>"u")return x1;const e=localStorage.getItem(V4);return e==="auto"||e==="light"||e==="dark"?e:x1}function Yu(e){const t=document.documentElement;t.classList.remove("dark","light"),t.classList.add(e),window.dispatchEvent(new CustomEvent("theme-changed",{detail:{resolved:e}}))}function e_(){const[e,t]=w.useState(()=>JI()),[n,r]=w.useState(()=>e==="auto"?Gu():e),a=w.useCallback(i=>{t(i),localStorage.setItem(V4,i);const s=i==="auto"?Gu():i;r(s),Yu(s)},[]);return w.useEffect(()=>{if(e!=="auto")return;const i=window.matchMedia($4),s=o=>{const l=o.matches?"dark":"light";r(l),Yu(l)};return i.addEventListener("change",s),()=>i.removeEventListener("change",s)},[e]),w.useEffect(()=>{const i=e==="auto"?Gu():e;r(i),Yu(i)},[e]),{mode:e,resolved:n,setMode:a}}function eo(){window.dispatchEvent(new Event(s0))}const nr="bg-surface-1 text-ink text-body rounded-lg border border-[var(--border)] focus:border-brand focus:outline-none transition-colors placeholder:text-ink-faint",Vn="bg-surface-3 text-ink-muted hover:bg-surface-3 hover:bg-surface-3 hover:text-ink-strong",$n="bg-brand text-white shadow-sm";function kt(e){return e?"px-4 py-3.5 border-t border-[var(--border-faint)]":"px-4 py-3.5"}function t_(){const e=$e(),[t,n]=w.useState([]),[r,a]=w.useState([]),[i,s]=w.useState("glm"),[o,l]=w.useState(""),[u,c]=w.useState(""),[h,m]=w.useState(null),[d,p]=w.useState(!1),[g,x]=w.useState(null),[b,v]=w.useState(!1),[T,N]=w.useState(!1),[k,A]=w.useState([]),[_,S]=w.useState(!1),[I,C]=w.useState(null),[D,L]=w.useState(null),[F,O]=w.useState(""),[R,H]=w.useState(!1),V=e_(),q=async ee=>{if(X)try{await ae.updateCustomProvider(X.id,{vision:ee}),await B()}catch{}},Z=async()=>{S(!0),C(null);try{const ee=await ae.discoverModels();ee.ok&&ee.models?A(ee.models):C(ee.error||e("settings.discover_failed"))}catch(ee){C(ee instanceof Error?ee.message:String(ee))}finally{S(!1)}},B=w.useCallback(async()=>{try{const[ee,Ie,de,he]=await Promise.all([ae.getProviderPresets(),ae.listCustomProviders(),ae.getSetting("active_provider"),ae.getSetting("active_model")]);n(ee),a(Ie);const pe=de??"glm";if(s(pe),pe.startsWith("custom-")){const Ce=Ie.find(Oe=>Oe.id===pe);m(Ce!=null&&Ce.hasApiKey?e("settings.key.configured"):null)}else{const Ce=ee.find(Oe=>Oe.id===pe);if(Ce){const Oe=await ae.getSetting(Ce.apiKeySetting);m(Oe?`${Oe.slice(0,4)}…${Oe.slice(-4)}`:null)}}if(pe.startsWith("custom-")){const Ce=Ie.find(Oe=>Oe.id===pe);l(he??(Ce==null?void 0:Ce.defaultModel)??"")}else{const Ce=ee.find(Oe=>Oe.id===pe);l(he??(Ce==null?void 0:Ce.defaultModel)??"")}}catch(ee){console.error("[SettingsView] load() failed:",ee)}},[e]);w.useEffect(()=>{B()},[B]);const Q=async ee=>{s(ee),x(null),c("");const Ie=t.find(de=>de.id===ee);if(Ie){const de=await ae.getSetting(Ie.apiKeySetting);m(de?`${de.slice(0,4)}…${de.slice(-4)}`:null),l(o||Ie.defaultModel)}},ne=async()=>{v(!1);try{if(await ae.setSetting("active_provider",i),await ae.setSetting("active_model",o),u.trim()){const ee=t.find(Ie=>Ie.id===i);ee&&(await ae.setSetting(ee.apiKeySetting,u.trim()),m(`${u.trim().slice(0,4)}…${u.trim().slice(-4)}`),c(""))}v(!0),setTimeout(()=>v(!1),2e3),window.dispatchEvent(new Event("llm-config-changed"))}catch{}},j=async()=>{p(!0),x(null);try{const ee=await ae.testLlmConnection();x(ee)}catch(ee){x({ok:!1,detail:ee instanceof Error?ee.message:String(ee),errorKind:"unknown"})}finally{p(!1)}},re=async ee=>{await ae.setSetting("active_provider",ee.id),await ae.setSetting("active_model",ee.defaultModel),s(ee.id),l(ee.defaultModel),N(!1),await B(),window.dispatchEvent(new Event("llm-config-changed"))},K=async ee=>{try{await ae.deleteCustomProvider(ee),i===ee&&(await ae.setSetting("active_provider","glm"),s("glm")),await B()}catch{}},X=i.startsWith("custom-")?r.find(ee=>ee.id===i):null;w.useEffect(()=>{if(!X)return;const ee=X.models.find(Ie=>Ie.id===o);O(ee!=null&&ee.contextWindow?String(ee.contextWindow):"")},[X,o]);const ce=async()=>{var pe,Ce;if(!X)return;const ee=F.trim().replace(/[,\s_]/g,""),Ie=/^(\d+)([km]?)$/i.exec(ee);if(ee!==""&&!Ie)return;const de=((pe=Ie==null?void 0:Ie[2])==null?void 0:pe.toLowerCase())==="k"?1e3:((Ce=Ie==null?void 0:Ie[2])==null?void 0:Ce.toLowerCase())==="m"?1e6:1,he=ee===""||!Ie?null:Math.max(1,Math.round(parseInt(Ie[1],10)*de));H(!0);try{const Oe=X.models.map(st=>st.id===o?{...st,contextWindow:he}:st);await ae.updateCustomProvider(X.id,{models:Oe}),await B(),window.dispatchEvent(new Event("llm-config-changed"))}catch{}finally{H(!1)}},le=i.startsWith("custom-")?null:t.find(ee=>ee.id===i);return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"px-5 pt-5 space-y-6",children:[f.jsxs("section",{children:[f.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.ai")}),f.jsxs("div",{className:"surface-card overflow-hidden",children:[f.jsxs("div",{className:kt(!1),children:[f.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.row.provider")}),f.jsxs("div",{className:"flex flex-wrap gap-1.5","data-testid":"provider-grid",children:[t.map(ee=>f.jsx("button",{onClick:()=>Q(ee.id),"data-testid":`provider-card-${ee.id}`,"aria-pressed":i===ee.id,className:`px-3 py-1.5 rounded-lg text-label font-medium whitespace-nowrap transition-colors ${i===ee.id?$n:Vn}`,children:ee.label},ee.id)),r.filter(ee=>ee.kind==="llm").map(ee=>f.jsxs("button",{onClick:()=>Q(ee.id),"data-testid":`provider-card-${ee.id}`,"aria-pressed":i===ee.id,className:`px-3 py-1.5 rounded-lg text-label font-medium whitespace-nowrap transition-colors inline-flex items-center gap-1 ${i===ee.id?$n:Vn}`,children:[f.jsx(ms,{className:"w-3.5 h-3.5","aria-hidden":"true"}),ee.label]},ee.id)),f.jsxs("button",{onClick:()=>N(ee=>!ee),"data-testid":"add-custom-provider",className:"px-3 py-1.5 rounded-lg text-label whitespace-nowrap inline-flex items-center gap-1 border border-dashed border-[var(--border)] text-ink-muted hover:border-ink-muted hover:text-ink-strong transition-colors",children:[f.jsx(el,{className:"w-3.5 h-3.5","aria-hidden":"true"}),e("settings.add_custom")]})]})]}),T&&f.jsx("div",{className:"px-4 py-3.5 bg-surface-1 border-t border-[var(--border-faint)]",children:f.jsx(Uo,{kind:"llm",testPrefix:"custom",onSaved:ee=>void re(ee),onCancel:()=>N(!1)})}),r.length>0&&i.startsWith("custom-")&&f.jsx("div",{className:kt(!0),children:f.jsx("button",{onClick:ee=>{const Ie=ee.currentTarget.getBoundingClientRect(),de=r.find(he=>he.id===i);de&&L({id:de.id,label:de.label,rect:Ie})},className:"text-label text-warning hover:underline",children:e("settings.delete_custom")})}),le&&f.jsxs(f.Fragment,{children:[le.baseUrl&&f.jsxs("div",{className:kt(!0),children:[f.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:"Base URL"}),f.jsx("code",{className:"text-label text-ink-faint font-mono break-all",children:le.baseUrl})]}),f.jsxs("div",{className:kt(!0),children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.model")}),f.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[f.jsxs("select",{value:o,onChange:ee=>l(ee.target.value),"data-testid":"model-select",className:`${nr} flex-1 px-2.5 py-1.5`,children:[le.models.map(ee=>f.jsx("option",{value:ee.id,children:ee.id},ee.id)),i==="openrouter"&&k.map(ee=>f.jsx("option",{value:ee.id,children:ee.id},ee.id))]}),i==="openrouter"&&f.jsxs("button",{onClick:Z,disabled:_,"data-testid":"discover-models-btn",className:"text-label text-accent hover:underline disabled:opacity-40 whitespace-nowrap inline-flex items-center gap-1",children:[f.jsx(Vy,{className:`w-3.5 h-3.5 ${_?"animate-spin":""}`,"aria-hidden":"true"}),e(_?"settings.discovering":"settings.refresh")]})]})]}),I&&f.jsx("div",{className:"text-label text-warning mt-1.5 ml-[68px]",children:I})]}),f.jsx("div",{className:kt(!0),children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.apikey")}),f.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[h&&f.jsxs("span",{className:"text-label text-brand shrink-0 inline-flex items-center gap-1",children:[f.jsx(Wn,{className:"w-3.5 h-3.5","aria-hidden":"true"}),h]}),f.jsx("input",{type:"password",value:u,onChange:ee=>c(ee.target.value),placeholder:e(h?"settings.key.overwrite_ph":"settings.key.paste_ph"),"data-testid":"settings-key-input",className:`${nr} flex-1 px-2.5 py-1.5`}),f.jsx("a",{href:le.keyUrl,target:"_blank",rel:"noopener noreferrer",className:"text-label text-brand hover:underline whitespace-nowrap",children:e("settings.key.get")})]})]})}),f.jsx("div",{className:kt(!0),children:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("button",{onClick:j,disabled:d,"data-testid":"test-connection-btn",className:"btn-3d-neutral px-3 py-1.5 text-label disabled:opacity-40",children:e(d?"settings.testing":"settings.test")}),g&&f.jsxs("span",{className:`text-label inline-flex items-center gap-1 ${g.ok?"text-brand":"text-warning"}`,children:[g.ok?f.jsx(Wn,{className:"w-4 h-4","aria-hidden":"true"}):f.jsx(va,{className:"w-4 h-4","aria-hidden":"true"}),g.detail]})]})})]}),X&&!le&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:kt(!0),children:[f.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:"Base URL"}),f.jsx("code",{className:"text-label text-ink-faint font-mono break-all",children:X.baseUrl})]}),f.jsx("div",{className:kt(!0),children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.model")}),X.models.length>1?f.jsx("select",{value:o,onChange:ee=>l(ee.target.value),"data-testid":"model-select-custom",className:`${nr} flex-1 px-2.5 py-1.5`,children:X.models.map(ee=>f.jsx("option",{value:ee.id,children:ee.id},ee.id))}):f.jsx("input",{type:"text",value:o,onChange:ee=>l(ee.target.value),placeholder:e("settings.custom.model_ph"),"data-testid":"model-input-custom",className:`${nr} flex-1 px-2.5 py-1.5 font-mono`})]})}),f.jsxs("div",{className:kt(!0),children:[f.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:e("settings.custom.windowLabel")}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("input",{type:"text",inputMode:"numeric",value:F,onChange:ee=>O(ee.target.value),placeholder:e("settings.custom.windowPh"),"data-testid":"context-window-input",className:`${nr} flex-1 px-2.5 py-1.5 font-mono tabular-nums`}),f.jsx("button",{onClick:ce,disabled:R,"data-testid":"context-window-save",className:"btn-3d-neutral px-3 py-1.5 text-label shrink-0 disabled:opacity-40",children:e("settings.custom.save")})]}),f.jsx("div",{className:"text-caption text-ink-faint mt-1",children:e("settings.custom.windowHint")})]}),f.jsx("div",{className:kt(!0),children:f.jsxs("label",{className:"inline-flex items-center gap-2 text-label cursor-pointer select-none","data-testid":"custom-vision-toggle",children:[f.jsx("input",{type:"checkbox",checked:X.vision,onChange:ee=>void q(ee.target.checked),className:"w-4 h-4 rounded accent-brand"}),f.jsx("span",{className:"text-ink-strong",children:e("settings.custom.vision")}),f.jsx("span",{className:"text-ink-faint",children:e("settings.custom.visionHint")})]})}),f.jsx("div",{className:kt(!0),children:f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx("button",{onClick:j,disabled:d,"data-testid":"test-connection-btn",className:"btn-3d-neutral px-3 py-1.5 text-label disabled:opacity-40",children:e(d?"settings.testing":"settings.test")}),g&&f.jsxs("span",{className:`text-label inline-flex items-center gap-1 ${g.ok?"text-brand":"text-warning"}`,children:[g.ok?f.jsx(Wn,{className:"w-4 h-4","aria-hidden":"true"}):f.jsx(va,{className:"w-4 h-4","aria-hidden":"true"}),g.detail]})]})})]})]})]}),f.jsxs("section",{children:[f.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.vision")}),f.jsx("div",{className:"surface-card overflow-hidden",children:f.jsx(r_,{activeProvider:i,activeModel:o,presets:t,customProviders:r})})]}),f.jsxs("section",{children:[f.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.speech")}),f.jsx("div",{className:"surface-card overflow-hidden",children:f.jsx(l_,{})})]}),f.jsxs("section",{children:[f.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.memory")}),f.jsx("div",{className:"surface-card overflow-hidden",children:f.jsx(a_,{})})]}),f.jsxs("section",{children:[f.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.companion")}),f.jsx("div",{className:"surface-card overflow-hidden",children:f.jsx(i_,{})})]}),f.jsxs("section",{children:[f.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.appearance")}),f.jsxs("div",{className:"surface-card overflow-hidden",children:[f.jsxs("div",{className:kt(!1),children:[f.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.row.theme")}),f.jsx("div",{className:"flex gap-2",children:[{mode:"auto",label:e("settings.theme.auto")},{mode:"light",label:e("settings.theme.light")},{mode:"dark",label:e("settings.theme.dark")}].map(({mode:ee,label:Ie})=>f.jsx("button",{onClick:()=>V.setMode(ee),"data-testid":`theme-${ee}`,"aria-pressed":V.mode===ee,className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${V.mode===ee?$n:Vn}`,children:Ie},ee))}),f.jsx("p",{className:"text-label text-ink-muted mt-2",children:V.mode==="auto"?e("settings.theme.following",{mode:e(`settings.theme.${V.resolved}`)}):null})]}),f.jsxs("div",{className:kt(!0),children:[f.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.row.interface_lang")}),f.jsx("div",{className:"flex gap-2",children:["zh-CN","en"].map(ee=>f.jsx("button",{onClick:()=>s5(ee),"data-testid":`lang-${ee}`,"aria-pressed":Ga()===ee,className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${Ga()===ee?$n:Vn}`,children:ee==="zh-CN"?"中文":"English"},ee))})]}),f.jsxs("div",{className:kt(!0),children:[f.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.row.import_lang")}),f.jsx(n_,{})]})]})]})]}),f.jsxs("div",{className:"sticky bottom-0 px-5 py-3 bg-surface-0 border-t border-[var(--border)] flex items-center justify-between gap-3",children:[f.jsx("span",{className:"text-label text-ink-muted",children:e("settings.footer.hint")}),f.jsxs("button",{onClick:ne,"data-testid":"settings-save",className:"btn-3d-brand px-5 py-2 text-body inline-flex items-center gap-1.5",children:[b&&f.jsx(Tn,{className:"w-4 h-4","aria-hidden":"true"}),e(b?"settings.saved_text":"settings.footer.save")]})]}),D&&f.jsx(tl,{anchorRect:D.rect,message:e("settings.delete_custom_confirm",{name:D.label}),danger:!0,confirmLabel:e("action.delete"),testid:"custom-provider-delete-confirm",onConfirm:()=>{K(D.id),L(null)},onCancel:()=>L(null)})]})}function n_(){const[e,t]=w.useState("en"),[n,r]=w.useState(!1);w.useEffect(()=>{ae.getSetting("pref_lang").then(s=>{s&&t(s),r(!0)})},[]);const a=async s=>{t(s),await ae.setSetting("pref_lang",s)},i=[{code:"en",label:"English"},{code:"zh-CN",label:"简体中文"},{code:"zh-TW",label:"繁體中文"}];return n?f.jsx("div",{className:"flex gap-2","data-testid":"pref-lang-options",children:i.map(s=>f.jsx("button",{onClick:()=>a(s.code),"data-testid":`pref-lang-${s.code}`,"aria-pressed":e===s.code,className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${e===s.code?$n:Vn}`,children:s.label},s.code))}):null}function r_({activeProvider:e,activeModel:t,presets:n,customProviders:r}){const a=$e(),[i,s]=w.useState(!1),[o,l]=w.useState(!1),[u,c]=w.useState(""),[h,m]=w.useState(!1),[d,p]=w.useState(!1),[g,x]=w.useState(null);w.useEffect(()=>{Promise.all([ae.getSetting("flag_multimodal_import"),ae.getSetting("vision_provider_override"),ae.getSetting("vision_model_override")]).then(([S,I])=>{s(S==="true"),c(I??""),l(!0)})},[]);const b=async()=>{const S=!i;s(S),await ae.setSetting("flag_multimodal_import",String(S))},v=async S=>{await ae.setSetting("vision_provider_override",S.id),await ae.setSetting("vision_model_override",S.defaultModel),c(S.id),m(!1)},T=async()=>{await ae.setSetting("vision_provider_override",""),await ae.setSetting("vision_model_override",""),c(""),m(!1)},N=async()=>{if(!d){p(!0),x(null);try{const S=await ae.testLlmConnection({vision:!0});x({ok:S.ok,detail:S.detail})}catch(S){x({ok:!1,detail:S instanceof Error?S.message:String(S)})}finally{p(!1)}}},k=r.filter(S=>S.kind==="vision"),A=u.startsWith("custom-")?r.find(S=>S.id===u):null,_=u&&!u.startsWith("custom-")?n.find(S=>S.id===u):null;return o?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"px-4 py-3.5 flex items-center gap-3",children:[f.jsx(Wa,{checked:i,onChange:b,label:a("settings.multimodal.toggle"),testid:"multimodal-toggle"}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"text-body font-medium text-ink-strong",children:a("settings.multimodal.toggle")}),f.jsx("div",{className:"text-label text-ink-muted",children:a("settings.multimodal.toggle.desc")})]})]}),f.jsxs("div",{className:"px-4 py-3.5 border-t border-[var(--border-faint)] space-y-3",children:[f.jsxs("div",{className:"text-label text-ink-muted bg-ink/5 rounded-lg p-3",children:[f.jsx("div",{className:"font-medium mb-1",children:a("settings.multimodal.current_model",{model:t||a("settings.multimodal.not_selected")})}),f.jsx("div",{children:e.startsWith("custom-")?a("settings.multimodal.hint_custom"):a("settings.multimodal.hint_preset")})]}),f.jsxs("div",{className:"bg-ink/5 rounded-lg p-3",children:[f.jsx("div",{className:"text-label font-medium text-ink-muted mb-2",children:a("settings.multimodal.override_title")}),f.jsx("div",{className:"text-caption text-ink-muted mb-2",children:a("settings.multimodal.override_bridge_hint")}),f.jsxs("div",{className:"space-y-3 mt-1",children:[A&&f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-label",children:[f.jsx(ms,{className:"w-3.5 h-3.5 text-ink-faint shrink-0","aria-hidden":"true"}),f.jsx("span",{className:"font-medium text-ink-strong",children:A.label}),f.jsx("code",{className:"text-ink-faint font-mono break-all",children:A.defaultModel}),f.jsx("span",{className:"text-ink-faint break-all min-w-0",children:A.baseUrl})]}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx("button",{onClick:()=>void N(),disabled:d,"data-testid":"vision-override-test",className:"btn-3d-neutral px-4 py-1.5 text-label disabled:opacity-50",children:a(d?"settings.testing":"settings.multimodal.test_override")}),f.jsx("button",{onClick:()=>m(S=>!S),className:"text-label text-accent hover:underline",children:a("settings.multimodal.replace_custom")}),f.jsx("button",{onClick:()=>void T(),className:"text-label text-ink-muted hover:text-ink-strong",children:a("settings.multimodal.stop_override")}),g&&f.jsxs("span",{className:`text-label inline-flex items-center gap-1 ${g.ok?"text-brand":"text-warning"}`,children:[g.ok?f.jsx(Wn,{className:"w-4 h-4","aria-hidden":"true"}):f.jsx(va,{className:"w-4 h-4","aria-hidden":"true"}),g.detail]})]})]}),_&&f.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-label",children:[f.jsx("span",{className:"text-ink-muted",children:a("settings.multimodal.legacy_preset",{label:_.label})}),f.jsx("button",{onClick:()=>void T(),className:"text-label text-ink-muted hover:text-ink-strong underline",children:a("settings.multimodal.stop_override")})]}),!A&&!_&&f.jsxs(f.Fragment,{children:[k.map(S=>f.jsxs("button",{onClick:()=>void v(S),className:"w-full text-left px-3 py-2 rounded-lg bg-surface-1 hover:bg-surface-3 transition-colors","data-testid":`vision-pick-${S.id}`,children:[f.jsx("span",{className:"text-label font-medium text-ink-strong",children:S.label}),f.jsx("span",{className:"text-label text-ink-faint font-mono break-all ml-2",children:S.defaultModel})]},S.id)),(h||k.length===0)&&f.jsx(Uo,{kind:"vision",testPrefix:"vision-custom",titleKey:"settings.custom.form_title_vision",modelPhKey:"settings.custom.model_ph_vision",onSaved:S=>void v(S),onCancel:()=>m(!1)}),k.length>0&&f.jsx("button",{onClick:()=>m(S=>!S),className:"text-label text-accent hover:underline",children:a(h?"action.cancel":"settings.custom.new")})]})]})]})]})]}):null}function a_(){const e=$e(),[t,n]=w.useState(!1),[r,a]=w.useState(!1);w.useEffect(()=>{ae.getSetting("flag_memory_system").then(s=>{n(s==="true"),a(!0)})},[]);const i=async()=>{const s=!t;n(s),await ae.setSetting("flag_memory_system",String(s))};return r?f.jsxs("div",{className:"px-4 py-3.5 flex items-center gap-3",children:[f.jsx(Wa,{checked:t,onChange:i,label:e("settings.memory.toggle"),testid:"memory-toggle"}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"text-body font-medium text-ink-strong",children:e("settings.memory.toggle")}),f.jsx("div",{className:"text-label text-ink-muted",children:e("settings.memory.toggle.desc")})]})]}):null}function i_(){const e=$e(),[t,n]=w.useState(!0),[r,a]=w.useState(!1),i=w.useSyncExternalStore(Bp,hc),[s,o]=w.useState(!0),[l,u]=w.useState(!1),c=typeof window<"u"&&!!window.__lookatstudyWeb;w.useEffect(()=>{ae.getSetting("companion_enabled").then(g=>{n(g!=="false"&&g!=="0"),a(!0)}),ae.getSetting("companion_sfx").then(g=>{o(g!=="false"&&g!=="0")}),ae.getSetting("companion_pet_mode").then(g=>{u(g==="1")})},[]);const h=async()=>{const g=!t;n(g),await ae.setSetting("companion_enabled",String(g)),window.dispatchEvent(new Event("companion-config-changed"))},m=async()=>{const g=!s;o(g),await ae.setSetting("companion_sfx",String(g)),window.dispatchEvent(new Event("companion-config-changed"))},d=async()=>{const g=!l;u(g),await ae.setSetting("companion_pet_mode",g?"1":"0"),window.dispatchEvent(new Event("companion-config-changed"))},p=async g=>{g!==i.form&&(await ae.setSetting("companion_form",g),window.dispatchEvent(new Event("companion-config-changed")))};return r?f.jsxs("div",{className:"px-4 py-3.5 flex flex-col gap-4",children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(Wa,{checked:t,onChange:h,label:e("settings.companion.toggle"),testid:"companion-toggle"}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"text-body font-medium text-ink-strong",children:e("settings.companion.toggle")}),f.jsx("div",{className:"text-label text-ink-muted",children:e("settings.companion.toggle.desc")})]})]}),t&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(Wa,{checked:s,onChange:m,label:e("settings.companion.sfx"),testid:"companion-sfx-toggle"}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"text-body font-medium text-ink-strong",children:e("settings.companion.sfx")}),f.jsx("div",{className:"text-label text-ink-muted",children:e("settings.companion.sfx.desc")})]})]}),!c&&f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(Wa,{checked:l,onChange:d,label:e("settings.companion.pet"),testid:"companion-pet-toggle"}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"text-body font-medium text-ink-strong",children:e("settings.companion.pet")}),f.jsx("div",{className:"text-label text-ink-muted",children:e("settings.companion.pet.desc")})]})]}),f.jsxs("div",{children:[f.jsx("div",{className:"text-label text-ink-muted mb-2",children:e("settings.companion.form")}),f.jsx("div",{className:"grid grid-cols-5 gap-2",role:"radiogroup","aria-label":e("settings.companion.form"),children:ry.map(g=>{const x=i.form===g;return f.jsxs("button",{type:"button",role:"radio","aria-checked":x,"data-testid":`companion-form-${g}`,onClick:()=>{p(g)},className:`flex flex-col items-center gap-0.5 rounded-xl p-1.5 border motion-safe:transition-colors
|
|
782
|
+
${x?"border-[var(--accent)] bg-surface-2 shadow-card":"border-[var(--border-faint)] hover:bg-surface-2"}`,title:e(`companion.form.${g}.desc`),children:[f.jsx(Fp,{form:g,expression:"happy",pose:"float",size:64}),f.jsx("span",{className:`text-label ${x?"text-ink-strong font-medium":"text-ink-muted"}`,children:e(`companion.form.${g}.name`)})]},g)})})]})]})]}):null}function Wa({checked:e,onChange:t,label:n,testid:r}){return f.jsx("button",{type:"button",role:"switch","aria-checked":e,"aria-label":n,onClick:t,"data-testid":r,className:`relative w-12 h-6 rounded-full transition-colors shrink-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand/60 focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--surface-2)] ${e?"bg-brand":"bg-ink/20 hover:bg-ink/25"}`,children:f.jsx("span",{className:`absolute left-0.5 top-1/2 -translate-y-1/2 w-5 h-5 rounded-full bg-white shadow transition-transform ${e?"translate-x-6":""}`})})}const s_=[{id:"zh-CN-XiaoxiaoNeural",label:"zh-CN · 晓晓(女)"},{id:"zh-CN-XiaoyiNeural",label:"zh-CN · 晓伊(女)"},{id:"zh-CN-YunxiNeural",label:"zh-CN · 云希(男)"},{id:"zh-CN-YunyangNeural",label:"zh-CN · 云扬(男·新闻)"},{id:"zh-CN-liaoning-XiaobeiNeural",label:"zh-CN · 晓北(女·东北)"},{id:"zh-CN-shaanxi-XiaoniNeural",label:"zh-CN · 晓妮(女·陕西)"},{id:"en-US-AriaNeural",label:"en-US · Aria(女)"},{id:"en-US-GuyNeural",label:"en-US · Guy(男)"},{id:"en-US-JennyNeural",label:"en-US · Jenny(女)"}],o_=[{sid:"45",label:"zf_xiaobei(女)"},{sid:"46",label:"zf_xiaoni(女)"},{sid:"47",label:"zf_xiaoxiao(女)"},{sid:"48",label:"zf_xiaoyi(女·默认)"},{sid:"49",label:"zm_yunjian(男)"},{sid:"50",label:"zm_yunxi(男)"},{sid:"51",label:"zm_yunxia(男)"},{sid:"52",label:"zm_yunyang(男)"}];function l_(){const e=$e(),[t,n]=w.useState([]),[r,a]=w.useState(null),[i,s]=w.useState(null),[o,l]=w.useState(null),[u,c]=w.useState(null),[h,m]=w.useState("edge"),[d,p]=w.useState("zh-CN-XiaoxiaoNeural"),[g,x]=w.useState("48"),[b,v]=w.useState("1.0"),[T,N]=w.useState(""),[k,A]=w.useState(""),[_,S]=w.useState([]),I=typeof window<"u"&&"speechSynthesis"in window,[C,D]=w.useState("local"),[L,F]=w.useState("asr-whisper-turbo"),[O,R]=w.useState(!0),[H,V]=w.useState([]),[q,Z]=w.useState(!1),[B,Q]=w.useState(!1),[ne,j]=w.useState(!1),[re,K]=w.useState(!1),[X,ce]=w.useState(!1),[le,ee]=w.useState(null),[Ie,de]=w.useState(!1),[he,pe]=w.useState(null),[Ce,Oe]=w.useState(null),st=w.useCallback(()=>{ae.listCustomProviders().then(ie=>V(ie.filter(nt=>nt.kind==="tts"||nt.kind==="asr"))).catch(()=>{})},[]);w.useEffect(()=>{Promise.all([ae.getSetting("tts_engine"),ae.getSetting("tts_voice_edge"),ae.getSetting("tts_sid_local"),ae.getSetting("tts_speed"),ae.getSetting("tts_custom_voice"),ae.getSetting("tts_system_voice"),ae.getSetting("asr_engine"),ae.getSetting("asr_local_model"),ae.getSetting("asr_auto_stop")]).then(([ie,nt,Tt,tn,Xn,Ar,Ge,et,Lt])=>{ie&&m(ie),nt&&p(nt),Tt&&x(Tt),tn&&v(tn),Xn&&N(Xn),Ar&&A(Ar),Ge&&D(Ge),(et==="asr-whisper-turbo"||et==="asr-whisper-small")&&F(et),R(Lt!=="0")}),st()},[st]),w.useEffect(()=>{if(typeof window>"u"||!("speechSynthesis"in window))return;const ie=()=>S(o0(window.speechSynthesis.getVoices()));return ie(),window.speechSynthesis.addEventListener("voiceschanged",ie),()=>window.speechSynthesis.removeEventListener("voiceschanged",ie)},[]);const Be=w.useCallback(()=>{window.api.getSpeechModelStatus().then(ie=>n(ie)).catch(()=>{})},[]);w.useEffect(()=>(Be(),window.api.on("speech:modelProgress",nt=>{l({id:nt.id,pct:Math.floor(nt.progress*100),label:nt.currentFile?nt.currentFile.split("/").pop()??"":""})})),[Be]);const ut=ie=>{s(null),a(ie),l({id:ie,pct:0,label:""}),window.api.ensureSpeechModel(ie).then(()=>{a(null),l(null),Be()}).catch(nt=>{a(null),l(null),s(nt instanceof Error?nt.message:String(nt)),Be()})},me=ie=>{a(ie),c(null),window.api.deleteSpeechModel(ie).then(Be).catch(nt=>s(nt instanceof Error?nt.message:String(nt))).finally(()=>a(null))},Ue=ie=>e(ie==="tts-kokoro"?"settings.speech.model.tts":ie==="asr-whisper-turbo"?"settings.speech.model.asr_turbo":"settings.speech.model.asr_small"),ct=ie=>e(ie==="asr-whisper-turbo"?"settings.speech.model.turbo_short":"settings.speech.model.small_short"),tt=ie=>ie.startsWith("asr-whisper")?e("settings.speech.license_mit"):e("settings.speech.license"),ft=ie=>e(ie==="ready"?"settings.speech.state.ready":ie==="error"?"settings.speech.state.error":"settings.speech.state.absent"),Xe=ie=>{var nt;return((nt=t.find(Tt=>Tt.id===ie))==null?void 0:nt.state)??"absent"},Pe=ie=>{m(ie),ee(null),ae.setSetting("tts_engine",ie),eo()},oe=ie=>{A(ie),ae.setSetting("tts_system_voice",ie),eo()},ge=ie=>{D(ie),pe(null),ae.setSetting("asr_engine",ie)},_e=H.filter(ie=>ie.kind==="tts"),Ae=H.filter(ie=>ie.kind==="asr"),ze=h.startsWith("custom-")?_e.find(ie=>ie.id===h)??null:null,ye=C.startsWith("custom-")?Ae.find(ie=>ie.id===C)??null:null,Re=h==="azure",He=C==="groq",dt=C==="azure",Jt=async()=>{if(!(!ze||X)){ce(!0),ee(null);try{ee(await ae.testCustomTts({providerId:ze.id}))}catch(ie){ee({ok:!1,detail:ie instanceof Error?ie.message:String(ie)})}finally{ce(!1)}}},Ot=async()=>{if(!(!ye||Ie)){de(!0),pe(null);try{pe(await ae.testCustomAsr({providerId:ye.id}))}catch(ie){pe({ok:!1,detail:ie instanceof Error?ie.message:String(ie)})}finally{de(!1)}}},en=async(ie,nt)=>{Oe(null);try{await ae.deleteCustomProvider(ie),nt==="tts"&&h===ie&&Pe("edge"),nt==="asr"&&C===ie&&ge("local"),st()}catch{}},Ze=ie=>{const nt=t.find(tn=>tn.id===ie),Tt=(nt==null?void 0:nt.state)??"absent";return f.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"text-label font-medium text-ink-strong truncate",children:Ue(ie)}),f.jsxs("div",{className:"text-caption text-ink-muted",children:[ft(Tt)," · ",tt(ie)]}),r===ie&&(o==null?void 0:o.id)===ie&&f.jsx("div",{className:"mt-1.5 h-1.5 rounded-full bg-ink/[0.08] overflow-hidden","data-testid":`speech-dl-bar-${ie}`,children:f.jsx("div",{className:"h-full bg-brand transition-all",style:{width:`${o.pct}%`}})}),r===ie&&(o==null?void 0:o.id)===ie&&f.jsxs("div",{className:"text-caption text-ink-faint mt-0.5","data-testid":`speech-dl-pct-${ie}`,children:[o.pct,"%",o.label?` · ${o.label}`:""]})]}),Tt==="ready"?u===ie?f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx("span",{className:"text-caption text-warning",children:e("settings.speech.confirm_del")}),f.jsx("button",{onClick:()=>me(ie),className:"text-label text-warning hover:underline","data-testid":`speech-del-confirm-${ie}`,children:e("settings.speech.delete")}),f.jsx("button",{onClick:()=>c(null),className:"text-label text-ink-muted hover:text-ink-strong",children:e("action.cancel")})]}):f.jsx("button",{onClick:()=>c(ie),disabled:r===ie,className:"text-label text-ink-muted hover:text-warning disabled:opacity-40","data-testid":`speech-del-${ie}`,children:e("settings.speech.delete")}):f.jsx("button",{onClick:()=>ut(ie),disabled:r!=null||Tt==="downloading",className:"btn-3d-brand px-3 py-1 text-label disabled:opacity-40","data-testid":`speech-dl-${ie}`,children:e(r===ie||Tt==="downloading"?"settings.speech.downloading":"settings.speech.download")})]},ie)},Yr=(ie,nt,Tt,tn,Xn)=>f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-label",children:[f.jsx(ms,{className:"w-3.5 h-3.5 text-ink-faint shrink-0","aria-hidden":"true"}),f.jsx("span",{className:"font-medium text-ink-strong",children:ie.label}),f.jsx("code",{className:"text-ink-faint font-mono break-all",children:ie.defaultModel}),f.jsx("span",{className:"text-ink-faint break-all min-w-0",children:ie.baseUrl}),ie.hasApiKey&&f.jsxs("span",{className:"text-brand shrink-0 inline-flex items-center gap-0.5",children:[f.jsx(Wn,{className:"w-3.5 h-3.5","aria-hidden":"true"}),e("settings.speech.key_saved")]})]}),f.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[f.jsx("button",{onClick:()=>void Xn(),disabled:Tt,className:"btn-3d-neutral px-3 py-1 text-label disabled:opacity-40","data-testid":`${nt}-custom-test`,children:e(Tt?"settings.testing":"settings.test")}),Ce===ie.id?f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-caption text-warning",children:e("settings.speech.confirm_del_custom")}),f.jsx("button",{onClick:()=>void en(ie.id,nt),className:"text-label text-warning hover:underline","data-testid":`${nt}-custom-del-confirm`,children:e("settings.speech.delete")}),f.jsx("button",{onClick:()=>Oe(null),className:"text-label text-ink-muted hover:text-ink-strong",children:e("action.cancel")})]}):f.jsx("button",{onClick:()=>Oe(ie.id),className:"text-label text-ink-muted hover:text-warning","data-testid":`${nt}-custom-del`,children:e("settings.speech.delete")}),tn&&f.jsxs("span",{className:`text-label inline-flex items-center gap-1 ${tn.ok?"text-brand":"text-warning"}`,children:[tn.ok?f.jsx(Wn,{className:"w-4 h-4","aria-hidden":"true"}):f.jsx(va,{className:"w-4 h-4","aria-hidden":"true"}),tn.detail]})]})]});return f.jsxs("div",{"data-testid":"settings-speech",children:[f.jsxs("div",{className:kt(!1),children:[f.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.speech.tts_title")}),f.jsxs("div",{className:"flex gap-2 flex-wrap",children:[f.jsx("button",{onClick:()=>{Pe("edge"),Z(!1),j(!1)},"data-testid":"tts-engine-edge","aria-pressed":h==="edge",className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${h==="edge"?$n:Vn}`,children:e("settings.speech.engine.edge")}),f.jsxs("button",{onClick:()=>{Pe("local"),Z(!1),j(!1)},"data-testid":"tts-engine-local","aria-pressed":h==="local",className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${h==="local"?$n:Vn}`,children:[e("settings.speech.engine.local"),Xe("tts-kokoro")!=="ready"?` · ${e("settings.speech.state.absent")}`:""]}),f.jsx("button",{onClick:()=>{Pe("system"),Z(!1),j(!1)},disabled:!I,"data-testid":"tts-engine-system","aria-pressed":h==="system",title:I?void 0:e("settings.speech.engine.system_unavailable"),className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${h==="system"?$n:Vn} ${I?"":"opacity-40 cursor-not-allowed"}`,children:e("settings.speech.engine.system")}),f.jsx("button",{onClick:()=>{Z(ie=>!ie),q||j(!1)},"data-testid":"tts-engine-custom","aria-pressed":h.startsWith("custom-")||q,className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${h.startsWith("custom-")||q?$n:Vn}`,children:e("settings.speech.engine.custom")}),Re&&f.jsxs("button",{disabled:!0,"data-testid":"tts-engine-azure",className:"px-4 py-2 rounded-xl text-body font-bold opacity-50 cursor-not-allowed",children:["Azure · ",e("settings.speech.legacy")]})]}),h==="edge"&&f.jsx("p",{className:"text-label text-ink-muted mt-2",children:e("settings.speech.engine.edge_note")})]}),h==="edge"&&f.jsxs("div",{className:kt(!1),children:[f.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:e("settings.speech.voice")}),f.jsx("select",{value:d,onChange:ie=>{p(ie.target.value),ae.setSetting("tts_voice_edge",ie.target.value)},"data-testid":"tts-voice-select",className:`${nr} w-full min-w-0 px-2.5 py-1.5`,children:s_.map(ie=>f.jsx("option",{value:ie.id,children:ie.label},ie.id))})]}),h==="local"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:kt(!1),children:[f.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:e("settings.speech.voice")}),f.jsx("select",{value:g,onChange:ie=>{x(ie.target.value),ae.setSetting("tts_sid_local",ie.target.value)},"data-testid":"tts-sid-select",className:`${nr} w-full min-w-0 px-2.5 py-1.5`,children:o_.map(ie=>f.jsx("option",{value:ie.sid,children:ie.label},ie.sid))})]}),f.jsx("div",{className:kt(!1),children:Ze("tts-kokoro")})]}),h==="system"&&f.jsx(f.Fragment,{children:f.jsxs("div",{className:kt(!1),children:[f.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:e("settings.speech.voice")}),f.jsxs("select",{value:k,onChange:ie=>oe(ie.target.value),"data-testid":"tts-system-voice-select",className:`${nr} w-full min-w-0 px-2.5 py-1.5`,children:[f.jsx("option",{value:"",children:e("settings.speech.voice_auto")}),_.map(ie=>f.jsx("option",{value:ie.name,children:gM(ie)},ie.voiceURI))]}),f.jsx("p",{className:"text-label text-ink-muted mt-2",children:e("settings.speech.engine.system_note")})]})}),q&&f.jsx("div",{className:kt(!1),children:f.jsxs("div",{className:"space-y-3",children:[ze&&Yr(ze,"tts",X,le,Jt),ze&&f.jsxs("div",{children:[f.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:e("settings.speech.voice")}),f.jsx("input",{type:"text",value:T,onChange:ie=>N(ie.target.value),onBlur:()=>void ae.setSetting("tts_custom_voice",T.trim()),placeholder:e("settings.speech.custom_voice_ph"),"data-testid":"tts-custom-voice",className:`${nr} w-full min-w-0 px-2.5 py-1.5 font-mono`})]}),!ze&&_e.map(ie=>f.jsxs("button",{onClick:()=>Pe(ie.id),className:"w-full text-left px-3 py-2 rounded-lg bg-surface-1 hover:bg-surface-3 transition-colors","data-testid":`tts-pick-${ie.id}`,children:[f.jsx("span",{className:"text-label font-medium text-ink-strong",children:ie.label}),f.jsx("span",{className:"text-label text-ink-faint font-mono break-all ml-2",children:ie.defaultModel})]},ie.id)),(ne||!ze&&_e.length===0)&&f.jsx(Uo,{kind:"tts",showProtocol:!1,testPrefix:"tts-custom",titleKey:"settings.custom.form_title_tts",modelPhKey:"settings.custom.model_ph_tts",testOverride:ie=>ae.testCustomTts({baseUrl:ie.baseUrl,apiKey:ie.apiKey||void 0,model:ie.model}),onSaved:ie=>{Pe(ie.id),j(!1),st()},onCancel:()=>j(!1)}),(ze||_e.length>0)&&f.jsx("button",{onClick:()=>j(ie=>!ie),className:"text-label text-accent hover:underline",children:e(ne?"action.cancel":"settings.custom.new")})]})}),f.jsx("div",{className:kt(!0),children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.speech.speed")}),f.jsx("input",{type:"range",min:"0.5",max:"2",step:"0.05",value:b,onChange:ie=>v(ie.target.value),onPointerUp:()=>{ae.setSetting("tts_speed",b),eo()},onKeyUp:()=>{ae.setSetting("tts_speed",b),eo()},"data-testid":"tts-speed-range",className:"flex-1 min-w-0 accent-[var(--brand)]"}),f.jsxs("span",{className:"text-label text-ink-muted tabular-nums w-10 text-right","data-testid":"tts-speed-value",children:[Number(b).toFixed(2),"x"]})]})}),f.jsxs("div",{className:kt(!0),children:[f.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.speech.asr_title")}),f.jsxs("div",{className:"flex gap-2 flex-wrap",children:[f.jsx("button",{onClick:()=>{ge("local"),Q(!1),K(!1)},"data-testid":"asr-engine-local","aria-pressed":C==="local",className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${C==="local"?$n:Vn}`,children:e("settings.speech.asr_engine.local")}),f.jsx("button",{onClick:()=>{Q(ie=>!ie),B||K(!1)},"data-testid":"asr-engine-custom","aria-pressed":C.startsWith("custom-")||B,className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${C.startsWith("custom-")||B?$n:Vn}`,children:e("settings.speech.engine.custom")}),He&&f.jsxs("button",{disabled:!0,"data-testid":"asr-engine-groq",className:"px-4 py-2 rounded-xl text-body font-bold opacity-50 cursor-not-allowed",children:["Groq · ",e("settings.speech.legacy")]}),dt&&f.jsxs("button",{disabled:!0,"data-testid":"asr-engine-azure",className:"px-4 py-2 rounded-xl text-body font-bold opacity-50 cursor-not-allowed",children:["Azure · ",e("settings.speech.legacy")]})]}),C==="local"?f.jsx("p",{className:"text-label text-ink-muted mt-2",children:e("settings.speech.asr_engine.local_note")}):C.startsWith("custom-")&&f.jsx("p",{className:"text-label text-ink-muted mt-2",children:e("settings.speech.asr_engine.custom_note")})]}),C==="local"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:kt(!1),children:[f.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:e("settings.model")}),f.jsx("select",{value:L,onChange:ie=>{F(ie.target.value),ae.setSetting("asr_local_model",ie.target.value)},"data-testid":"asr-model-select",className:`${nr} w-full min-w-0 px-2.5 py-1.5`,children:["asr-whisper-turbo","asr-whisper-small"].map(ie=>f.jsxs("option",{value:ie,children:[ct(ie)," · ",ft(Xe(ie))]},ie))})]}),f.jsx("div",{className:kt(!1),children:Ze(L)})]}),B&&f.jsx("div",{className:kt(!1),children:f.jsxs("div",{className:"space-y-3",children:[ye&&Yr(ye,"asr",Ie,he,Ot),!ye&&Ae.map(ie=>f.jsxs("button",{onClick:()=>ge(ie.id),className:"w-full text-left px-3 py-2 rounded-lg bg-surface-1 hover:bg-surface-3 transition-colors","data-testid":`asr-pick-${ie.id}`,children:[f.jsx("span",{className:"text-label font-medium text-ink-strong",children:ie.label}),f.jsx("span",{className:"text-label text-ink-faint font-mono break-all ml-2",children:ie.defaultModel})]},ie.id)),(re||!ye&&Ae.length===0)&&f.jsx(Uo,{kind:"asr",showProtocol:!1,testPrefix:"asr-custom",titleKey:"settings.custom.form_title_asr",modelPhKey:"settings.custom.model_ph_asr",testOverride:ie=>ae.testCustomAsr({baseUrl:ie.baseUrl,apiKey:ie.apiKey||void 0,model:ie.model}),onSaved:ie=>{ge(ie.id),K(!1),st()},onCancel:()=>K(!1)}),(ye||Ae.length>0)&&f.jsx("button",{onClick:()=>K(ie=>!ie),className:"text-label text-accent hover:underline",children:e(re?"action.cancel":"settings.custom.new")})]})}),f.jsxs("div",{className:kt(!0),children:[f.jsxs("div",{className:"flex items-center gap-3",children:[f.jsx(Wa,{checked:O,onChange:()=>{const ie=!O;R(ie),ae.setSetting("asr_auto_stop",ie?"1":"0")},label:e("settings.speech.asr_auto_stop"),testid:"asr-auto-stop-toggle"}),f.jsx("div",{className:"text-body font-medium text-ink-strong",children:e("settings.speech.asr_auto_stop")})]}),f.jsx("p",{className:"text-label text-ink-muted mt-2",children:e("settings.speech.asr_ux_note")})]}),i&&f.jsx("div",{className:"px-4 py-3 text-label text-warning break-all",role:"alert",children:i==="engine-unavailable"?e("chat.speech.engine_unavailable"):i})]})}function u_(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 a=e[r];if(a.type==="tool-call"&&a.toolName===t.toolName&&a.state==="input-available"){n=r;break}}return n<0?e:e.map((r,a)=>a===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 a=e[r];if(a.type==="tool-call"&&a.toolName===t.toolName&&a.state==="input-available"){n=r;break}}return n<0?e:e.map((r,a)=>a===n?{...r,state:"output-error",error:t.error}:r)}return e}let c_=0;const to=()=>`msg-v2-${++c_}`;function d_(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 h_(e,t){const[n,r]=w.useState([]),[a,i]=w.useState(!1),s=w.useRef(null);w.useEffect(()=>{if(!e){r([]),i(!1),s.current=null;return}let m=!1;return(async()=>{try{const d=await ae.threadGetMessages(e);if(m)return;r(d.map(p=>{const g=d_(p.partsJson);return{id:p.id,role:p.role,parts:g??[{type:"text",text:p.content}],...p.displayText?{displayText:p.displayText}:{}}}))}catch{m||r([])}})(),()=>{m=!0}},[e]),w.useEffect(()=>ae.on("chat:part",d=>{const g=s.current;r(x=>{let b=g,v=x;if(!(b&&x.some(k=>k.id===b))){const k=x[x.length-1];k&&k.role==="assistant"?b=k.id:(b=to(),v=[...x,{id:b,role:"assistant",parts:[]}])}const N=b;return v.map(k=>k.id===N?{...k,parts:u_(k.parts,d)}:k)})}),[]),w.useEffect(()=>ae.on("chat:done",(d,p)=>{i(!1),s.current=null,p&&(p.userMessageId||p.assistantMessageId)&&r(g=>{let x=-1,b=-1;for(let v=g.length-1;v>=0&&(g[v].role==="user"&&x===-1&&(x=v),g[v].role==="assistant"&&b===-1&&(b=v),!(x!==-1&&b!==-1));v--);return g.map((v,T)=>T===x&&p.userMessageId?{...v,id:p.userMessageId}:T===b&&p.assistantMessageId?{...v,id:p.assistantMessageId}:v)})}),[]),w.useEffect(()=>ae.on("chat:error",d=>{i(!1),s.current=null,r(p=>[...p,{id:to(),role:"assistant",parts:[{type:"text",text:`⚠️ ${d}`}]}])}),[]);const o=w.useCallback(async(m,d,p,g)=>{const x=d??e;if(!x||a||!m.trim())return;const b=m.trim(),v={id:to(),role:"user",parts:[...(g??[]).map(T=>({type:"attachment",attachment:{kind:T.kind,name:T.name,mime:T.mime,size:T.size,...T.previewUrl?{previewUrl:T.previewUrl}:{}}})),{type:"text",text:b}],...p?{displayText:p}:{}};r(T=>[...T,v]),i(!0),s.current=null;try{await ae.agentChatThread(x,b,p,t??null,g)}catch(T){i(!1),r(N=>[...N,{id:to(),role:"assistant",parts:[{type:"text",text:`⚠️ ${T instanceof Error?T.message:String(T)}`}]}])}},[e,a,t]),l=w.useCallback(async()=>{if(!(!e||!a)){try{await ae.abortAgentChatThread(e)}catch{}i(!1),s.current=null}},[e,a]),u=w.useCallback(()=>{r([])},[]);w.useEffect(()=>{const m=d=>{const p=d.detail;if(typeof p!="string")return;const x={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"}}[p];x&&o(x.msg,void 0,W0(x.labelKey))};return window.addEventListener("lookatstudy-command",m),()=>window.removeEventListener("lookatstudy-command",m)},[o]);const c=w.useCallback((m,d,p)=>{r(g=>g.map(x=>{if(x.id!==m)return x;const b=[...x.parts],v=b[d];return v&&v.type==="tool-call"&&(b[d]={...v,output:{...typeof v.output=="object"&&v.output?v.output:{},status:p?"applied":"rejected"}}),{...x,parts:b}}))},[]),h=w.useCallback(m=>{r(m)},[]);return{messages:n,streaming:a,send:o,stop:l,clear:u,markProposalStatus:c,setMessagesForNode:h}}const no=(e,t=60)=>e.length>t?e.slice(0,t)+"…":e;function f_(e,t){return t("quiz.hook.label",{correct:e.correct,total:e.total})}function m_(e,t){const n=e.detail.map((a,i)=>a.correct?t("quiz.hook.lineOk",{n:i+1,prompt:no(a.prompt)}):t("quiz.hook.lineWrong",{n:i+1,prompt:no(a.prompt),chosen:no(a.chosen,30),answer:no(a.answerText,30)})),r=e.title?`《${e.title}》`:"";return t("quiz.hook.message",{title:r,correct:e.correct,total:e.total})+(n.length?`
|
|
783
|
+
`+n.join(`
|
|
784
|
+
`):"")}function p_(e,t){const[n,r]=w.useState([]),[a,i]=w.useState(null),s=w.useCallback(async()=>{if(!e||!t){r([]),i(null);return}try{const g=(await ae.threadList(e,"active")).filter(x=>x.focusNodeId===t);r(g),g.length>0?i(g[0].id):i(null)}catch{r([]),i(null)}},[e,t]);w.useEffect(()=>{s()},[s]);const o=w.useCallback(async p=>{if(!e||!t)return null;try{const g=await ae.threadCreate({...p,courseId:e,focusNodeId:t});return r(x=>[g,...x]),i(g.id),g}catch{return null}},[e,t]),l=w.useCallback(async(p,g)=>{try{const x=await ae.threadUpdate(p,g);return x&&(x.status==="archived"?(r(b=>b.filter(v=>v.id!==p)),i(b=>{var T;return b!==p?b:((T=n.filter(N=>N.id!==p)[0])==null?void 0:T.id)??null})):r(b=>b.map(v=>v.id===p?x:v))),x}catch{return null}},[n]),u=w.useCallback(async p=>{try{await ae.threadDelete(p),r(g=>g.filter(x=>x.id!==p)),i(g=>{var b;return g!==p?g:((b=n.filter(v=>v.id!==p)[0])==null?void 0:b.id)??null})}catch{}},[n]),c=w.useCallback(p=>{const g=n.find(x=>x.id===p)??null;return g?(r(x=>x.filter(b=>b.id!==p)),i(x=>{var v;return x!==p?x:((v=n.filter(T=>T.id!==p)[0])==null?void 0:v.id)??null}),g):null},[n]),h=w.useCallback(p=>{r(g=>[p,...g.filter(x=>x.id!==p.id)]),i(p.id)},[]),m=w.useCallback(async(p,g)=>{if(!e||!t)return null;if(a)return a;const x=await o({title:(g??p).trim()});return(x==null?void 0:x.id)??null},[e,t,a,o]),d=n.find(p=>p.id===a)??null;return{threads:n,activeId:a,activeThread:d,setActiveId:i,reload:s,create:o,update:l,remove:u,removeWithUndo:c,restore:h,ensureThreadForSend:m}}function g_({threads:e,activeThread:t,focusNodeTitle:n,onPickThread:r,onCreate:a,onRename:i,onArchive:s,onDelete:o}){const l=$e(),[u,c]=w.useState(null),[h,m]=w.useState(null),[d,p]=w.useState(null),[g,x]=w.useState(""),[b,v]=w.useState(null),T=w.useRef(null);w.useEffect(()=>{const _=S=>{T.current&&!T.current.contains(S.target)&&(c(null),m(null))};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[]);const N=(_,S)=>{_.stopPropagation();const I=_.currentTarget.getBoundingClientRect(),C=Math.max(8,I.right-128),D=I.bottom+4;m({top:D,left:C}),c(u===S?null:S)},k=_=>{p(_.id),x(_.title??""),c(null),m(null)},A=()=>{d&&g.trim()&&i(d,g.trim()),p(null)};return e.length===0?f.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:[f.jsx("span",{className:"w-1 h-1 rounded-full bg-brand shrink-0"}),f.jsx("span",{className:"text-ink-muted truncate flex-1",children:n??l("thread.empty.no_node")}),f.jsx("span",{className:"text-caption text-ink-muted shrink-0",children:l("thread.empty.hint")})]}):f.jsxs("div",{className:"shrink-0 bg-surface-1","data-testid":"thread-switcher",children:[f.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(_=>{const S=_.id===(t==null?void 0:t.id),I=d===_.id;return f.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 ${S?"text-ink-strong":"text-ink-muted hover:text-ink-strong"}`,onClick:()=>!I&&r(_.id),"data-testid":`thread-tab-${_.id.slice(0,8)}`,children:[f.jsx("span",{className:`w-1 h-1 rounded-full shrink-0 transition-opacity ${S?"bg-brand opacity-100":"bg-[var(--border)] opacity-0 group-hover:opacity-60"}`}),I?f.jsx("input",{value:g,onChange:C=>x(C.target.value),onKeyDown:C=>{C.key==="Enter"&&A(),C.key==="Escape"&&p(null)},onBlur:A,onClick:C=>C.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"}):f.jsx("span",{className:`text-label max-w-[120px] truncate ${S?"font-semibold":"font-normal"}`,"data-tooltip":_.title||l("toast.threadDefault"),children:_.title||l("toast.threadDefault")}),!I&&f.jsx("button",{onClick:C=>N(C,_.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-${_.id.slice(0,8)}`,title:l("thread.actions.label"),"aria-label":l("thread.actions.label"),children:f.jsx(No,{className:"w-3 h-3"})})]},_.id)}),f.jsx("button",{onClick:a,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:f.jsx(el,{className:"w-3.5 h-3.5"})})]}),u&&h&&(()=>{const _=e.find(S=>S.id===u);return _?f.jsxs("div",{ref:T,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-${_.id.slice(0,8)}`,onClick:S=>S.stopPropagation(),children:[f.jsxs("button",{onClick:()=>k(_),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:[f.jsx(Xy,{className:"w-3 h-3"}),l("thread.menu.rename")]}),f.jsxs("button",{onClick:()=>{s(_.id),c(null),m(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:[f.jsx(fy,{className:"w-3 h-3"}),l("thread.menu.archive")]}),f.jsxs("button",{onClick:S=>{const I=S.currentTarget.getBoundingClientRect();v({id:_.id,title:_.title??l("toast.threadDefault"),rect:I}),c(null),m(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:[f.jsx(gc,{className:"w-3 h-3"}),l("action.delete")]})]}):null})(),b&&f.jsx(tl,{anchorRect:b.rect,message:l("thread.delete.confirm",{name:b.title}),danger:!0,confirmLabel:l("action.delete"),testid:"thread-delete-confirm",onConfirm:()=>{o(b.id),v(null)},onCancel:()=>v(null)})]})}const x_=1240,b_=920;function y_(e){return e>=x_?1:e>=b_?2:3}function v_(e){return e==="rail"?"rail":"notebook"}function w_(e,t,n){if(Math.abs(t)<60||Math.abs(t)<Math.abs(n)*1.6)return null;const r=["rail","chat","notebook"],a=r.indexOf(e)+(t<0?1:-1);return a>=0&&a<r.length?r[a]:null}function k_(e){return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}function T_(){return y_(typeof window>"u"?E_:window.innerWidth)}const E_=99999;function S_(){return w.useSyncExternalStore(k_,T_,()=>1)}const Od=w.createContext({});function jd(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}const A_=typeof window<"u",qo=A_?w.useLayoutEffect:w.useEffect,Ml=w.createContext(null);function Bd(e,t){e.indexOf(t)===-1&&e.push(t)}function Vo(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const or=(e,t,n)=>n>t?t:n<e?e:n;let Il=()=>{};const Ur={},W4=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),G4=e=>typeof e=="object"&&e!==null,Y4=e=>/^0[^.\s]+$/u.test(e);function K4(e){let t;return()=>(t===void 0&&(t=e()),t)}const jn=e=>e,As=(...e)=>e.reduce((t,n)=>r=>n(t(r))),ls=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1};class Fd{constructor(){this.subscriptions=[]}add(t){return Bd(this.subscriptions,t),()=>Vo(this.subscriptions,t)}notify(t,n,r){const a=this.subscriptions.length;if(a)if(a===1)this.subscriptions[0](t,n,r);else for(let i=0;i<a;i++){const s=this.subscriptions[i];s&&s(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const An=e=>e*1e3,On=e=>e/1e3,X4=(e,t)=>t?e*(1e3/t):0,Q4=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,C_=1e-7,N_=12;function M_(e,t,n,r,a){let i,s,o=0;do s=t+(n-t)/2,i=Q4(s,r,a)-e,i>0?n=s:t=s;while(Math.abs(i)>C_&&++o<N_);return s}function Cs(e,t,n,r){if(e===t&&n===r)return jn;const a=i=>M_(i,0,1,e,n);return i=>i===0||i===1?i:Q4(a(i),t,r)}const Z4=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,J4=e=>t=>1-e(1-t),eb=Cs(.33,1.53,.69,.99),zd=J4(eb),tb=Z4(zd),nb=e=>e>=1?1:(e*=2)<1?.5*zd(e):.5*(2-Math.pow(2,-10*(e-1))),Hd=e=>1-Math.sin(Math.acos(e)),rb=J4(Hd),ab=Z4(Hd),I_=Cs(.42,0,1,1),__=Cs(0,0,.58,1),ib=Cs(.42,0,.58,1),R_=e=>Array.isArray(e)&&typeof e[0]!="number",sb=e=>Array.isArray(e)&&typeof e[0]=="number",L_={linear:jn,easeIn:I_,easeInOut:ib,easeOut:__,circIn:Hd,circInOut:ab,circOut:rb,backIn:zd,backInOut:tb,backOut:eb,anticipate:nb},D_=e=>typeof e=="string",b1=e=>{if(sb(e)){Il(e.length===4);const[t,n,r,a]=e;return Cs(t,n,r,a)}else if(D_(e))return L_[e];return e},ro=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function P_(e){let t=new Set,n=new Set,r=!1,a=!1;const i=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function o(u){i.has(u)&&(l.schedule(u),e()),u(s)}const l={schedule:(u,c=!1,h=!1)=>{const d=h&&r?t:n;return c&&i.add(u),d.add(u),u},cancel:u=>{n.delete(u),i.delete(u)},process:u=>{if(s=u,r){a=!0;return}r=!0;const c=t;t=n,n=c,t.forEach(o),t.clear(),r=!1,a&&(a=!1,l.process(u))}};return l}const O_=40;function ob(e,t){let n=!1,r=!0;const a={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,s=ro.reduce((T,N)=>(T[N]=P_(i),T),{}),{setup:o,read:l,resolveKeyframes:u,preUpdate:c,update:h,preRender:m,render:d,postRender:p}=s,g=()=>{const T=Ur.useManualTiming,N=T?a.timestamp:performance.now();n=!1,T||(a.delta=r?1e3/60:Math.max(Math.min(N-a.timestamp,O_),1)),a.timestamp=N,a.isProcessing=!0,o.process(a),l.process(a),u.process(a),c.process(a),h.process(a),m.process(a),d.process(a),p.process(a),a.isProcessing=!1,n&&t&&(r=!1,e(g))},x=()=>{n=!0,r=!0,a.isProcessing||e(g)};return{schedule:ro.reduce((T,N)=>{const k=s[N];return T[N]=(A,_=!1,S=!1)=>(n||x(),k.schedule(A,_,S)),T},{}),cancel:T=>{for(let N=0;N<ro.length;N++)s[ro[N]].cancel(T)},state:a,steps:s}}const{schedule:yt,cancel:qr,state:Qt,steps:Ku}=ob(typeof requestAnimationFrame<"u"?requestAnimationFrame:jn,!0);let bo;function j_(){bo=void 0}const fn={now:()=>(bo===void 0&&fn.set(Qt.isProcessing||Ur.useManualTiming?Qt.timestamp:performance.now()),bo),set:e=>{bo=e,queueMicrotask(j_)}},lb=e=>t=>typeof t=="string"&&t.startsWith(e),ub=lb("--"),B_=lb("var(--"),Ud=e=>B_(e)?F_.test(e.split("/*")[0].trim()):!1,F_=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function y1(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const hi={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},us={...hi,transform:e=>or(0,1,e)},ao={...hi,default:1},Ki=e=>Math.round(e*1e5)/1e5,qd=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function z_(e){return e==null}const H_=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Vd=(e,t)=>n=>!!(typeof n=="string"&&H_.test(n)&&n.startsWith(e)||t&&!z_(n)&&Object.prototype.hasOwnProperty.call(n,t)),cb=(e,t,n)=>r=>{if(typeof r!="string")return r;const[a,i,s,o]=r.match(qd);return{[e]:parseFloat(a),[t]:parseFloat(i),[n]:parseFloat(s),alpha:o!==void 0?parseFloat(o):1}},U_=e=>or(0,255,e),Xu={...hi,transform:e=>Math.round(U_(e))},ca={test:Vd("rgb","red"),parse:cb("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Xu.transform(e)+", "+Xu.transform(t)+", "+Xu.transform(n)+", "+Ki(us.transform(r))+")"};function q_(e){let t="",n="",r="",a="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),a=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),a=e.substring(4,5),t+=t,n+=n,r+=r,a+=a),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:a?parseInt(a,16)/255:1}}const d0={test:Vd("#"),parse:q_,transform:ca.transform},Ns=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),pr=Ns("deg"),ir=Ns("%"),je=Ns("px"),V_=Ns("vh"),$_=Ns("vw"),v1={...ir,parse:e=>ir.parse(e)/100,transform:e=>ir.transform(e*100)},za={test:Vd("hsl","hue"),parse:cb("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+ir.transform(Ki(t))+", "+ir.transform(Ki(n))+", "+Ki(us.transform(r))+")"},Bt={test:e=>ca.test(e)||d0.test(e)||za.test(e),parse:e=>ca.test(e)?ca.parse(e):za.test(e)?za.parse(e):d0.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ca.transform(e):za.transform(e),getAnimatableNone:e=>{const t=Bt.parse(e);return t.alpha=0,Bt.transform(t)}},W_=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function G_(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(qd))==null?void 0:t.length)||0)+(((n=e.match(W_))==null?void 0:n.length)||0)>0}const db="number",hb="color",Y_="var",K_="var(",w1="${}",X_=/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 ei(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},a=[];let i=0;const o=t.replace(X_,l=>(Bt.test(l)?(r.color.push(i),a.push(hb),n.push(Bt.parse(l))):l.startsWith(K_)?(r.var.push(i),a.push(Y_),n.push(l)):(r.number.push(i),a.push(db),n.push(parseFloat(l))),++i,w1)).split(w1);return{values:n,split:o,indexes:r,types:a}}function Q_(e){return ei(e).values}function fb({split:e,types:t}){const n=e.length;return r=>{let a="";for(let i=0;i<n;i++)if(a+=e[i],r[i]!==void 0){const s=t[i];s===db?a+=Ki(r[i]):s===hb?a+=Bt.transform(r[i]):a+=r[i]}return a}}function Z_(e){return fb(ei(e))}const J_=e=>typeof e=="number"?0:Bt.test(e)?Bt.getAnimatableNone(e):e,eR=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:J_(e);function tR(e){const t=ei(e);return fb(t)(t.values.map((r,a)=>eR(r,t.split[a])))}const Yn={test:G_,parse:Q_,createTransformer:Z_,getAnimatableNone:tR};function Qu(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 nR({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let a=0,i=0,s=0;if(!t)a=i=s=n;else{const o=n<.5?n*(1+t):n+t-n*t,l=2*n-o;a=Qu(l,o,e+1/3),i=Qu(l,o,e),s=Qu(l,o,e-1/3)}return{red:Math.round(a*255),green:Math.round(i*255),blue:Math.round(s*255),alpha:r}}function $o(e,t){return n=>n>0?t:e}const bt=(e,t,n)=>e+(t-e)*n,Zu=(e,t,n)=>{const r=e*e,a=n*(t*t-r)+r;return a<0?0:Math.sqrt(a)},rR=[d0,ca,za],aR=e=>rR.find(t=>t.test(e));function k1(e){const t=aR(e);if(!t)return!1;let n=t.parse(e);return t===za&&(n=nR(n)),n}const T1=(e,t)=>{const n=k1(e),r=k1(t);if(!n||!r)return $o(e,t);const a={...n};return i=>(a.red=Zu(n.red,r.red,i),a.green=Zu(n.green,r.green,i),a.blue=Zu(n.blue,r.blue,i),a.alpha=bt(n.alpha,r.alpha,i),ca.transform(a))},h0=new Set(["none","hidden"]);function iR(e,t){return h0.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function sR(e,t){return n=>bt(e,t,n)}function $d(e){return typeof e=="number"?sR:typeof e=="string"?Ud(e)?$o:Bt.test(e)?T1:uR:Array.isArray(e)?mb:typeof e=="object"?Bt.test(e)?T1:oR:$o}function mb(e,t){const n=[...e],r=n.length,a=e.map((i,s)=>$d(i)(i,t[s]));return i=>{for(let s=0;s<r;s++)n[s]=a[s](i);return n}}function oR(e,t){const n={...e,...t},r={};for(const a in n)e[a]!==void 0&&t[a]!==void 0&&(r[a]=$d(e[a])(e[a],t[a]));return a=>{for(const i in r)n[i]=r[i](a);return n}}function lR(e,t){const n=[],r={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const i=t.types[a],s=e.indexes[i][r[i]],o=e.values[s]??0;n[a]=o,r[i]++}return n}const uR=(e,t)=>{const n=Yn.createTransformer(t),r=ei(e),a=ei(t);return r.indexes.var.length===a.indexes.var.length&&r.indexes.color.length===a.indexes.color.length&&r.indexes.number.length>=a.indexes.number.length?h0.has(e)&&!a.values.length||h0.has(t)&&!r.values.length?iR(e,t):As(mb(lR(r,a),a.values),n):$o(e,t)};function pb(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?bt(e,t,n):$d(e)(e,t)}const cR=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>yt.update(t,n),stop:()=>qr(t),now:()=>Qt.isProcessing?Qt.timestamp:fn.now()}},gb=(e,t,n=10)=>{let r="";const a=Math.max(Math.round(t/n),2);for(let i=0;i<a;i++)r+=Math.round(e(i/(a-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Wo=2e4;function Wd(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Wo;)t+=n,r=e.next(t);return t>=Wo?1/0:t}function dR(e,t=100,n){const r=n({...e,keyframes:[0,t]}),a=Math.min(Wd(r),Wo);return{type:"keyframes",ease:i=>r.next(a*i).value/t,duration:On(a)}}const Rt={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 f0(e,t){return e*Math.sqrt(1-t*t)}const hR=12;function fR(e,t,n){let r=n;for(let a=1;a<hR;a++)r=r-e(r)/t(r);return r}const Ju=.001;function mR({duration:e=Rt.duration,bounce:t=Rt.bounce,velocity:n=Rt.velocity,mass:r=Rt.mass}){let a,i,s=1-t;s=or(Rt.minDamping,Rt.maxDamping,s),e=or(Rt.minDuration,Rt.maxDuration,On(e)),s<1?(a=u=>{const c=u*s,h=c*e,m=c-n,d=f0(u,s),p=Math.exp(-h);return Ju-m/d*p},i=u=>{const h=u*s*e,m=h*n+n,d=Math.pow(s,2)*Math.pow(u,2)*e,p=Math.exp(-h),g=f0(Math.pow(u,2),s);return(-a(u)+Ju>0?-1:1)*((m-d)*p)/g}):(a=u=>{const c=Math.exp(-u*e),h=(u-n)*e+1;return-Ju+c*h},i=u=>{const c=Math.exp(-u*e),h=(n-u)*(e*e);return c*h});const o=5/e,l=fR(a,i,o);if(e=An(e),isNaN(l))return{stiffness:Rt.stiffness,damping:Rt.damping,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:s*2*Math.sqrt(r*u),duration:e}}}const pR=["duration","bounce"],gR=["stiffness","damping","mass"];function E1(e,t){return t.some(n=>e[n]!==void 0)}function xR(e){let t={velocity:Rt.velocity,stiffness:Rt.stiffness,damping:Rt.damping,mass:Rt.mass,isResolvedFromDuration:!1,...e};if(!E1(e,gR)&&E1(e,pR))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),a=r*r,i=2*or(.05,1,1-(e.bounce||0))*Math.sqrt(a);t={...t,mass:Rt.mass,stiffness:a,damping:i}}else{const n=mR({...e,velocity:0});t={...t,...n,mass:Rt.mass},t.isResolvedFromDuration=!0}return t}function Go(e=Rt.visualDuration,t=Rt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:a}=n;const i=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],o={done:!1,value:i},{stiffness:l,damping:u,mass:c,duration:h,velocity:m,isResolvedFromDuration:d}=xR({...n,velocity:-On(n.velocity||0)}),p=m||0,g=u/(2*Math.sqrt(l*c)),x=s-i,b=On(Math.sqrt(l/c)),v=Math.abs(x)<5;r||(r=v?Rt.restSpeed.granular:Rt.restSpeed.default),a||(a=v?Rt.restDelta.granular:Rt.restDelta.default);let T,N,k,A,_,S;if(g<1)k=f0(b,g),A=(p+g*b*x)/k,T=C=>{const D=Math.exp(-g*b*C);return s-D*(A*Math.sin(k*C)+x*Math.cos(k*C))},_=g*b*A+x*k,S=g*b*x-A*k,N=C=>Math.exp(-g*b*C)*(_*Math.sin(k*C)+S*Math.cos(k*C));else if(g===1){T=D=>s-Math.exp(-b*D)*(x+(p+b*x)*D);const C=p+b*x;N=D=>Math.exp(-b*D)*(b*C*D-p)}else{const C=b*Math.sqrt(g*g-1);T=O=>{const R=Math.exp(-g*b*O),H=Math.min(C*O,300);return s-R*((p+g*b*x)*Math.sinh(H)+C*x*Math.cosh(H))/C};const D=(p+g*b*x)/C,L=g*b*D-x*C,F=g*b*x-D*C;N=O=>{const R=Math.exp(-g*b*O),H=Math.min(C*O,300);return R*(L*Math.sinh(H)+F*Math.cosh(H))}}const I={calculatedDuration:d&&h||null,velocity:C=>An(N(C)),next:C=>{if(!d&&g<1){const L=Math.exp(-g*b*C),F=Math.sin(k*C),O=Math.cos(k*C),R=s-L*(A*F+x*O),H=An(L*(_*F+S*O));return o.done=Math.abs(H)<=r&&Math.abs(s-R)<=a,o.value=o.done?s:R,o}const D=T(C);if(d)o.done=C>=h;else{const L=An(N(C));o.done=Math.abs(L)<=r&&Math.abs(s-D)<=a}return o.value=o.done?s:D,o},toString:()=>{const C=Math.min(Wd(I),Wo),D=gb(L=>I.next(C*L).value,C,30);return C+"ms "+D},toTransition:()=>{}};return I}Go.applyToOptions=e=>{const t=dR(e,100,Go);return e.ease=t.ease,e.duration=An(t.duration),e.type="keyframes",e};const bR=5;function xb(e,t,n){const r=Math.max(t-bR,0);return X4(n-e(r),t-r)}function m0({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:a=10,bounceStiffness:i=500,modifyTarget:s,min:o,max:l,restDelta:u=.5,restSpeed:c}){const h=e[0],m={done:!1,value:h},d=S=>o!==void 0&&S<o||l!==void 0&&S>l,p=S=>o===void 0?l:l===void 0||Math.abs(o-S)<Math.abs(l-S)?o:l;let g=n*t;const x=h+g,b=s===void 0?x:s(x);b!==x&&(g=b-h);const v=S=>-g*Math.exp(-S/r),T=S=>b+v(S),N=S=>{const I=v(S),C=T(S);m.done=Math.abs(I)<=u,m.value=m.done?b:C};let k,A;const _=S=>{d(m.value)&&(k=S,A=Go({keyframes:[m.value,p(m.value)],velocity:xb(T,S,m.value),damping:a,stiffness:i,restDelta:u,restSpeed:c}))};return _(0),{calculatedDuration:null,next:S=>{let I=!1;return!A&&k===void 0&&(I=!0,N(S),_(S)),k!==void 0&&S>=k?A.next(S-k):(!I&&N(S),m)}}}function yR(e,t,n){const r=[],a=n||Ur.mix||pb,i=e.length-1;for(let s=0;s<i;s++){let o=a(e[s],e[s+1]);if(t){const l=Array.isArray(t)?t[s]||jn:t;o=As(l,o)}r.push(o)}return r}function vR(e,t,{clamp:n=!0,ease:r,mixer:a}={}){const i=e.length;if(Il(i===t.length),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=yR(t,r,a),l=o.length,u=c=>{if(s&&c<e[0])return t[0];let h=0;if(l>1)for(;h<e.length-2&&!(c<e[h+1]);h++);const m=ls(e[h],e[h+1],c);return o[h](m)};return n?c=>u(or(e[0],e[i-1],c)):u}function wR(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const a=ls(0,t,r);e.push(bt(n,1,a))}}function kR(e){const t=[0];return wR(t,e.length-1),t}function TR(e,t){return e.map(n=>n*t)}function ER(e,t){return e.map(()=>t||ib).splice(0,e.length-1)}function Xi({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const a=R_(r)?r.map(b1):b1(r),i={done:!1,value:t[0]},s=TR(n&&n.length===t.length?n:kR(t),e),o=vR(s,t,{ease:Array.isArray(a)?a:ER(t,a)});return{calculatedDuration:e,next:l=>(i.value=o(l),i.done=l>=e,i)}}const SR=e=>e!==null;function _l(e,{repeat:t,repeatType:n="loop"},r,a=1){const i=e.filter(SR),o=a<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!o||r===void 0?i[o]:r}const AR={decay:m0,inertia:m0,tween:Xi,keyframes:Xi,spring:Go};function bb(e){typeof e.type=="string"&&(e.type=AR[e.type])}class Gd{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 CR=e=>e/100;class Yo extends Gd{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,a;const{motionValue:n}=this.options;n&&n.updatedAt!==fn.now()&&this.tick(fn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(a=(r=this.options).onStop)==null||a.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;bb(t);const{type:n=Xi,repeat:r=0,repeatDelay:a=0,repeatType:i,velocity:s=0}=t;let{keyframes:o}=t;const l=n||Xi;l!==Xi&&typeof o[0]!="number"&&(this.mixKeyframes=As(CR,pb(o[0],o[1])),o=[0,100]);const u=l({...t,keyframes:o});i==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...o].reverse(),velocity:-s})),u.calculatedDuration===null&&(u.calculatedDuration=Wd(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+a,this.totalDuration=this.resolvedDuration*(r+1)-a,this.generator=u}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:a,mixKeyframes:i,mirroredGenerator:s,resolvedDuration:o,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:c,repeat:h,repeatType:m,repeatDelay:d,type:p,onUpdate:g,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-a/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const b=this.currentTime-u*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?b<0:b>a;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=a);let T=this.currentTime,N=r;if(h){const S=Math.min(this.currentTime,a)/o;let I=Math.floor(S),C=S%1;!C&&S>=1&&(C=1),C===1&&I--,I=Math.min(I,h+1),!!(I%2)&&(m==="reverse"?(C=1-C,d&&(C-=d/o)):m==="mirror"&&(N=s)),T=or(0,1,C)*o}let k;v?(this.delayState.value=c[0],k=this.delayState):k=N.next(T),i&&!v&&(k.value=i(k.value));let{done:A}=k;!v&&l!==null&&(A=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return _&&p!==m0&&(k.value=_l(c,this.options,x,this.speed)),g&&g(k.value),_&&this.finish(),k}then(t,n){return this.finished.then(t,n)}get duration(){return On(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+On(t)}get time(){return On(this.currentTime)}set time(t){t=An(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 xb(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(fn.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=On(this.currentTime))}play(){var a,i;if(this.isStopped)return;const{driver:t=cR,startTime:n}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),(i=(a=this.options).onPlay)==null||i.call(a);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(fn.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 NR(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const da=e=>e*180/Math.PI,p0=e=>{const t=da(Math.atan2(e[1],e[0]));return g0(t)},MR={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:p0,rotateZ:p0,skewX:e=>da(Math.atan(e[1])),skewY:e=>da(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},g0=e=>(e=e%360,e<0&&(e+=360),e),S1=p0,A1=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),C1=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),IR={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:A1,scaleY:C1,scale:e=>(A1(e)+C1(e))/2,rotateX:e=>g0(da(Math.atan2(e[6],e[5]))),rotateY:e=>g0(da(Math.atan2(-e[2],e[0]))),rotateZ:S1,rotate:S1,skewX:e=>da(Math.atan(e[4])),skewY:e=>da(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function x0(e){return e.includes("scale")?1:0}function b0(e,t){if(!e||e==="none")return x0(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,a;if(n)r=IR,a=n;else{const o=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=MR,a=o}if(!a)return x0(t);const i=r[t],s=a[1].split(",").map(RR);return typeof i=="function"?i(s):s[i]}const _R=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return b0(n,t)};function RR(e){return parseFloat(e.trim())}const fi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],mi=new Set([...fi,"pathRotation"]),N1=e=>e===hi||e===je,LR=new Set(["x","y","z"]),DR=fi.filter(e=>!LR.has(e));function PR(e){const t=[];return DR.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const jr={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const a=e.max-e.min;return r==="border-box"?a:a-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const a=e.max-e.min;return r==="border-box"?a:a-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})=>b0(t,"x"),y:(e,{transform:t})=>b0(t,"y")};jr.translateX=jr.x;jr.translateY=jr.y;const ba=new Set;let y0=!1,v0=!1,w0=!1;function yb(){if(v0){const e=Array.from(ba).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const a=PR(r);a.length&&(n.set(r,a),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const a=n.get(r);a&&a.forEach(([i,s])=>{var o;(o=r.getValue(i))==null||o.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}v0=!1,y0=!1,ba.forEach(e=>e.complete(w0)),ba.clear()}function vb(){ba.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(v0=!0)})}function OR(){w0=!0,vb(),yb(),w0=!1}class Yd{constructor(t,n,r,a,i,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=a,this.element=i,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(ba.add(this),y0||(y0=!0,yt.read(vb),yt.resolveKeyframes(yb))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:a}=this;if(t[0]===null){const i=a==null?void 0:a.get(),s=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const o=r.readValue(n,s);o!=null&&(t[0]=o)}t[0]===void 0&&(t[0]=s),a&&i===void 0&&a.set(t[0])}NR(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ba.delete(this)}cancel(){this.state==="scheduled"&&(ba.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const jR=e=>e.startsWith("--");function wb(e,t,n){jR(t)?e.style.setProperty(t,n):e.style[t]=n}const BR={};function kb(e,t){const n=K4(e);return()=>BR[t]??n()}const FR=kb(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Tb=kb(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Pi=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,M1={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Pi([0,.65,.55,1]),circOut:Pi([.55,0,1,.45]),backIn:Pi([.31,.01,.66,-.59]),backOut:Pi([.33,1.53,.69,.99])};function Eb(e,t){if(e)return typeof e=="function"?Tb()?gb(e,t):"ease-out":sb(e)?Pi(e):Array.isArray(e)?e.map(n=>Eb(n,t)||M1.easeOut):M1[e]}function zR(e,t,n,{delay:r=0,duration:a=300,repeat:i=0,repeatType:s="loop",ease:o="easeOut",times:l}={},u=void 0){const c={[t]:n};l&&(c.offset=l);const h=Eb(o,a);Array.isArray(h)&&(c.easing=h);const m={delay:r,duration:a,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:i+1,direction:s==="reverse"?"alternate":"normal"};return u&&(m.pseudoElement=u),e.animate(c,m)}function Sb(e){return typeof e=="function"&&"applyToOptions"in e}function HR({type:e,...t}){return Sb(e)&&Tb()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Ab extends Gd{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:a,pseudoElement:i,allowFlatten:s=!1,finalKeyframe:o,onComplete:l}=t;this.isPseudoElement=!!i,this.allowFlatten=s,this.options=t,Il(typeof t.type!="string");const u=HR(t);this.animation=zR(n,r,a,u,i),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const c=_l(a,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(c),wb(n,r,c),this.animation.cancel()}l==null||l(),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,a;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((a=(r=this.animation).commitStyles)==null||a.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 On(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+On(t)}get time(){return On(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=An(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:a}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&FR()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),jn):a(this)}}const Cb={anticipate:nb,backInOut:tb,circInOut:ab};function UR(e){return e in Cb}function qR(e){typeof e.ease=="string"&&UR(e.ease)&&(e.ease=Cb[e.ease])}const ec=10;class VR extends Ab{constructor(t){qR(t),bb(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:a,element:i,...s}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const o=new Yo({...s,autoplay:!1}),l=Math.max(ec,fn.now()-this.startTime),u=or(0,ec,l-ec),c=o.sample(l).value,{name:h}=this.options;i&&h&&wb(i,h,c),n.setWithVelocity(o.sample(Math.max(0,l-u)).value,c,u),o.stop()}}const I1=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Yn.test(e)||e==="0")&&!e.startsWith("url("));function $R(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 WR(e,t,n,r){const a=e[0];if(a===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],s=I1(a,t),o=I1(i,t);return!s||!o?!1:$R(e)||(n==="spring"||Sb(n))&&r}function k0(e){e.duration=0,e.type="keyframes"}const Nb=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),GR=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function YR(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&GR.test(e[t]))return!0;return!1}const KR=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),XR=K4(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function QR(e){var h;const{motionValue:t,name:n,repeatDelay:r,repeatType:a,damping:i,type:s,keyframes:o}=e,l=(h=t==null?void 0:t.owner)==null?void 0:h.current;if(!(l instanceof HTMLElement)&&!(l instanceof SVGElement))return!1;const{onUpdate:u,transformTemplate:c}=t.owner.getProps();return XR()&&n&&(Nb.has(n)||KR.has(n)&&YR(o))&&(n!=="transform"||!c)&&!u&&!r&&a!=="mirror"&&i!==0&&s!=="inertia"}const ZR=40;class JR extends Gd{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:a=0,repeatDelay:i=0,repeatType:s="loop",keyframes:o,name:l,motionValue:u,element:c,...h}){var p;super(),this.stop=()=>{var g,x;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=fn.now();const m={autoplay:t,delay:n,type:r,repeat:a,repeatDelay:i,repeatType:s,name:l,motionValue:u,element:c,...h},d=(c==null?void 0:c.KeyframeResolver)||Yd;this.keyframeResolver=new d(o,(g,x,b)=>this.onKeyframesResolved(g,x,m,!b),l,u,c),(p=this.keyframeResolver)==null||p.scheduleResolve()}onKeyframesResolved(t,n,r,a){var b,v;this.keyframeResolver=void 0;const{name:i,type:s,velocity:o,delay:l,isHandoff:u,onUpdate:c}=r;this.resolvedAt=fn.now();let h=!0;WR(t,i,s,o)||(h=!1,(Ur.instantAnimations||!l)&&(c==null||c(_l(t,r,n))),t[0]=t[t.length-1],k0(r),r.repeat=0);const d={startTime:a?this.resolvedAt?this.resolvedAt-this.createdAt>ZR?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},p=h&&!u&&QR(d),g=(v=(b=d.motionValue)==null?void 0:b.owner)==null?void 0:v.current;let x;if(p)try{x=new VR({...d,element:g})}catch{x=new Yo(d)}else x=new Yo(d);x.finished.then(()=>{this.notifyFinished()}).catch(jn),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}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(),OR()),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 Mb(e,t,n,r=0,a=1){const i=Array.from(e).sort((u,c)=>u.sortNodePosition(c)).indexOf(t),s=e.size,o=(s-1)*r;return typeof n=="function"?n(i,s):a===1?i*r:o-i*r}const _1=30,eL=e=>!isNaN(parseFloat(e));class tL{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const a=fn.now();if(this.updatedAt!==a&&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 s of this.dependents)s.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=fn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=eL(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 Fd);const r=this.events[t].add(n);return t==="change"?()=>{r(),yt.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=fn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>_1)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,_1);return X4(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 ti(e,t){return new tL(e,t)}function Ib(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Kd(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?Ib(n,e):n}const nL={type:"spring",stiffness:500,damping:25,restSpeed:10},rL=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),aL={type:"keyframes",duration:.8},iL={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},sL=(e,{keyframes:t})=>t.length>2?aL:mi.has(e)?e.startsWith("scale")?rL(t[1]):nL:iL,oL=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function lL(e){for(const t in e)if(!oL.has(t))return!0;return!1}const Xd=(e,t,n,r={},a,i)=>s=>{const o=Kd(r,e)||{},l=o.delay||r.delay||0;let{elapsed:u=0}=r;u=u-An(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...o,delay:-u,onUpdate:m=>{t.set(m),o.onUpdate&&o.onUpdate(m)},onComplete:()=>{s(),o.onComplete&&o.onComplete()},name:e,motionValue:t,element:i?void 0:a};lL(o)||Object.assign(c,sL(e,c)),c.duration&&(c.duration=An(c.duration)),c.repeatDelay&&(c.repeatDelay=An(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(k0(c),c.delay===0&&(h=!0)),(Ur.instantAnimations||Ur.skipAnimations||a!=null&&a.shouldSkipAnimations||o.skipAnimations)&&(h=!0,k0(c),c.delay=0),c.allowFlatten=!o.type&&!o.ease,h&&!i&&t.get()!==void 0){const m=_l(c.keyframes,o);if(m!==void 0){yt.update(()=>{c.onUpdate(m),c.onComplete()});return}}return o.isSync?new Yo(c):new JR(c)},uL=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function cL(e){const t=uL.exec(e);if(!t)return[,];const[,n,r,a]=t;return[`--${n??r}`,a]}function _b(e,t,n=1){const[r,a]=cL(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const s=i.trim();return W4(s)?parseFloat(s):s}return Ud(a)?_b(a,t,n+1):a}function R1(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Qd(e,t,n,r){if(typeof t=="function"){const[a,i]=R1(r);t=t(n!==void 0?n:e.custom,a,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[a,i]=R1(r);t=t(n!==void 0?n:e.custom,a,i)}return t}function ya(e,t,n){const r=e.getProps();return Qd(r,t,n!==void 0?n:r.custom,e)}const Rb=new Set(["width","height","top","left","right","bottom",...fi]),T0=e=>Array.isArray(e);function dL(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ti(n))}function hL(e){return T0(e)?e[e.length-1]||0:e}function fL(e,t){const n=ya(e,t);let{transitionEnd:r={},transition:a={},...i}=n||{};i={...i,...r};for(const s in i){const o=hL(i[s]);dL(e,s,o)}}const Zt=e=>!!(e&&e.getVelocity);function mL(e){return!!(Zt(e)&&e.add)}function E0(e,t){const n=e.getValue("willChange");if(mL(n))return n.add(t);if(!n&&Ur.WillChange){const r=new Ur.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Zd(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const pL="framerAppearId",Lb="data-"+Zd(pL);function Db(e){return e.props[Lb]}function gL({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Pb(e,t,{delay:n=0,transitionOverride:r,type:a}={}){let{transition:i,transitionEnd:s,...o}=t;const l=e.getDefaultTransition();i=i?Ib(i,l):l;const u=i==null?void 0:i.reduceMotion,c=i==null?void 0:i.skipAnimations;r&&(i=r);const h=[],m=a&&e.animationState&&e.animationState.getState()[a],d=i==null?void 0:i.path;d&&d.animateVisualElement(e,o,i,n,h);for(const p in o){const g=e.getValue(p,e.latestValues[p]??null),x=o[p];if(x===void 0||m&&gL(m,p))continue;const b={delay:n,...Kd(i||{},p)};c&&(b.skipAnimations=!0);const v=g.get();if(v!==void 0&&!g.isAnimating()&&!Array.isArray(x)&&x===v&&!b.velocity){yt.update(()=>g.set(x));continue}let T=!1;if(window.MotionHandoffAnimation){const A=Db(e);if(A){const _=window.MotionHandoffAnimation(A,p,yt);_!==null&&(b.startTime=_,T=!0)}}E0(e,p);const N=u??e.shouldReduceMotion;g.start(Xd(p,g,x,N&&Rb.has(p)?{type:!1}:b,e,T));const k=g.animation;k&&h.push(k)}if(s){const p=()=>yt.update(()=>{s&&fL(e,s)});h.length?Promise.all(h).then(p):p()}return h}function S0(e,t,n={}){var l;const r=ya(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(a=n.transitionOverride);const i=r?()=>Promise.all(Pb(e,r,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:h,staggerDirection:m}=a;return xL(e,t,u,c,h,m,n)}:()=>Promise.resolve(),{when:o}=a;if(o){const[u,c]=o==="beforeChildren"?[i,s]:[s,i];return u().then(()=>c())}else return Promise.all([i(),s(n.delay)])}function xL(e,t,n=0,r=0,a=0,i=1,s){const o=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),o.push(S0(l,t,{...s,delay:n+(typeof r=="function"?0:r)+Mb(e.variantChildren,l,r,a,i)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(o)}function bL(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const a=t.map(i=>S0(e,i,n));r=Promise.all(a)}else if(typeof t=="string")r=S0(e,t,n);else{const a=typeof t=="function"?ya(e,t,n.custom):t;r=Promise.all(Pb(e,a,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const yL={test:e=>e==="auto",parse:e=>e},Ob=e=>t=>t.test(e),jb=[hi,je,ir,pr,$_,V_,yL],L1=e=>jb.find(Ob(e));function vL(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Y4(e):!0}const wL=new Set(["brightness","contrast","saturate","opacity"]);function kL(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(qd)||[];if(!r)return e;const a=n.replace(r,"");let i=wL.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+a+")"}const TL=/\b([a-z-]*)\(.*?\)/gu,A0={...Yn,getAnimatableNone:e=>{const t=e.match(TL);return t?t.map(kL).join(" "):e}},C0={...Yn,getAnimatableNone:e=>{const t=Yn.parse(e);return Yn.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},D1={...hi,transform:Math.round},EL={rotate:pr,pathRotation:pr,rotateX:pr,rotateY:pr,rotateZ:pr,scale:ao,scaleX:ao,scaleY:ao,scaleZ:ao,skew:pr,skewX:pr,skewY:pr,distance:je,translateX:je,translateY:je,translateZ:je,x:je,y:je,z:je,perspective:je,transformPerspective:je,opacity:us,originX:v1,originY:v1,originZ:je},Ko={borderWidth:je,borderTopWidth:je,borderRightWidth:je,borderBottomWidth:je,borderLeftWidth:je,borderRadius:je,borderTopLeftRadius:je,borderTopRightRadius:je,borderBottomRightRadius:je,borderBottomLeftRadius:je,width:je,maxWidth:je,height:je,maxHeight:je,top:je,right:je,bottom:je,left:je,inset:je,insetBlock:je,insetBlockStart:je,insetBlockEnd:je,insetInline:je,insetInlineStart:je,insetInlineEnd:je,padding:je,paddingTop:je,paddingRight:je,paddingBottom:je,paddingLeft:je,paddingBlock:je,paddingBlockStart:je,paddingBlockEnd:je,paddingInline:je,paddingInlineStart:je,paddingInlineEnd:je,margin:je,marginTop:je,marginRight:je,marginBottom:je,marginLeft:je,marginBlock:je,marginBlockStart:je,marginBlockEnd:je,marginInline:je,marginInlineStart:je,marginInlineEnd:je,fontSize:je,backgroundPositionX:je,backgroundPositionY:je,...EL,zIndex:D1,fillOpacity:us,strokeOpacity:us,numOctaves:D1},SL={...Ko,color:Bt,backgroundColor:Bt,outlineColor:Bt,fill:Bt,stroke:Bt,borderColor:Bt,borderTopColor:Bt,borderRightColor:Bt,borderBottomColor:Bt,borderLeftColor:Bt,filter:A0,WebkitFilter:A0,mask:C0,WebkitMask:C0},Bb=e=>SL[e],AL=new Set([A0,C0]);function Fb(e,t){let n=Bb(e);return AL.has(n)||(n=Yn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const CL=new Set(["auto","none","0"]);function NL(e,t,n){let r=0,a;for(;r<e.length&&!a;){const i=e[r];typeof i=="string"&&!CL.has(i)&&ei(i).values.length&&(a=e[r]),r++}if(a&&n)for(const i of t)e[i]=Fb(n,a)}class ML extends Yd{constructor(t,n,r,a,i){super(t,n,r,a,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 h=t[c];if(typeof h=="string"&&(h=h.trim(),Ud(h))){const m=_b(h,n.current);m!==void 0&&(t[c]=m),c===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!Rb.has(r)||t.length!==2)return;const[a,i]=t,s=L1(a),o=L1(i),l=y1(a),u=y1(i);if(l!==u&&jr[r]){this.needsMeasurement=!0;return}if(s!==o)if(N1(s)&&N1(o))for(let c=0;c<t.length;c++){const h=t[c];typeof h=="string"&&(t[c]=parseFloat(h))}else jr[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let a=0;a<t.length;a++)(t[a]===null||vL(t[a]))&&r.push(a);r.length&&NL(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=jr[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const a=n[n.length-1];a!==void 0&&t.getValue(r,a).jump(a,!1)}measureEndState(){var o;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const a=t.getValue(n);a&&a.jump(this.measuredOrigin,!1);const i=r.length-1,s=r[i];r[i]=jr[n](t.measureViewportBox(),window.getComputedStyle(t.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),(o=this.removedTransforms)!=null&&o.length&&this.removedTransforms.forEach(([l,u])=>{t.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const Jd=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function zb(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const a=(n==null?void 0:n[e])??r.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e).filter(r=>r!=null)}const N0=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function yo(e){return G4(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:eh}=ob(queueMicrotask,!1),Un={x:!1,y:!1};function Hb(){return Un.x||Un.y}function IL(e){return e==="x"||e==="y"?Un[e]?null:(Un[e]=!0,()=>{Un[e]=!1}):Un.x||Un.y?null:(Un.x=Un.y=!0,()=>{Un.x=Un.y=!1})}function Ub(e,t){const n=zb(e),r=new AbortController,a={passive:!0,...t,signal:r.signal};return[n,a,()=>r.abort()]}function _L(e){return!(e.pointerType==="touch"||Hb())}function RL(e,t,n={}){const[r,a,i]=Ub(e,n);return r.forEach(s=>{let o=!1,l=!1,u;const c=()=>{s.removeEventListener("pointerleave",p)},h=x=>{u&&(u(x),u=void 0),c()},m=x=>{o=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),l&&(l=!1,h(x))},d=()=>{o=!0,window.addEventListener("pointerup",m,a),window.addEventListener("pointercancel",m,a)},p=x=>{if(x.pointerType!=="touch"){if(o){l=!0;return}h(x)}},g=x=>{if(!_L(x))return;l=!1;const b=t(s,x);typeof b=="function"&&(u=b,s.addEventListener("pointerleave",p,a))};s.addEventListener("pointerenter",g,a),s.addEventListener("pointerdown",d,a)}),i}const qb=(e,t)=>t?e===t?!0:qb(e,t.parentElement):!1,th=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,LL=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function DL(e){return LL.has(e.tagName)||e.isContentEditable===!0}const PL=new Set(["INPUT","SELECT","TEXTAREA"]);function OL(e){return PL.has(e.tagName)||e.isContentEditable===!0}const vo=new WeakSet;function P1(e){return t=>{t.key==="Enter"&&e(t)}}function tc(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const jL=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=P1(()=>{if(vo.has(n))return;tc(n,"down");const a=P1(()=>{tc(n,"up")}),i=()=>tc(n,"cancel");n.addEventListener("keyup",a,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function O1(e){return th(e)&&!Hb()}const j1=new WeakSet;function BL(e,t,n={}){const[r,a,i]=Ub(e,n),s=o=>{const l=o.currentTarget;if(!O1(o)||j1.has(o))return;vo.add(l),n.stopPropagation&&j1.add(o);const u=t(l,o),c={...a,capture:!0},h=(p,g)=>{window.removeEventListener("pointerup",m,c),window.removeEventListener("pointercancel",d,c),vo.has(l)&&vo.delete(l),O1(p)&&typeof u=="function"&&u(p,{success:g})},m=p=>{h(p,l===window||l===document||n.useGlobalTarget||qb(l,p.target))},d=p=>{h(p,!1)};window.addEventListener("pointerup",m,c),window.addEventListener("pointercancel",d,c)};return r.forEach(o=>{(n.useGlobalTarget?window:o).addEventListener("pointerdown",s,a),yo(o)&&(o.addEventListener("focus",u=>jL(u,a)),!DL(o)&&!o.hasAttribute("tabindex")&&(o.tabIndex=0))}),i}function nh(e){return G4(e)&&"ownerSVGElement"in e}const wo=new WeakMap;let Rr;const Vb=(e,t,n)=>(r,a)=>a&&a[0]?a[0][e+"Size"]:nh(r)&&"getBBox"in r?r.getBBox()[t]:r[n],FL=Vb("inline","width","offsetWidth"),zL=Vb("block","height","offsetHeight");function HL({target:e,borderBoxSize:t}){var n;(n=wo.get(e))==null||n.forEach(r=>{r(e,{get width(){return FL(e,t)},get height(){return zL(e,t)}})})}function UL(e){e.forEach(HL)}function qL(){typeof ResizeObserver>"u"||(Rr=new ResizeObserver(UL))}function VL(e,t){Rr||qL();const n=zb(e);return n.forEach(r=>{let a=wo.get(r);a||(a=new Set,wo.set(r,a)),a.add(t),Rr==null||Rr.observe(r)}),()=>{n.forEach(r=>{const a=wo.get(r);a==null||a.delete(t),a!=null&&a.size||Rr==null||Rr.unobserve(r)})}}const ko=new Set;let Ha;function $L(){Ha=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};ko.forEach(t=>t(e))},window.addEventListener("resize",Ha)}function WL(e){return ko.add(e),Ha||$L(),()=>{ko.delete(e),!ko.size&&typeof Ha=="function"&&(window.removeEventListener("resize",Ha),Ha=void 0)}}function B1(e,t){return typeof e=="function"?WL(e):VL(e,t)}function GL(e){return nh(e)&&e.tagName==="svg"}const YL=[...jb,Bt,Yn],KL=e=>YL.find(Ob(e)),F1=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ua=()=>({x:F1(),y:F1()}),z1=()=>({min:0,max:0}),Ut=()=>({x:z1(),y:z1()}),XL=new WeakMap;function Rl(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function cs(e){return typeof e=="string"||Array.isArray(e)}const rh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ah=["initial",...rh];function Ll(e){return Rl(e.animate)||ah.some(t=>cs(e[t]))}function $b(e){return!!(Ll(e)||e.variants)}function QL(e,t,n){for(const r in t){const a=t[r],i=n[r];if(Zt(a))e.addValue(r,a);else if(Zt(i))e.addValue(r,ti(a,{owner:e}));else if(i!==a)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(a):s.hasAnimated||s.set(a)}else{const s=e.getStaticValue(r);e.addValue(r,ti(s!==void 0?s:a,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const M0={current:null},Wb={current:!1},ZL=typeof window<"u";function JL(){if(Wb.current=!0,!!ZL)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>M0.current=e.matches;e.addEventListener("change",t),t()}else M0.current=!1}const H1=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Xo={};function Gb(e){Xo=e}function eD(){return Xo}class tD{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:a,skipAnimations:i,blockInitialAnimation:s,visualState:o},l={}){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=Yd,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=fn.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,yt.render(this.render,!1,!0))};const{latestValues:u,renderState:c}=o;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=a,this.skipAnimationsConfig=i,this.options=l,this.blockInitialAnimation=!!s,this.isControllingVariants=Ll(n),this.isVariantNode=$b(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:h,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in m){const p=m[d];u[d]!==void 0&&Zt(p)&&p.set(u[d])}}mount(t){var n,r;if(this.hasBeenMounted)for(const a in this.initialValues)(n=this.values.get(a))==null||n.jump(this.initialValues[a]),this.latestValues[a]=this.initialValues[a];this.current=t,XL.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((a,i)=>this.bindToMotionValue(i,a)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Wb.current||JL(),this.shouldReduceMotion=M0.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(),qr(this.notifyUpdate),qr(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&&Nb.has(t)&&this.current instanceof HTMLElement){const{factory:s,keyframes:o,times:l,ease:u,duration:c}=n.accelerate,h=new Ab({element:this.current,name:t,keyframes:o,times:l,ease:u,duration:An(c)}),m=s(h);this.valueSubscriptions.set(t,()=>{m(),h.cancel()});return}const r=mi.has(t);r&&this.onBindTransform&&this.onBindTransform();const a=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&yt.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,()=>{a(),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 Xo){const n=Xo[t];if(!n)continue;const{isEnabled:r,Feature:a}=n;if(!this.features[t]&&a&&r(this.props)&&(this.features[t]=new a(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):Ut()}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<H1.length;r++){const a=H1[r];this.propEventSubscriptions[a]&&(this.propEventSubscriptions[a](),delete this.propEventSubscriptions[a]);const i="on"+a,s=t[i];s&&(this.propEventSubscriptions[a]=this.on(a,s))}this.prevMotionValues=QL(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=ti(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"&&(W4(r)||Y4(r))?r=parseFloat(r):!KL(r)&&Yn.test(n)&&(r=Fb(t,n)),this.setBaseTarget(t,Zt(r)?r.get():r)),Zt(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 s=Qd(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);s&&(r=s[t])}if(n&&r!==void 0)return r;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!Zt(a)?a:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Fd),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){eh.render(this.render)}}class Yb extends tD{constructor(){super(...arguments),this.KeyframeResolver=ML}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;Zt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Gr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Kb({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function nD({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function rD(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 nc(e){return e===void 0||e===1}function I0({scale:e,scaleX:t,scaleY:n}){return!nc(e)||!nc(t)||!nc(n)}function la(e){return I0(e)||Xb(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Xb(e){return U1(e.x)||U1(e.y)}function U1(e){return e&&e!=="0%"}function Qo(e,t,n){const r=e-n,a=t*r;return n+a}function q1(e,t,n,r,a){return a!==void 0&&(e=Qo(e,a,r)),Qo(e,n,r)+t}function _0(e,t=0,n=1,r,a){e.min=q1(e.min,t,n,r,a),e.max=q1(e.max,t,n,r,a)}function Qb(e,{x:t,y:n}){_0(e.x,t.translate,t.scale,t.originPoint),_0(e.y,n.translate,n.scale,n.originPoint)}const V1=.999999999999,$1=1.0000000000001;function aD(e,t,n,r=!1){var o;const a=n.length;if(!a)return;t.x=t.y=1;let i,s;for(let l=0;l<a;l++){i=n[l],s=i.projectionDelta;const{visualElement:u}=i.options;u&&u.props.style&&u.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(tr(e.x,-i.scroll.offset.x),tr(e.y,-i.scroll.offset.y)),s&&(t.x*=s.x.scale,t.y*=s.y.scale,Qb(e,s)),r&&la(i.latestValues)&&To(e,i.latestValues,(o=i.layout)==null?void 0:o.layoutBox))}t.x<$1&&t.x>V1&&(t.x=1),t.y<$1&&t.y>V1&&(t.y=1)}function tr(e,t){e.min+=t,e.max+=t}function W1(e,t,n,r,a=.5){const i=bt(e.min,e.max,a);_0(e,t,n,i,r)}function G1(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function To(e,t,n){const r=n??e;W1(e.x,G1(t.x,r.x),t.scaleX,t.scale,t.originX),W1(e.y,G1(t.y,r.y),t.scaleY,t.scale,t.originY)}function Zb(e,t){return Kb(rD(e.getBoundingClientRect(),t))}function iD(e,t,n){const r=Zb(e,n),{scroll:a}=t;return a&&(tr(r.x,a.offset.x),tr(r.y,a.offset.y)),r}const sD={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},oD=fi.length;function lD(e,t,n){let r="",a=!0;for(let s=0;s<oD;s++){const o=fi[s],l=e[o];if(l===void 0)continue;let u=!0;if(typeof l=="number")u=l===(o.startsWith("scale")?1:0);else{const c=parseFloat(l);u=o.startsWith("scale")?c===1:c===0}if(!u||n){const c=N0(l,Ko[o]);if(!u){a=!1;const h=sD[o]||o;r+=`${h}(${c}) `}n&&(t[o]=c)}}const i=e.pathRotation;return i&&(a=!1,r+=`rotate(${N0(i,Ko.pathRotation)}) `),r=r.trim(),n?r=n(t,a?"":r):a&&(r="none"),r}function ih(e,t,n){const{style:r,vars:a,transformOrigin:i}=e;let s=!1,o=!1;for(const l in t){const u=t[l];if(mi.has(l)){s=!0;continue}else if(ub(l)){a[l]=u;continue}else{const c=N0(u,Ko[l]);l.startsWith("origin")?(o=!0,i[l]=c):r[l]=c}}if(t.transform||(s||n?r.transform=lD(t,e.transform,n):r.transform&&(r.transform="none")),o){const{originX:l="50%",originY:u="50%",originZ:c=0}=i;r.transformOrigin=`${l} ${u} ${c}`}}function Jb(e,{style:t,vars:n},r,a){const i=e.style;let s;for(s in t)i[s]=t[s];a==null||a.applyProjectionStyles(i,r);for(s in n)i.setProperty(s,n[s])}function Y1(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Mi={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(je.test(e))e=parseFloat(e);else return e;const n=Y1(e,t.target.x),r=Y1(e,t.target.y);return`${n}% ${r}%`}},uD={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,a=Yn.parse(e);if(a.length>5)return r;const i=Yn.createTransformer(e),s=typeof a[0]!="number"?1:0,o=n.x.scale*t.x,l=n.y.scale*t.y;a[0+s]/=o,a[1+s]/=l;const u=bt(o,l,.5);return typeof a[2+s]=="number"&&(a[2+s]/=u),typeof a[3+s]=="number"&&(a[3+s]/=u),i(a)}},R0={borderRadius:{...Mi,applyTo:[...Jd]},borderTopLeftRadius:Mi,borderTopRightRadius:Mi,borderBottomLeftRadius:Mi,borderBottomRightRadius:Mi,boxShadow:uD};function e3(e,{layout:t,layoutId:n}){return mi.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!R0[e]||e==="opacity")}function sh(e,t,n){var s;const r=e.style,a=t==null?void 0:t.style,i={};if(!r)return i;for(const o in r)(Zt(r[o])||a&&Zt(a[o])||e3(o,e)||((s=n==null?void 0:n.getValue(o))==null?void 0:s.liveStyle)!==void 0)&&(i[o]=r[o]);return i}function cD(e){return window.getComputedStyle(e)}class dD extends Yb{constructor(){super(...arguments),this.type="html",this.renderInstance=Jb}mount(t){Il(!!t.style),super.mount(t)}readValueFromInstance(t,n){var r;if(mi.has(n))return(r=this.projection)!=null&&r.isProjecting?x0(n):_R(t,n);{const a=cD(t),i=(ub(n)?a.getPropertyValue(n):a[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Zb(t,n)}build(t,n,r){ih(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return sh(t,n,r)}}const hD={offset:"stroke-dashoffset",array:"stroke-dasharray"},fD={offset:"strokeDashoffset",array:"strokeDasharray"};function mD(e,t,n=1,r=0,a=!0){e.pathLength=1;const i=a?hD:fD;e[i.offset]=`${-r}`,e[i.array]=`${t} ${n}`}const t3=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function n3(e,{attrX:t,attrY:n,attrScale:r,pathLength:a,pathSpacing:i=1,pathOffset:s=0,...o},l,u,c){if(ih(e,o,u),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:m}=e;for(const d of t3)h[d]!==void 0&&(m[d]=h[d],delete h[d]);(m.transform||h.transformOrigin)&&(m.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),m.transform&&(m.transformBox=(c==null?void 0:c.transformBox)??"fill-box",delete h.transformBox),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),a!==void 0&&mD(h,a,i,s,!1)}const r3=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"]),a3=e=>typeof e=="string"&&e.toLowerCase()==="svg";function pD(e,t,n,r){Jb(e,t,void 0,r);for(const a in t.attrs)e.setAttribute(r3.has(a)?a:Zd(a),t.attrs[a])}function i3(e,t,n){const r=sh(e,t,n);for(const a in e)if(Zt(e[a])||Zt(t[a])){const i=fi.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;r[i]=e[a]}return r}class gD extends Yb{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ut}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(mi.has(n)){const r=Bb(n);return r&&r.default||0}if(t3.includes(n)){const a=getComputedStyle(t)[n];if(typeof a=="string"&&a)return a.trim()}return n=r3.has(n)?n:Zd(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return i3(t,n,r)}build(t,n,r){n3(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,a){pD(t,n,r,a)}mount(t){this.isSVGTag=a3(t.tagName),super.mount(t)}}const xD=ah.length;function s3(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?s3(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<xD;n++){const r=ah[n],a=e.props[r];(cs(a)||a===!1)&&(t[r]=a)}return t}function o3(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 bD=[...rh].reverse(),yD=rh.length;function vD(e){return t=>Promise.all(t.map(({animation:n,options:r})=>bL(e,n,r)))}function wD(e){let t=vD(e),n=K1(),r=!0,a=!1;const i=u=>(c,h)=>{var d;const m=ya(e,h,u==="exit"?(d=e.presenceContext)==null?void 0:d.custom:void 0);if(m){const{transition:p,transitionEnd:g,...x}=m;c={...c,...x,...g}}return c};function s(u){t=u(e)}function o(u){const{props:c}=e,h=s3(e.parent)||{},m=[],d=new Set;let p={},g=1/0;for(let b=0;b<yD;b++){const v=bD[b],T=n[v],N=c[v]!==void 0?c[v]:h[v],k=cs(N),A=v===u?T.isActive:null;A===!1&&(g=b);let _=N===h[v]&&N!==c[v]&&k;if(_&&(r||a)&&e.manuallyAnimateOnMount&&(_=!1),T.protectedKeys={...p},!T.isActive&&A===null||!N&&!T.prevProp||Rl(N)||typeof N=="boolean")continue;if(v==="exit"&&T.isActive&&A!==!0){T.prevResolvedValues&&(p={...p,...T.prevResolvedValues});continue}const S=kD(T.prevProp,N);let I=S||v===u&&T.isActive&&!_&&k||b>g&&k,C=!1;const D=Array.isArray(N)?N:[N];let L=D.reduce(i(v),{});A===!1&&(L={});const{prevResolvedValues:F={}}=T,O={...F,...L},R=q=>{I=!0,d.has(q)&&(C=!0,d.delete(q)),T.needsAnimating[q]=!0;const Z=e.getValue(q);Z&&(Z.liveStyle=!1)};for(const q in O){const Z=L[q],B=F[q];if(p.hasOwnProperty(q))continue;let Q=!1;T0(Z)&&T0(B)?Q=!o3(Z,B)||S:Q=Z!==B,Q?Z!=null?R(q):d.add(q):Z!==void 0&&d.has(q)?R(q):T.protectedKeys[q]=!0}T.prevProp=N,T.prevResolvedValues=L,T.isActive&&(p={...p,...L}),(r||a)&&e.blockInitialAnimation&&(I=!1);const H=_&&S;I&&(!H||C)&&m.push(...D.map(q=>{const Z={type:v};if(typeof q=="string"&&(r||a)&&!H&&e.manuallyAnimateOnMount&&e.parent){const{parent:B}=e,Q=ya(B,q);if(B.enteringChildren&&Q){const{delayChildren:ne}=Q.transition||{};Z.delay=Mb(B.enteringChildren,e,ne)}}return{animation:q,options:Z}}))}if(d.size){const b={};if(typeof c.initial!="boolean"){const v=ya(e,Array.isArray(c.initial)?c.initial[0]:c.initial);v&&v.transition&&(b.transition=v.transition)}d.forEach(v=>{const T=e.getBaseTarget(v),N=e.getValue(v);N&&(N.liveStyle=!0),b[v]=T??null}),m.push({animation:b})}let x=!!m.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(x=!1),r=!1,a=!1,x?t(m):Promise.resolve()}function l(u,c){var m;if(n[u].isActive===c)return Promise.resolve();(m=e.variantChildren)==null||m.forEach(d=>{var p;return(p=d.animationState)==null?void 0:p.setActive(u,c)}),n[u].isActive=c;const h=o(u);for(const d in n)n[d].protectedKeys={};return h}return{animateChanges:o,setActive:l,setAnimateFunction:s,getState:()=>n,reset:()=>{n=K1(),a=!0}}}function kD(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!o3(t,e):!1}function aa(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function K1(){return{animate:aa(!0),whileInView:aa(),whileHover:aa(),whileTap:aa(),whileDrag:aa(),whileFocus:aa(),exit:aa()}}function L0(e,t){e.min=t.min,e.max=t.max}function Hn(e,t){L0(e.x,t.x),L0(e.y,t.y)}function X1(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const l3=1e-4,TD=1-l3,ED=1+l3,u3=.01,SD=0-u3,AD=0+u3;function mn(e){return e.max-e.min}function CD(e,t,n){return Math.abs(e-t)<=n}function Q1(e,t,n,r=.5){e.origin=r,e.originPoint=bt(t.min,t.max,e.origin),e.scale=mn(n)/mn(t),e.translate=bt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=TD&&e.scale<=ED||isNaN(e.scale))&&(e.scale=1),(e.translate>=SD&&e.translate<=AD||isNaN(e.translate))&&(e.translate=0)}function Qi(e,t,n,r){Q1(e.x,t.x,n.x,r?r.originX:void 0),Q1(e.y,t.y,n.y,r?r.originY:void 0)}function Z1(e,t,n,r=0){const a=r?bt(n.min,n.max,r):n.min;e.min=a+t.min,e.max=e.min+mn(t)}function ND(e,t,n,r){Z1(e.x,t.x,n.x,r==null?void 0:r.x),Z1(e.y,t.y,n.y,r==null?void 0:r.y)}function J1(e,t,n,r=0){const a=r?bt(n.min,n.max,r):n.min;e.min=t.min-a,e.max=e.min+mn(t)}function Zo(e,t,n,r){J1(e.x,t.x,n.x,r==null?void 0:r.x),J1(e.y,t.y,n.y,r==null?void 0:r.y)}function ep(e,t,n,r,a){return e-=t,e=Qo(e,1/n,r),a!==void 0&&(e=Qo(e,1/a,r)),e}function MD(e,t=0,n=1,r=.5,a,i=e,s=e){if(ir.test(t)&&(t=parseFloat(t),t=bt(s.min,s.max,t/100)-s.min),typeof t!="number")return;let o=bt(i.min,i.max,r);e===i&&(o-=t),e.min=ep(e.min,t,n,o,a),e.max=ep(e.max,t,n,o,a)}function tp(e,t,[n,r,a],i,s){MD(e,t[n],t[r],t[a],t.scale,i,s)}const ID=["x","scaleX","originX"],_D=["y","scaleY","originY"];function np(e,t,n,r){tp(e.x,t,ID,n?n.x:void 0,r?r.x:void 0),tp(e.y,t,_D,n?n.y:void 0,r?r.y:void 0)}function rp(e){return e.translate===0&&e.scale===1}function c3(e){return rp(e.x)&&rp(e.y)}function ap(e,t){return e.min===t.min&&e.max===t.max}function RD(e,t){return ap(e.x,t.x)&&ap(e.y,t.y)}function ip(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function d3(e,t){return ip(e.x,t.x)&&ip(e.y,t.y)}function sp(e){return mn(e.x)/mn(e.y)}function op(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Zn(e){return[e("x"),e("y")]}function LD(e,t,n){let r="";const a=e.x.translate/t.x,i=e.y.translate/t.y,s=(n==null?void 0:n.z)||0;if((a||i||s)&&(r=`translate3d(${a}px, ${i}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:c,pathRotation:h,rotateX:m,rotateY:d,skewX:p,skewY:g}=n;u&&(r=`perspective(${u}px) ${r}`),c&&(r+=`rotate(${c}deg) `),h&&(r+=`rotate(${h}deg) `),m&&(r+=`rotateX(${m}deg) `),d&&(r+=`rotateY(${d}deg) `),p&&(r+=`skewX(${p}deg) `),g&&(r+=`skewY(${g}deg) `)}const o=e.x.scale*t.x,l=e.y.scale*t.y;return(o!==1||l!==1)&&(r+=`scale(${o}, ${l})`),r||"none"}const DD=Jd.length,lp=e=>typeof e=="string"?parseFloat(e):e,up=e=>typeof e=="number"||je.test(e);function PD(e,t,n,r,a,i){a?(e.opacity=bt(0,n.opacity??1,OD(r)),e.opacityExit=bt(t.opacity??1,0,jD(r))):i&&(e.opacity=bt(t.opacity??1,n.opacity??1,r));for(let s=0;s<DD;s++){const o=Jd[s];let l=cp(t,o),u=cp(n,o);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||up(l)===up(u)?(e[o]=Math.max(bt(lp(l),lp(u),r),0),(ir.test(u)||ir.test(l))&&(e[o]+="%")):e[o]=u}(t.rotate||n.rotate)&&(e.rotate=bt(t.rotate||0,n.rotate||0,r))}function cp(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const OD=h3(0,.5,rb),jD=h3(.5,.95,jn);function h3(e,t,n){return r=>r<e?0:r>t?1:n(ls(e,t,r))}function BD(e,t,n){const r=Zt(e)?e:ti(e);return r.start(Xd("",r,t,n)),r.animation}function ds(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}const FD=(e,t)=>e.depth-t.depth;class zD{constructor(){this.children=[],this.isDirty=!1}add(t){Bd(this.children,t),this.isDirty=!0}remove(t){Vo(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(FD),this.isDirty=!1,this.children.forEach(t)}}function HD(e,t){const n=fn.now(),r=({timestamp:a})=>{const i=a-n;i>=t&&(qr(r),e(i-t))};return yt.setup(r,!0),()=>qr(r)}function Eo(e){return Zt(e)?e.get():e}class UD{constructor(){this.members=[]}add(t){Bd(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 a=r.instance;(!a||a.isConnected===!1)&&!r.snapshot&&(Vo(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Vo(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 a=this.members[r];if(a.isPresent!==!1&&((n=a.instance)==null?void 0:n.isConnected)!==!1)return this.promote(a),!0}return!1}promote(t,n){var a;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:s}=t.options;(i===void 0||i!==s)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(a=t.root)!=null&&a.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,a,i,s;(r=(n=t.options).onExitComplete)==null||r.call(n),(s=(a=t.resumingFrom)==null?void 0:(i=a.options).onExitComplete)==null||s.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 So={hasAnimatedSinceResize:!0,hasEverUpdated:!1},rc=["","X","Y","Z"],qD=1e3;let VD=0;function ac(e,t,n,r){const{latestValues:a}=t;a[e]&&(n[e]=a[e],t.setStaticValue(e,0),r&&(r[e]=0))}function f3(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Db(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:a,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",yt,!(a||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&f3(r)}function m3({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:a}){return class{constructor(s={},o=t==null?void 0:t()){this.id=VD++,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(GD),this.nodes.forEach(JD),this.nodes.forEach(eP),this.nodes.forEach(YD)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,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 l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new zD)}addEventListener(s,o){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Fd),this.eventHandlers.get(s).add(o)}notifyListeners(s,...o){const l=this.eventHandlers.get(s);l&&l.notify(...o)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=nh(s)&&!GL(s),this.instance=s;const{layoutId:o,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||o)&&(this.isLayoutDirty=!0),e){let c,h=0;const m=()=>this.root.updateBlockedByResize=!1;yt.read(()=>{h=window.innerWidth}),e(s,()=>{const d=window.innerWidth;d!==h&&(h=d,this.root.updateBlockedByResize=!0,c&&c(),c=HD(m,250),So.hasAnimatedSinceResize&&(So.hasAnimatedSinceResize=!1,this.nodes.forEach(fp)))})}o&&this.root.registerSharedNode(o,this),this.options.animate!==!1&&u&&(o||l)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:m,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||iP,{onLayoutAnimationStart:g,onLayoutAnimationComplete:x}=u.getProps(),b=!this.targetLayout||!d3(this.targetLayout,d),v=!h&&m;if(this.options.layoutRoot||this.resumeFrom||v||h&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...Kd(p,"layout"),onPlay:g,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(c,v,T.path)}else h||fp(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),qr(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(tP),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&f3(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const h=this.path[c];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:o,layout:l}=this.options;if(o===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const l=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),l&&this.nodes.forEach(XD),this.nodes.forEach(dp);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(hp);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(QD),this.nodes.forEach(ZD),this.nodes.forEach($D),this.nodes.forEach(WD)):this.nodes.forEach(hp),this.clearAllSnapshots();const o=fn.now();Qt.delta=or(0,1e3/60,o-Qt.timestamp),Qt.timestamp=o,Qt.isProcessing=!0,Ku.update.process(Qt),Ku.preRender.process(Qt),Ku.render.process(Qt),Qt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,eh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(KD),this.sharedNodes.forEach(nP)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,yt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){yt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!mn(this.snapshot.measuredBox.x)&&!mn(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 l=0;l<this.path.length;l++)this.path[l].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Ut()),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,s?s.layoutBox:void 0)}updateScroll(s="measure"){let o=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(o=!1),o&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!a)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,o=this.projectionDelta&&!c3(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;s&&this.instance&&(o||la(this.latestValues)||c)&&(a(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const o=this.measurePageBox();let l=this.removeElementScroll(o);return s&&(l=this.removeTransform(l)),sP(l),{animationId:this.root.animationId,measuredBox:o,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:s}=this.options;if(!s)return Ut();const o=s.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(oP))){const{scroll:c}=this.root;c&&(tr(o.x,c.offset.x),tr(o.y,c.offset.y))}return o}removeElementScroll(s){var l;const o=Ut();if(Hn(o,s),(l=this.scroll)!=null&&l.wasRoot)return o;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:h,options:m}=c;c!==this.root&&h&&m.layoutScroll&&(h.wasRoot&&Hn(o,s),tr(o.x,h.offset.x),tr(o.y,h.offset.y))}return o}applyTransform(s,o=!1,l){var c,h;const u=l||Ut();Hn(u,s);for(let m=0;m<this.path.length;m++){const d=this.path[m];!o&&d.options.layoutScroll&&d.scroll&&d!==d.root&&(tr(u.x,-d.scroll.offset.x),tr(u.y,-d.scroll.offset.y)),la(d.latestValues)&&To(u,d.latestValues,(c=d.layout)==null?void 0:c.layoutBox)}return la(this.latestValues)&&To(u,this.latestValues,(h=this.layout)==null?void 0:h.layoutBox),u}removeTransform(s){var l;const o=Ut();Hn(o,s);for(let u=0;u<this.path.length;u++){const c=this.path[u];if(!la(c.latestValues))continue;let h;c.instance&&(I0(c.latestValues)&&c.updateSnapshot(),h=Ut(),Hn(h,c.measurePageBox())),np(o,c.latestValues,(l=c.snapshot)==null?void 0:l.layoutBox,h)}return la(this.latestValues)&&np(o,this.latestValues),o}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.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!==Qt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!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 l=!!this.resumingFrom||this!==o;if(!(s||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(d=this.parent)!=null&&d.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:h}=this.options;if(!this.layout||!(c||h))return;this.resolvedRelativeTargetAt=Qt.timestamp;const m=this.getClosestProjectingParent();m&&this.linkedParentVersion!==m.layoutVersion&&!m.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&m&&m.layout?this.createRelativeTarget(m,this.layout.layoutBox,m.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ut(),this.targetWithTransforms=Ut()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),ND(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Hn(this.target,this.layout.layoutBox),Qb(this.target,this.targetDelta)):Hn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?this.createRelativeTarget(m,this.target,m.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||I0(this.parent.latestValues)||Xb(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(s,o,l){this.relativeParent=s,this.linkedParentVersion=s.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ut(),this.relativeTargetOrigin=Ut(),Zo(this.relativeTargetOrigin,o,l,this.options.layoutAnchor||void 0),Hn(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var p;const s=this.getLead(),o=!!this.resumingFrom||this!==s;let l=!0;if((this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty)&&(l=!1),o&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Qt.timestamp&&(l=!1),l)return;const{layout:u,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||!(u||c))return;Hn(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,m=this.treeScale.y;aD(this.layoutCorrected,this.treeScale,this.path,o),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=Ut());const{target:d}=s;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(X1(this.prevProjectionDelta.x,this.projectionDelta.x),X1(this.prevProjectionDelta.y,this.projectionDelta.y)),Qi(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==m||!op(this.projectionDelta.x,this.prevProjectionDelta.x)||!op(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var o;if((o=this.options.visualElement)==null||o.scheduleRender(),s){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ua(),this.projectionDelta=Ua(),this.projectionDeltaWithTransform=Ua()}setAnimationOrigin(s,o=!1,l){const u=this.snapshot,c=u?u.latestValues:{},h={...this.latestValues},m=Ua();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!o;const d=Ut(),p=u?u.source:void 0,g=this.layout?this.layout.source:void 0,x=p!==g,b=this.getStack(),v=!b||b.members.length<=1,T=!!(x&&!v&&this.options.crossfade===!0&&!this.path.some(aP));this.animationProgress=0;let N;const k=l==null?void 0:l.interpolateProjection(s);this.mixTargetDelta=A=>{const _=A/1e3,S=k==null?void 0:k(_);S?(m.x.translate=S.x,m.x.scale=bt(s.x.scale,1,_),m.x.origin=s.x.origin,m.x.originPoint=s.x.originPoint,m.y.translate=S.y,m.y.scale=bt(s.y.scale,1,_),m.y.origin=s.y.origin,m.y.originPoint=s.y.originPoint):(mp(m.x,s.x,_),mp(m.y,s.y,_)),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Zo(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),rP(this.relativeTarget,this.relativeTargetOrigin,d,_),N&&RD(this.relativeTarget,N)&&(this.isProjectionDirty=!1),N||(N=Ut()),Hn(N,this.relativeTarget)),x&&(this.animationValues=h,PD(h,c,this.latestValues,_,T,v)),S&&S.rotate!==void 0&&(this.animationValues||(this.animationValues=h),this.animationValues.pathRotation=S.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=_},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){var o,l,u;this.notifyListeners("animationStart"),(o=this.currentAnimation)==null||o.stop(),(u=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||u.stop(),this.pendingAnimation&&(qr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=yt.update(()=>{So.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=ti(0)),this.motionValue.jump(0,!1),this.currentAnimation=BD(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),s.onUpdate&&s.onUpdate(c)},onComplete:()=>{s.onComplete&&s.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 s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(qD),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:o,target:l,layout:u,latestValues:c}=s;if(!(!o||!l||!u)){if(this!==s&&this.layout&&u&&p3(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Ut();const h=mn(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+h;const m=mn(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+m}Hn(o,l),To(o,c),Qi(this.projectionDeltaWithTransform,this.layoutCorrected,o,c)}}registerSharedNode(s,o){this.sharedNodes.has(s)||this.sharedNodes.set(s,new UD),this.sharedNodes.get(s).add(o);const u=o.options.initialPromotionConfig;o.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(o):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var o;const{layoutId:s}=this.options;return s?((o=this.getStack())==null?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:s}=this.options;return s?(o=this.getStack())==null?void 0:o.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:o,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let o=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(o=!0),!o)return;const u={};l.z&&ac("z",s,u,this.animationValues);for(let c=0;c<rc.length;c++)ac(`rotate${rc[c]}`,s,u,this.animationValues),ac(`skew${rc[c]}`,s,u,this.animationValues);s.render();for(const c in u)s.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);s.scheduleRender()}applyProjectionStyles(s,o){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=Eo(o==null?void 0:o.pointerEvents)||"",s.transform=l?l(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=Eo(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!la(this.latestValues)&&(s.transform=l?l({},""):"none",this.hasProjected=!1);return}s.visibility="";const c=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=LD(this.projectionDeltaWithTransform,this.treeScale,c);l&&(h=l(c,h)),s.transform=h;const{x:m,y:d}=this.projectionDelta;s.transformOrigin=`${m.origin*100}% ${d.origin*100}% 0`,u.animationValues?s.opacity=u===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:s.opacity=u===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const p in R0){if(c[p]===void 0)continue;const{correct:g,applyTo:x,isCSSVariable:b}=R0[p],v=h==="none"?c[p]:g(c[p],u);if(x){const T=x.length;for(let N=0;N<T;N++)s[x[N]]=v}else b?this.options.visualElement.renderState.vars[p]=v:s[p]=v}this.options.layoutId&&(s.pointerEvents=u===this?Eo(o==null?void 0:o.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var o;return(o=s.currentAnimation)==null?void 0:o.stop()}),this.root.nodes.forEach(dp),this.root.sharedNodes.clear()}}}function $D(e){e.updateLayout()}function WD(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:a}=e.layout,{animationType:i}=e.options,s=t.source!==e.layout.source;if(i==="size")Zn(h=>{const m=s?t.measuredBox[h]:t.layoutBox[h],d=mn(m);m.min=r[h].min,m.max=m.min+d});else if(i==="x"||i==="y"){const h=i==="x"?"y":"x";L0(s?t.measuredBox[h]:t.layoutBox[h],r[h])}else p3(i,t.layoutBox,r)&&Zn(h=>{const m=s?t.measuredBox[h]:t.layoutBox[h],d=mn(r[h]);m.max=m.min+d,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[h].max=e.relativeTarget[h].min+d)});const o=Ua();Qi(o,r,t.layoutBox);const l=Ua();s?Qi(l,e.applyTransform(a,!0),t.measuredBox):Qi(l,r,t.layoutBox);const u=!c3(o);let c=!1;if(!e.resumeFrom){const h=e.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:m,layout:d}=h;if(m&&d){const p=e.options.layoutAnchor||void 0,g=Ut();Zo(g,t.layoutBox,m.layoutBox,p);const x=Ut();Zo(x,r,d.layoutBox,p),d3(g,x)||(c=!0),h.options.layoutRoot&&(e.relativeTarget=x,e.relativeTargetOrigin=g,e.relativeParent=h)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:o,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function GD(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 YD(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function KD(e){e.clearSnapshot()}function dp(e){e.clearMeasurements()}function XD(e){e.isLayoutDirty=!0,e.updateLayout()}function hp(e){e.isLayoutDirty=!1}function QD(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function ZD(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function fp(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function JD(e){e.resolveTargetDelta()}function eP(e){e.calcProjection()}function tP(e){e.resetSkewAndRotation()}function nP(e){e.removeLeadSnapshot()}function mp(e,t,n){e.translate=bt(t.translate,0,n),e.scale=bt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function pp(e,t,n,r){e.min=bt(t.min,n.min,r),e.max=bt(t.max,n.max,r)}function rP(e,t,n,r){pp(e.x,t.x,n.x,r),pp(e.y,t.y,n.y,r)}function aP(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const iP={duration:.45,ease:[.4,0,.1,1]},gp=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),xp=gp("applewebkit/")&&!gp("chrome/")?Math.round:jn;function bp(e){e.min=xp(e.min),e.max=xp(e.max)}function sP(e){bp(e.x),bp(e.y)}function p3(e,t,n){return e==="position"||e==="preserve-aspect"&&!CD(sp(t),sp(n),.2)}function oP(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const lP=m3({attachResizeListener:(e,t)=>ds(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}),ic={current:void 0},g3=m3({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ic.current){const e=new lP({});e.mount(window),e.setOptions({layoutScroll:!0}),ic.current=e}return ic.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),oh=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function yp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function uP(...e){return t=>{let n=!1;const r=e.map(a=>{const i=yp(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<r.length;a++){const i=r[a];typeof i=="function"?i():yp(e[a],null)}}}}function cP(...e){return w.useCallback(uP(...e),e)}class dP extends w.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(yo(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,a=yo(r)&&r.offsetWidth||0,i=yo(r)&&r.offsetHeight||0,s=getComputedStyle(n),o=this.props.sizeRef.current;o.height=parseFloat(s.height),o.width=parseFloat(s.width),o.top=n.offsetTop,o.left=n.offsetLeft,o.right=a-o.width-o.left,o.bottom=i-o.height-o.top,o.direction=s.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function hP({children:e,isPresent:t,anchorX:n,anchorY:r,root:a,pop:i}){var m;const s=w.useId(),o=w.useRef(null),l=w.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:u}=w.useContext(oh),c=i!==!1?((m=e.props)==null?void 0:m.ref)??(e==null?void 0:e.ref):void 0,h=cP(o,c);return w.useInsertionEffect(()=>{const{width:d,height:p,top:g,left:x,right:b,bottom:v,direction:T}=l.current;if(t||i===!1||!o.current||!d||!p)return;const N=T==="rtl",k=n==="left"?N?`right: ${b}`:`left: ${x}`:N?`left: ${x}`:`right: ${b}`,A=r==="bottom"?`bottom: ${v}`:`top: ${g}`;o.current.dataset.motionPopId=s;const _=document.createElement("style");u&&(_.nonce=u);const S=a??document.head;return S.appendChild(_),_.sheet&&_.sheet.insertRule(`
|
|
785
|
+
[data-motion-pop-id="${s}"] {
|
|
786
|
+
position: absolute !important;
|
|
787
|
+
width: ${d}px !important;
|
|
788
|
+
height: ${p}px !important;
|
|
789
|
+
${k}px !important;
|
|
790
|
+
${A}px !important;
|
|
791
|
+
}
|
|
792
|
+
`),()=>{var I;(I=o.current)==null||I.removeAttribute("data-motion-pop-id"),S.contains(_)&&S.removeChild(_)}},[t]),f.jsx(dP,{isPresent:t,childRef:o,sizeRef:l,pop:i,children:i===!1?e:w.cloneElement(e,{ref:h})})}const fP=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:a,presenceAffectsLayout:i,mode:s,anchorX:o,anchorY:l,root:u})=>{const c=jd(mP),h=w.useId(),m=w.useRef(n),d=w.useRef(r);qo(()=>{m.current=n,d.current=r});let p=!0,g=w.useMemo(()=>(p=!1,{id:h,initial:t,isPresent:n,custom:a,onExitComplete:x=>{c.set(x,!0);for(const b of c.values())if(!b)return;r&&r()},register:x=>(c.set(x,!1),()=>{var b;c.delete(x),!m.current&&!c.size&&((b=d.current)==null||b.call(d))})}),[n,c,r]);return i&&p&&(g={...g}),w.useMemo(()=>{c.forEach((x,b)=>c.set(b,!1))},[n]),w.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),e=f.jsx(hP,{pop:s==="popLayout",isPresent:n,anchorX:o,anchorY:l,root:u,children:e}),f.jsx(Ml.Provider,{value:g,children:e})};function mP(){return new Map}function x3(e=!0){const t=w.useContext(Ml);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:a}=t,i=w.useId();w.useEffect(()=>{if(e)return a(i)},[e]);const s=w.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,s]:[!0]}const io=e=>e.key||"";function vp(e){const t=[];return w.Children.forEach(e,n=>{w.isValidElement(n)&&t.push(n)}),t}const pP=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:a=!0,mode:i="sync",propagate:s=!1,anchorX:o="left",anchorY:l="top",root:u})=>{const[c,h]=x3(s),m=w.useMemo(()=>vp(e),[e]),d=s&&!c?[]:m.map(io),p=w.useRef(!0),g=w.useRef(m),x=jd(()=>new Map),b=w.useRef(new Set),[v,T]=w.useState(m),[N,k]=w.useState(m);qo(()=>{s&&!c&&!N.length&&(h==null||h())},[c,s,N.length,h]),qo(()=>{p.current=!1,g.current=m;for(let S=0;S<N.length;S++){const I=io(N[S]);d.includes(I)?(x.delete(I),b.current.delete(I)):x.get(I)!==!0&&x.set(I,!1)}},[N,d.length,d.join("-")]);const A=[];if(m!==v){let S=[...m];for(let I=0;I<N.length;I++){const C=N[I],D=io(C);d.includes(D)||(S.splice(I,0,C),A.push(C))}return i==="wait"&&A.length&&(S=A),k(vp(S)),T(m),null}const{forceRender:_}=w.useContext(Od);return f.jsx(f.Fragment,{children:N.map(S=>{const I=io(S),C=s&&!c?!1:m===N||d.includes(I),D=()=>{if(b.current.has(I))return;if(x.has(I))b.current.add(I),x.set(I,!0);else return;let L=!0;x.forEach(F=>{F||(L=!1)}),L&&(_==null||_(),k(g.current),s&&(h==null||h()),r&&r())};return f.jsx(fP,{isPresent:C,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:a,mode:i,root:u,onExitComplete:C?void 0:D,anchorX:o,anchorY:l,children:S},I)})})},b3=w.createContext({strict:!1}),wp={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 kp=!1;function gP(){if(kp)return;const e={};for(const t in wp)e[t]={isEnabled:n=>wp[t].some(r=>!!n[r])};Gb(e),kp=!0}function y3(){return gP(),eD()}function xP(e){const t=y3();for(const n in e)t[n]={...t[n],...e[n]};Gb(t)}const Dl=w.createContext({});function bP(e,t){if(Ll(e)){const{initial:n,animate:r}=e;return{initial:n===!1||cs(n)?n:void 0,animate:cs(r)?r:void 0}}return e.inherit!==!1?t:{}}function yP(e){const{initial:t,animate:n}=bP(e,w.useContext(Dl));return w.useMemo(()=>({initial:t,animate:n}),[Tp(t),Tp(n)])}function Tp(e){return Array.isArray(e)?e.join(" "):e}const lh=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function v3(e,t,n){for(const r in t)!Zt(t[r])&&!e3(r,n)&&(e[r]=t[r])}function vP({transformTemplate:e},t){return w.useMemo(()=>{const n=lh();return ih(n,t,e),Object.assign({},n.vars,n.style)},[t])}function wP(e,t){const n=e.style||{},r={};return v3(r,n,e),Object.assign(r,vP(e,t)),r}function kP(e,t){const n={},r=wP(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 w3=()=>({...lh(),attrs:{}});function TP(e,t,n,r){const a=w.useMemo(()=>{const i=w3();return n3(i,t,a3(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};v3(i,e.style,e),a.style={...i,...a.style}}return a}const EP=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 Jo(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||EP.has(e)}function SP(e,t){return e.startsWith("on")?!Jo(e):(t==null?void 0:t(e))??!Jo(e)}function AP(e,t,n,r){const a={};for(const i in e)i==="values"&&typeof e.values=="object"||Zt(e[i])||(SP(i,r)||n===!0&&Jo(i)||!t&&!Jo(i)||e.draggable&&i.startsWith("onDrag"))&&(a[i]=e[i]);return a}const CP=["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 uh(e){return typeof e!="string"||e.includes("-")?!1:!!(CP.indexOf(e)>-1||/[A-Z]/u.test(e))}function NP(e,t,n,{latestValues:r},a,i=!1,s,o){const u=(s??uh(e)?TP:kP)(t,r,a,e),c=AP(t,typeof e=="string",i,o),h=e!==w.Fragment?{...c,...u,ref:n}:{},{children:m}=t,d=w.useMemo(()=>Zt(m)?m.get():m,[m]);return w.createElement(e,{...h,children:d})}function MP({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,a){return{latestValues:IP(n,r,a,e),renderState:t()}}function IP(e,t,n,r){const a={},i=r(e,{});for(const m in i)a[m]=Eo(i[m]);let{initial:s,animate:o}=e;const l=Ll(e),u=$b(e);t&&u&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),o===void 0&&(o=t.animate));let c=n?n.initial===!1:!1;c=c||s===!1;const h=c?o:s;if(h&&typeof h!="boolean"&&!Rl(h)){const m=Array.isArray(h)?h:[h];for(let d=0;d<m.length;d++){const p=Qd(e,m[d]);if(p){const{transitionEnd:g,transition:x,...b}=p;for(const v in b){let T=b[v];if(Array.isArray(T)){const N=c?T.length-1:0;T=T[N]}T!==null&&(a[v]=T)}for(const v in g)a[v]=g[v]}}}return a}const k3=e=>(t,n)=>{const r=w.useContext(Dl),a=w.useContext(Ml),i=()=>MP(e,t,r,a);return n?i():jd(i)},_P=k3({scrapeMotionValuesFromProps:sh,createRenderState:lh}),RP=k3({scrapeMotionValuesFromProps:i3,createRenderState:w3}),LP=Symbol.for("motionComponentSymbol");function DP(e,t,n){const r=w.useRef(n);w.useInsertionEffect(()=>{r.current=n});const a=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 s=r.current;if(typeof s=="function")if(i){const l=s(i);typeof l=="function"&&(a.current=l)}else a.current?(a.current(),a.current=null):s(i);else s&&(s.current=i)},[t])}const T3=w.createContext({});function Ba(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function PP(e,t,n,r,a,i){var T,N;const{visualElement:s}=w.useContext(Dl),o=w.useContext(b3),l=w.useContext(Ml),u=w.useContext(oh),c=u.reducedMotion,h=u.skipAnimations,m=w.useRef(null),d=w.useRef(!1);r=r||o.renderer,!m.current&&r&&(m.current=r(e,{visualState:t,parent:s,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c,skipAnimations:h,isSVG:i}),d.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const p=m.current,g=w.useContext(T3);p&&!p.projection&&a&&(p.type==="html"||p.type==="svg")&&OP(m.current,n,a,g);const x=w.useRef(!1);w.useInsertionEffect(()=>{p&&x.current&&p.update(n,l)});const b=n[Lb],v=w.useRef(!!b&&typeof window<"u"&&!((T=window.MotionHandoffIsComplete)!=null&&T.call(window,b))&&((N=window.MotionHasOptimisedAnimation)==null?void 0:N.call(window,b)));return qo(()=>{d.current=!0,p&&(x.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),p.scheduleRenderMicrotask(),v.current&&p.animationState&&p.animationState.animateChanges())}),w.useEffect(()=>{p&&(!v.current&&p.animationState&&p.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var k;(k=window.MotionHandoffMarkAsComplete)==null||k.call(window,b)}),v.current=!1),p.enteringChildren=void 0)}),p}function OP(e,t,n,r){const{layoutId:a,layout:i,drag:s,dragConstraints:o,layoutScroll:l,layoutRoot:u,layoutAnchor:c,layoutCrossfade:h}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:E3(e.parent)),e.projection.setOptions({layoutId:a,layout:i,alwaysMeasureLayout:!!s||o&&Ba(o),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:h,layoutScroll:l,layoutRoot:u,layoutAnchor:c})}function E3(e){if(e)return e.options.allowProjection!==!1?e.projection:E3(e.parent)}function sc(e,{forwardMotionProps:t=!1,type:n}={},r,a){r&&xP(r);const i=n?n==="svg":uh(e),s=i?RP:_P;function o(u,c){let h;const m={...w.useContext(oh),...u,layoutId:jP(u)},{isStatic:d,isValidProp:p}=m,g=yP(u),x=s(u,d);if(!d&&typeof window<"u"){BP();const b=FP(m);h=b.MeasureLayout,g.visualElement=PP(e,x,m,a,b.ProjectionNode,i)}return f.jsxs(Dl.Provider,{value:g,children:[h&&g.visualElement?f.jsx(h,{visualElement:g.visualElement,...m}):null,NP(e,u,DP(x,g.visualElement,c),x,d,t,i,p)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=w.forwardRef(o);return l[LP]=e,l}function jP({layoutId:e}){const t=w.useContext(Od).id;return t&&e!==void 0?t+"-"+e:e}function BP(e,t){w.useContext(b3).strict}function FP(e){const t=y3(),{drag:n,layout:r}=t;if(!n&&!r)return{};const a={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?a.MeasureLayout:void 0,ProjectionNode:a.ProjectionNode}}function zP(e,t){if(typeof Proxy>"u")return sc;const n=new Map,r=(i,s)=>sc(i,s,e,t),a=(i,s)=>r(i,s);return new Proxy(a,{get:(i,s)=>s==="create"?r:(n.has(s)||n.set(s,sc(s,void 0,e,t)),n.get(s))})}const HP=(e,t)=>t.isSVG??uh(e)?new gD(t):new dD(t,{allowProjection:e!==w.Fragment});class UP extends Gr{constructor(t){super(t),t.animationState||(t.animationState=wD(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Rl(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 qP=0;class VP extends Gr{constructor(){super(...arguments),this.id=qP++,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:s,custom:o}=this.node.getProps();if(typeof s=="string"||typeof s=="object"&&s!==null&&!Array.isArray(s)){const l=ya(this.node,s,o);if(l){const{transition:u,transitionEnd:c,...h}=l;for(const m in h)(i=this.node.getValue(m))==null||i.jump(h[m])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const a=this.node.animationState.setActive("exit",!t);n&&!t&&a.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 $P={animation:{Feature:UP},exit:{Feature:VP}};function Ms(e){return{point:{x:e.pageX,y:e.pageY}}}const WP=e=>t=>th(t)&&e(t,Ms(t));function Zi(e,t,n,r){return ds(e,t,WP(n),r)}const S3=({current:e})=>e?e.ownerDocument.defaultView:null,Ep=(e,t)=>Math.abs(e-t);function GP(e,t){const n=Ep(e.x,t.x),r=Ep(e.y,t.y);return Math.sqrt(n**2+r**2)}const Sp=new Set(["auto","scroll"]);class A3{constructor(t,n,{transformPagePoint:r,contextWindow:a=window,dragSnapToOrigin:i=!1,distanceThreshold:s=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=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=so(this.lastRawMoveEventInfo,this.transformPagePoint));const p=oc(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,x=GP(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!x)return;const{point:b}=p,{timestamp:v}=Qt;this.history.push({...b,timestamp:v});const{onStart:T,onMove:N}=this.handlers;g||(T&&T(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),N&&N(this.lastMoveEvent,p)},this.handlePointerMove=(p,g)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=g,this.lastMoveEventInfo=so(g,this.transformPagePoint),yt.update(this.updatePoint,!0)},this.handlePointerUp=(p,g)=>{this.end();const{onEnd:x,onSessionEnd:b,resumeAnimation:v}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=oc(p.type==="pointercancel"?this.lastMoveEventInfo:so(g,this.transformPagePoint),this.history);this.startEvent&&x&&x(p,T),b&&b(p,T)},!th(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=s,this.contextWindow=a||window;const l=Ms(t),u=so(l,this.transformPagePoint),{point:c}=u,{timestamp:h}=Qt;this.history=[{...c,timestamp:h}];const{onSessionStart:m}=n;m&&m(t,oc(u,this.history));const d={passive:!0,capture:!0};this.removeListeners=As(Zi(this.contextWindow,"pointermove",this.handlePointerMove,d),Zi(this.contextWindow,"pointerup",this.handlePointerUp,d),Zi(this.contextWindow,"pointercancel",this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(Sp.has(r.overflowX)||Sp.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,a=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},i={x:a.x-n.x,y:a.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,a),yt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),qr(this.updatePoint)}}function so(e,t){return t?{point:t(e.point)}:e}function Ap(e,t){return{x:e.x-t.x,y:e.y-t.y}}function oc({point:e},t){return{point:e,delta:Ap(e,C3(t)),offset:Ap(e,YP(t)),velocity:KP(t,.1)}}function YP(e){return e[0]}function C3(e){return e[e.length-1]}function KP(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const a=C3(e);for(;n>=0&&(r=e[n],!(a.timestamp-r.timestamp>An(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&a.timestamp-r.timestamp>An(t)*2&&(r=e[1]);const i=On(a.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const s={x:(a.x-r.x)/i,y:(a.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function XP(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?bt(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?bt(n,e,r.max):Math.min(e,n)),e}function Cp(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 QP(e,{top:t,left:n,bottom:r,right:a}){return{x:Cp(e.x,n,a),y:Cp(e.y,t,r)}}function Np(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 ZP(e,t){return{x:Np(e.x,t.x),y:Np(e.y,t.y)}}function JP(e,t){let n=.5;const r=mn(e),a=mn(t);return a>r?n=ls(t.min,t.max-r,e.min):r>a&&(n=ls(e.min,e.max-a,t.min)),or(0,1,n)}function eO(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 D0=.35;function tO(e=D0){return e===!1?e=0:e===!0&&(e=D0),{x:Mp(e,"left","right"),y:Mp(e,"top","bottom")}}function Mp(e,t,n){return{min:Ip(e,t),max:Ip(e,n)}}function Ip(e,t){return typeof e=="number"?e:e[t]||0}const nO=new WeakMap;class rO{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=Ut(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:a}=this.visualElement;if(a&&a.isPresent===!1)return;const i=h=>{n&&this.snapToCursor(Ms(h).point),this.stopAnimation()},s=(h,m)=>{const{drag:d,dragPropagation:p,onDragStart:g}=this.getProps();if(d&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=IL(d),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Zn(b=>{let v=this.getAxisMotionValue(b).get()||0;if(ir.test(v)){const{projection:T}=this.visualElement;if(T&&T.layout){const N=T.layout.layoutBox[b];N&&(v=mn(N)*(parseFloat(v)/100))}}this.originPoint[b]=v}),g&&yt.update(()=>g(h,m),!1,!0),E0(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},o=(h,m)=>{this.latestPointerEvent=h,this.latestPanInfo=m;const{dragPropagation:d,dragDirectionLock:p,onDirectionLock:g,onDrag:x}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:b}=m;if(p&&this.currentDirection===null){this.currentDirection=iO(b),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",m.point,b),this.updateAxis("y",m.point,b),this.visualElement.render(),x&&yt.update(()=>x(h,m),!1,!0)},l=(h,m)=>{this.latestPointerEvent=h,this.latestPanInfo=m,this.stop(h,m),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:c}=this.getProps();this.panSession=new A3(t,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:r,contextWindow:S3(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,a=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!a||!r)return;const{velocity:s}=a;this.startAnimation(s);const{onDragEnd:o}=this.getProps();o&&yt.postRender(()=>o(r,a))}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:a}=this.getProps();if(!r||!oo(t,a,this.currentDirection))return;const i=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=XP(s,this.constraints[t],this.elastic[t])),i.set(s)}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,a=this.constraints;t&&Ba(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=QP(r.layoutBox,t):this.constraints=!1,this.elastic=tO(n),a!==this.constraints&&!Ba(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&Zn(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=eO(r.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ba(t))return!1;const r=t.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;a.root&&(a.root.scroll=void 0,a.root.updateScroll());const i=iD(r,a.root,this.visualElement.getTransformPagePoint());let s=ZP(a.layout.layoutBox,i);if(n){const o=n(nD(s));this.hasMutatedConstraints=!!o,o&&(s=Kb(o))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:a,dragTransition:i,dragSnapToOrigin:s,onDragTransitionEnd:o}=this.getProps(),l=this.constraints||{},u=Zn(c=>{if(!oo(c,n,this.currentDirection))return;let h=l&&l[c]||{};(s===!0||s===c)&&(h={min:0,max:0});const m=a?200:1e6,d=a?40:1e7,p={type:"inertia",velocity:r?t[c]:0,bounceStiffness:m,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...i,...h};return this.startAxisValueAnimation(c,p)});return Promise.all(u).then(o)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return E0(this.visualElement,t),r.start(Xd(t,r,0,n,this.visualElement,!1))}stopAnimation(){Zn(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,a=this.visualElement.getProps()[n];return a||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){Zn(n=>{const{drag:r}=this.getProps();if(!oo(n,r,this.currentDirection))return;const{projection:a}=this.visualElement,i=this.getAxisMotionValue(n);if(a&&a.layout){const{min:s,max:o}=a.layout.layoutBox[n],l=i.get()||0;i.set(t[n]-bt(s,o,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ba(n)||!r||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};Zn(s=>{const o=this.getAxisMotionValue(s);if(o&&this.constraints!==!1){const l=o.get();a[s]=JP({min:l,max:l},this.constraints[s])}});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(),Zn(s=>{if(!oo(s,t,null))return;const o=this.getAxisMotionValue(s),{min:l,max:u}=this.constraints[s];o.set(bt(l,u,a[s]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;nO.set(this.visualElement,this);const t=this.visualElement.current,n=Zi(t,"pointerdown",u=>{const{drag:c,dragListener:h=!0}=this.getProps(),m=u.target,d=m!==t&&OL(m);c&&h&&!d&&this.start(u)});let r;const a=()=>{const{dragConstraints:u}=this.getProps();Ba(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),r||(r=aO(t,u.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,s=i.addEventListener("measure",a);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),yt.read(a);const o=ds(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:c})=>{this.isDragging&&c&&(Zn(h=>{const m=this.getAxisMotionValue(h);m&&(this.originPoint[h]+=u[h].translate,m.set(m.get()+u[h].translate))}),this.visualElement.render())}));return()=>{o(),n(),s(),l&&l(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:a=!1,dragConstraints:i=!1,dragElastic:s=D0,dragMomentum:o=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:a,dragConstraints:i,dragElastic:s,dragMomentum:o}}}function _p(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function aO(e,t,n){const r=B1(e,_p(n)),a=B1(t,_p(n));return()=>{r(),a()}}function oo(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function iO(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class sO extends Gr{constructor(t){super(t),this.removeGroupControls=jn,this.removeListeners=jn,this.controls=new rO(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||jn}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 lc=e=>(t,n)=>{e&&yt.update(()=>e(t,n),!1,!0)};class oO extends Gr{constructor(){super(...arguments),this.removePointerDownListener=jn}onPointerDown(t){this.session=new A3(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:S3(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:a}=this.node.getProps();return{onSessionStart:lc(t),onStart:lc(n),onMove:lc(r),onEnd:(i,s)=>{delete this.session,a&&yt.postRender(()=>a(i,s))}}}mount(){this.removePointerDownListener=Zi(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 uc=!1;class lO extends w.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:a}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&a&&r.register(i),uc&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),So.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:a,isPresent:i}=this.props,{projection:s}=r;return s&&(s.isPresent=i,t.layoutDependency!==n&&s.setOptions({...s.options,layoutDependency:n}),uc=!0,a||t.layoutDependency!==n||n===void 0||t.isPresent!==i?s.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?s.promote():s.relegate()||yt.postRender(()=>{const o=s.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(),eh.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:a}=t;uc=!0,a&&(a.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(a),r&&r.deregister&&r.deregister(a))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function N3(e){const[t,n]=x3(),r=w.useContext(Od);return f.jsx(lO,{...e,layoutGroup:r,switchLayoutGroup:w.useContext(T3),isPresent:t,safeToRemove:n})}const uO={pan:{Feature:oO},drag:{Feature:sO,ProjectionNode:g3,MeasureLayout:N3}};function Rp(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const a="onHover"+n,i=r[a];i&&yt.postRender(()=>i(t,Ms(t)))}class cO extends Gr{mount(){const{current:t}=this.node;t&&(this.unmount=RL(t,(n,r)=>(Rp(this.node,r,"Start"),a=>Rp(this.node,a,"End"))))}unmount(){}}class dO extends Gr{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=As(ds(this.node.current,"focus",()=>this.onFocus()),ds(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Lp(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 a="onTap"+(n==="End"?"":n),i=r[a];i&&yt.postRender(()=>i(t,Ms(t)))}class hO extends Gr{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=BL(t,(a,i)=>(Lp(this.node,i,"Start"),(s,{success:o})=>Lp(this.node,s,o?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const P0=new WeakMap,cc=new WeakMap,fO=e=>{const t=P0.get(e.target);t&&t(e)},mO=e=>{e.forEach(fO)};function pO({root:e,...t}){const n=e||document;cc.has(n)||cc.set(n,{});const r=cc.get(n),a=JSON.stringify(t);return r[a]||(r[a]=new IntersectionObserver(mO,{root:e,...t})),r[a]}function gO(e,t,n){const r=pO(t);return P0.set(e,n),r.observe(e),()=>{P0.delete(e),r.unobserve(e)}}const xO={some:0,all:1};class bO extends Gr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:a="some",once:i}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof a=="number"?a:xO[a]},o=u=>{const{isIntersecting:c}=u;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:h,onViewportLeave:m}=this.node.getProps(),d=c?h:m;d&&d(u)};this.stopObserver=gO(this.node.current,s,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(yO(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function yO({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const vO={inView:{Feature:bO},tap:{Feature:hO},focus:{Feature:dO},hover:{Feature:cO}},wO={layout:{ProjectionNode:g3,MeasureLayout:N3}},kO={...$P,...vO,...uO,...wO},TO=zP(kO,HP),EO=TO;function SO(e){switch(e){case"correct":return{Icon:Wn,color:"var(--brand)"};case"wrong":return{Icon:va,color:"var(--warning)"};case"mastery":case"level-up":return{Icon:Vp,color:"var(--gold)"};case"unlock":return{Icon:pc,color:"var(--brand)"};case"streak":return{Icon:$p,color:"var(--review)"};case"energy-full":return{Icon:xc,color:"var(--brand)"};case"exam-pass":return{Icon:py,color:"var(--exam)"};case"lesson-complete":return{Icon:Jy,color:"var(--gold)"};default:return{Icon:pc,color:"var(--brand)"}}}function AO(){const e=j0(),t=w.useRef(null),n=w.useRef([]),r=w.useRef(0),[a,i]=w.useState(null);return w.useEffect(()=>{if(e)return;const s=t.current;if(!s)return;const o=s.getContext("2d");if(!o)return;const l=()=>{const m=Math.min(window.devicePixelRatio||1,2);s.width=window.innerWidth*m,s.height=window.innerHeight*m,s.style.width=window.innerWidth+"px",s.style.height=window.innerHeight+"px",o.setTransform(m,0,0,m,0,0)};l(),window.addEventListener("resize",l);const u=()=>{o.clearRect(0,0,window.innerWidth,window.innerHeight);const m=n.current;for(let d=m.length-1;d>=0;d--){const p=m[d];if(p.x+=p.vx,p.y+=p.vy,p.vy+=.25,p.vx*=.99,p.rot+=p.vr,p.life--,p.life<=0){m.splice(d,1);continue}const g=Math.min(1,p.life/p.maxLife);o.save(),o.globalAlpha=g,o.translate(p.x,p.y),o.rotate(p.rot),o.fillStyle=p.color,p.shape==="circle"?(o.beginPath(),o.arc(0,0,p.size,0,Math.PI*2),o.fill()):o.fillRect(-p.size/2,-p.size/2,p.size,p.size*.6),o.restore()}r.current=m.length>0?requestAnimationFrame(u):0},h=Sh(m=>{var b,v;const d=ay(m.kind),p=Math.round(d.particles*(m.intensity??1)),g=((b=m.origin)==null?void 0:b.x)??window.innerWidth/2,x=((v=m.origin)==null?void 0:v.y)??window.innerHeight/2;for(let T=0;T<p;T++){const N=Math.PI*2*T/p+Math.random()*.3,k=3+Math.random()*6,A=d.durationMs/16*(.7+Math.random()*.5);n.current.push({x:g,y:x,vx:Math.cos(N)*k,vy:Math.sin(N)*k-2,life:A,maxLife:A,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(u))});return()=>{h(),window.removeEventListener("resize",l),r.current&&cancelAnimationFrame(r.current),r.current=0,n.current=[]}},[e]),w.useEffect(()=>{if(!e)return;let s=0;return Sh(l=>{const u=++s;i({kind:l.kind,id:u}),setTimeout(()=>{u===s&&i(null)},600)})},[e]),e?f.jsx(pP,{children:a&&(()=>{const{Icon:s,color:o}=SO(a.kind);return f.jsx(EO.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:f.jsx(s,{className:"w-24 h-24",color:o,strokeWidth:1.5})},a.id)})()}):f.jsx("canvas",{ref:t,className:"fixed inset-0 pointer-events-none z-[60]","aria-hidden":"true"})}const Dp=["direct","guide","practice"];function CO(){const e=$e(),[t,n]=w.useState([]),[r,a]=w.useState([]),[i,s]=w.useState({}),[o,l]=w.useState(null),[u,c]=w.useState(null),[h,m]=w.useState(null),[d,p]=w.useState(null),g=w.useCallback(te=>{p(te instanceof Error?te.message:String(te)),console.error(te)},[]),[x,b]=w.useState([]),[v,T]=w.useState(null),[N,k]=w.useState([]),[A,_]=w.useState(null),[S,I]=w.useState("map"),[C,D]=w.useState(null),[L,F]=w.useState(new Set),[O,R]=w.useState(null),H=w.useRef({active:!1,terminate:null}),[V,q]=w.useState({open:!1,pendingAction:null}),Z=w.useRef(null),[B,Q]=w.useState(null),[ne,j]=w.useState(!1),[re,K]=w.useState(!0),[X,ce]=w.useState(!0),le=S_(),[ee,Ie]=w.useState("notebook"),[de,he]=w.useState("chat"),pe=w.useRef(de);pe.current=de;const Ce=w.useRef(le);w.useEffect(()=>{Ce.current!==le&&(le===1?(K(!0),ce(!0)):le===2&&Ce.current===3&&Ie(v_(pe.current)),Ce.current=le)},[le]);const Oe=le===3?de==="rail":le===2?ee==="rail":re,st=le===3?de==="notebook":le===2?ee==="notebook":X,Be=le!==3||de==="chat",ut=()=>{le===1?K(te=>!te):le===2?Ie(te=>te==="rail"?"notebook":"rail"):he(te=>te==="rail"?"chat":"rail")},me=()=>{le===1?ce(te=>!te):le===2?Ie(te=>te==="notebook"?"rail":"notebook"):he(te=>te==="notebook"?"chat":"notebook")},Ue=w.useRef(null),ct=te=>{var Ne,qe;if(le!==3)return;const fe=te.touches[0];Ue.current={x:fe.clientX,y:fe.clientY,multi:te.touches.length>1,noswipe:!!((qe=(Ne=te.target).closest)!=null&&qe.call(Ne,"[data-noswipe]"))}},tt=te=>{const fe=Ue.current;if(Ue.current=null,!fe||fe.multi||fe.noswipe||le!==3)return;const Ne=te.changedTouches[0],qe=w_(pe.current,Ne.clientX-fe.x,Ne.clientY-fe.y);qe&&he(qe)},[ft,Xe]=w.useState(!1),[Pe,oe]=w.useState(null),[ge,_e]=w.useState([]),Ae=p_(h,O),ze=ng(),ye=h_(Ae.activeId,ze);w.useEffect(()=>{iy(ye.streaming)},[ye.streaming]);const[Re,He]=w.useState(""),dt=w.useCallback(te=>{He(te)},[]),Jt=w.useCallback((te,fe,Ne)=>{if(te.type==="content"){if(Q("content"),Ne){const qe=gt=>{document.querySelector(`mark[data-note-id="${Ne}"]`)?window.dispatchEvent(new CustomEvent("lookatstudy-jump-to-note",{detail:Ne})):gt>0&&setTimeout(()=>qe(gt-1),150)};setTimeout(()=>qe(10),100)}}else if(te.threadId!==Ae.activeId&&Ae.setActiveId(te.threadId),Ne){const qe=gt=>{document.querySelector(`mark[data-note-id="${Ne}"]`)?window.dispatchEvent(new CustomEvent("lookatstudy-jump-to-chat-note",{detail:Ne})):gt>0&&setTimeout(()=>qe(gt-1),150)};setTimeout(()=>qe(10),120)}},[Ae]),[Ot,en]=w.useState(null);w.useEffect(()=>{if(!O){en(null);return}let te=!1;return ae.getNodeSummary(O,ze).then(fe=>{te||en(fe)}).catch(()=>{te||en(null)}),()=>{te=!0}},[O,ze]);const Ze=w.useMemo(()=>r.find(te=>te.id===O)??null,[r,O]),Yr=w.useMemo(()=>ge.map(te=>({...te,label:e(`starter.${te.key}.label`),hint:e(`starter.${te.key}.hint`),message:e(`starter.${te.key}.message`,{title:(Ze==null?void 0:Ze.title)??""})})),[ge,Ze,e]),ie=w.useRef(null),nt=w.useCallback(()=>{var te;Ze&&((te=ie.current)==null||te.call(ie,e("chat.action.startLearningPrompt",{title:Ze.title}),e("chat.action.startLearning",{title:Ze.title})))},[Ze,e]),Tt=w.useCallback(async()=>{try{const[te,fe,Ne,qe,gt,vn]=await Promise.all([ae.listCourses(),ae.getStreak(),ae.listSouls(),ae.getActiveSoul(),ae.getXpStatus(),ae.getDueReviews()]);n(te),l(fe),k(Ne),c(gt),_(qe),F(new Set(vn)),h&&!te.some(_3=>_3.id===h)&&(m(null),R(null),a([]),s({}),D(null),b([]),T(null))}catch(te){p(te instanceof Error?te.message:String(te))}},[h]);w.useEffect(()=>{Tt()},[Tt]);const tn=w.useCallback(async()=>{try{oe(await ae.isAgentReady())}catch{oe({ready:!1,missing:e("error.checkReadyFailed")})}},[e]);w.useEffect(()=>{tn();const te=()=>tn();return window.addEventListener("llm-config-changed",te),()=>window.removeEventListener("llm-config-changed",te)},[tn]);const Xn=w.useRef(0),Ar=w.useRef(0);w.useEffect(()=>{Xn.current=(u==null?void 0:u.todayXp)??0},[u]),w.useEffect(()=>{Ar.current=(o==null?void 0:o.currentStreak)??0},[o]);const Ge=w.useCallback(async()=>{const te=r.filter(qe=>qe.type==="lesson"||qe.type==="exam"),fe=await Promise.all(te.map(async qe=>{const gt=await ae.getProgress(qe.id);return[qe.id,gt]})),Ne={};for(const[qe,gt]of fe)gt&&(Ne[qe]=gt);s(Ne)},[r]);w.useEffect(()=>ae.on("state:changed",fe=>{fe==="xp"?ae.getXpStatus().then(Ne=>{c(Ne),Xn.current<100&&Ne.todayXp>=100&&ha("energy-full")}).catch(()=>{}):fe==="streak"?ae.getStreak().then(Ne=>{l(Ne),Ne.currentStreak>Ar.current&&ha("streak")}).catch(()=>{}):fe==="mastery"&&(ha("mastery"),Tt(),Ge())}),[Tt,Ge]),w.useEffect(()=>{h&&(ae.getCourseLanguages(h).then(b).catch(()=>b([])),ae.getCourseLanguage(h).then(T).catch(()=>T(null)))},[h]),w.useEffect(()=>{h&&(ae.getCourseTree(h,v??void 0).then(async te=>{a(te);const fe=te.filter(gt=>gt.type==="lesson"||gt.type==="exam"),Ne=await Promise.all(fe.map(async gt=>{const vn=await ae.getProgress(gt.id);return[gt.id,vn]})),qe={};for(const[gt,vn]of Ne)vn&&(qe[gt]=vn);s(qe)}).catch(g),ae.getDashboard(h).then(D).catch(g))},[h,v,g]),w.useEffect(()=>{if(!O){_e([]);return}ae.getStarterPrompts(O).then(_e).catch(()=>_e([]))},[O]),w.useEffect(()=>{const te=fe=>{if(fe.key==="Escape"&&Ae.activeId&&(ae.abortAgentChatThread(Ae.activeId).catch(()=>{}),j(!1),Xe(!1)),(fe.ctrlKey||fe.metaKey)&&fe.key==="k"&&(fe.preventDefault(),Xe(Ne=>!Ne)),(fe.ctrlKey||fe.metaKey)&&fe.key==="b"&&(fe.preventDefault(),ut()),(fe.ctrlKey||fe.metaKey)&&fe.key==="Tab"){if(fe.preventDefault(),H.current.active)return;const Ne=Ae.threads;if(Ne.length>1){const qe=Ne.findIndex(vn=>vn.id===Ae.activeId),gt=fe.shiftKey?(qe-1+Ne.length)%Ne.length:(qe+1)%Ne.length;Ae.setActiveId(Ne[gt].id)}}(!fe.target||!fe.target.matches("input, textarea, select"))&&(fe.key==="1"&&I("map"),fe.key==="2"&&I("import"),fe.key==="s"&&(fe.ctrlKey||fe.metaKey)&&(fe.preventDefault(),j(!0)))};return window.addEventListener("keydown",te),()=>window.removeEventListener("keydown",te)},[O]);const et=w.useCallback(async te=>{var fe;try{if(te.type==="exam"){R(te.id),Q("content");return}if(((fe=i[te.id])==null?void 0:fe.status)==="locked"){R(null);return}await ae.markNodeAttempted(te.id);const Ne=await ae.getStreak();await Ge(),l(Ne),R(te.id),Q("content"),Bl(!1)}catch(Ne){g(Ne)}},[i,Ge,g]),Lt=w.useCallback(te=>{if(H.current.active){q({open:!0,pendingAction:te});return}te()},[]),Et=w.useCallback(te=>{if(H.current.active&&te.id!==O){q({open:!0,pendingAction:()=>void et(te)});return}et(te)},[et,O]),Yt=w.useCallback(te=>{H.current=te},[]),ot=w.useCallback(async()=>{const te=V.pendingAction;q({open:!1,pendingAction:null});const fe=H.current;if(H.current={active:!1,terminate:null},fe.active&&fe.terminate)try{await fe.terminate()}catch{}te==null||te()},[V.pendingAction]);ni(Z,V.open),w.useEffect(()=>{if(!V.open)return;const te=fe=>{fe.key==="Escape"&&q({open:!1,pendingAction:null})};return window.addEventListener("keydown",te),()=>window.removeEventListener("keydown",te)},[V.open]);const Qe=async te=>{try{await ae.setActiveSoul(te),_(te)}catch(fe){g(fe)}},rt=w.useCallback(async(te,fe,Ne)=>{try{await ae.applyProposal(te),ye.markProposalStatus(fe,Ne,!0)}catch(qe){g(qe)}},[ye,g]),ln=w.useCallback(async(te,fe,Ne)=>{try{await ae.rejectProposal(te),ye.markProposalStatus(fe,Ne,!1)}catch(qe){g(qe)}},[ye,g]),ht=t.find(te=>te.id===h),Nt=w.useMemo(()=>{const te=new Set(r.map(fe=>fe.id));return new Set([...L].filter(fe=>te.has(fe)))},[L,r]),$t=Nt.size,Ca=w.useMemo(()=>r.filter(te=>te.type==="section").sort((te,fe)=>te.orderIdx-fe.orderIdx),[r]),Is=w.useMemo(()=>{const te=Dp.map(Ne=>N.find(qe=>qe.name===Ne)).filter(Ne=>!!Ne),fe=N.filter(Ne=>!Dp.includes(Ne.name));return[...te,...fe]},[N]),nn=XM(h),pi=ZM(),Dt=Pd();w.useEffect(()=>ae.on("exam:status",fe=>{if(fe.status!=="ready"||fe.nodeId===O)return;const Ne=r.find(qe=>qe.id===fe.nodeId);Ne&&Dt.show(e("exam.ready.toast",{title:Ne.title}),{duration:4e3})}),[O,r,Dt,e]);const Kt=w.useCallback(async te=>{const fe=t.find(Ne=>Ne.id===te);try{await ae.deleteCourse(te),Dt.show(e("import.deleted",{title:(fe==null?void 0:fe.title)??te}),{duration:3e3}),Tt()}catch(Ne){g(Ne)}},[t,Tt,g,Dt,e]),Kr=w.useCallback(async(te,fe,Ne)=>{if(!te.trim()||ye.streaming)return;if(!Ae.activeId){const gt=await Ae.ensureThreadForSend(te,fe);if(gt){ye.send(te,gt,fe,Ne);return}Dt.show(e("toast.threadCreateFailed"));return}const qe=Ae.activeThread;qe&&!qe.title&&Ae.update(qe.id,{title:(fe??te).trim()}),ye.send(te,void 0,fe,Ne)},[ye,Ae,Dt,e]),Xr=w.useRef(ye.streaming);Xr.current=ye.streaming;const gi=w.useCallback(te=>{const fe=m_(te,e),Ne=f_(te,e),qe=gt=>{var vn;if(!Xr.current){(vn=ie.current)==null||vn.call(ie,fe,Ne);return}gt>0&&setTimeout(()=>qe(gt-1),2e3)};qe(10)},[e]);ie.current=Kr;const Na=new Set(["concept_map","diagram","compare_table","code_walkthrough"]),Xt=w.useMemo(()=>{const te=i1(ye.messages).filter(Ne=>{var qe;return Na.has(((qe=Ne.output)==null?void 0:qe.artifactType)??"")});if(te.length)return te[te.length-1];const fe=nn.items.filter(Ne=>Na.has(Ne.artifactType)).map(Ne=>{try{return{id:Ne.id,toolName:Ne.artifactType,output:JSON.parse(Ne.data)}}catch{return null}}).filter(Ne=>Ne!==null);return fe.length?fe[fe.length-1]:null},[ye.messages,nn.items]),Qr=w.useRef(new Set);w.useEffect(()=>{!Xt||Qr.current.has(Xt.id)||(Qr.current.add(Xt.id),ye.streaming&&Q("board"))},[Xt,ye.streaming]);const Pl=w.useMemo(()=>ye.messages.reduce((te,fe)=>te+fe.parts.reduce((Ne,qe)=>qe.type==="text"?Ne+Zp(qe.text):Ne,0),0),[ye.messages]),ch=w.useRef(!1);w.useEffect(()=>{$t>0&&!ch.current&&(ch.current=!0,Dt.show(e("review.nudge",{n:$t}),{duration:4e3}))},[$t,Dt,e]);const dh=w.useMemo(()=>i1(ye.messages),[ye.messages]),hh=w.useRef(new Set);w.useEffect(()=>{for(const te of dh){const fe=te.output;if(!fe||!fe.artifactType)continue;const Ne=`${fe.artifactType}:${JSON.stringify(fe)}`;hh.current.has(Ne)||(hh.current.add(Ne),nn.save({nodeId:O,artifactType:fe.artifactType,title:fe.title??null,data:fe}),Dt.show(e("toast.artifactSaved"),{duration:3e3}))}},[dh,nn,O,Dt,e]),w.useEffect(()=>{S!=="map"&&Q(null)},[S]);const[I3,Ol]=w.useState(!1),[jl,Bl]=w.useState(!1),fh=(Ze==null?void 0:Ze.type)==="exam";return w.useEffect(()=>{fh&&window.dispatchEvent(new CustomEvent("companion-exam-enter"))},[fh]),w.useEffect(()=>{sy(jl)},[jl]),f.jsxs("div",{className:"h-[var(--app-height,100vh)] flex flex-col bg-surface-1 text-neutral-900 dark:text-neutral-100 overflow-hidden",children:[f.jsx(MO,{streak:o,xp:u,fontSize:pi.size,onFontBump:pi.bump,onOpenSettings:()=>j(!0),leftVisible:Oe,rightVisible:st,onToggleLeft:ut,onToggleRight:me,tier:le,bottomBar:le===3?f.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:H0,label:e("pane.map"),testid:"t3-btn-rail"},{k:"chat",icon:Py,label:e("pane.chat"),testid:"t3-btn-chat"},{k:"notebook",icon:Hy,label:e("pane.notes"),testid:"t3-btn-notebook"}].map(({k:te,icon:fe,label:Ne,testid:qe})=>f.jsx("button",{role:"tab","aria-selected":de===te,"aria-label":Ne,"data-testid":qe,"data-tooltip":Ne,onClick:()=>he(te),className:`w-8 h-7 flex items-center justify-center rounded-md transition-colors ${de===te?"bg-brand/20 text-brand":"text-ink-muted active:bg-ink/10"}`,children:f.jsx(fe,{className:"w-4 h-4"})},te))}):void 0}),d&&f.jsx(RO,{message:d,onClose:()=>p(null)}),f.jsxs("div",{className:"flex-1 flex min-h-0 min-w-0",onTouchStart:ct,onTouchEnd:tt,children:[Oe&&f.jsx(ov,{fullWidth:le===3,view:S,onViewChange:I,courseTitle:(ht==null?void 0:ht.title)??null,courseId:h,courses:t,sections:Ca,tree:r,progressMap:i,selectedNodeId:O,dueCount:$t,dueNodeIds:Nt,overallMastery:(C==null?void 0:C.overallMastery)??0,streak:(o==null?void 0:o.currentStreak)??0,streaming:ye.streaming,onJumpNode:te=>{if(ye.streaming)return;const fe=r.find(Ne=>Ne.id===te);fe&&Et(fe),le===3&&he("chat")},onOpenReview:()=>Ol(!0),onSelectCourse:te=>Lt(()=>{m(te),Tt()}),onDeleteCourse:te=>Lt(()=>{Kt(te)}),onCoursesChanged:()=>{Tt()},availableLanguages:x,currentLocale:v,onLocaleChange:async te=>{h&&(await ae.setCourseLanguage(h,te),T(te))}}),f.jsxs(f.Fragment,{children:[Be&&f.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:le===3?{flex:1}:st?{width:"clamp(480px, 36vw, 800px)"}:{flex:1},"data-testid":"chat-panel",children:h?(Ze==null?void 0:Ze.type)==="exam"?f.jsx(KI,{examNode:Ze,locale:ze,onSessionChange:Yt,paused:V.open,onExamCompleted:()=>{ae.getProgress(Ze.id).then(te=>{te&&s(fe=>({...fe,[Ze.id]:te}))})}}):f.jsxs(f.Fragment,{children:[f.jsx(g_,{threads:Ae.threads,activeThread:Ae.activeThread,focusNodeTitle:(Ze==null?void 0:Ze.title)??null,onPickThread:te=>{ye.streaming||Ae.setActiveId(te)},onCreate:()=>{ye.streaming||(Ae.create({title:null}),Dt.show(e("toast.threadCreated")))},onRename:(te,fe)=>{Ae.update(te,{title:fe}),Dt.show(e("toast.threadRenamed"))},onArchive:te=>{Ae.update(te,{status:"archived"}),Dt.show(e("toast.threadArchived"),{duration:5e3,action:{label:e("action.undo"),onClick:()=>Ae.update(te,{status:"active"})}})},onDelete:te=>{const fe=Ae.removeWithUndo(te);fe&&(Dt.show(`${e("toast.threadDeleted")}${fe.title?`「${fe.title}」`:""}`,{duration:5e3,action:{label:e("action.undo"),onClick:()=>{Ae.restore(fe),Dt.show(e("toast.restored"))}}}),setTimeout(()=>{ae.threadDelete(fe.id).catch(()=>{})},5500))}}),f.jsx(nI,{messages:ye.messages,streaming:ye.streaming,onApplyProposal:rt,onRejectProposal:ln,summary:Ot,onStartLearning:Pe!=null&&Pe.ready?nt:void 0,agentReady:(Pe==null?void 0:Pe.ready)??!1,onGotoSettings:()=>j(!0),hasNode:!!Ze,selectedNodeId:O,threadId:Ae.activeId,onPickQuizAction:te=>{Kr(te)},onQuizCompleted:gi,cardMode:le===3,chatNotes:nn.items.filter(te=>te.artifactType==="user_note"&&te.sourceAnchor),onSaveChatNote:(te,fe,Ne,qe)=>{!Ze||!Ae.activeId||(nn.saveUserNote({nodeId:Ze.id,text:te,sourceType:"chat",sourceAnchor:{type:"chat",threadId:Ae.activeId,msgId:fe,startOffset:Ne,endOffset:qe}}),Dt.show(e("toast.noteSaved"),{duration:2e3}))}}),f.jsx(NI,{nodeId:O,agentReady:(Pe==null?void 0:Pe.ready)??!1,streaming:ye.streaming,souls:Is,activeSoul:A,starterPrompts:ye.messages.length>0?Yr:[],onPickSoul:Qe,onSend:Kr,onStop:ye.stop,onLogFriction:O?(te,fe)=>{ae.logFriction(O,te,fe),Dt.show(e("chat.friction.saved"),{duration:2500})}:void 0,onGotoSettings:()=>j(!0),insertText:Re,historyTokens:Pl})]}):f.jsx("div",{className:"flex-1 flex items-center justify-center px-6","data-testid":"chat-no-course",children:f.jsxs("div",{className:"text-center max-w-sm",children:[f.jsx("div",{className:"text-5xl mb-4 opacity-30",children:"📚"}),f.jsx("div",{className:"text-title font-bold text-ink mb-2",children:e("course.empty.title")}),f.jsx("div",{className:"text-body text-ink-muted leading-relaxed",children:e("course.empty.desc")})]})})}),st&&f.jsx("main",{className:le===3?"flex-1 min-w-0 bg-surface-2":"flex-1 min-w-[440px] bg-surface-2","data-testid":le===3?"notebook-pane-full":void 0,children:f.jsx($M,{selectedNode:Ze,items:nn.items,loading:nn.loading,forceTab:B,canvasArtifact:Xt,onUserTabChange:()=>Q(null),onRemove:te=>{nn.remove(te),Dt.show(e("toast.noteDeleted"))},onTogglePin:te=>{nn.togglePin(te)},onRecordQuizResult:(te,fe)=>{nn.recordQuizResult(te,fe)},onUpdateNoteComment:(te,fe)=>{nn.updateUserNoteComment(te,fe)},onSaveContentNote:(te,fe)=>{Ze&&(nn.saveUserNote({nodeId:Ze.id,text:te,sourceType:"content",sourceAnchor:fe}),Dt.show(e("toast.noteSaved"),{duration:2e3}))},onJumpToSource:Jt,onQuoteToChat:dt,locale:v,isReviewing:jl,onReviewDone:()=>Bl(!1)})})]})]}),ne&&f.jsx(IO,{onClose:()=>j(!1)}),I3&&f.jsx(_O,{onClose:()=>Ol(!1),tree:r,dashboard:C,progressMap:i,onPickNode:te=>{Lt(()=>{R(te),Q("content"),Ol(!1),Bl(!0)})}}),V.open&&f.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50","data-testid":"exam-leave-modal",children:f.jsxs("div",{ref:Z,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:[f.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[f.jsx(vr,{className:"w-5 h-5 text-warning shrink-0"}),f.jsx("span",{className:"text-title font-bold text-ink",children:e("exam.leave.title")})]}),f.jsx("div",{className:"text-body text-ink-muted mb-5 leading-relaxed",children:e("exam.leave.message")}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx("button",{className:"btn-3d-neutral px-4 py-1.5 text-body",onClick:()=>q({open:!1,pendingAction:null}),"data-testid":"exam-leave-cancel",children:e("exam.leave.cancel")}),f.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 ot(),"data-testid":"exam-leave-confirm",children:e("exam.leave.confirm")})]})]})}),ft&&f.jsx(ZI,{onClose:()=>Xe(!1),onPick:te=>{Xe(!1),NO(te)},hasNode:!!O}),f.jsx(bv,{}),f.jsx(AO,{}),f.jsx(qI,{courseId:h})]})}function NO(e){window.dispatchEvent(new CustomEvent("lookatstudy-command",{detail:e}))}function MO({streak:e,xp:t,fontSize:n,onFontBump:r,onOpenSettings:a,leftVisible:i,rightVisible:s,onToggleLeft:o,onToggleRight:l,tier:u,bottomBar:c}){const h=$e();return c?f.jsx("header",{className:"app-header shrink-0",children:f.jsxs("div",{className:"flex items-center h-12 px-4",children:[f.jsx("div",{className:"flex-1 flex items-center min-w-0",children:t&&f.jsxs("div",{className:"flex items-center gap-1 shrink-0","data-testid":"xp-bar",title:h("header.energy"),children:[f.jsx(xc,{className:`w-3.5 h-3.5 text-brand ${t.todayXp>=100?"energy-breathe":""}`,fill:t.todayXp>=100?"currentColor":"none","aria-hidden":"true"}),f.jsx("span",{className:"text-label font-bold tabular-nums text-brand",children:t.todayXp})]})}),c,f.jsx("div",{className:"flex-1 flex items-center justify-end",children:f.jsx("button",{onClick:a,"data-testid":"header-settings","aria-label":h("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:h("header.settings"),children:f.jsx(No,{className:"w-4 h-4"})})})]})}):f.jsx("header",{className:"app-header shrink-0 flex flex-col",children:f.jsxs("div",{className:"flex items-center pt-2.5 pb-3 px-6 justify-between",children:[f.jsx("div",{className:"flex items-center gap-2 min-w-0",children:f.jsxs("h1",{className:"text-body font-extrabold tracking-tight text-neutral-900 dark:text-neutral-100 select-none min-w-0 truncate",children:["Lookat",f.jsx("span",{className:"text-brand",children:"Study"})]})}),f.jsxs("div",{className:"flex items-center gap-3",children:[u!==3&&f.jsxs("div",{className:"flex items-center gap-0.5",children:[f.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:h("header.toggleLeft"),children:f.jsx(By,{className:"w-4 h-4"})}),f.jsx("button",{onClick:l,"data-testid":"layout-toggle-right",className:`w-7 h-7 flex items-center justify-center rounded-md transition-colors ${s?"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:h("header.toggleRight"),children:f.jsx(Fy,{className:"w-4 h-4"})})]}),u!==3&&f.jsxs("div",{className:"flex items-center gap-0.5","data-testid":"font-size-control",children:[f.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:h("header.font.smaller"),children:"A-"}),f.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:h("header.font.larger"),children:"A+"})]}),t&&f.jsxs("div",{className:"flex items-center gap-1.5","data-testid":"xp-bar",title:h("header.energy"),children:[f.jsx(xc,{className:`w-3.5 h-3.5 text-brand ${t.todayXp>=100?"energy-breathe":""}`,fill:t.todayXp>=100?"currentColor":"none","aria-hidden":"true"}),f.jsx("div",{className:"w-16 h-2 bg-neutral-200 dark:bg-neutral-800 rounded-full overflow-hidden",children:f.jsx("div",{className:"h-full rounded-full bg-brand transition-all duration-500",style:{width:`${Math.min(100,Math.max(3,t.todayXp))}%`}})}),f.jsx("span",{className:"text-label font-bold tabular-nums text-brand",children:t.todayXp})]}),t&&f.jsx("div",{className:"flex items-center gap-1 px-2 py-0.5 rounded-full bg-brand/10","data-testid":"level-badge",title:h("header.level.title"),children:f.jsxs("span",{className:"text-label font-bold text-brand",children:["Lv.",t.level]})}),e&&f.jsx(LO,{streak:e}),f.jsx("button",{onClick:a,"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:h("header.settings"),children:f.jsx(No,{className:"w-4 h-4"})})]})]})})}function IO({onClose:e}){const t=$e(),n=w.useRef(null);return ni(n,!0),f.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end","data-testid":"settings-drawer",children:[f.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:e}),f.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:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)] shrink-0",children:[f.jsx("h2",{className:"text-body font-bold",children:t("settings.title")}),f.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:"✕"})]}),f.jsx("div",{className:"flex-1 overflow-y-auto",children:f.jsx(t_,{})})]})]})}function _O({onClose:e,tree:t,onPickNode:n,dashboard:r,progressMap:a}){const i=$e(),s=w.useRef(null);ni(s,!0);const[o,l]=w.useState([]);w.useEffect(()=>{ae.getAllSrsItems().then(T=>l(T)).catch(()=>l([]))},[]);const u=w.useMemo(()=>new Map(o.map(T=>[T.nodeId,T])),[o]),c=w.useMemo(()=>{const T=new Map(t.map(k=>[k.id,k])),N=o.filter(k=>T.has(k.nodeId));return{overdue:N.filter(k=>k.overdue),short:N.filter(k=>!k.overdue&&k.intervalDays>0&&k.intervalDays<=7),long:N.filter(k=>!k.overdue&&k.intervalDays>7),inactive:N.filter(k=>k.repetitions===0&&!k.overdue)}},[o,t]),h=w.useMemo(()=>t.filter(N=>N.type==="section"&&(N.world??"study")==="study").sort((N,k)=>N.orderIdx-k.orderIdx).map(N=>({section:N,lessons:t.filter(k=>k.parentId===N.id&&k.type==="lesson").sort((k,A)=>k.orderIdx-A.orderIdx)})),[t]),m=w.useMemo(()=>{const T=new Map;for(const N of(r==null?void 0:r.sections)??[])T.set(N.sectionId,N.avgMastery);return T},[r]),d=w.useMemo(()=>t.filter(T=>{var k;const N=(k=a[T.id])==null?void 0:k.status;return T.type==="lesson"&&(T.world??"study")==="study"&&(N==="in_progress"||N==="mastered")}),[t,a]),[p,g]=w.useState(new Set),x=T=>g(N=>{const k=new Set(N);return k.has(T)?k.delete(T):k.add(T),k}),b=T=>{const N=u.get(T);return N?N.overdue?{color:"bg-review",title:i("review.quadrant.overdue")}:N.intervalDays>0&&N.intervalDays<=7?{color:"bg-gold",title:i("review.quadrant.short")}:N.intervalDays>7?{color:"bg-brand",title:i("review.quadrant.long")}:null:null},v=c.overdue.length>0;return f.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end","data-testid":"review-drawer",children:[f.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:e}),f.jsxs("div",{ref:s,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:[f.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)] shrink-0",children:[f.jsxs("h2",{className:"text-body font-bold flex items-center gap-1.5",children:[f.jsx(sr,{className:"w-4 h-4","aria-hidden":"true"})," ",i("review.title")]}),f.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:"✕"})]}),f.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-5","data-testid":"review-panel",children:[d.length>0&&f.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:[f.jsx(Ky,{className:"w-4 h-4"}),i("review.interleave")]}),o.length>0&&f.jsxs("div",{children:[f.jsx("div",{className:"text-caption font-bold text-ink-muted uppercase tracking-wider mb-2",children:i("review.srsHint")}),f.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=>f.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 rounded-full bg-surface-3",children:[f.jsx("span",{className:`w-2 h-2 rounded-full ${T.dot}`}),f.jsx("span",{className:"text-label text-ink-muted",children:T.label}),f.jsx("span",{className:"text-label font-extrabold text-ink-strong tabular-nums",children:T.items.length})]},T.label))}),v&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"text-label text-ink-faint mb-1.5",children:i("review.overdueQuickHint")}),f.jsx("div",{className:"flex flex-wrap gap-1.5",children:c.overdue.slice(0,8).map(T=>{const N=t.find(k=>k.id===T.nodeId);return N?f.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:N.title},T.nodeId):null})})]})]}),h.length>0&&f.jsxs("div",{children:[f.jsx("div",{className:"text-caption font-bold text-ink-muted uppercase tracking-wider mb-2",children:i("review.myProgress")}),f.jsx("div",{className:"space-y-1",children:h.map(({section:T,lessons:N})=>{const k=Math.round((m.get(T.id)??0)*100),A=p.has(T.id),_=N.filter(S=>{var C;const I=(C=a[S.id])==null?void 0:C.status;return I==="in_progress"||I==="mastered"});return f.jsxs("div",{children:[f.jsxs("button",{onClick:()=>x(T.id),className:"w-full flex items-center gap-2 p-2 rounded-lg hover:bg-surface-3 transition-colors",children:[A?f.jsx(F0,{className:"w-3.5 h-3.5 text-ink-muted shrink-0"}):f.jsx(yy,{className:"w-3.5 h-3.5 text-ink-muted shrink-0"}),f.jsx("span",{className:"text-body text-ink-strong font-bold truncate flex-1 text-left",children:T.title}),_.length>0&&f.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[f.jsx("div",{className:"w-16 h-1.5 bg-surface-3 rounded-full overflow-hidden",children:f.jsx("div",{className:`h-full rounded-full ${k>=100?"bg-gold":"bg-brand"}`,style:{width:`${Math.max(3,k)}%`}})}),f.jsxs("span",{className:"text-label tabular-nums text-ink-muted w-8 text-right",children:[k,"%"]})]})]}),A&&f.jsx("div",{className:"ml-5 mt-0.5 mb-1 space-y-0.5","data-testid":"review-lesson-list",children:N.length===0?f.jsx("div",{className:"text-label text-ink-faint py-1.5 pl-1",children:"—"}):N.map(S=>{const I=a[S.id],C=I?Math.round((I.mastery??0)*100):null,D=b(S.id),L=(I==null?void 0:I.status)==="in_progress"||(I==null?void 0:I.status)==="mastered";return f.jsxs("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded-lg transition-colors ${(D==null?void 0:D.color)==="bg-review"?"bg-review/8":"hover:bg-surface-3"}`,children:[D?f.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${D.color} shrink-0`,title:D.title}):f.jsx("span",{className:"w-1.5 h-1.5 shrink-0"}),f.jsx("span",{className:`text-label truncate flex-1 ${L?"text-ink-strong":"text-ink-faint"}`,children:S.title}),C!==null&&f.jsxs("span",{className:"text-label tabular-nums text-ink-muted shrink-0 w-8 text-right",children:[C,"%"]}),L&&f.jsx("button",{onClick:()=>n(S.id),"data-testid":`review-lesson-${S.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")})]},S.id)})})]},T.id)})})]}),r&&r.frictionByNode.length>0&&f.jsxs("div",{children:[f.jsx("div",{className:"text-caption font-bold text-review uppercase tracking-wider mb-1.5",children:i("dashboard.mini.struggle")}),r.frictionByNode.map(T=>f.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:[f.jsxs("span",{className:"text-label text-review font-bold tabular-nums",children:[T.count,"×"]}),f.jsx("span",{className:"text-label text-ink-strong truncate flex-1",children:T.title})]},T.nodeId))]}),d.length===0&&o.length===0&&h.length===0&&f.jsxs("div",{className:"text-center py-16","data-testid":"review-empty",children:[f.jsx("div",{className:"text-4xl mb-3 opacity-30",children:"📖"}),f.jsx("div",{className:"text-body text-ink-muted",children:i("review.empty.title")}),f.jsx("div",{className:"text-label text-ink-faint mt-1",children:i("review.empty.desc")})]})]})]})]})}function RO({message:e,onClose:t}){const n=$e();return f.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:[f.jsxs("span",{children:["⚠️ ",e]}),f.jsx("button",{className:"ml-3 underline text-warning-light",onClick:t,children:n("action.close")})]})}function LO({streak:e}){const t=$e();return f.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:[f.jsx($p,{className:"w-4 h-4 text-review flame-flicker"}),f.jsx("span",{className:"text-body font-extrabold text-review",children:e.currentStreak}),e.freezeCount>0&&f.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:[f.jsx(Yy,{className:"w-3 h-3 text-review/80","aria-hidden":"true"}),f.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 DO({rejected:e}){const t=navigator.language.startsWith("zh"),[n,r]=B0.useState(""),a=i=>{i.preventDefault();const s=n.trim();if(!s)return;const o=s.includes("token=")?new URL(s).searchParams.get("token")??"":s;o&&Ao(async()=>{const{setWebToken:l}=await import("./api-web-DI50TDfG.js");return{setWebToken:l}},[],import.meta.url).then(({setWebToken:l})=>l(o))};return f.jsx("div",{className:"min-h-[var(--app-height,100vh)] bg-[#0e2a12] flex items-center justify-center p-6",children:f.jsxs("form",{onSubmit:a,className:"w-full max-w-sm text-center",children:[f.jsx("div",{className:"text-4xl mb-3",children:"🎈"}),f.jsx("h1",{className:"text-title font-bold text-white mb-1",children:"LookatStudy"}),f.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&&f.jsx("p",{className:"text-label text-warning-light mb-3",children:t?"上次的令牌被拒绝了,请重新输入":"Previous token was rejected, please re-enter"}),f.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"}),f.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"}),f.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 M3=oy.createRoot(document.getElementById("root"));function PO(){M3.render(f.jsx(B0.StrictMode,{children:f.jsx(zM,{children:f.jsx(CO,{})})}))}function Pp(e){M3.render(f.jsx(B0.StrictMode,{children:f.jsx(DO,{rejected:e})}))}async function OO(){const{installAppHeight:e}=await Ao(async()=>{const{installAppHeight:t}=await import("./app-height-D5bf5z0g.js");return{installAppHeight:t}},[],import.meta.url);if(e(),!window.api){const t=await Ao(()=>import("./api-web-DI50TDfG.js"),[],import.meta.url);if(window.addEventListener(t.TOKEN_REJECTED_EVENT,()=>Pp(!0)),!t.hasWebToken()){Pp(!1);return}try{await t.installWebApi()}catch(n){console.error("[boot] web api 安装失败:",n)}}PO()}OO();export{Ao as _};
|