lookatstudy-mobile 0.16.0 → 0.18.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/install-termux.sh +109 -26
- package/package.json +1 -1
- package/server.cjs +25306 -601
- package/web/assets/abnfDiagram-N423BO3Z-CU2Rg7X-.js +1 -0
- package/web/assets/api-web-DI50TDfG.js +1 -0
- package/web/assets/{arc-Bj7Boh6s.js → arc-CVHcrwtq.js} +1 -1
- package/web/assets/architectureDiagram-T3A2C74G-CbOpSoqA.js +36 -0
- package/web/assets/{blockDiagram-VBNYF7ZC-DAzIMkNI.js → blockDiagram-VBNYF7ZC-DkENfYJJ.js} +2 -2
- package/web/assets/{c4Diagram-5PPSVZJV-NlYvtXbZ.js → c4Diagram-5PPSVZJV-D2nKbUxh.js} +2 -2
- package/web/assets/channel-AThd-Hly.js +1 -0
- package/web/assets/{chunk-2GRJ4B5K-Cy2RZsUk.js → chunk-2GRJ4B5K-B2LBmawX.js} +1 -1
- package/web/assets/{chunk-2Q5K7J3B-DtK3xo3Z.js → chunk-2Q5K7J3B-ByZtx99c.js} +1 -1
- package/web/assets/{chunk-5RXB4S5H-CmVGejcd.js → chunk-5RXB4S5H-b6PGx0ql.js} +1 -1
- package/web/assets/{chunk-5VM5RSS4-EO_k0Crh.js → chunk-5VM5RSS4-wmKKoEHl.js} +1 -1
- package/web/assets/{chunk-6Q2QTUOP-TBVy-R-c.js → chunk-6Q2QTUOP-CZ89fwLd.js} +1 -1
- package/web/assets/{chunk-GF5L2VYU-_N0jD1tE.js → chunk-GF5L2VYU-3EIIkl6Y.js} +1 -1
- package/web/assets/{chunk-JWPE2WC7-BIAuolFx.js → chunk-JWPE2WC7-CdCWYrp8.js} +1 -1
- package/web/assets/{chunk-KBJHAD2P-DqcnXfI8.js → chunk-KBJHAD2P-CmZTgHqr.js} +1 -1
- package/web/assets/{chunk-RYQCIY6F-D5RQKqlg.js → chunk-RYQCIY6F-DfyARx_z.js} +1 -1
- package/web/assets/{chunk-XXDRQBXY-1Ksx_dPa.js → chunk-XXDRQBXY-DIoEGjYu.js} +1 -1
- package/web/assets/classDiagram-JCYQIIEL-Ccd6qf2i.js +1 -0
- package/web/assets/classDiagram-v2-OCEON4UE-Ccd6qf2i.js +1 -0
- package/web/assets/cose-bilkent-JH36ORCC-BktEcSRI.js +1 -0
- package/web/assets/{cynefin-VYW2F7L2-CAYbjl57.js → cynefin-VYW2F7L2-sXHUKhTr.js} +1 -1
- package/web/assets/cynefinDiagram-MW4NZA55-CQvZqGMF.js +62 -0
- package/web/assets/{dagre-VZM6K2ZE-CKP3kBHM.js → dagre-VZM6K2ZE-BgVOc66g.js} +2 -2
- package/web/assets/{diagram-7IWD3JNH-CLfr8NaW.js → diagram-7IWD3JNH-CqXnEFCF.js} +2 -2
- package/web/assets/{diagram-B4RE2ZJO-h051w7zn.js → diagram-B4RE2ZJO-CbG6ewsb.js} +2 -2
- package/web/assets/diagram-LBJQPF4R-qCVZtiwb.js +24 -0
- package/web/assets/diagram-Q27KOJAE-fRbvC_4J.js +24 -0
- package/web/assets/diagram-UB23O5K3-DYruB-zm.js +41 -0
- package/web/assets/ebnfDiagram-BXEA7PRR-BKbJqSDg.js +1 -0
- package/web/assets/{erDiagram-JOGREHBK-Bz30kI2B.js → erDiagram-JOGREHBK-anDPN9Fg.js} +2 -2
- package/web/assets/{flowDiagram-UKHOOZJN-CsFP_-KD.js → flowDiagram-UKHOOZJN-DlMRxaQ8.js} +1 -1
- package/web/assets/ganttDiagram-PKOTCBZU-BoCCJylo.js +292 -0
- package/web/assets/gitGraphDiagram-DS77QQ5N-D37HEJEv.js +106 -0
- package/web/assets/index-CeFnA9sR.js +53 -0
- package/web/assets/index-D8iAKGNi.css +1 -0
- package/web/assets/infoDiagram-6WML65LV-Cp2uwsRp.js +2 -0
- package/web/assets/{ishikawaDiagram-WSZJBQD7-Bt6EfUkc.js → ishikawaDiagram-WSZJBQD7-IDCvF8oq.js} +2 -2
- package/web/assets/{journeyDiagram-NVQOT4AX-DmVq_JOG.js → journeyDiagram-NVQOT4AX-CqJjuMRj.js} +2 -2
- package/web/assets/{kanban-definition-27J2QSJJ-tE00W58E.js → kanban-definition-27J2QSJJ-Bzy4l8Im.js} +2 -2
- package/web/assets/{linear-CAqnKu9J.js → linear-BYt2jke2.js} +1 -1
- package/web/assets/main-BaffLdJi.js +528 -0
- package/web/assets/{mermaid.core-uJSxER2x.js → mermaid.core-ChBcV6rX.js} +11 -11
- package/web/assets/{mindmap-definition-FAOFIHXS-D5S_P9_s.js → mindmap-definition-FAOFIHXS-BiQCF2qx.js} +2 -2
- package/web/assets/pegDiagram-VL7TDLO6-JrAhM2Rh.js +1 -0
- package/web/assets/pet-CTf4hJTR.css +1 -0
- package/web/assets/pet-f5Q8AEiU.js +1 -0
- package/web/assets/{pieDiagram-7S7Q4E2Y-DYpiHnao.js → pieDiagram-7S7Q4E2Y-DNB9KI82.js} +2 -2
- package/web/assets/{quadrantDiagram-CIZ2JOQS-BqycGz7D.js → quadrantDiagram-CIZ2JOQS-D9CQH6qH.js} +4 -4
- package/web/assets/railroadDiagram-AXF67PYL-GRAK-BbS.js +1 -0
- package/web/assets/{requirementDiagram-LRYGKXZP-CH-xotLo.js → requirementDiagram-LRYGKXZP-CTFmkmvv.js} +2 -2
- package/web/assets/{sankeyDiagram-W5VNT64P-BCLFObl1.js → sankeyDiagram-W5VNT64P-ocFhBtMa.js} +2 -2
- package/web/assets/{sequenceDiagram-SI44F4Z6-CE1T-Oar.js → sequenceDiagram-SI44F4Z6-itHtrU2O.js} +2 -2
- package/web/assets/sizeCapture-X5ZJPWSS-Bj_0p16L.js +1 -0
- package/web/assets/stateDiagram-OKZ733FA-BZ3FXzdZ.js +1 -0
- package/web/assets/stateDiagram-v2-UEYNNEHI-DacbF0mj.js +1 -0
- package/web/assets/swimlanes-SLNWSIFB-nlxlUqVN.js +2 -0
- package/web/assets/swimlanesDiagram-ULZ7WXOC-Bk858mY5.js +8 -0
- package/web/assets/{timeline-definition-Z64GVDOM-CPajwTED.js → timeline-definition-Z64GVDOM-B-IqLhkR.js} +2 -2
- package/web/assets/{vennDiagram-T6HMQDX7-DKkB137-.js → vennDiagram-T6HMQDX7-Dr1sgkuO.js} +2 -2
- package/web/assets/{wardleyDiagram-T6FBY63Y-CHD6tq1V.js → wardleyDiagram-T6FBY63Y-BOOJsnbk.js} +2 -2
- package/web/assets/{xychartDiagram-ELKLHX3M-DIO9Q6BD.js → xychartDiagram-ELKLHX3M-Bb3lgEh4.js} +2 -2
- package/web/index.html +3 -2
- package/web/pet.html +19 -0
- package/web/assets/abnfDiagram-N423BO3Z-uVyZuC2D.js +0 -1
- package/web/assets/api-web-BydHmVA4.js +0 -1
- package/web/assets/architectureDiagram-T3A2C74G-CrbkXNQp.js +0 -36
- package/web/assets/channel-JNlIjRLZ.js +0 -1
- package/web/assets/classDiagram-JCYQIIEL-C-12RKGI.js +0 -1
- package/web/assets/classDiagram-v2-OCEON4UE-C-12RKGI.js +0 -1
- package/web/assets/cose-bilkent-JH36ORCC-DAUofPwo.js +0 -1
- package/web/assets/cynefinDiagram-MW4NZA55-UaEI49aN.js +0 -62
- package/web/assets/diagram-LBJQPF4R-CUOsO4df.js +0 -24
- package/web/assets/diagram-Q27KOJAE-BXbJxAlu.js +0 -24
- package/web/assets/diagram-UB23O5K3-BHV6tpU9.js +0 -41
- package/web/assets/ebnfDiagram-BXEA7PRR-CAahAB9-.js +0 -1
- package/web/assets/ganttDiagram-PKOTCBZU-Cm5qe_5U.js +0 -292
- package/web/assets/gitGraphDiagram-DS77QQ5N-DNktj2Kq.js +0 -106
- package/web/assets/index-BC_sP79K.js +0 -563
- package/web/assets/index-BSTI-ywB.css +0 -1
- package/web/assets/infoDiagram-6WML65LV-vZK5e7Xx.js +0 -2
- package/web/assets/pegDiagram-VL7TDLO6-BZkaiQ_9.js +0 -1
- package/web/assets/railroadDiagram-AXF67PYL-DEoY1V9D.js +0 -1
- package/web/assets/sizeCapture-X5ZJPWSS-uf4-mQAU.js +0 -1
- package/web/assets/stateDiagram-OKZ733FA-Dt2wQF9A.js +0 -1
- package/web/assets/stateDiagram-v2-UEYNNEHI-BbJD6fMT.js +0 -1
- package/web/assets/swimlanes-SLNWSIFB-jLXDXtjZ.js +0 -2
- package/web/assets/swimlanesDiagram-ULZ7WXOC-BTdV0I38.js +0 -8
|
@@ -1,563 +0,0 @@
|
|
|
1
|
-
var GA=Object.defineProperty;var XA=(e,t,n)=>t in e?GA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Kh=(e,t,n)=>XA(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();const KA="modulepreload",$A=function(e,t){return new URL(e,t).href},Jb={},qc=function(t,n,i){let o=Promise.resolve();if(n&&n.length>0){let l=function(p){return Promise.all(p.map(x=>Promise.resolve(x).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};const c=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),f=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));o=l(n.map(p=>{if(p=$A(p,i),p in Jb)return;Jb[p]=!0;const x=p.endsWith(".css"),b=x?'[rel="stylesheet"]':"";if(!!i)for(let E=c.length-1;E>=0;E--){const T=c[E];if(T.href===p&&(!x||T.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${p}"]${b}`))return;const y=document.createElement("link");if(y.rel=x?"stylesheet":KA,x||(y.as="script"),y.crossOrigin="",y.href=p,f&&y.setAttribute("nonce",f),document.head.appendChild(y),x)return new Promise((E,T)=>{y.addEventListener("load",E),y.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${p}`)))})}))}function s(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return o.then(l=>{for(const c of l||[])c.status==="rejected"&&s(c.reason);return t().catch(s)})};var ey=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ol(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $h={exports:{}},Yo={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var ty;function QA(){if(ty)return Yo;ty=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(i,o,s){var l=null;if(s!==void 0&&(l=""+s),o.key!==void 0&&(l=""+o.key),"key"in o){s={};for(var c in o)c!=="key"&&(s[c]=o[c])}else s=o;return o=s.ref,{$$typeof:e,type:i,key:l,ref:o!==void 0?o:null,props:s}}return Yo.Fragment=t,Yo.jsx=n,Yo.jsxs=n,Yo}var ny;function WA(){return ny||(ny=1,$h.exports=QA()),$h.exports}var m=WA(),Qh={exports:{}},Qe={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var ay;function ZA(){if(ay)return Qe;ay=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),b=Symbol.iterator;function g(Y){return Y===null||typeof Y!="object"?null:(Y=b&&Y[b]||Y["@@iterator"],typeof Y=="function"?Y:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,T={};function w(Y,W,U){this.props=Y,this.context=W,this.refs=T,this.updater=U||y}w.prototype.isReactComponent={},w.prototype.setState=function(Y,W){if(typeof Y!="object"&&typeof Y!="function"&&Y!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,Y,W,"setState")},w.prototype.forceUpdate=function(Y){this.updater.enqueueForceUpdate(this,Y,"forceUpdate")};function M(){}M.prototype=w.prototype;function _(Y,W,U){this.props=Y,this.context=W,this.refs=T,this.updater=U||y}var L=_.prototype=new M;L.constructor=_,E(L,w.prototype),L.isPureReactComponent=!0;var A=Array.isArray;function R(){}var j={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function I(Y,W,U){var ae=U.ref;return{$$typeof:e,type:Y,key:W,ref:ae!==void 0?ae:null,props:U}}function D(Y,W){return I(Y.type,W,Y.props)}function P(Y){return typeof Y=="object"&&Y!==null&&Y.$$typeof===e}function z(Y){var W={"=":"=0",":":"=2"};return"$"+Y.replace(/[=:]/g,function(U){return W[U]})}var K=/\/+/g;function q(Y,W){return typeof Y=="object"&&Y!==null&&Y.key!=null?z(""+Y.key):W.toString(36)}function B(Y){switch(Y.status){case"fulfilled":return Y.value;case"rejected":throw Y.reason;default:switch(typeof Y.status=="string"?Y.then(R,R):(Y.status="pending",Y.then(function(W){Y.status==="pending"&&(Y.status="fulfilled",Y.value=W)},function(W){Y.status==="pending"&&(Y.status="rejected",Y.reason=W)})),Y.status){case"fulfilled":return Y.value;case"rejected":throw Y.reason}}throw Y}function H(Y,W,U,ae,J){var ne=typeof Y;(ne==="undefined"||ne==="boolean")&&(Y=null);var me=!1;if(Y===null)me=!0;else switch(ne){case"bigint":case"string":case"number":me=!0;break;case"object":switch(Y.$$typeof){case e:case t:me=!0;break;case p:return me=Y._init,H(me(Y._payload),W,U,ae,J)}}if(me)return J=J(Y),me=ae===""?"."+q(Y,0):ae,A(J)?(U="",me!=null&&(U=me.replace(K,"$&/")+"/"),H(J,W,U,"",function(Fe){return Fe})):J!=null&&(P(J)&&(J=D(J,U+(J.key==null||Y&&Y.key===J.key?"":(""+J.key).replace(K,"$&/")+"/")+me)),W.push(J)),1;me=0;var Z=ae===""?".":ae+":";if(A(Y))for(var we=0;we<Y.length;we++)ae=Y[we],ne=Z+q(ae,we),me+=H(ae,W,U,ne,J);else if(we=g(Y),typeof we=="function")for(Y=we.call(Y),we=0;!(ae=Y.next()).done;)ae=ae.value,ne=Z+q(ae,we++),me+=H(ae,W,U,ne,J);else if(ne==="object"){if(typeof Y.then=="function")return H(B(Y),W,U,ae,J);throw W=String(Y),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(Y).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.")}return me}function G(Y,W,U){if(Y==null)return Y;var ae=[],J=0;return H(Y,ae,"","",function(ne){return W.call(U,ne,J++)}),ae}function Q(Y){if(Y._status===-1){var W=Y._result;W=W(),W.then(function(U){(Y._status===0||Y._status===-1)&&(Y._status=1,Y._result=U)},function(U){(Y._status===0||Y._status===-1)&&(Y._status=2,Y._result=U)}),Y._status===-1&&(Y._status=0,Y._result=W)}if(Y._status===1)return Y._result.default;throw Y._result}var re=typeof reportError=="function"?reportError:function(Y){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var W=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof Y=="object"&&Y!==null&&typeof Y.message=="string"?String(Y.message):String(Y),error:Y});if(!window.dispatchEvent(W))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",Y);return}console.error(Y)},F={map:G,forEach:function(Y,W,U){G(Y,function(){W.apply(this,arguments)},U)},count:function(Y){var W=0;return G(Y,function(){W++}),W},toArray:function(Y){return G(Y,function(W){return W})||[]},only:function(Y){if(!P(Y))throw Error("React.Children.only expected to receive a single React element child.");return Y}};return Qe.Activity=x,Qe.Children=F,Qe.Component=w,Qe.Fragment=n,Qe.Profiler=o,Qe.PureComponent=_,Qe.StrictMode=i,Qe.Suspense=d,Qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,Qe.__COMPILER_RUNTIME={__proto__:null,c:function(Y){return j.H.useMemoCache(Y)}},Qe.cache=function(Y){return function(){return Y.apply(null,arguments)}},Qe.cacheSignal=function(){return null},Qe.cloneElement=function(Y,W,U){if(Y==null)throw Error("The argument must be a React element, but you passed "+Y+".");var ae=E({},Y.props),J=Y.key;if(W!=null)for(ne in W.key!==void 0&&(J=""+W.key),W)!N.call(W,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&W.ref===void 0||(ae[ne]=W[ne]);var ne=arguments.length-2;if(ne===1)ae.children=U;else if(1<ne){for(var me=Array(ne),Z=0;Z<ne;Z++)me[Z]=arguments[Z+2];ae.children=me}return I(Y.type,J,ae)},Qe.createContext=function(Y){return Y={$$typeof:l,_currentValue:Y,_currentValue2:Y,_threadCount:0,Provider:null,Consumer:null},Y.Provider=Y,Y.Consumer={$$typeof:s,_context:Y},Y},Qe.createElement=function(Y,W,U){var ae,J={},ne=null;if(W!=null)for(ae in W.key!==void 0&&(ne=""+W.key),W)N.call(W,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(J[ae]=W[ae]);var me=arguments.length-2;if(me===1)J.children=U;else if(1<me){for(var Z=Array(me),we=0;we<me;we++)Z[we]=arguments[we+2];J.children=Z}if(Y&&Y.defaultProps)for(ae in me=Y.defaultProps,me)J[ae]===void 0&&(J[ae]=me[ae]);return I(Y,ne,J)},Qe.createRef=function(){return{current:null}},Qe.forwardRef=function(Y){return{$$typeof:c,render:Y}},Qe.isValidElement=P,Qe.lazy=function(Y){return{$$typeof:p,_payload:{_status:-1,_result:Y},_init:Q}},Qe.memo=function(Y,W){return{$$typeof:f,type:Y,compare:W===void 0?null:W}},Qe.startTransition=function(Y){var W=j.T,U={};j.T=U;try{var ae=Y(),J=j.S;J!==null&&J(U,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(R,re)}catch(ne){re(ne)}finally{W!==null&&U.types!==null&&(W.types=U.types),j.T=W}},Qe.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},Qe.use=function(Y){return j.H.use(Y)},Qe.useActionState=function(Y,W,U){return j.H.useActionState(Y,W,U)},Qe.useCallback=function(Y,W){return j.H.useCallback(Y,W)},Qe.useContext=function(Y){return j.H.useContext(Y)},Qe.useDebugValue=function(){},Qe.useDeferredValue=function(Y,W){return j.H.useDeferredValue(Y,W)},Qe.useEffect=function(Y,W){return j.H.useEffect(Y,W)},Qe.useEffectEvent=function(Y){return j.H.useEffectEvent(Y)},Qe.useId=function(){return j.H.useId()},Qe.useImperativeHandle=function(Y,W,U){return j.H.useImperativeHandle(Y,W,U)},Qe.useInsertionEffect=function(Y,W){return j.H.useInsertionEffect(Y,W)},Qe.useLayoutEffect=function(Y,W){return j.H.useLayoutEffect(Y,W)},Qe.useMemo=function(Y,W){return j.H.useMemo(Y,W)},Qe.useOptimistic=function(Y,W){return j.H.useOptimistic(Y,W)},Qe.useReducer=function(Y,W,U){return j.H.useReducer(Y,W,U)},Qe.useRef=function(Y){return j.H.useRef(Y)},Qe.useState=function(Y){return j.H.useState(Y)},Qe.useSyncExternalStore=function(Y,W,U){return j.H.useSyncExternalStore(Y,W,U)},Qe.useTransition=function(){return j.H.useTransition()},Qe.version="19.2.8",Qe}var iy;function rp(){return iy||(iy=1,Qh.exports=ZA()),Qh.exports}var C=rp();const sp=Ol(C);var Wh={exports:{}},Go={},Zh={exports:{}},Jh={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var ry;function JA(){return ry||(ry=1,(function(e){function t(H,G){var Q=H.length;H.push(G);e:for(;0<Q;){var re=Q-1>>>1,F=H[re];if(0<o(F,G))H[re]=G,H[Q]=F,Q=re;else break e}}function n(H){return H.length===0?null:H[0]}function i(H){if(H.length===0)return null;var G=H[0],Q=H.pop();if(Q!==G){H[0]=Q;e:for(var re=0,F=H.length,Y=F>>>1;re<Y;){var W=2*(re+1)-1,U=H[W],ae=W+1,J=H[ae];if(0>o(U,Q))ae<F&&0>o(J,U)?(H[re]=J,H[ae]=Q,re=ae):(H[re]=U,H[W]=Q,re=W);else if(ae<F&&0>o(J,Q))H[re]=J,H[ae]=Q,re=ae;else break e}}return G}function o(H,G){var Q=H.sortIndex-G.sortIndex;return Q!==0?Q:H.id-G.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var d=[],f=[],p=1,x=null,b=3,g=!1,y=!1,E=!1,T=!1,w=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function L(H){for(var G=n(f);G!==null;){if(G.callback===null)i(f);else if(G.startTime<=H)i(f),G.sortIndex=G.expirationTime,t(d,G);else break;G=n(f)}}function A(H){if(E=!1,L(H),!y)if(n(d)!==null)y=!0,R||(R=!0,z());else{var G=n(f);G!==null&&B(A,G.startTime-H)}}var R=!1,j=-1,N=5,I=-1;function D(){return T?!0:!(e.unstable_now()-I<N)}function P(){if(T=!1,R){var H=e.unstable_now();I=H;var G=!0;try{e:{y=!1,E&&(E=!1,M(j),j=-1),g=!0;var Q=b;try{t:{for(L(H),x=n(d);x!==null&&!(x.expirationTime>H&&D());){var re=x.callback;if(typeof re=="function"){x.callback=null,b=x.priorityLevel;var F=re(x.expirationTime<=H);if(H=e.unstable_now(),typeof F=="function"){x.callback=F,L(H),G=!0;break t}x===n(d)&&i(d),L(H)}else i(d);x=n(d)}if(x!==null)G=!0;else{var Y=n(f);Y!==null&&B(A,Y.startTime-H),G=!1}}break e}finally{x=null,b=Q,g=!1}G=void 0}}finally{G?z():R=!1}}}var z;if(typeof _=="function")z=function(){_(P)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,q=K.port2;K.port1.onmessage=P,z=function(){q.postMessage(null)}}else z=function(){w(P,0)};function B(H,G){j=w(function(){H(e.unstable_now())},G)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(H){switch(b){case 1:case 2:case 3:var G=3;break;default:G=b}var Q=b;b=G;try{return H()}finally{b=Q}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(H,G){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var Q=b;b=H;try{return G()}finally{b=Q}},e.unstable_scheduleCallback=function(H,G,Q){var re=e.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?re+Q:re):Q=re,H){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=Q+F,H={id:p++,callback:G,priorityLevel:H,startTime:Q,expirationTime:F,sortIndex:-1},Q>re?(H.sortIndex=Q,t(f,H),n(d)===null&&H===n(f)&&(E?(M(j),j=-1):E=!0,B(A,Q-re))):(H.sortIndex=F,t(d,H),y||g||(y=!0,R||(R=!0,z()))),H},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(H){var G=b;return function(){var Q=b;b=G;try{return H.apply(this,arguments)}finally{b=Q}}}})(Jh)),Jh}var sy;function eC(){return sy||(sy=1,Zh.exports=JA()),Zh.exports}var em={exports:{}},gn={};/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var oy;function tC(){if(oy)return gn;oy=1;var e=rp();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function s(d,f,p){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:x==null?null:""+x,children:d,containerInfo:f,implementation:p}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return gn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,gn.createPortal=function(d,f){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return s(d,f,null,p)},gn.flushSync=function(d){var f=l.T,p=i.p;try{if(l.T=null,i.p=2,d)return d()}finally{l.T=f,i.p=p,i.d.f()}},gn.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,i.d.C(d,f))},gn.prefetchDNS=function(d){typeof d=="string"&&i.d.D(d)},gn.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var p=f.as,x=c(p,f.crossOrigin),b=typeof f.integrity=="string"?f.integrity:void 0,g=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?i.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:x,integrity:b,fetchPriority:g}):p==="script"&&i.d.X(d,{crossOrigin:x,integrity:b,fetchPriority:g,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},gn.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=c(f.as,f.crossOrigin);i.d.M(d,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&i.d.M(d)},gn.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,x=c(p,f.crossOrigin);i.d.L(d,p,{crossOrigin:x,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},gn.preloadModule=function(d,f){if(typeof d=="string")if(f){var p=c(f.as,f.crossOrigin);i.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else i.d.m(d)},gn.requestFormReset=function(d){i.d.r(d)},gn.unstable_batchedUpdates=function(d,f){return d(f)},gn.useFormState=function(d,f,p){return l.H.useFormState(d,f,p)},gn.useFormStatus=function(){return l.H.useHostTransitionStatus()},gn.version="19.2.8",gn}var ly;function xE(){if(ly)return em.exports;ly=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),em.exports=tC(),em.exports}/**
|
|
34
|
-
* @license React
|
|
35
|
-
* react-dom-client.production.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var uy;function nC(){if(uy)return Go;uy=1;var e=eC(),t=rp(),n=xE();function i(a){var r="https://react.dev/errors/"+a;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)r+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+a+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function s(a){var r=a,u=a;if(a.alternate)for(;r.return;)r=r.return;else{a=r;do r=a,(r.flags&4098)!==0&&(u=r.return),a=r.return;while(a)}return r.tag===3?u:null}function l(a){if(a.tag===13){var r=a.memoizedState;if(r===null&&(a=a.alternate,a!==null&&(r=a.memoizedState)),r!==null)return r.dehydrated}return null}function c(a){if(a.tag===31){var r=a.memoizedState;if(r===null&&(a=a.alternate,a!==null&&(r=a.memoizedState)),r!==null)return r.dehydrated}return null}function d(a){if(s(a)!==a)throw Error(i(188))}function f(a){var r=a.alternate;if(!r){if(r=s(a),r===null)throw Error(i(188));return r!==a?null:a}for(var u=a,h=r;;){var v=u.return;if(v===null)break;var S=v.alternate;if(S===null){if(h=v.return,h!==null){u=h;continue}break}if(v.child===S.child){for(S=v.child;S;){if(S===u)return d(v),a;if(S===h)return d(v),r;S=S.sibling}throw Error(i(188))}if(u.return!==h.return)u=v,h=S;else{for(var O=!1,V=v.child;V;){if(V===u){O=!0,u=v,h=S;break}if(V===h){O=!0,h=v,u=S;break}V=V.sibling}if(!O){for(V=S.child;V;){if(V===u){O=!0,u=S,h=v;break}if(V===h){O=!0,h=S,u=v;break}V=V.sibling}if(!O)throw Error(i(189))}}if(u.alternate!==h)throw Error(i(190))}if(u.tag!==3)throw Error(i(188));return u.stateNode.current===u?a:r}function p(a){var r=a.tag;if(r===5||r===26||r===27||r===6)return a;for(a=a.child;a!==null;){if(r=p(a),r!==null)return r;a=a.sibling}return null}var x=Object.assign,b=Symbol.for("react.element"),g=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),_=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),D=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function z(a){return a===null||typeof a!="object"?null:(a=P&&a[P]||a["@@iterator"],typeof a=="function"?a:null)}var K=Symbol.for("react.client.reference");function q(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===K?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case E:return"Fragment";case w:return"Profiler";case T:return"StrictMode";case A:return"Suspense";case R:return"SuspenseList";case I:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case y:return"Portal";case _:return a.displayName||"Context";case M:return(a._context.displayName||"Context")+".Consumer";case L:var r=a.render;return a=a.displayName,a||(a=r.displayName||r.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case j:return r=a.displayName||null,r!==null?r:q(a.type)||"Memo";case N:r=a._payload,a=a._init;try{return q(a(r))}catch{}}return null}var B=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},re=[],F=-1;function Y(a){return{current:a}}function W(a){0>F||(a.current=re[F],re[F]=null,F--)}function U(a,r){F++,re[F]=a.current,a.current=r}var ae=Y(null),J=Y(null),ne=Y(null),me=Y(null);function Z(a,r){switch(U(ne,r),U(J,a),U(ae,null),r.nodeType){case 9:case 11:a=(a=r.documentElement)&&(a=a.namespaceURI)?Tb(a):0;break;default:if(a=r.tagName,r=r.namespaceURI)r=Tb(r),a=Sb(r,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}W(ae),U(ae,a)}function we(){W(ae),W(J),W(ne)}function Fe(a){a.memoizedState!==null&&U(me,a);var r=ae.current,u=Sb(r,a.type);r!==u&&(U(J,a),U(ae,u))}function Se(a){J.current===a&&(W(ae),W(J)),me.current===a&&(W(me),Ho._currentValue=Q)}var ve,Oe;function Ie(a){if(ve===void 0)try{throw Error()}catch(u){var r=u.stack.trim().match(/\n( *(at )?)/);ve=r&&r[1]||"",Oe=-1<u.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+ve+a+Oe}var $e=!1;function Nt(a,r){if(!a||$e)return"";$e=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(r){var ke=function(){throw Error()};if(Object.defineProperty(ke.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ke,[])}catch(ge){var he=ge}Reflect.construct(a,[],ke)}else{try{ke.call()}catch(ge){he=ge}a.call(ke.prototype)}}else{try{throw Error()}catch(ge){he=ge}(ke=a())&&typeof ke.catch=="function"&&ke.catch(function(){})}}catch(ge){if(ge&&he&&typeof ge.stack=="string")return[ge.stack,he.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=h.DetermineComponentFrameRoot(),O=S[0],V=S[1];if(O&&V){var te=O.split(`
|
|
44
|
-
`),de=V.split(`
|
|
45
|
-
`);for(v=h=0;h<te.length&&!te[h].includes("DetermineComponentFrameRoot");)h++;for(;v<de.length&&!de[v].includes("DetermineComponentFrameRoot");)v++;if(h===te.length||v===de.length)for(h=te.length-1,v=de.length-1;1<=h&&0<=v&&te[h]!==de[v];)v--;for(;1<=h&&0<=v;h--,v--)if(te[h]!==de[v]){if(h!==1||v!==1)do if(h--,v--,0>v||te[h]!==de[v]){var be=`
|
|
46
|
-
`+te[h].replace(" at new "," at ");return a.displayName&&be.includes("<anonymous>")&&(be=be.replace("<anonymous>",a.displayName)),be}while(1<=h&&0<=v);break}}}finally{$e=!1,Error.prepareStackTrace=u}return(u=a?a.displayName||a.name:"")?Ie(u):""}function Ot(a,r){switch(a.tag){case 26:case 27:case 5:return Ie(a.type);case 16:return Ie("Lazy");case 13:return a.child!==r&&r!==null?Ie("Suspense Fallback"):Ie("Suspense");case 19:return Ie("SuspenseList");case 0:case 15:return Nt(a.type,!1);case 11:return Nt(a.type.render,!1);case 1:return Nt(a.type,!0);case 31:return Ie("Activity");default:return""}}function Te(a){try{var r="",u=null;do r+=Ot(a,u),u=a,a=a.return;while(a);return r}catch(h){return`
|
|
47
|
-
Error generating stack: `+h.message+`
|
|
48
|
-
`+h.stack}}var Ze=Object.prototype.hasOwnProperty,rt=e.unstable_scheduleCallback,bt=e.unstable_cancelCallback,gt=e.unstable_shouldYield,lt=e.unstable_requestPaint,st=e.unstable_now,Ue=e.unstable_getCurrentPriorityLevel,pe=e.unstable_ImmediatePriority,Ce=e.unstable_UserBlockingPriority,je=e.unstable_NormalPriority,Le=e.unstable_LowPriority,at=e.unstable_IdlePriority,Me=e.log,tt=e.unstable_setDisableYieldValue,We=null,se=null;function qe(a){if(typeof Me=="function"&&tt(a),se&&typeof se.setStrictMode=="function")try{se.setStrictMode(We,a)}catch{}}var Je=Math.clz32?Math.clz32:Ur,Ft=Math.log,it=Math.LN2;function Ur(a){return a>>>=0,a===0?32:31-(Ft(a)/it|0)|0}var pn=256,ci=262144,On=4194304;function la(a){var r=a&42;if(r!==0)return r;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Ki(a,r,u){var h=a.pendingLanes;if(h===0)return 0;var v=0,S=a.suspendedLanes,O=a.pingedLanes;a=a.warmLanes;var V=h&134217727;return V!==0?(h=V&~S,h!==0?v=la(h):(O&=V,O!==0?v=la(O):u||(u=V&~a,u!==0&&(v=la(u))))):(V=h&~S,V!==0?v=la(V):O!==0?v=la(O):u||(u=h&~a,u!==0&&(v=la(u)))),v===0?0:r!==0&&r!==v&&(r&S)===0&&(S=v&-v,u=r&-r,S>=u||S===32&&(u&4194048)!==0)?r:v}function di(a,r){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&r)===0}function Hr(a,r){switch(a){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Fr(){var a=On;return On<<=1,(On&62914560)===0&&(On=4194304),a}function $i(a){for(var r=[],u=0;31>u;u++)r.push(a);return r}function Qi(a,r){a.pendingLanes|=r,r!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Bd(a,r,u,h,v,S){var O=a.pendingLanes;a.pendingLanes=u,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=u,a.entangledLanes&=u,a.errorRecoveryDisabledLanes&=u,a.shellSuspendCounter=0;var V=a.entanglements,te=a.expirationTimes,de=a.hiddenUpdates;for(u=O&~u;0<u;){var be=31-Je(u),ke=1<<be;V[be]=0,te[be]=-1;var he=de[be];if(he!==null)for(de[be]=null,be=0;be<he.length;be++){var ge=he[be];ge!==null&&(ge.lane&=-536870913)}u&=~ke}h!==0&&Ql(a,h,0),S!==0&&v===0&&a.tag!==0&&(a.suspendedLanes|=S&~(O&~r))}function Ql(a,r,u){a.pendingLanes|=r,a.suspendedLanes&=~r;var h=31-Je(r);a.entangledLanes|=r,a.entanglements[h]=a.entanglements[h]|1073741824|u&261930}function Wl(a,r){var u=a.entangledLanes|=r;for(a=a.entanglements;u;){var h=31-Je(u),v=1<<h;v&r|a[h]&r&&(a[h]|=r),u&=~v}}function Zl(a,r){var u=r&-r;return u=(u&42)!==0?1:Ws(u),(u&(a.suspendedLanes|r))!==0?0:u}function Ws(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function Wi(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function Zs(){var a=G.p;return a!==0?a:(a=window.event,a===void 0?32:Gb(a.type))}function Zi(a,r){var u=G.p;try{return G.p=a,r()}finally{G.p=u}}var va=Math.random().toString(36).slice(2),nn="__reactFiber$"+va,kt="__reactProps$"+va,Pa="__reactContainer$"+va,Ut="__reactEvents$"+va,zd="__reactListeners$"+va,Js="__reactHandles$"+va,eo="__reactResources$"+va,Ji="__reactMarker$"+va;function Vr(a){delete a[nn],delete a[kt],delete a[Ut],delete a[zd],delete a[Js]}function Gn(a){var r=a[nn];if(r)return r;for(var u=a.parentNode;u;){if(r=u[Pa]||u[nn]){if(u=r.alternate,r.child!==null||u!==null&&u.child!==null)for(a=Mb(a);a!==null;){if(u=a[nn])return u;a=Mb(a)}return r}a=u,u=a.parentNode}return null}function Ba(a){if(a=a[nn]||a[Pa]){var r=a.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return a}return null}function er(a){var r=a.tag;if(r===5||r===26||r===27||r===6)return a.stateNode;throw Error(i(33))}function za(a){var r=a[eo];return r||(r=a[eo]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Gt(a){a[Ji]=!0}var to=new Set,Jl={};function ua(a,r){fi(a,r),fi(a+"Capture",r)}function fi(a,r){for(Jl[a]=r,a=0;a<r.length;a++)to.add(r[a])}var no=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),le={},ye={};function Re(a){return Ze.call(ye,a)?!0:Ze.call(le,a)?!1:no.test(a)?ye[a]=!0:(le[a]=!0,!1)}function He(a,r,u){if(Re(r))if(u===null)a.removeAttribute(r);else{switch(typeof u){case"undefined":case"function":case"symbol":a.removeAttribute(r);return;case"boolean":var h=r.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){a.removeAttribute(r);return}}a.setAttribute(r,""+u)}}function xt(a,r,u){if(u===null)a.removeAttribute(r);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(r);return}a.setAttribute(r,""+u)}}function Ht(a,r,u,h){if(h===null)a.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(u);return}a.setAttributeNS(r,u,""+h)}}function kn(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function mg(a){var r=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function zw(a,r,u){var h=Object.getOwnPropertyDescriptor(a.constructor.prototype,r);if(!a.hasOwnProperty(r)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var v=h.get,S=h.set;return Object.defineProperty(a,r,{configurable:!0,get:function(){return v.call(this)},set:function(O){u=""+O,S.call(this,O)}}),Object.defineProperty(a,r,{enumerable:h.enumerable}),{getValue:function(){return u},setValue:function(O){u=""+O},stopTracking:function(){a._valueTracker=null,delete a[r]}}}}function Ud(a){if(!a._valueTracker){var r=mg(a)?"checked":"value";a._valueTracker=zw(a,r,""+a[r])}}function pg(a){if(!a)return!1;var r=a._valueTracker;if(!r)return!0;var u=r.getValue(),h="";return a&&(h=mg(a)?a.checked?"true":"false":a.value),a=h,a!==u?(r.setValue(a),!0):!1}function eu(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var Uw=/[\n"\\]/g;function Xn(a){return a.replace(Uw,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Hd(a,r,u,h,v,S,O,V){a.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?a.type=O:a.removeAttribute("type"),r!=null?O==="number"?(r===0&&a.value===""||a.value!=r)&&(a.value=""+kn(r)):a.value!==""+kn(r)&&(a.value=""+kn(r)):O!=="submit"&&O!=="reset"||a.removeAttribute("value"),r!=null?Fd(a,O,kn(r)):u!=null?Fd(a,O,kn(u)):h!=null&&a.removeAttribute("value"),v==null&&S!=null&&(a.defaultChecked=!!S),v!=null&&(a.checked=v&&typeof v!="function"&&typeof v!="symbol"),V!=null&&typeof V!="function"&&typeof V!="symbol"&&typeof V!="boolean"?a.name=""+kn(V):a.removeAttribute("name")}function gg(a,r,u,h,v,S,O,V){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(a.type=S),r!=null||u!=null){if(!(S!=="submit"&&S!=="reset"||r!=null)){Ud(a);return}u=u!=null?""+kn(u):"",r=r!=null?""+kn(r):u,V||r===a.value||(a.value=r),a.defaultValue=r}h=h??v,h=typeof h!="function"&&typeof h!="symbol"&&!!h,a.checked=V?a.checked:!!h,a.defaultChecked=!!h,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(a.name=O),Ud(a)}function Fd(a,r,u){r==="number"&&eu(a.ownerDocument)===a||a.defaultValue===""+u||(a.defaultValue=""+u)}function qr(a,r,u,h){if(a=a.options,r){r={};for(var v=0;v<u.length;v++)r["$"+u[v]]=!0;for(u=0;u<a.length;u++)v=r.hasOwnProperty("$"+a[u].value),a[u].selected!==v&&(a[u].selected=v),v&&h&&(a[u].defaultSelected=!0)}else{for(u=""+kn(u),r=null,v=0;v<a.length;v++){if(a[v].value===u){a[v].selected=!0,h&&(a[v].defaultSelected=!0);return}r!==null||a[v].disabled||(r=a[v])}r!==null&&(r.selected=!0)}}function xg(a,r,u){if(r!=null&&(r=""+kn(r),r!==a.value&&(a.value=r),u==null)){a.defaultValue!==r&&(a.defaultValue=r);return}a.defaultValue=u!=null?""+kn(u):""}function bg(a,r,u,h){if(r==null){if(h!=null){if(u!=null)throw Error(i(92));if(B(h)){if(1<h.length)throw Error(i(93));h=h[0]}u=h}u==null&&(u=""),r=u}u=kn(r),a.defaultValue=u,h=a.textContent,h===u&&h!==""&&h!==null&&(a.value=h),Ud(a)}function Yr(a,r){if(r){var u=a.firstChild;if(u&&u===a.lastChild&&u.nodeType===3){u.nodeValue=r;return}}a.textContent=r}var Hw=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function yg(a,r,u){var h=r.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?a.setProperty(r,""):r==="float"?a.cssFloat="":a[r]="":h?a.setProperty(r,u):typeof u!="number"||u===0||Hw.has(r)?r==="float"?a.cssFloat=u:a[r]=(""+u).trim():a[r]=u+"px"}function vg(a,r,u){if(r!=null&&typeof r!="object")throw Error(i(62));if(a=a.style,u!=null){for(var h in u)!u.hasOwnProperty(h)||r!=null&&r.hasOwnProperty(h)||(h.indexOf("--")===0?a.setProperty(h,""):h==="float"?a.cssFloat="":a[h]="");for(var v in r)h=r[v],r.hasOwnProperty(v)&&u[v]!==h&&yg(a,v,h)}else for(var S in r)r.hasOwnProperty(S)&&yg(a,S,r[S])}function Vd(a){if(a.indexOf("-")===-1)return!1;switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Fw=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["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"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["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"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["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"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Vw=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function tu(a){return Vw.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function Ua(){}var qd=null;function Yd(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Gr=null,Xr=null;function Eg(a){var r=Ba(a);if(r&&(a=r.stateNode)){var u=a[kt]||null;e:switch(a=r.stateNode,r.type){case"input":if(Hd(a,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),r=u.name,u.type==="radio"&&r!=null){for(u=a;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Xn(""+r)+'"][type="radio"]'),r=0;r<u.length;r++){var h=u[r];if(h!==a&&h.form===a.form){var v=h[kt]||null;if(!v)throw Error(i(90));Hd(h,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name)}}for(r=0;r<u.length;r++)h=u[r],h.form===a.form&&pg(h)}break e;case"textarea":xg(a,u.value,u.defaultValue);break e;case"select":r=u.value,r!=null&&qr(a,!!u.multiple,r,!1)}}}var Gd=!1;function Tg(a,r,u){if(Gd)return a(r,u);Gd=!0;try{var h=a(r);return h}finally{if(Gd=!1,(Gr!==null||Xr!==null)&&(Fu(),Gr&&(r=Gr,a=Xr,Xr=Gr=null,Eg(r),a)))for(r=0;r<a.length;r++)Eg(a[r])}}function ao(a,r){var u=a.stateNode;if(u===null)return null;var h=u[kt]||null;if(h===null)return null;u=h[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(a=a.type,h=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!h;break e;default:a=!1}if(a)return null;if(u&&typeof u!="function")throw Error(i(231,r,typeof u));return u}var Ha=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xd=!1;if(Ha)try{var io={};Object.defineProperty(io,"passive",{get:function(){Xd=!0}}),window.addEventListener("test",io,io),window.removeEventListener("test",io,io)}catch{Xd=!1}var hi=null,Kd=null,nu=null;function Sg(){if(nu)return nu;var a,r=Kd,u=r.length,h,v="value"in hi?hi.value:hi.textContent,S=v.length;for(a=0;a<u&&r[a]===v[a];a++);var O=u-a;for(h=1;h<=O&&r[u-h]===v[S-h];h++);return nu=v.slice(a,1<h?1-h:void 0)}function au(a){var r=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&r===13&&(a=13)):a=r,a===10&&(a=13),32<=a||a===13?a:0}function iu(){return!0}function kg(){return!1}function wn(a){function r(u,h,v,S,O){this._reactName=u,this._targetInst=v,this.type=h,this.nativeEvent=S,this.target=O,this.currentTarget=null;for(var V in a)a.hasOwnProperty(V)&&(u=a[V],this[V]=u?u(S):S[V]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?iu:kg,this.isPropagationStopped=kg,this}return x(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=iu)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=iu)},persist:function(){},isPersistent:iu}),r}var tr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ru=wn(tr),ro=x({},tr,{view:0,detail:0}),qw=wn(ro),$d,Qd,so,su=x({},ro,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zd,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==so&&(so&&a.type==="mousemove"?($d=a.screenX-so.screenX,Qd=a.screenY-so.screenY):Qd=$d=0,so=a),$d)},movementY:function(a){return"movementY"in a?a.movementY:Qd}}),wg=wn(su),Yw=x({},su,{dataTransfer:0}),Gw=wn(Yw),Xw=x({},ro,{relatedTarget:0}),Wd=wn(Xw),Kw=x({},tr,{animationName:0,elapsedTime:0,pseudoElement:0}),$w=wn(Kw),Qw=x({},tr,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),Ww=wn(Qw),Zw=x({},tr,{data:0}),Ag=wn(Zw),Jw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},e3={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},t3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function n3(a){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(a):(a=t3[a])?!!r[a]:!1}function Zd(){return n3}var a3=x({},ro,{key:function(a){if(a.key){var r=Jw[a.key]||a.key;if(r!=="Unidentified")return r}return a.type==="keypress"?(a=au(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?e3[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zd,charCode:function(a){return a.type==="keypress"?au(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?au(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),i3=wn(a3),r3=x({},su,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Cg=wn(r3),s3=x({},ro,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zd}),o3=wn(s3),l3=x({},tr,{propertyName:0,elapsedTime:0,pseudoElement:0}),u3=wn(l3),c3=x({},su,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),d3=wn(c3),f3=x({},tr,{newState:0,oldState:0}),h3=wn(f3),m3=[9,13,27,32],Jd=Ha&&"CompositionEvent"in window,oo=null;Ha&&"documentMode"in document&&(oo=document.documentMode);var p3=Ha&&"TextEvent"in window&&!oo,Ng=Ha&&(!Jd||oo&&8<oo&&11>=oo),_g=" ",Mg=!1;function Rg(a,r){switch(a){case"keyup":return m3.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Dg(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Kr=!1;function g3(a,r){switch(a){case"compositionend":return Dg(r);case"keypress":return r.which!==32?null:(Mg=!0,_g);case"textInput":return a=r.data,a===_g&&Mg?null:a;default:return null}}function x3(a,r){if(Kr)return a==="compositionend"||!Jd&&Rg(a,r)?(a=Sg(),nu=Kd=hi=null,Kr=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Ng&&r.locale!=="ko"?null:r.data;default:return null}}var b3={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Lg(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r==="input"?!!b3[a.type]:r==="textarea"}function Og(a,r,u,h){Gr?Xr?Xr.push(h):Xr=[h]:Gr=h,r=$u(r,"onChange"),0<r.length&&(u=new ru("onChange","change",null,u,h),a.push({event:u,listeners:r}))}var lo=null,uo=null;function y3(a){gb(a,0)}function ou(a){var r=er(a);if(pg(r))return a}function Ig(a,r){if(a==="change")return r}var jg=!1;if(Ha){var ef;if(Ha){var tf="oninput"in document;if(!tf){var Pg=document.createElement("div");Pg.setAttribute("oninput","return;"),tf=typeof Pg.oninput=="function"}ef=tf}else ef=!1;jg=ef&&(!document.documentMode||9<document.documentMode)}function Bg(){lo&&(lo.detachEvent("onpropertychange",zg),uo=lo=null)}function zg(a){if(a.propertyName==="value"&&ou(uo)){var r=[];Og(r,uo,a,Yd(a)),Tg(y3,r)}}function v3(a,r,u){a==="focusin"?(Bg(),lo=r,uo=u,lo.attachEvent("onpropertychange",zg)):a==="focusout"&&Bg()}function E3(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return ou(uo)}function T3(a,r){if(a==="click")return ou(r)}function S3(a,r){if(a==="input"||a==="change")return ou(r)}function k3(a,r){return a===r&&(a!==0||1/a===1/r)||a!==a&&r!==r}var In=typeof Object.is=="function"?Object.is:k3;function co(a,r){if(In(a,r))return!0;if(typeof a!="object"||a===null||typeof r!="object"||r===null)return!1;var u=Object.keys(a),h=Object.keys(r);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var v=u[h];if(!Ze.call(r,v)||!In(a[v],r[v]))return!1}return!0}function Ug(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Hg(a,r){var u=Ug(a);a=0;for(var h;u;){if(u.nodeType===3){if(h=a+u.textContent.length,a<=r&&h>=r)return{node:u,offset:r-a};a=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Ug(u)}}function Fg(a,r){return a&&r?a===r?!0:a&&a.nodeType===3?!1:r&&r.nodeType===3?Fg(a,r.parentNode):"contains"in a?a.contains(r):a.compareDocumentPosition?!!(a.compareDocumentPosition(r)&16):!1:!1}function Vg(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var r=eu(a.document);r instanceof a.HTMLIFrameElement;){try{var u=typeof r.contentWindow.location.href=="string"}catch{u=!1}if(u)a=r.contentWindow;else break;r=eu(a.document)}return r}function nf(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r&&(r==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||r==="textarea"||a.contentEditable==="true")}var w3=Ha&&"documentMode"in document&&11>=document.documentMode,$r=null,af=null,fo=null,rf=!1;function qg(a,r,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;rf||$r==null||$r!==eu(h)||(h=$r,"selectionStart"in h&&nf(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),fo&&co(fo,h)||(fo=h,h=$u(af,"onSelect"),0<h.length&&(r=new ru("onSelect","select",null,r,u),a.push({event:r,listeners:h}),r.target=$r)))}function nr(a,r){var u={};return u[a.toLowerCase()]=r.toLowerCase(),u["Webkit"+a]="webkit"+r,u["Moz"+a]="moz"+r,u}var Qr={animationend:nr("Animation","AnimationEnd"),animationiteration:nr("Animation","AnimationIteration"),animationstart:nr("Animation","AnimationStart"),transitionrun:nr("Transition","TransitionRun"),transitionstart:nr("Transition","TransitionStart"),transitioncancel:nr("Transition","TransitionCancel"),transitionend:nr("Transition","TransitionEnd")},sf={},Yg={};Ha&&(Yg=document.createElement("div").style,"AnimationEvent"in window||(delete Qr.animationend.animation,delete Qr.animationiteration.animation,delete Qr.animationstart.animation),"TransitionEvent"in window||delete Qr.transitionend.transition);function ar(a){if(sf[a])return sf[a];if(!Qr[a])return a;var r=Qr[a],u;for(u in r)if(r.hasOwnProperty(u)&&u in Yg)return sf[a]=r[u];return a}var Gg=ar("animationend"),Xg=ar("animationiteration"),Kg=ar("animationstart"),A3=ar("transitionrun"),C3=ar("transitionstart"),N3=ar("transitioncancel"),$g=ar("transitionend"),Qg=new Map,of="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");of.push("scrollEnd");function ca(a,r){Qg.set(a,r),ua(r,[a])}var lu=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},Kn=[],Wr=0,lf=0;function uu(){for(var a=Wr,r=lf=Wr=0;r<a;){var u=Kn[r];Kn[r++]=null;var h=Kn[r];Kn[r++]=null;var v=Kn[r];Kn[r++]=null;var S=Kn[r];if(Kn[r++]=null,h!==null&&v!==null){var O=h.pending;O===null?v.next=v:(v.next=O.next,O.next=v),h.pending=v}S!==0&&Wg(u,v,S)}}function cu(a,r,u,h){Kn[Wr++]=a,Kn[Wr++]=r,Kn[Wr++]=u,Kn[Wr++]=h,lf|=h,a.lanes|=h,a=a.alternate,a!==null&&(a.lanes|=h)}function uf(a,r,u,h){return cu(a,r,u,h),du(a)}function ir(a,r){return cu(a,null,null,r),du(a)}function Wg(a,r,u){a.lanes|=u;var h=a.alternate;h!==null&&(h.lanes|=u);for(var v=!1,S=a.return;S!==null;)S.childLanes|=u,h=S.alternate,h!==null&&(h.childLanes|=u),S.tag===22&&(a=S.stateNode,a===null||a._visibility&1||(v=!0)),a=S,S=S.return;return a.tag===3?(S=a.stateNode,v&&r!==null&&(v=31-Je(u),a=S.hiddenUpdates,h=a[v],h===null?a[v]=[r]:h.push(r),r.lane=u|536870912),S):null}function du(a){if(50<Oo)throw Oo=0,bh=null,Error(i(185));for(var r=a.return;r!==null;)a=r,r=a.return;return a.tag===3?a.stateNode:null}var Zr={};function _3(a,r,u,h){this.tag=a,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jn(a,r,u,h){return new _3(a,r,u,h)}function cf(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Fa(a,r){var u=a.alternate;return u===null?(u=jn(a.tag,r,a.key,a.mode),u.elementType=a.elementType,u.type=a.type,u.stateNode=a.stateNode,u.alternate=a,a.alternate=u):(u.pendingProps=r,u.type=a.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=a.flags&65011712,u.childLanes=a.childLanes,u.lanes=a.lanes,u.child=a.child,u.memoizedProps=a.memoizedProps,u.memoizedState=a.memoizedState,u.updateQueue=a.updateQueue,r=a.dependencies,u.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},u.sibling=a.sibling,u.index=a.index,u.ref=a.ref,u.refCleanup=a.refCleanup,u}function Zg(a,r){a.flags&=65011714;var u=a.alternate;return u===null?(a.childLanes=0,a.lanes=r,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=u.childLanes,a.lanes=u.lanes,a.child=u.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=u.memoizedProps,a.memoizedState=u.memoizedState,a.updateQueue=u.updateQueue,a.type=u.type,r=u.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),a}function fu(a,r,u,h,v,S){var O=0;if(h=a,typeof a=="function")cf(a)&&(O=1);else if(typeof a=="string")O=OA(a,u,ae.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case I:return a=jn(31,u,r,v),a.elementType=I,a.lanes=S,a;case E:return rr(u.children,v,S,r);case T:O=8,v|=24;break;case w:return a=jn(12,u,r,v|2),a.elementType=w,a.lanes=S,a;case A:return a=jn(13,u,r,v),a.elementType=A,a.lanes=S,a;case R:return a=jn(19,u,r,v),a.elementType=R,a.lanes=S,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case _:O=10;break e;case M:O=9;break e;case L:O=11;break e;case j:O=14;break e;case N:O=16,h=null;break e}O=29,u=Error(i(130,a===null?"null":typeof a,"")),h=null}return r=jn(O,u,r,v),r.elementType=a,r.type=h,r.lanes=S,r}function rr(a,r,u,h){return a=jn(7,a,h,r),a.lanes=u,a}function df(a,r,u){return a=jn(6,a,null,r),a.lanes=u,a}function Jg(a){var r=jn(18,null,null,0);return r.stateNode=a,r}function ff(a,r,u){return r=jn(4,a.children!==null?a.children:[],a.key,r),r.lanes=u,r.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},r}var e1=new WeakMap;function $n(a,r){if(typeof a=="object"&&a!==null){var u=e1.get(a);return u!==void 0?u:(r={value:a,source:r,stack:Te(r)},e1.set(a,r),r)}return{value:a,source:r,stack:Te(r)}}var Jr=[],es=0,hu=null,ho=0,Qn=[],Wn=0,mi=null,Ea=1,Ta="";function Va(a,r){Jr[es++]=ho,Jr[es++]=hu,hu=a,ho=r}function t1(a,r,u){Qn[Wn++]=Ea,Qn[Wn++]=Ta,Qn[Wn++]=mi,mi=a;var h=Ea;a=Ta;var v=32-Je(h)-1;h&=~(1<<v),u+=1;var S=32-Je(r)+v;if(30<S){var O=v-v%5;S=(h&(1<<O)-1).toString(32),h>>=O,v-=O,Ea=1<<32-Je(r)+v|u<<v|h,Ta=S+a}else Ea=1<<S|u<<v|h,Ta=a}function hf(a){a.return!==null&&(Va(a,1),t1(a,1,0))}function mf(a){for(;a===hu;)hu=Jr[--es],Jr[es]=null,ho=Jr[--es],Jr[es]=null;for(;a===mi;)mi=Qn[--Wn],Qn[Wn]=null,Ta=Qn[--Wn],Qn[Wn]=null,Ea=Qn[--Wn],Qn[Wn]=null}function n1(a,r){Qn[Wn++]=Ea,Qn[Wn++]=Ta,Qn[Wn++]=mi,Ea=r.id,Ta=r.overflow,mi=a}var un=null,It=null,mt=!1,pi=null,Zn=!1,pf=Error(i(519));function gi(a){var r=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw mo($n(r,a)),pf}function a1(a){var r=a.stateNode,u=a.type,h=a.memoizedProps;switch(r[nn]=a,r[kt]=h,u){case"dialog":ct("cancel",r),ct("close",r);break;case"iframe":case"object":case"embed":ct("load",r);break;case"video":case"audio":for(u=0;u<jo.length;u++)ct(jo[u],r);break;case"source":ct("error",r);break;case"img":case"image":case"link":ct("error",r),ct("load",r);break;case"details":ct("toggle",r);break;case"input":ct("invalid",r),gg(r,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":ct("invalid",r);break;case"textarea":ct("invalid",r),bg(r,h.value,h.defaultValue,h.children)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||r.textContent===""+u||h.suppressHydrationWarning===!0||vb(r.textContent,u)?(h.popover!=null&&(ct("beforetoggle",r),ct("toggle",r)),h.onScroll!=null&&ct("scroll",r),h.onScrollEnd!=null&&ct("scrollend",r),h.onClick!=null&&(r.onclick=Ua),r=!0):r=!1,r||gi(a,!0)}function i1(a){for(un=a.return;un;)switch(un.tag){case 5:case 31:case 13:Zn=!1;return;case 27:case 3:Zn=!0;return;default:un=un.return}}function ts(a){if(a!==un)return!1;if(!mt)return i1(a),mt=!0,!1;var r=a.tag,u;if((u=r!==3&&r!==27)&&((u=r===5)&&(u=a.type,u=!(u!=="form"&&u!=="button")||Lh(a.type,a.memoizedProps)),u=!u),u&&It&&gi(a),i1(a),r===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));It=_b(a)}else if(r===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));It=_b(a)}else r===27?(r=It,Mi(a.type)?(a=Bh,Bh=null,It=a):It=r):It=un?ea(a.stateNode.nextSibling):null;return!0}function sr(){It=un=null,mt=!1}function gf(){var a=pi;return a!==null&&(_n===null?_n=a:_n.push.apply(_n,a),pi=null),a}function mo(a){pi===null?pi=[a]:pi.push(a)}var xf=Y(null),or=null,qa=null;function xi(a,r,u){U(xf,r._currentValue),r._currentValue=u}function Ya(a){a._currentValue=xf.current,W(xf)}function bf(a,r,u){for(;a!==null;){var h=a.alternate;if((a.childLanes&r)!==r?(a.childLanes|=r,h!==null&&(h.childLanes|=r)):h!==null&&(h.childLanes&r)!==r&&(h.childLanes|=r),a===u)break;a=a.return}}function yf(a,r,u,h){var v=a.child;for(v!==null&&(v.return=a);v!==null;){var S=v.dependencies;if(S!==null){var O=v.child;S=S.firstContext;e:for(;S!==null;){var V=S;S=v;for(var te=0;te<r.length;te++)if(V.context===r[te]){S.lanes|=u,V=S.alternate,V!==null&&(V.lanes|=u),bf(S.return,u,a),h||(O=null);break e}S=V.next}}else if(v.tag===18){if(O=v.return,O===null)throw Error(i(341));O.lanes|=u,S=O.alternate,S!==null&&(S.lanes|=u),bf(O,u,a),O=null}else O=v.child;if(O!==null)O.return=v;else for(O=v;O!==null;){if(O===a){O=null;break}if(v=O.sibling,v!==null){v.return=O.return,O=v;break}O=O.return}v=O}}function ns(a,r,u,h){a=null;for(var v=r,S=!1;v!==null;){if(!S){if((v.flags&524288)!==0)S=!0;else if((v.flags&262144)!==0)break}if(v.tag===10){var O=v.alternate;if(O===null)throw Error(i(387));if(O=O.memoizedProps,O!==null){var V=v.type;In(v.pendingProps.value,O.value)||(a!==null?a.push(V):a=[V])}}else if(v===me.current){if(O=v.alternate,O===null)throw Error(i(387));O.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(a!==null?a.push(Ho):a=[Ho])}v=v.return}a!==null&&yf(r,a,u,h),r.flags|=262144}function mu(a){for(a=a.firstContext;a!==null;){if(!In(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function lr(a){or=a,qa=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function cn(a){return r1(or,a)}function pu(a,r){return or===null&&lr(a),r1(a,r)}function r1(a,r){var u=r._currentValue;if(r={context:r,memoizedValue:u,next:null},qa===null){if(a===null)throw Error(i(308));qa=r,a.dependencies={lanes:0,firstContext:r},a.flags|=524288}else qa=qa.next=r;return u}var M3=typeof AbortController<"u"?AbortController:function(){var a=[],r=this.signal={aborted:!1,addEventListener:function(u,h){a.push(h)}};this.abort=function(){r.aborted=!0,a.forEach(function(u){return u()})}},R3=e.unstable_scheduleCallback,D3=e.unstable_NormalPriority,Qt={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function vf(){return{controller:new M3,data:new Map,refCount:0}}function po(a){a.refCount--,a.refCount===0&&R3(D3,function(){a.controller.abort()})}var go=null,Ef=0,as=0,is=null;function L3(a,r){if(go===null){var u=go=[];Ef=0,as=kh(),is={status:"pending",value:void 0,then:function(h){u.push(h)}}}return Ef++,r.then(s1,s1),r}function s1(){if(--Ef===0&&go!==null){is!==null&&(is.status="fulfilled");var a=go;go=null,as=0,is=null;for(var r=0;r<a.length;r++)(0,a[r])()}}function O3(a,r){var u=[],h={status:"pending",value:null,reason:null,then:function(v){u.push(v)}};return a.then(function(){h.status="fulfilled",h.value=r;for(var v=0;v<u.length;v++)(0,u[v])(r)},function(v){for(h.status="rejected",h.reason=v,v=0;v<u.length;v++)(0,u[v])(void 0)}),h}var o1=H.S;H.S=function(a,r){qx=st(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&L3(a,r),o1!==null&&o1(a,r)};var ur=Y(null);function Tf(){var a=ur.current;return a!==null?a:_t.pooledCache}function gu(a,r){r===null?U(ur,ur.current):U(ur,r.pool)}function l1(){var a=Tf();return a===null?null:{parent:Qt._currentValue,pool:a}}var rs=Error(i(460)),Sf=Error(i(474)),xu=Error(i(542)),bu={then:function(){}};function u1(a){return a=a.status,a==="fulfilled"||a==="rejected"}function c1(a,r,u){switch(u=a[u],u===void 0?a.push(r):u!==r&&(r.then(Ua,Ua),r=u),r.status){case"fulfilled":return r.value;case"rejected":throw a=r.reason,f1(a),a;default:if(typeof r.status=="string")r.then(Ua,Ua);else{if(a=_t,a!==null&&100<a.shellSuspendCounter)throw Error(i(482));a=r,a.status="pending",a.then(function(h){if(r.status==="pending"){var v=r;v.status="fulfilled",v.value=h}},function(h){if(r.status==="pending"){var v=r;v.status="rejected",v.reason=h}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw a=r.reason,f1(a),a}throw dr=r,rs}}function cr(a){try{var r=a._init;return r(a._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(dr=u,rs):u}}var dr=null;function d1(){if(dr===null)throw Error(i(459));var a=dr;return dr=null,a}function f1(a){if(a===rs||a===xu)throw Error(i(483))}var ss=null,xo=0;function yu(a){var r=xo;return xo+=1,ss===null&&(ss=[]),c1(ss,a,r)}function bo(a,r){r=r.props.ref,a.ref=r!==void 0?r:null}function vu(a,r){throw r.$$typeof===b?Error(i(525)):(a=Object.prototype.toString.call(r),Error(i(31,a==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":a)))}function h1(a){function r(oe,ie){if(a){var ce=oe.deletions;ce===null?(oe.deletions=[ie],oe.flags|=16):ce.push(ie)}}function u(oe,ie){if(!a)return null;for(;ie!==null;)r(oe,ie),ie=ie.sibling;return null}function h(oe){for(var ie=new Map;oe!==null;)oe.key!==null?ie.set(oe.key,oe):ie.set(oe.index,oe),oe=oe.sibling;return ie}function v(oe,ie){return oe=Fa(oe,ie),oe.index=0,oe.sibling=null,oe}function S(oe,ie,ce){return oe.index=ce,a?(ce=oe.alternate,ce!==null?(ce=ce.index,ce<ie?(oe.flags|=67108866,ie):ce):(oe.flags|=67108866,ie)):(oe.flags|=1048576,ie)}function O(oe){return a&&oe.alternate===null&&(oe.flags|=67108866),oe}function V(oe,ie,ce,Ee){return ie===null||ie.tag!==6?(ie=df(ce,oe.mode,Ee),ie.return=oe,ie):(ie=v(ie,ce),ie.return=oe,ie)}function te(oe,ie,ce,Ee){var Ve=ce.type;return Ve===E?be(oe,ie,ce.props.children,Ee,ce.key):ie!==null&&(ie.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===N&&cr(Ve)===ie.type)?(ie=v(ie,ce.props),bo(ie,ce),ie.return=oe,ie):(ie=fu(ce.type,ce.key,ce.props,null,oe.mode,Ee),bo(ie,ce),ie.return=oe,ie)}function de(oe,ie,ce,Ee){return ie===null||ie.tag!==4||ie.stateNode.containerInfo!==ce.containerInfo||ie.stateNode.implementation!==ce.implementation?(ie=ff(ce,oe.mode,Ee),ie.return=oe,ie):(ie=v(ie,ce.children||[]),ie.return=oe,ie)}function be(oe,ie,ce,Ee,Ve){return ie===null||ie.tag!==7?(ie=rr(ce,oe.mode,Ee,Ve),ie.return=oe,ie):(ie=v(ie,ce),ie.return=oe,ie)}function ke(oe,ie,ce){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return ie=df(""+ie,oe.mode,ce),ie.return=oe,ie;if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case g:return ce=fu(ie.type,ie.key,ie.props,null,oe.mode,ce),bo(ce,ie),ce.return=oe,ce;case y:return ie=ff(ie,oe.mode,ce),ie.return=oe,ie;case N:return ie=cr(ie),ke(oe,ie,ce)}if(B(ie)||z(ie))return ie=rr(ie,oe.mode,ce,null),ie.return=oe,ie;if(typeof ie.then=="function")return ke(oe,yu(ie),ce);if(ie.$$typeof===_)return ke(oe,pu(oe,ie),ce);vu(oe,ie)}return null}function he(oe,ie,ce,Ee){var Ve=ie!==null?ie.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return Ve!==null?null:V(oe,ie,""+ce,Ee);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case g:return ce.key===Ve?te(oe,ie,ce,Ee):null;case y:return ce.key===Ve?de(oe,ie,ce,Ee):null;case N:return ce=cr(ce),he(oe,ie,ce,Ee)}if(B(ce)||z(ce))return Ve!==null?null:be(oe,ie,ce,Ee,null);if(typeof ce.then=="function")return he(oe,ie,yu(ce),Ee);if(ce.$$typeof===_)return he(oe,ie,pu(oe,ce),Ee);vu(oe,ce)}return null}function ge(oe,ie,ce,Ee,Ve){if(typeof Ee=="string"&&Ee!==""||typeof Ee=="number"||typeof Ee=="bigint")return oe=oe.get(ce)||null,V(ie,oe,""+Ee,Ve);if(typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case g:return oe=oe.get(Ee.key===null?ce:Ee.key)||null,te(ie,oe,Ee,Ve);case y:return oe=oe.get(Ee.key===null?ce:Ee.key)||null,de(ie,oe,Ee,Ve);case N:return Ee=cr(Ee),ge(oe,ie,ce,Ee,Ve)}if(B(Ee)||z(Ee))return oe=oe.get(ce)||null,be(ie,oe,Ee,Ve,null);if(typeof Ee.then=="function")return ge(oe,ie,ce,yu(Ee),Ve);if(Ee.$$typeof===_)return ge(oe,ie,ce,pu(ie,Ee),Ve);vu(ie,Ee)}return null}function Pe(oe,ie,ce,Ee){for(var Ve=null,yt=null,ze=ie,nt=ie=0,ht=null;ze!==null&&nt<ce.length;nt++){ze.index>nt?(ht=ze,ze=null):ht=ze.sibling;var vt=he(oe,ze,ce[nt],Ee);if(vt===null){ze===null&&(ze=ht);break}a&&ze&&vt.alternate===null&&r(oe,ze),ie=S(vt,ie,nt),yt===null?Ve=vt:yt.sibling=vt,yt=vt,ze=ht}if(nt===ce.length)return u(oe,ze),mt&&Va(oe,nt),Ve;if(ze===null){for(;nt<ce.length;nt++)ze=ke(oe,ce[nt],Ee),ze!==null&&(ie=S(ze,ie,nt),yt===null?Ve=ze:yt.sibling=ze,yt=ze);return mt&&Va(oe,nt),Ve}for(ze=h(ze);nt<ce.length;nt++)ht=ge(ze,oe,nt,ce[nt],Ee),ht!==null&&(a&&ht.alternate!==null&&ze.delete(ht.key===null?nt:ht.key),ie=S(ht,ie,nt),yt===null?Ve=ht:yt.sibling=ht,yt=ht);return a&&ze.forEach(function(Ii){return r(oe,Ii)}),mt&&Va(oe,nt),Ve}function Ge(oe,ie,ce,Ee){if(ce==null)throw Error(i(151));for(var Ve=null,yt=null,ze=ie,nt=ie=0,ht=null,vt=ce.next();ze!==null&&!vt.done;nt++,vt=ce.next()){ze.index>nt?(ht=ze,ze=null):ht=ze.sibling;var Ii=he(oe,ze,vt.value,Ee);if(Ii===null){ze===null&&(ze=ht);break}a&&ze&&Ii.alternate===null&&r(oe,ze),ie=S(Ii,ie,nt),yt===null?Ve=Ii:yt.sibling=Ii,yt=Ii,ze=ht}if(vt.done)return u(oe,ze),mt&&Va(oe,nt),Ve;if(ze===null){for(;!vt.done;nt++,vt=ce.next())vt=ke(oe,vt.value,Ee),vt!==null&&(ie=S(vt,ie,nt),yt===null?Ve=vt:yt.sibling=vt,yt=vt);return mt&&Va(oe,nt),Ve}for(ze=h(ze);!vt.done;nt++,vt=ce.next())vt=ge(ze,oe,nt,vt.value,Ee),vt!==null&&(a&&vt.alternate!==null&&ze.delete(vt.key===null?nt:vt.key),ie=S(vt,ie,nt),yt===null?Ve=vt:yt.sibling=vt,yt=vt);return a&&ze.forEach(function(YA){return r(oe,YA)}),mt&&Va(oe,nt),Ve}function Ct(oe,ie,ce,Ee){if(typeof ce=="object"&&ce!==null&&ce.type===E&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case g:e:{for(var Ve=ce.key;ie!==null;){if(ie.key===Ve){if(Ve=ce.type,Ve===E){if(ie.tag===7){u(oe,ie.sibling),Ee=v(ie,ce.props.children),Ee.return=oe,oe=Ee;break e}}else if(ie.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===N&&cr(Ve)===ie.type){u(oe,ie.sibling),Ee=v(ie,ce.props),bo(Ee,ce),Ee.return=oe,oe=Ee;break e}u(oe,ie);break}else r(oe,ie);ie=ie.sibling}ce.type===E?(Ee=rr(ce.props.children,oe.mode,Ee,ce.key),Ee.return=oe,oe=Ee):(Ee=fu(ce.type,ce.key,ce.props,null,oe.mode,Ee),bo(Ee,ce),Ee.return=oe,oe=Ee)}return O(oe);case y:e:{for(Ve=ce.key;ie!==null;){if(ie.key===Ve)if(ie.tag===4&&ie.stateNode.containerInfo===ce.containerInfo&&ie.stateNode.implementation===ce.implementation){u(oe,ie.sibling),Ee=v(ie,ce.children||[]),Ee.return=oe,oe=Ee;break e}else{u(oe,ie);break}else r(oe,ie);ie=ie.sibling}Ee=ff(ce,oe.mode,Ee),Ee.return=oe,oe=Ee}return O(oe);case N:return ce=cr(ce),Ct(oe,ie,ce,Ee)}if(B(ce))return Pe(oe,ie,ce,Ee);if(z(ce)){if(Ve=z(ce),typeof Ve!="function")throw Error(i(150));return ce=Ve.call(ce),Ge(oe,ie,ce,Ee)}if(typeof ce.then=="function")return Ct(oe,ie,yu(ce),Ee);if(ce.$$typeof===_)return Ct(oe,ie,pu(oe,ce),Ee);vu(oe,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint"?(ce=""+ce,ie!==null&&ie.tag===6?(u(oe,ie.sibling),Ee=v(ie,ce),Ee.return=oe,oe=Ee):(u(oe,ie),Ee=df(ce,oe.mode,Ee),Ee.return=oe,oe=Ee),O(oe)):u(oe,ie)}return function(oe,ie,ce,Ee){try{xo=0;var Ve=Ct(oe,ie,ce,Ee);return ss=null,Ve}catch(ze){if(ze===rs||ze===xu)throw ze;var yt=jn(29,ze,null,oe.mode);return yt.lanes=Ee,yt.return=oe,yt}finally{}}}var fr=h1(!0),m1=h1(!1),bi=!1;function kf(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wf(a,r){a=a.updateQueue,r.updateQueue===a&&(r.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function yi(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function vi(a,r,u){var h=a.updateQueue;if(h===null)return null;if(h=h.shared,(Et&2)!==0){var v=h.pending;return v===null?r.next=r:(r.next=v.next,v.next=r),h.pending=r,r=du(a),Wg(a,null,u),r}return cu(a,h,r,u),du(a)}function yo(a,r,u){if(r=r.updateQueue,r!==null&&(r=r.shared,(u&4194048)!==0)){var h=r.lanes;h&=a.pendingLanes,u|=h,r.lanes=u,Wl(a,u)}}function Af(a,r){var u=a.updateQueue,h=a.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var v=null,S=null;if(u=u.firstBaseUpdate,u!==null){do{var O={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};S===null?v=S=O:S=S.next=O,u=u.next}while(u!==null);S===null?v=S=r:S=S.next=r}else v=S=r;u={baseState:h.baseState,firstBaseUpdate:v,lastBaseUpdate:S,shared:h.shared,callbacks:h.callbacks},a.updateQueue=u;return}a=u.lastBaseUpdate,a===null?u.firstBaseUpdate=r:a.next=r,u.lastBaseUpdate=r}var Cf=!1;function vo(){if(Cf){var a=is;if(a!==null)throw a}}function Eo(a,r,u,h){Cf=!1;var v=a.updateQueue;bi=!1;var S=v.firstBaseUpdate,O=v.lastBaseUpdate,V=v.shared.pending;if(V!==null){v.shared.pending=null;var te=V,de=te.next;te.next=null,O===null?S=de:O.next=de,O=te;var be=a.alternate;be!==null&&(be=be.updateQueue,V=be.lastBaseUpdate,V!==O&&(V===null?be.firstBaseUpdate=de:V.next=de,be.lastBaseUpdate=te))}if(S!==null){var ke=v.baseState;O=0,be=de=te=null,V=S;do{var he=V.lane&-536870913,ge=he!==V.lane;if(ge?(ft&he)===he:(h&he)===he){he!==0&&he===as&&(Cf=!0),be!==null&&(be=be.next={lane:0,tag:V.tag,payload:V.payload,callback:null,next:null});e:{var Pe=a,Ge=V;he=r;var Ct=u;switch(Ge.tag){case 1:if(Pe=Ge.payload,typeof Pe=="function"){ke=Pe.call(Ct,ke,he);break e}ke=Pe;break e;case 3:Pe.flags=Pe.flags&-65537|128;case 0:if(Pe=Ge.payload,he=typeof Pe=="function"?Pe.call(Ct,ke,he):Pe,he==null)break e;ke=x({},ke,he);break e;case 2:bi=!0}}he=V.callback,he!==null&&(a.flags|=64,ge&&(a.flags|=8192),ge=v.callbacks,ge===null?v.callbacks=[he]:ge.push(he))}else ge={lane:he,tag:V.tag,payload:V.payload,callback:V.callback,next:null},be===null?(de=be=ge,te=ke):be=be.next=ge,O|=he;if(V=V.next,V===null){if(V=v.shared.pending,V===null)break;ge=V,V=ge.next,ge.next=null,v.lastBaseUpdate=ge,v.shared.pending=null}}while(!0);be===null&&(te=ke),v.baseState=te,v.firstBaseUpdate=de,v.lastBaseUpdate=be,S===null&&(v.shared.lanes=0),wi|=O,a.lanes=O,a.memoizedState=ke}}function p1(a,r){if(typeof a!="function")throw Error(i(191,a));a.call(r)}function g1(a,r){var u=a.callbacks;if(u!==null)for(a.callbacks=null,a=0;a<u.length;a++)p1(u[a],r)}var os=Y(null),Eu=Y(0);function x1(a,r){a=ei,U(Eu,a),U(os,r),ei=a|r.baseLanes}function Nf(){U(Eu,ei),U(os,os.current)}function _f(){ei=Eu.current,W(os),W(Eu)}var Pn=Y(null),Jn=null;function Ei(a){var r=a.alternate;U(Xt,Xt.current&1),U(Pn,a),Jn===null&&(r===null||os.current!==null||r.memoizedState!==null)&&(Jn=a)}function Mf(a){U(Xt,Xt.current),U(Pn,a),Jn===null&&(Jn=a)}function b1(a){a.tag===22?(U(Xt,Xt.current),U(Pn,a),Jn===null&&(Jn=a)):Ti()}function Ti(){U(Xt,Xt.current),U(Pn,Pn.current)}function Bn(a){W(Pn),Jn===a&&(Jn=null),W(Xt)}var Xt=Y(0);function Tu(a){for(var r=a;r!==null;){if(r.tag===13){var u=r.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||jh(u)||Ph(u)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break;for(;r.sibling===null;){if(r.return===null||r.return===a)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Ga=0,et=null,wt=null,Wt=null,Su=!1,ls=!1,hr=!1,ku=0,To=0,us=null,I3=0;function Vt(){throw Error(i(321))}function Rf(a,r){if(r===null)return!1;for(var u=0;u<r.length&&u<a.length;u++)if(!In(a[u],r[u]))return!1;return!0}function Df(a,r,u,h,v,S){return Ga=S,et=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,H.H=a===null||a.memoizedState===null?tx:Xf,hr=!1,S=u(h,v),hr=!1,ls&&(S=v1(r,u,h,v)),y1(a),S}function y1(a){H.H=wo;var r=wt!==null&&wt.next!==null;if(Ga=0,Wt=wt=et=null,Su=!1,To=0,us=null,r)throw Error(i(300));a===null||Zt||(a=a.dependencies,a!==null&&mu(a)&&(Zt=!0))}function v1(a,r,u,h){et=a;var v=0;do{if(ls&&(us=null),To=0,ls=!1,25<=v)throw Error(i(301));if(v+=1,Wt=wt=null,a.updateQueue!=null){var S=a.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}H.H=nx,S=r(u,h)}while(ls);return S}function j3(){var a=H.H,r=a.useState()[0];return r=typeof r.then=="function"?So(r):r,a=a.useState()[0],(wt!==null?wt.memoizedState:null)!==a&&(et.flags|=1024),r}function Lf(){var a=ku!==0;return ku=0,a}function Of(a,r,u){r.updateQueue=a.updateQueue,r.flags&=-2053,a.lanes&=~u}function If(a){if(Su){for(a=a.memoizedState;a!==null;){var r=a.queue;r!==null&&(r.pending=null),a=a.next}Su=!1}Ga=0,Wt=wt=et=null,ls=!1,To=ku=0,us=null}function vn(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Wt===null?et.memoizedState=Wt=a:Wt=Wt.next=a,Wt}function Kt(){if(wt===null){var a=et.alternate;a=a!==null?a.memoizedState:null}else a=wt.next;var r=Wt===null?et.memoizedState:Wt.next;if(r!==null)Wt=r,wt=a;else{if(a===null)throw et.alternate===null?Error(i(467)):Error(i(310));wt=a,a={memoizedState:wt.memoizedState,baseState:wt.baseState,baseQueue:wt.baseQueue,queue:wt.queue,next:null},Wt===null?et.memoizedState=Wt=a:Wt=Wt.next=a}return Wt}function wu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function So(a){var r=To;return To+=1,us===null&&(us=[]),a=c1(us,a,r),r=et,(Wt===null?r.memoizedState:Wt.next)===null&&(r=r.alternate,H.H=r===null||r.memoizedState===null?tx:Xf),a}function Au(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return So(a);if(a.$$typeof===_)return cn(a)}throw Error(i(438,String(a)))}function jf(a){var r=null,u=et.updateQueue;if(u!==null&&(r=u.memoCache),r==null){var h=et.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(r={data:h.data.map(function(v){return v.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),u===null&&(u=wu(),et.updateQueue=u),u.memoCache=r,u=r.data[r.index],u===void 0)for(u=r.data[r.index]=Array(a),h=0;h<a;h++)u[h]=D;return r.index++,u}function Xa(a,r){return typeof r=="function"?r(a):r}function Cu(a){var r=Kt();return Pf(r,wt,a)}function Pf(a,r,u){var h=a.queue;if(h===null)throw Error(i(311));h.lastRenderedReducer=u;var v=a.baseQueue,S=h.pending;if(S!==null){if(v!==null){var O=v.next;v.next=S.next,S.next=O}r.baseQueue=v=S,h.pending=null}if(S=a.baseState,v===null)a.memoizedState=S;else{r=v.next;var V=O=null,te=null,de=r,be=!1;do{var ke=de.lane&-536870913;if(ke!==de.lane?(ft&ke)===ke:(Ga&ke)===ke){var he=de.revertLane;if(he===0)te!==null&&(te=te.next={lane:0,revertLane:0,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null}),ke===as&&(be=!0);else if((Ga&he)===he){de=de.next,he===as&&(be=!0);continue}else ke={lane:0,revertLane:de.revertLane,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},te===null?(V=te=ke,O=S):te=te.next=ke,et.lanes|=he,wi|=he;ke=de.action,hr&&u(S,ke),S=de.hasEagerState?de.eagerState:u(S,ke)}else he={lane:ke,revertLane:de.revertLane,gesture:de.gesture,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},te===null?(V=te=he,O=S):te=te.next=he,et.lanes|=ke,wi|=ke;de=de.next}while(de!==null&&de!==r);if(te===null?O=S:te.next=V,!In(S,a.memoizedState)&&(Zt=!0,be&&(u=is,u!==null)))throw u;a.memoizedState=S,a.baseState=O,a.baseQueue=te,h.lastRenderedState=S}return v===null&&(h.lanes=0),[a.memoizedState,h.dispatch]}function Bf(a){var r=Kt(),u=r.queue;if(u===null)throw Error(i(311));u.lastRenderedReducer=a;var h=u.dispatch,v=u.pending,S=r.memoizedState;if(v!==null){u.pending=null;var O=v=v.next;do S=a(S,O.action),O=O.next;while(O!==v);In(S,r.memoizedState)||(Zt=!0),r.memoizedState=S,r.baseQueue===null&&(r.baseState=S),u.lastRenderedState=S}return[S,h]}function E1(a,r,u){var h=et,v=Kt(),S=mt;if(S){if(u===void 0)throw Error(i(407));u=u()}else u=r();var O=!In((wt||v).memoizedState,u);if(O&&(v.memoizedState=u,Zt=!0),v=v.queue,Hf(k1.bind(null,h,v,a),[a]),v.getSnapshot!==r||O||Wt!==null&&Wt.memoizedState.tag&1){if(h.flags|=2048,cs(9,{destroy:void 0},S1.bind(null,h,v,u,r),null),_t===null)throw Error(i(349));S||(Ga&127)!==0||T1(h,r,u)}return u}function T1(a,r,u){a.flags|=16384,a={getSnapshot:r,value:u},r=et.updateQueue,r===null?(r=wu(),et.updateQueue=r,r.stores=[a]):(u=r.stores,u===null?r.stores=[a]:u.push(a))}function S1(a,r,u,h){r.value=u,r.getSnapshot=h,w1(r)&&A1(a)}function k1(a,r,u){return u(function(){w1(r)&&A1(a)})}function w1(a){var r=a.getSnapshot;a=a.value;try{var u=r();return!In(a,u)}catch{return!0}}function A1(a){var r=ir(a,2);r!==null&&Mn(r,a,2)}function zf(a){var r=vn();if(typeof a=="function"){var u=a;if(a=u(),hr){qe(!0);try{u()}finally{qe(!1)}}}return r.memoizedState=r.baseState=a,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xa,lastRenderedState:a},r}function C1(a,r,u,h){return a.baseState=u,Pf(a,wt,typeof h=="function"?h:Xa)}function P3(a,r,u,h,v){if(Mu(a))throw Error(i(485));if(a=r.action,a!==null){var S={payload:v,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){S.listeners.push(O)}};H.T!==null?u(!0):S.isTransition=!1,h(S),u=r.pending,u===null?(S.next=r.pending=S,N1(r,S)):(S.next=u.next,r.pending=u.next=S)}}function N1(a,r){var u=r.action,h=r.payload,v=a.state;if(r.isTransition){var S=H.T,O={};H.T=O;try{var V=u(v,h),te=H.S;te!==null&&te(O,V),_1(a,r,V)}catch(de){Uf(a,r,de)}finally{S!==null&&O.types!==null&&(S.types=O.types),H.T=S}}else try{S=u(v,h),_1(a,r,S)}catch(de){Uf(a,r,de)}}function _1(a,r,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){M1(a,r,h)},function(h){return Uf(a,r,h)}):M1(a,r,u)}function M1(a,r,u){r.status="fulfilled",r.value=u,R1(r),a.state=u,r=a.pending,r!==null&&(u=r.next,u===r?a.pending=null:(u=u.next,r.next=u,N1(a,u)))}function Uf(a,r,u){var h=a.pending;if(a.pending=null,h!==null){h=h.next;do r.status="rejected",r.reason=u,R1(r),r=r.next;while(r!==h)}a.action=null}function R1(a){a=a.listeners;for(var r=0;r<a.length;r++)(0,a[r])()}function D1(a,r){return r}function L1(a,r){if(mt){var u=_t.formState;if(u!==null){e:{var h=et;if(mt){if(It){t:{for(var v=It,S=Zn;v.nodeType!==8;){if(!S){v=null;break t}if(v=ea(v.nextSibling),v===null){v=null;break t}}S=v.data,v=S==="F!"||S==="F"?v:null}if(v){It=ea(v.nextSibling),h=v.data==="F!";break e}}gi(h)}h=!1}h&&(r=u[0])}}return u=vn(),u.memoizedState=u.baseState=r,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:D1,lastRenderedState:r},u.queue=h,u=Z1.bind(null,et,h),h.dispatch=u,h=zf(!1),S=Gf.bind(null,et,!1,h.queue),h=vn(),v={state:r,dispatch:null,action:a,pending:null},h.queue=v,u=P3.bind(null,et,v,S,u),v.dispatch=u,h.memoizedState=a,[r,u,!1]}function O1(a){var r=Kt();return I1(r,wt,a)}function I1(a,r,u){if(r=Pf(a,r,D1)[0],a=Cu(Xa)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var h=So(r)}catch(O){throw O===rs?xu:O}else h=r;r=Kt();var v=r.queue,S=v.dispatch;return u!==r.memoizedState&&(et.flags|=2048,cs(9,{destroy:void 0},B3.bind(null,v,u),null)),[h,S,a]}function B3(a,r){a.action=r}function j1(a){var r=Kt(),u=wt;if(u!==null)return I1(r,u,a);Kt(),r=r.memoizedState,u=Kt();var h=u.queue.dispatch;return u.memoizedState=a,[r,h,!1]}function cs(a,r,u,h){return a={tag:a,create:u,deps:h,inst:r,next:null},r=et.updateQueue,r===null&&(r=wu(),et.updateQueue=r),u=r.lastEffect,u===null?r.lastEffect=a.next=a:(h=u.next,u.next=a,a.next=h,r.lastEffect=a),a}function P1(){return Kt().memoizedState}function Nu(a,r,u,h){var v=vn();et.flags|=a,v.memoizedState=cs(1|r,{destroy:void 0},u,h===void 0?null:h)}function _u(a,r,u,h){var v=Kt();h=h===void 0?null:h;var S=v.memoizedState.inst;wt!==null&&h!==null&&Rf(h,wt.memoizedState.deps)?v.memoizedState=cs(r,S,u,h):(et.flags|=a,v.memoizedState=cs(1|r,S,u,h))}function B1(a,r){Nu(8390656,8,a,r)}function Hf(a,r){_u(2048,8,a,r)}function z3(a){et.flags|=4;var r=et.updateQueue;if(r===null)r=wu(),et.updateQueue=r,r.events=[a];else{var u=r.events;u===null?r.events=[a]:u.push(a)}}function z1(a){var r=Kt().memoizedState;return z3({ref:r,nextImpl:a}),function(){if((Et&2)!==0)throw Error(i(440));return r.impl.apply(void 0,arguments)}}function U1(a,r){return _u(4,2,a,r)}function H1(a,r){return _u(4,4,a,r)}function F1(a,r){if(typeof r=="function"){a=a();var u=r(a);return function(){typeof u=="function"?u():r(null)}}if(r!=null)return a=a(),r.current=a,function(){r.current=null}}function V1(a,r,u){u=u!=null?u.concat([a]):null,_u(4,4,F1.bind(null,r,a),u)}function Ff(){}function q1(a,r){var u=Kt();r=r===void 0?null:r;var h=u.memoizedState;return r!==null&&Rf(r,h[1])?h[0]:(u.memoizedState=[a,r],a)}function Y1(a,r){var u=Kt();r=r===void 0?null:r;var h=u.memoizedState;if(r!==null&&Rf(r,h[1]))return h[0];if(h=a(),hr){qe(!0);try{a()}finally{qe(!1)}}return u.memoizedState=[h,r],h}function Vf(a,r,u){return u===void 0||(Ga&1073741824)!==0&&(ft&261930)===0?a.memoizedState=r:(a.memoizedState=u,a=Gx(),et.lanes|=a,wi|=a,u)}function G1(a,r,u,h){return In(u,r)?u:os.current!==null?(a=Vf(a,u,h),In(a,r)||(Zt=!0),a):(Ga&42)===0||(Ga&1073741824)!==0&&(ft&261930)===0?(Zt=!0,a.memoizedState=u):(a=Gx(),et.lanes|=a,wi|=a,r)}function X1(a,r,u,h,v){var S=G.p;G.p=S!==0&&8>S?S:8;var O=H.T,V={};H.T=V,Gf(a,!1,r,u);try{var te=v(),de=H.S;if(de!==null&&de(V,te),te!==null&&typeof te=="object"&&typeof te.then=="function"){var be=O3(te,h);ko(a,r,be,Hn(a))}else ko(a,r,h,Hn(a))}catch(ke){ko(a,r,{then:function(){},status:"rejected",reason:ke},Hn())}finally{G.p=S,O!==null&&V.types!==null&&(O.types=V.types),H.T=O}}function U3(){}function qf(a,r,u,h){if(a.tag!==5)throw Error(i(476));var v=K1(a).queue;X1(a,v,r,Q,u===null?U3:function(){return $1(a),u(h)})}function K1(a){var r=a.memoizedState;if(r!==null)return r;r={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xa,lastRenderedState:Q},next:null};var u={};return r.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xa,lastRenderedState:u},next:null},a.memoizedState=r,a=a.alternate,a!==null&&(a.memoizedState=r),r}function $1(a){var r=K1(a);r.next===null&&(r=a.alternate.memoizedState),ko(a,r.next.queue,{},Hn())}function Yf(){return cn(Ho)}function Q1(){return Kt().memoizedState}function W1(){return Kt().memoizedState}function H3(a){for(var r=a.return;r!==null;){switch(r.tag){case 24:case 3:var u=Hn();a=yi(u);var h=vi(r,a,u);h!==null&&(Mn(h,r,u),yo(h,r,u)),r={cache:vf()},a.payload=r;return}r=r.return}}function F3(a,r,u){var h=Hn();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Mu(a)?J1(r,u):(u=uf(a,r,u,h),u!==null&&(Mn(u,a,h),ex(u,r,h)))}function Z1(a,r,u){var h=Hn();ko(a,r,u,h)}function ko(a,r,u,h){var v={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Mu(a))J1(r,v);else{var S=a.alternate;if(a.lanes===0&&(S===null||S.lanes===0)&&(S=r.lastRenderedReducer,S!==null))try{var O=r.lastRenderedState,V=S(O,u);if(v.hasEagerState=!0,v.eagerState=V,In(V,O))return cu(a,r,v,0),_t===null&&uu(),!1}catch{}finally{}if(u=uf(a,r,v,h),u!==null)return Mn(u,a,h),ex(u,r,h),!0}return!1}function Gf(a,r,u,h){if(h={lane:2,revertLane:kh(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Mu(a)){if(r)throw Error(i(479))}else r=uf(a,u,h,2),r!==null&&Mn(r,a,2)}function Mu(a){var r=a.alternate;return a===et||r!==null&&r===et}function J1(a,r){ls=Su=!0;var u=a.pending;u===null?r.next=r:(r.next=u.next,u.next=r),a.pending=r}function ex(a,r,u){if((u&4194048)!==0){var h=r.lanes;h&=a.pendingLanes,u|=h,r.lanes=u,Wl(a,u)}}var wo={readContext:cn,use:Au,useCallback:Vt,useContext:Vt,useEffect:Vt,useImperativeHandle:Vt,useLayoutEffect:Vt,useInsertionEffect:Vt,useMemo:Vt,useReducer:Vt,useRef:Vt,useState:Vt,useDebugValue:Vt,useDeferredValue:Vt,useTransition:Vt,useSyncExternalStore:Vt,useId:Vt,useHostTransitionStatus:Vt,useFormState:Vt,useActionState:Vt,useOptimistic:Vt,useMemoCache:Vt,useCacheRefresh:Vt};wo.useEffectEvent=Vt;var tx={readContext:cn,use:Au,useCallback:function(a,r){return vn().memoizedState=[a,r===void 0?null:r],a},useContext:cn,useEffect:B1,useImperativeHandle:function(a,r,u){u=u!=null?u.concat([a]):null,Nu(4194308,4,F1.bind(null,r,a),u)},useLayoutEffect:function(a,r){return Nu(4194308,4,a,r)},useInsertionEffect:function(a,r){Nu(4,2,a,r)},useMemo:function(a,r){var u=vn();r=r===void 0?null:r;var h=a();if(hr){qe(!0);try{a()}finally{qe(!1)}}return u.memoizedState=[h,r],h},useReducer:function(a,r,u){var h=vn();if(u!==void 0){var v=u(r);if(hr){qe(!0);try{u(r)}finally{qe(!1)}}}else v=r;return h.memoizedState=h.baseState=v,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:v},h.queue=a,a=a.dispatch=F3.bind(null,et,a),[h.memoizedState,a]},useRef:function(a){var r=vn();return a={current:a},r.memoizedState=a},useState:function(a){a=zf(a);var r=a.queue,u=Z1.bind(null,et,r);return r.dispatch=u,[a.memoizedState,u]},useDebugValue:Ff,useDeferredValue:function(a,r){var u=vn();return Vf(u,a,r)},useTransition:function(){var a=zf(!1);return a=X1.bind(null,et,a.queue,!0,!1),vn().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,r,u){var h=et,v=vn();if(mt){if(u===void 0)throw Error(i(407));u=u()}else{if(u=r(),_t===null)throw Error(i(349));(ft&127)!==0||T1(h,r,u)}v.memoizedState=u;var S={value:u,getSnapshot:r};return v.queue=S,B1(k1.bind(null,h,S,a),[a]),h.flags|=2048,cs(9,{destroy:void 0},S1.bind(null,h,S,u,r),null),u},useId:function(){var a=vn(),r=_t.identifierPrefix;if(mt){var u=Ta,h=Ea;u=(h&~(1<<32-Je(h)-1)).toString(32)+u,r="_"+r+"R_"+u,u=ku++,0<u&&(r+="H"+u.toString(32)),r+="_"}else u=I3++,r="_"+r+"r_"+u.toString(32)+"_";return a.memoizedState=r},useHostTransitionStatus:Yf,useFormState:L1,useActionState:L1,useOptimistic:function(a){var r=vn();r.memoizedState=r.baseState=a;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=u,r=Gf.bind(null,et,!0,u),u.dispatch=r,[a,r]},useMemoCache:jf,useCacheRefresh:function(){return vn().memoizedState=H3.bind(null,et)},useEffectEvent:function(a){var r=vn(),u={impl:a};return r.memoizedState=u,function(){if((Et&2)!==0)throw Error(i(440));return u.impl.apply(void 0,arguments)}}},Xf={readContext:cn,use:Au,useCallback:q1,useContext:cn,useEffect:Hf,useImperativeHandle:V1,useInsertionEffect:U1,useLayoutEffect:H1,useMemo:Y1,useReducer:Cu,useRef:P1,useState:function(){return Cu(Xa)},useDebugValue:Ff,useDeferredValue:function(a,r){var u=Kt();return G1(u,wt.memoizedState,a,r)},useTransition:function(){var a=Cu(Xa)[0],r=Kt().memoizedState;return[typeof a=="boolean"?a:So(a),r]},useSyncExternalStore:E1,useId:Q1,useHostTransitionStatus:Yf,useFormState:O1,useActionState:O1,useOptimistic:function(a,r){var u=Kt();return C1(u,wt,a,r)},useMemoCache:jf,useCacheRefresh:W1};Xf.useEffectEvent=z1;var nx={readContext:cn,use:Au,useCallback:q1,useContext:cn,useEffect:Hf,useImperativeHandle:V1,useInsertionEffect:U1,useLayoutEffect:H1,useMemo:Y1,useReducer:Bf,useRef:P1,useState:function(){return Bf(Xa)},useDebugValue:Ff,useDeferredValue:function(a,r){var u=Kt();return wt===null?Vf(u,a,r):G1(u,wt.memoizedState,a,r)},useTransition:function(){var a=Bf(Xa)[0],r=Kt().memoizedState;return[typeof a=="boolean"?a:So(a),r]},useSyncExternalStore:E1,useId:Q1,useHostTransitionStatus:Yf,useFormState:j1,useActionState:j1,useOptimistic:function(a,r){var u=Kt();return wt!==null?C1(u,wt,a,r):(u.baseState=a,[a,u.queue.dispatch])},useMemoCache:jf,useCacheRefresh:W1};nx.useEffectEvent=z1;function Kf(a,r,u,h){r=a.memoizedState,u=u(h,r),u=u==null?r:x({},r,u),a.memoizedState=u,a.lanes===0&&(a.updateQueue.baseState=u)}var $f={enqueueSetState:function(a,r,u){a=a._reactInternals;var h=Hn(),v=yi(h);v.payload=r,u!=null&&(v.callback=u),r=vi(a,v,h),r!==null&&(Mn(r,a,h),yo(r,a,h))},enqueueReplaceState:function(a,r,u){a=a._reactInternals;var h=Hn(),v=yi(h);v.tag=1,v.payload=r,u!=null&&(v.callback=u),r=vi(a,v,h),r!==null&&(Mn(r,a,h),yo(r,a,h))},enqueueForceUpdate:function(a,r){a=a._reactInternals;var u=Hn(),h=yi(u);h.tag=2,r!=null&&(h.callback=r),r=vi(a,h,u),r!==null&&(Mn(r,a,u),yo(r,a,u))}};function ax(a,r,u,h,v,S,O){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(h,S,O):r.prototype&&r.prototype.isPureReactComponent?!co(u,h)||!co(v,S):!0}function ix(a,r,u,h){a=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(u,h),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(u,h),r.state!==a&&$f.enqueueReplaceState(r,r.state,null)}function mr(a,r){var u=r;if("ref"in r){u={};for(var h in r)h!=="ref"&&(u[h]=r[h])}if(a=a.defaultProps){u===r&&(u=x({},u));for(var v in a)u[v]===void 0&&(u[v]=a[v])}return u}function rx(a){lu(a)}function sx(a){console.error(a)}function ox(a){lu(a)}function Ru(a,r){try{var u=a.onUncaughtError;u(r.value,{componentStack:r.stack})}catch(h){setTimeout(function(){throw h})}}function lx(a,r,u){try{var h=a.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function Qf(a,r,u){return u=yi(u),u.tag=3,u.payload={element:null},u.callback=function(){Ru(a,r)},u}function ux(a){return a=yi(a),a.tag=3,a}function cx(a,r,u,h){var v=u.type.getDerivedStateFromError;if(typeof v=="function"){var S=h.value;a.payload=function(){return v(S)},a.callback=function(){lx(r,u,h)}}var O=u.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(a.callback=function(){lx(r,u,h),typeof v!="function"&&(Ai===null?Ai=new Set([this]):Ai.add(this));var V=h.stack;this.componentDidCatch(h.value,{componentStack:V!==null?V:""})})}function V3(a,r,u,h,v){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(r=u.alternate,r!==null&&ns(r,u,v,!0),u=Pn.current,u!==null){switch(u.tag){case 31:case 13:return Jn===null?Vu():u.alternate===null&&qt===0&&(qt=3),u.flags&=-257,u.flags|=65536,u.lanes=v,h===bu?u.flags|=16384:(r=u.updateQueue,r===null?u.updateQueue=new Set([h]):r.add(h),Eh(a,h,v)),!1;case 22:return u.flags|=65536,h===bu?u.flags|=16384:(r=u.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([h])},u.updateQueue=r):(u=r.retryQueue,u===null?r.retryQueue=new Set([h]):u.add(h)),Eh(a,h,v)),!1}throw Error(i(435,u.tag))}return Eh(a,h,v),Vu(),!1}if(mt)return r=Pn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=v,h!==pf&&(a=Error(i(422),{cause:h}),mo($n(a,u)))):(h!==pf&&(r=Error(i(423),{cause:h}),mo($n(r,u))),a=a.current.alternate,a.flags|=65536,v&=-v,a.lanes|=v,h=$n(h,u),v=Qf(a.stateNode,h,v),Af(a,v),qt!==4&&(qt=2)),!1;var S=Error(i(520),{cause:h});if(S=$n(S,u),Lo===null?Lo=[S]:Lo.push(S),qt!==4&&(qt=2),r===null)return!0;h=$n(h,u),u=r;do{switch(u.tag){case 3:return u.flags|=65536,a=v&-v,u.lanes|=a,a=Qf(u.stateNode,h,a),Af(u,a),!1;case 1:if(r=u.type,S=u.stateNode,(u.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Ai===null||!Ai.has(S))))return u.flags|=65536,v&=-v,u.lanes|=v,v=ux(v),cx(v,a,u,h),Af(u,v),!1}u=u.return}while(u!==null);return!1}var Wf=Error(i(461)),Zt=!1;function dn(a,r,u,h){r.child=a===null?m1(r,null,u,h):fr(r,a.child,u,h)}function dx(a,r,u,h,v){u=u.render;var S=r.ref;if("ref"in h){var O={};for(var V in h)V!=="ref"&&(O[V]=h[V])}else O=h;return lr(r),h=Df(a,r,u,O,S,v),V=Lf(),a!==null&&!Zt?(Of(a,r,v),Ka(a,r,v)):(mt&&V&&hf(r),r.flags|=1,dn(a,r,h,v),r.child)}function fx(a,r,u,h,v){if(a===null){var S=u.type;return typeof S=="function"&&!cf(S)&&S.defaultProps===void 0&&u.compare===null?(r.tag=15,r.type=S,hx(a,r,S,h,v)):(a=fu(u.type,null,h,r,r.mode,v),a.ref=r.ref,a.return=r,r.child=a)}if(S=a.child,!rh(a,v)){var O=S.memoizedProps;if(u=u.compare,u=u!==null?u:co,u(O,h)&&a.ref===r.ref)return Ka(a,r,v)}return r.flags|=1,a=Fa(S,h),a.ref=r.ref,a.return=r,r.child=a}function hx(a,r,u,h,v){if(a!==null){var S=a.memoizedProps;if(co(S,h)&&a.ref===r.ref)if(Zt=!1,r.pendingProps=h=S,rh(a,v))(a.flags&131072)!==0&&(Zt=!0);else return r.lanes=a.lanes,Ka(a,r,v)}return Zf(a,r,u,h,v)}function mx(a,r,u,h){var v=h.children,S=a!==null?a.memoizedState:null;if(a===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((r.flags&128)!==0){if(S=S!==null?S.baseLanes|u:u,a!==null){for(h=r.child=a.child,v=0;h!==null;)v=v|h.lanes|h.childLanes,h=h.sibling;h=v&~S}else h=0,r.child=null;return px(a,r,S,u,h)}if((u&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},a!==null&&gu(r,S!==null?S.cachePool:null),S!==null?x1(r,S):Nf(),b1(r);else return h=r.lanes=536870912,px(a,r,S!==null?S.baseLanes|u:u,u,h)}else S!==null?(gu(r,S.cachePool),x1(r,S),Ti(),r.memoizedState=null):(a!==null&&gu(r,null),Nf(),Ti());return dn(a,r,v,u),r.child}function Ao(a,r){return a!==null&&a.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function px(a,r,u,h,v){var S=Tf();return S=S===null?null:{parent:Qt._currentValue,pool:S},r.memoizedState={baseLanes:u,cachePool:S},a!==null&&gu(r,null),Nf(),b1(r),a!==null&&ns(a,r,h,!0),r.childLanes=v,null}function Du(a,r){return r=Ou({mode:r.mode,children:r.children},a.mode),r.ref=a.ref,a.child=r,r.return=a,r}function gx(a,r,u){return fr(r,a.child,null,u),a=Du(r,r.pendingProps),a.flags|=2,Bn(r),r.memoizedState=null,a}function q3(a,r,u){var h=r.pendingProps,v=(r.flags&128)!==0;if(r.flags&=-129,a===null){if(mt){if(h.mode==="hidden")return a=Du(r,h),r.lanes=536870912,Ao(null,a);if(Mf(r),(a=It)?(a=Nb(a,Zn),a=a!==null&&a.data==="&"?a:null,a!==null&&(r.memoizedState={dehydrated:a,treeContext:mi!==null?{id:Ea,overflow:Ta}:null,retryLane:536870912,hydrationErrors:null},u=Jg(a),u.return=r,r.child=u,un=r,It=null)):a=null,a===null)throw gi(r);return r.lanes=536870912,null}return Du(r,h)}var S=a.memoizedState;if(S!==null){var O=S.dehydrated;if(Mf(r),v)if(r.flags&256)r.flags&=-257,r=gx(a,r,u);else if(r.memoizedState!==null)r.child=a.child,r.flags|=128,r=null;else throw Error(i(558));else if(Zt||ns(a,r,u,!1),v=(u&a.childLanes)!==0,Zt||v){if(h=_t,h!==null&&(O=Zl(h,u),O!==0&&O!==S.retryLane))throw S.retryLane=O,ir(a,O),Mn(h,a,O),Wf;Vu(),r=gx(a,r,u)}else a=S.treeContext,It=ea(O.nextSibling),un=r,mt=!0,pi=null,Zn=!1,a!==null&&n1(r,a),r=Du(r,h),r.flags|=4096;return r}return a=Fa(a.child,{mode:h.mode,children:h.children}),a.ref=r.ref,r.child=a,a.return=r,a}function Lu(a,r){var u=r.ref;if(u===null)a!==null&&a.ref!==null&&(r.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(i(284));(a===null||a.ref!==u)&&(r.flags|=4194816)}}function Zf(a,r,u,h,v){return lr(r),u=Df(a,r,u,h,void 0,v),h=Lf(),a!==null&&!Zt?(Of(a,r,v),Ka(a,r,v)):(mt&&h&&hf(r),r.flags|=1,dn(a,r,u,v),r.child)}function xx(a,r,u,h,v,S){return lr(r),r.updateQueue=null,u=v1(r,h,u,v),y1(a),h=Lf(),a!==null&&!Zt?(Of(a,r,S),Ka(a,r,S)):(mt&&h&&hf(r),r.flags|=1,dn(a,r,u,S),r.child)}function bx(a,r,u,h,v){if(lr(r),r.stateNode===null){var S=Zr,O=u.contextType;typeof O=="object"&&O!==null&&(S=cn(O)),S=new u(h,S),r.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=$f,r.stateNode=S,S._reactInternals=r,S=r.stateNode,S.props=h,S.state=r.memoizedState,S.refs={},kf(r),O=u.contextType,S.context=typeof O=="object"&&O!==null?cn(O):Zr,S.state=r.memoizedState,O=u.getDerivedStateFromProps,typeof O=="function"&&(Kf(r,u,O,h),S.state=r.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(O=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),O!==S.state&&$f.enqueueReplaceState(S,S.state,null),Eo(r,h,S,v),vo(),S.state=r.memoizedState),typeof S.componentDidMount=="function"&&(r.flags|=4194308),h=!0}else if(a===null){S=r.stateNode;var V=r.memoizedProps,te=mr(u,V);S.props=te;var de=S.context,be=u.contextType;O=Zr,typeof be=="object"&&be!==null&&(O=cn(be));var ke=u.getDerivedStateFromProps;be=typeof ke=="function"||typeof S.getSnapshotBeforeUpdate=="function",V=r.pendingProps!==V,be||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(V||de!==O)&&ix(r,S,h,O),bi=!1;var he=r.memoizedState;S.state=he,Eo(r,h,S,v),vo(),de=r.memoizedState,V||he!==de||bi?(typeof ke=="function"&&(Kf(r,u,ke,h),de=r.memoizedState),(te=bi||ax(r,u,te,h,he,de,O))?(be||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(r.flags|=4194308)):(typeof S.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=h,r.memoizedState=de),S.props=h,S.state=de,S.context=O,h=te):(typeof S.componentDidMount=="function"&&(r.flags|=4194308),h=!1)}else{S=r.stateNode,wf(a,r),O=r.memoizedProps,be=mr(u,O),S.props=be,ke=r.pendingProps,he=S.context,de=u.contextType,te=Zr,typeof de=="object"&&de!==null&&(te=cn(de)),V=u.getDerivedStateFromProps,(de=typeof V=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(O!==ke||he!==te)&&ix(r,S,h,te),bi=!1,he=r.memoizedState,S.state=he,Eo(r,h,S,v),vo();var ge=r.memoizedState;O!==ke||he!==ge||bi||a!==null&&a.dependencies!==null&&mu(a.dependencies)?(typeof V=="function"&&(Kf(r,u,V,h),ge=r.memoizedState),(be=bi||ax(r,u,be,h,he,ge,te)||a!==null&&a.dependencies!==null&&mu(a.dependencies))?(de||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(h,ge,te),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(h,ge,te)),typeof S.componentDidUpdate=="function"&&(r.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof S.componentDidUpdate!="function"||O===a.memoizedProps&&he===a.memoizedState||(r.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||O===a.memoizedProps&&he===a.memoizedState||(r.flags|=1024),r.memoizedProps=h,r.memoizedState=ge),S.props=h,S.state=ge,S.context=te,h=be):(typeof S.componentDidUpdate!="function"||O===a.memoizedProps&&he===a.memoizedState||(r.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||O===a.memoizedProps&&he===a.memoizedState||(r.flags|=1024),h=!1)}return S=h,Lu(a,r),h=(r.flags&128)!==0,S||h?(S=r.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:S.render(),r.flags|=1,a!==null&&h?(r.child=fr(r,a.child,null,v),r.child=fr(r,null,u,v)):dn(a,r,u,v),r.memoizedState=S.state,a=r.child):a=Ka(a,r,v),a}function yx(a,r,u,h){return sr(),r.flags|=256,dn(a,r,u,h),r.child}var Jf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function eh(a){return{baseLanes:a,cachePool:l1()}}function th(a,r,u){return a=a!==null?a.childLanes&~u:0,r&&(a|=Un),a}function vx(a,r,u){var h=r.pendingProps,v=!1,S=(r.flags&128)!==0,O;if((O=S)||(O=a!==null&&a.memoizedState===null?!1:(Xt.current&2)!==0),O&&(v=!0,r.flags&=-129),O=(r.flags&32)!==0,r.flags&=-33,a===null){if(mt){if(v?Ei(r):Ti(),(a=It)?(a=Nb(a,Zn),a=a!==null&&a.data!=="&"?a:null,a!==null&&(r.memoizedState={dehydrated:a,treeContext:mi!==null?{id:Ea,overflow:Ta}:null,retryLane:536870912,hydrationErrors:null},u=Jg(a),u.return=r,r.child=u,un=r,It=null)):a=null,a===null)throw gi(r);return Ph(a)?r.lanes=32:r.lanes=536870912,null}var V=h.children;return h=h.fallback,v?(Ti(),v=r.mode,V=Ou({mode:"hidden",children:V},v),h=rr(h,v,u,null),V.return=r,h.return=r,V.sibling=h,r.child=V,h=r.child,h.memoizedState=eh(u),h.childLanes=th(a,O,u),r.memoizedState=Jf,Ao(null,h)):(Ei(r),nh(r,V))}var te=a.memoizedState;if(te!==null&&(V=te.dehydrated,V!==null)){if(S)r.flags&256?(Ei(r),r.flags&=-257,r=ah(a,r,u)):r.memoizedState!==null?(Ti(),r.child=a.child,r.flags|=128,r=null):(Ti(),V=h.fallback,v=r.mode,h=Ou({mode:"visible",children:h.children},v),V=rr(V,v,u,null),V.flags|=2,h.return=r,V.return=r,h.sibling=V,r.child=h,fr(r,a.child,null,u),h=r.child,h.memoizedState=eh(u),h.childLanes=th(a,O,u),r.memoizedState=Jf,r=Ao(null,h));else if(Ei(r),Ph(V)){if(O=V.nextSibling&&V.nextSibling.dataset,O)var de=O.dgst;O=de,h=Error(i(419)),h.stack="",h.digest=O,mo({value:h,source:null,stack:null}),r=ah(a,r,u)}else if(Zt||ns(a,r,u,!1),O=(u&a.childLanes)!==0,Zt||O){if(O=_t,O!==null&&(h=Zl(O,u),h!==0&&h!==te.retryLane))throw te.retryLane=h,ir(a,h),Mn(O,a,h),Wf;jh(V)||Vu(),r=ah(a,r,u)}else jh(V)?(r.flags|=192,r.child=a.child,r=null):(a=te.treeContext,It=ea(V.nextSibling),un=r,mt=!0,pi=null,Zn=!1,a!==null&&n1(r,a),r=nh(r,h.children),r.flags|=4096);return r}return v?(Ti(),V=h.fallback,v=r.mode,te=a.child,de=te.sibling,h=Fa(te,{mode:"hidden",children:h.children}),h.subtreeFlags=te.subtreeFlags&65011712,de!==null?V=Fa(de,V):(V=rr(V,v,u,null),V.flags|=2),V.return=r,h.return=r,h.sibling=V,r.child=h,Ao(null,h),h=r.child,V=a.child.memoizedState,V===null?V=eh(u):(v=V.cachePool,v!==null?(te=Qt._currentValue,v=v.parent!==te?{parent:te,pool:te}:v):v=l1(),V={baseLanes:V.baseLanes|u,cachePool:v}),h.memoizedState=V,h.childLanes=th(a,O,u),r.memoizedState=Jf,Ao(a.child,h)):(Ei(r),u=a.child,a=u.sibling,u=Fa(u,{mode:"visible",children:h.children}),u.return=r,u.sibling=null,a!==null&&(O=r.deletions,O===null?(r.deletions=[a],r.flags|=16):O.push(a)),r.child=u,r.memoizedState=null,u)}function nh(a,r){return r=Ou({mode:"visible",children:r},a.mode),r.return=a,a.child=r}function Ou(a,r){return a=jn(22,a,null,r),a.lanes=0,a}function ah(a,r,u){return fr(r,a.child,null,u),a=nh(r,r.pendingProps.children),a.flags|=2,r.memoizedState=null,a}function Ex(a,r,u){a.lanes|=r;var h=a.alternate;h!==null&&(h.lanes|=r),bf(a.return,r,u)}function ih(a,r,u,h,v,S){var O=a.memoizedState;O===null?a.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:v,treeForkCount:S}:(O.isBackwards=r,O.rendering=null,O.renderingStartTime=0,O.last=h,O.tail=u,O.tailMode=v,O.treeForkCount=S)}function Tx(a,r,u){var h=r.pendingProps,v=h.revealOrder,S=h.tail;h=h.children;var O=Xt.current,V=(O&2)!==0;if(V?(O=O&1|2,r.flags|=128):O&=1,U(Xt,O),dn(a,r,h,u),h=mt?ho:0,!V&&a!==null&&(a.flags&128)!==0)e:for(a=r.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&Ex(a,u,r);else if(a.tag===19)Ex(a,u,r);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break e;for(;a.sibling===null;){if(a.return===null||a.return===r)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(v){case"forwards":for(u=r.child,v=null;u!==null;)a=u.alternate,a!==null&&Tu(a)===null&&(v=u),u=u.sibling;u=v,u===null?(v=r.child,r.child=null):(v=u.sibling,u.sibling=null),ih(r,!1,v,u,S,h);break;case"backwards":case"unstable_legacy-backwards":for(u=null,v=r.child,r.child=null;v!==null;){if(a=v.alternate,a!==null&&Tu(a)===null){r.child=v;break}a=v.sibling,v.sibling=u,u=v,v=a}ih(r,!0,u,null,S,h);break;case"together":ih(r,!1,null,null,void 0,h);break;default:r.memoizedState=null}return r.child}function Ka(a,r,u){if(a!==null&&(r.dependencies=a.dependencies),wi|=r.lanes,(u&r.childLanes)===0)if(a!==null){if(ns(a,r,u,!1),(u&r.childLanes)===0)return null}else return null;if(a!==null&&r.child!==a.child)throw Error(i(153));if(r.child!==null){for(a=r.child,u=Fa(a,a.pendingProps),r.child=u,u.return=r;a.sibling!==null;)a=a.sibling,u=u.sibling=Fa(a,a.pendingProps),u.return=r;u.sibling=null}return r.child}function rh(a,r){return(a.lanes&r)!==0?!0:(a=a.dependencies,!!(a!==null&&mu(a)))}function Y3(a,r,u){switch(r.tag){case 3:Z(r,r.stateNode.containerInfo),xi(r,Qt,a.memoizedState.cache),sr();break;case 27:case 5:Fe(r);break;case 4:Z(r,r.stateNode.containerInfo);break;case 10:xi(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Mf(r),null;break;case 13:var h=r.memoizedState;if(h!==null)return h.dehydrated!==null?(Ei(r),r.flags|=128,null):(u&r.child.childLanes)!==0?vx(a,r,u):(Ei(r),a=Ka(a,r,u),a!==null?a.sibling:null);Ei(r);break;case 19:var v=(a.flags&128)!==0;if(h=(u&r.childLanes)!==0,h||(ns(a,r,u,!1),h=(u&r.childLanes)!==0),v){if(h)return Tx(a,r,u);r.flags|=128}if(v=r.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),U(Xt,Xt.current),h)break;return null;case 22:return r.lanes=0,mx(a,r,u,r.pendingProps);case 24:xi(r,Qt,a.memoizedState.cache)}return Ka(a,r,u)}function Sx(a,r,u){if(a!==null)if(a.memoizedProps!==r.pendingProps)Zt=!0;else{if(!rh(a,u)&&(r.flags&128)===0)return Zt=!1,Y3(a,r,u);Zt=(a.flags&131072)!==0}else Zt=!1,mt&&(r.flags&1048576)!==0&&t1(r,ho,r.index);switch(r.lanes=0,r.tag){case 16:e:{var h=r.pendingProps;if(a=cr(r.elementType),r.type=a,typeof a=="function")cf(a)?(h=mr(a,h),r.tag=1,r=bx(null,r,a,h,u)):(r.tag=0,r=Zf(null,r,a,h,u));else{if(a!=null){var v=a.$$typeof;if(v===L){r.tag=11,r=dx(null,r,a,h,u);break e}else if(v===j){r.tag=14,r=fx(null,r,a,h,u);break e}}throw r=q(a)||a,Error(i(306,r,""))}}return r;case 0:return Zf(a,r,r.type,r.pendingProps,u);case 1:return h=r.type,v=mr(h,r.pendingProps),bx(a,r,h,v,u);case 3:e:{if(Z(r,r.stateNode.containerInfo),a===null)throw Error(i(387));h=r.pendingProps;var S=r.memoizedState;v=S.element,wf(a,r),Eo(r,h,null,u);var O=r.memoizedState;if(h=O.cache,xi(r,Qt,h),h!==S.cache&&yf(r,[Qt],u,!0),vo(),h=O.element,S.isDehydrated)if(S={element:h,isDehydrated:!1,cache:O.cache},r.updateQueue.baseState=S,r.memoizedState=S,r.flags&256){r=yx(a,r,h,u);break e}else if(h!==v){v=$n(Error(i(424)),r),mo(v),r=yx(a,r,h,u);break e}else{switch(a=r.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(It=ea(a.firstChild),un=r,mt=!0,pi=null,Zn=!0,u=m1(r,null,h,u),r.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(sr(),h===v){r=Ka(a,r,u);break e}dn(a,r,h,u)}r=r.child}return r;case 26:return Lu(a,r),a===null?(u=Ob(r.type,null,r.pendingProps,null))?r.memoizedState=u:mt||(u=r.type,a=r.pendingProps,h=Qu(ne.current).createElement(u),h[nn]=r,h[kt]=a,fn(h,u,a),Gt(h),r.stateNode=h):r.memoizedState=Ob(r.type,a.memoizedProps,r.pendingProps,a.memoizedState),null;case 27:return Fe(r),a===null&&mt&&(h=r.stateNode=Rb(r.type,r.pendingProps,ne.current),un=r,Zn=!0,v=It,Mi(r.type)?(Bh=v,It=ea(h.firstChild)):It=v),dn(a,r,r.pendingProps.children,u),Lu(a,r),a===null&&(r.flags|=4194304),r.child;case 5:return a===null&&mt&&((v=h=It)&&(h=EA(h,r.type,r.pendingProps,Zn),h!==null?(r.stateNode=h,un=r,It=ea(h.firstChild),Zn=!1,v=!0):v=!1),v||gi(r)),Fe(r),v=r.type,S=r.pendingProps,O=a!==null?a.memoizedProps:null,h=S.children,Lh(v,S)?h=null:O!==null&&Lh(v,O)&&(r.flags|=32),r.memoizedState!==null&&(v=Df(a,r,j3,null,null,u),Ho._currentValue=v),Lu(a,r),dn(a,r,h,u),r.child;case 6:return a===null&&mt&&((a=u=It)&&(u=TA(u,r.pendingProps,Zn),u!==null?(r.stateNode=u,un=r,It=null,a=!0):a=!1),a||gi(r)),null;case 13:return vx(a,r,u);case 4:return Z(r,r.stateNode.containerInfo),h=r.pendingProps,a===null?r.child=fr(r,null,h,u):dn(a,r,h,u),r.child;case 11:return dx(a,r,r.type,r.pendingProps,u);case 7:return dn(a,r,r.pendingProps,u),r.child;case 8:return dn(a,r,r.pendingProps.children,u),r.child;case 12:return dn(a,r,r.pendingProps.children,u),r.child;case 10:return h=r.pendingProps,xi(r,r.type,h.value),dn(a,r,h.children,u),r.child;case 9:return v=r.type._context,h=r.pendingProps.children,lr(r),v=cn(v),h=h(v),r.flags|=1,dn(a,r,h,u),r.child;case 14:return fx(a,r,r.type,r.pendingProps,u);case 15:return hx(a,r,r.type,r.pendingProps,u);case 19:return Tx(a,r,u);case 31:return q3(a,r,u);case 22:return mx(a,r,u,r.pendingProps);case 24:return lr(r),h=cn(Qt),a===null?(v=Tf(),v===null&&(v=_t,S=vf(),v.pooledCache=S,S.refCount++,S!==null&&(v.pooledCacheLanes|=u),v=S),r.memoizedState={parent:h,cache:v},kf(r),xi(r,Qt,v)):((a.lanes&u)!==0&&(wf(a,r),Eo(r,null,null,u),vo()),v=a.memoizedState,S=r.memoizedState,v.parent!==h?(v={parent:h,cache:h},r.memoizedState=v,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=v),xi(r,Qt,h)):(h=S.cache,xi(r,Qt,h),h!==v.cache&&yf(r,[Qt],u,!0))),dn(a,r,r.pendingProps.children,u),r.child;case 29:throw r.pendingProps}throw Error(i(156,r.tag))}function $a(a){a.flags|=4}function sh(a,r,u,h,v){if((r=(a.mode&32)!==0)&&(r=!1),r){if(a.flags|=16777216,(v&335544128)===v)if(a.stateNode.complete)a.flags|=8192;else if(Qx())a.flags|=8192;else throw dr=bu,Sf}else a.flags&=-16777217}function kx(a,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!zb(r))if(Qx())a.flags|=8192;else throw dr=bu,Sf}function Iu(a,r){r!==null&&(a.flags|=4),a.flags&16384&&(r=a.tag!==22?Fr():536870912,a.lanes|=r,ms|=r)}function Co(a,r){if(!mt)switch(a.tailMode){case"hidden":r=a.tail;for(var u=null;r!==null;)r.alternate!==null&&(u=r),r=r.sibling;u===null?a.tail=null:u.sibling=null;break;case"collapsed":u=a.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?r||a.tail===null?a.tail=null:a.tail.sibling=null:h.sibling=null}}function jt(a){var r=a.alternate!==null&&a.alternate.child===a.child,u=0,h=0;if(r)for(var v=a.child;v!==null;)u|=v.lanes|v.childLanes,h|=v.subtreeFlags&65011712,h|=v.flags&65011712,v.return=a,v=v.sibling;else for(v=a.child;v!==null;)u|=v.lanes|v.childLanes,h|=v.subtreeFlags,h|=v.flags,v.return=a,v=v.sibling;return a.subtreeFlags|=h,a.childLanes=u,r}function G3(a,r,u){var h=r.pendingProps;switch(mf(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jt(r),null;case 1:return jt(r),null;case 3:return u=r.stateNode,h=null,a!==null&&(h=a.memoizedState.cache),r.memoizedState.cache!==h&&(r.flags|=2048),Ya(Qt),we(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(a===null||a.child===null)&&(ts(r)?$a(r):a===null||a.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,gf())),jt(r),null;case 26:var v=r.type,S=r.memoizedState;return a===null?($a(r),S!==null?(jt(r),kx(r,S)):(jt(r),sh(r,v,null,h,u))):S?S!==a.memoizedState?($a(r),jt(r),kx(r,S)):(jt(r),r.flags&=-16777217):(a=a.memoizedProps,a!==h&&$a(r),jt(r),sh(r,v,a,h,u)),null;case 27:if(Se(r),u=ne.current,v=r.type,a!==null&&r.stateNode!=null)a.memoizedProps!==h&&$a(r);else{if(!h){if(r.stateNode===null)throw Error(i(166));return jt(r),null}a=ae.current,ts(r)?a1(r):(a=Rb(v,h,u),r.stateNode=a,$a(r))}return jt(r),null;case 5:if(Se(r),v=r.type,a!==null&&r.stateNode!=null)a.memoizedProps!==h&&$a(r);else{if(!h){if(r.stateNode===null)throw Error(i(166));return jt(r),null}if(S=ae.current,ts(r))a1(r);else{var O=Qu(ne.current);switch(S){case 1:S=O.createElementNS("http://www.w3.org/2000/svg",v);break;case 2:S=O.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;default:switch(v){case"svg":S=O.createElementNS("http://www.w3.org/2000/svg",v);break;case"math":S=O.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;case"script":S=O.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof h.is=="string"?O.createElement("select",{is:h.is}):O.createElement("select"),h.multiple?S.multiple=!0:h.size&&(S.size=h.size);break;default:S=typeof h.is=="string"?O.createElement(v,{is:h.is}):O.createElement(v)}}S[nn]=r,S[kt]=h;e:for(O=r.child;O!==null;){if(O.tag===5||O.tag===6)S.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===r)break e;for(;O.sibling===null;){if(O.return===null||O.return===r)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}r.stateNode=S;e:switch(fn(S,v,h),v){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&$a(r)}}return jt(r),sh(r,r.type,a===null?null:a.memoizedProps,r.pendingProps,u),null;case 6:if(a&&r.stateNode!=null)a.memoizedProps!==h&&$a(r);else{if(typeof h!="string"&&r.stateNode===null)throw Error(i(166));if(a=ne.current,ts(r)){if(a=r.stateNode,u=r.memoizedProps,h=null,v=un,v!==null)switch(v.tag){case 27:case 5:h=v.memoizedProps}a[nn]=r,a=!!(a.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||vb(a.nodeValue,u)),a||gi(r,!0)}else a=Qu(a).createTextNode(h),a[nn]=r,r.stateNode=a}return jt(r),null;case 31:if(u=r.memoizedState,a===null||a.memoizedState!==null){if(h=ts(r),u!==null){if(a===null){if(!h)throw Error(i(318));if(a=r.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(557));a[nn]=r}else sr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;jt(r),a=!1}else u=gf(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=u),a=!0;if(!a)return r.flags&256?(Bn(r),r):(Bn(r),null);if((r.flags&128)!==0)throw Error(i(558))}return jt(r),null;case 13:if(h=r.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(v=ts(r),h!==null&&h.dehydrated!==null){if(a===null){if(!v)throw Error(i(318));if(v=r.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(i(317));v[nn]=r}else sr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;jt(r),v=!1}else v=gf(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=v),v=!0;if(!v)return r.flags&256?(Bn(r),r):(Bn(r),null)}return Bn(r),(r.flags&128)!==0?(r.lanes=u,r):(u=h!==null,a=a!==null&&a.memoizedState!==null,u&&(h=r.child,v=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(v=h.alternate.memoizedState.cachePool.pool),S=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(S=h.memoizedState.cachePool.pool),S!==v&&(h.flags|=2048)),u!==a&&u&&(r.child.flags|=8192),Iu(r,r.updateQueue),jt(r),null);case 4:return we(),a===null&&Nh(r.stateNode.containerInfo),jt(r),null;case 10:return Ya(r.type),jt(r),null;case 19:if(W(Xt),h=r.memoizedState,h===null)return jt(r),null;if(v=(r.flags&128)!==0,S=h.rendering,S===null)if(v)Co(h,!1);else{if(qt!==0||a!==null&&(a.flags&128)!==0)for(a=r.child;a!==null;){if(S=Tu(a),S!==null){for(r.flags|=128,Co(h,!1),a=S.updateQueue,r.updateQueue=a,Iu(r,a),r.subtreeFlags=0,a=u,u=r.child;u!==null;)Zg(u,a),u=u.sibling;return U(Xt,Xt.current&1|2),mt&&Va(r,h.treeForkCount),r.child}a=a.sibling}h.tail!==null&&st()>Uu&&(r.flags|=128,v=!0,Co(h,!1),r.lanes=4194304)}else{if(!v)if(a=Tu(S),a!==null){if(r.flags|=128,v=!0,a=a.updateQueue,r.updateQueue=a,Iu(r,a),Co(h,!0),h.tail===null&&h.tailMode==="hidden"&&!S.alternate&&!mt)return jt(r),null}else 2*st()-h.renderingStartTime>Uu&&u!==536870912&&(r.flags|=128,v=!0,Co(h,!1),r.lanes=4194304);h.isBackwards?(S.sibling=r.child,r.child=S):(a=h.last,a!==null?a.sibling=S:r.child=S,h.last=S)}return h.tail!==null?(a=h.tail,h.rendering=a,h.tail=a.sibling,h.renderingStartTime=st(),a.sibling=null,u=Xt.current,U(Xt,v?u&1|2:u&1),mt&&Va(r,h.treeForkCount),a):(jt(r),null);case 22:case 23:return Bn(r),_f(),h=r.memoizedState!==null,a!==null?a.memoizedState!==null!==h&&(r.flags|=8192):h&&(r.flags|=8192),h?(u&536870912)!==0&&(r.flags&128)===0&&(jt(r),r.subtreeFlags&6&&(r.flags|=8192)):jt(r),u=r.updateQueue,u!==null&&Iu(r,u.retryQueue),u=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),h=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(h=r.memoizedState.cachePool.pool),h!==u&&(r.flags|=2048),a!==null&&W(ur),null;case 24:return u=null,a!==null&&(u=a.memoizedState.cache),r.memoizedState.cache!==u&&(r.flags|=2048),Ya(Qt),jt(r),null;case 25:return null;case 30:return null}throw Error(i(156,r.tag))}function X3(a,r){switch(mf(r),r.tag){case 1:return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 3:return Ya(Qt),we(),a=r.flags,(a&65536)!==0&&(a&128)===0?(r.flags=a&-65537|128,r):null;case 26:case 27:case 5:return Se(r),null;case 31:if(r.memoizedState!==null){if(Bn(r),r.alternate===null)throw Error(i(340));sr()}return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 13:if(Bn(r),a=r.memoizedState,a!==null&&a.dehydrated!==null){if(r.alternate===null)throw Error(i(340));sr()}return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 19:return W(Xt),null;case 4:return we(),null;case 10:return Ya(r.type),null;case 22:case 23:return Bn(r),_f(),a!==null&&W(ur),a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 24:return Ya(Qt),null;case 25:return null;default:return null}}function wx(a,r){switch(mf(r),r.tag){case 3:Ya(Qt),we();break;case 26:case 27:case 5:Se(r);break;case 4:we();break;case 31:r.memoizedState!==null&&Bn(r);break;case 13:Bn(r);break;case 19:W(Xt);break;case 10:Ya(r.type);break;case 22:case 23:Bn(r),_f(),a!==null&&W(ur);break;case 24:Ya(Qt)}}function No(a,r){try{var u=r.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var v=h.next;u=v;do{if((u.tag&a)===a){h=void 0;var S=u.create,O=u.inst;h=S(),O.destroy=h}u=u.next}while(u!==v)}}catch(V){St(r,r.return,V)}}function Si(a,r,u){try{var h=r.updateQueue,v=h!==null?h.lastEffect:null;if(v!==null){var S=v.next;h=S;do{if((h.tag&a)===a){var O=h.inst,V=O.destroy;if(V!==void 0){O.destroy=void 0,v=r;var te=u,de=V;try{de()}catch(be){St(v,te,be)}}}h=h.next}while(h!==S)}}catch(be){St(r,r.return,be)}}function Ax(a){var r=a.updateQueue;if(r!==null){var u=a.stateNode;try{g1(r,u)}catch(h){St(a,a.return,h)}}}function Cx(a,r,u){u.props=mr(a.type,a.memoizedProps),u.state=a.memoizedState;try{u.componentWillUnmount()}catch(h){St(a,r,h)}}function _o(a,r){try{var u=a.ref;if(u!==null){switch(a.tag){case 26:case 27:case 5:var h=a.stateNode;break;case 30:h=a.stateNode;break;default:h=a.stateNode}typeof u=="function"?a.refCleanup=u(h):u.current=h}}catch(v){St(a,r,v)}}function Sa(a,r){var u=a.ref,h=a.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(v){St(a,r,v)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(v){St(a,r,v)}else u.current=null}function Nx(a){var r=a.type,u=a.memoizedProps,h=a.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(v){St(a,a.return,v)}}function oh(a,r,u){try{var h=a.stateNode;pA(h,a.type,u,r),h[kt]=r}catch(v){St(a,a.return,v)}}function _x(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Mi(a.type)||a.tag===4}function lh(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||_x(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Mi(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function uh(a,r,u){var h=a.tag;if(h===5||h===6)a=a.stateNode,r?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(a,r):(r=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,r.appendChild(a),u=u._reactRootContainer,u!=null||r.onclick!==null||(r.onclick=Ua));else if(h!==4&&(h===27&&Mi(a.type)&&(u=a.stateNode,r=null),a=a.child,a!==null))for(uh(a,r,u),a=a.sibling;a!==null;)uh(a,r,u),a=a.sibling}function ju(a,r,u){var h=a.tag;if(h===5||h===6)a=a.stateNode,r?u.insertBefore(a,r):u.appendChild(a);else if(h!==4&&(h===27&&Mi(a.type)&&(u=a.stateNode),a=a.child,a!==null))for(ju(a,r,u),a=a.sibling;a!==null;)ju(a,r,u),a=a.sibling}function Mx(a){var r=a.stateNode,u=a.memoizedProps;try{for(var h=a.type,v=r.attributes;v.length;)r.removeAttributeNode(v[0]);fn(r,h,u),r[nn]=a,r[kt]=u}catch(S){St(a,a.return,S)}}var Qa=!1,Jt=!1,ch=!1,Rx=typeof WeakSet=="function"?WeakSet:Set,sn=null;function K3(a,r){if(a=a.containerInfo,Rh=ac,a=Vg(a),nf(a)){if("selectionStart"in a)var u={start:a.selectionStart,end:a.selectionEnd};else e:{u=(u=a.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var v=h.anchorOffset,S=h.focusNode;h=h.focusOffset;try{u.nodeType,S.nodeType}catch{u=null;break e}var O=0,V=-1,te=-1,de=0,be=0,ke=a,he=null;t:for(;;){for(var ge;ke!==u||v!==0&&ke.nodeType!==3||(V=O+v),ke!==S||h!==0&&ke.nodeType!==3||(te=O+h),ke.nodeType===3&&(O+=ke.nodeValue.length),(ge=ke.firstChild)!==null;)he=ke,ke=ge;for(;;){if(ke===a)break t;if(he===u&&++de===v&&(V=O),he===S&&++be===h&&(te=O),(ge=ke.nextSibling)!==null)break;ke=he,he=ke.parentNode}ke=ge}u=V===-1||te===-1?null:{start:V,end:te}}else u=null}u=u||{start:0,end:0}}else u=null;for(Dh={focusedElem:a,selectionRange:u},ac=!1,sn=r;sn!==null;)if(r=sn,a=r.child,(r.subtreeFlags&1028)!==0&&a!==null)a.return=r,sn=a;else for(;sn!==null;){switch(r=sn,S=r.alternate,a=r.flags,r.tag){case 0:if((a&4)!==0&&(a=r.updateQueue,a=a!==null?a.events:null,a!==null))for(u=0;u<a.length;u++)v=a[u],v.ref.impl=v.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&S!==null){a=void 0,u=r,v=S.memoizedProps,S=S.memoizedState,h=u.stateNode;try{var Pe=mr(u.type,v);a=h.getSnapshotBeforeUpdate(Pe,S),h.__reactInternalSnapshotBeforeUpdate=a}catch(Ge){St(u,u.return,Ge)}}break;case 3:if((a&1024)!==0){if(a=r.stateNode.containerInfo,u=a.nodeType,u===9)Ih(a);else if(u===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Ih(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(i(163))}if(a=r.sibling,a!==null){a.return=r.return,sn=a;break}sn=r.return}}function Dx(a,r,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:Za(a,u),h&4&&No(5,u);break;case 1:if(Za(a,u),h&4)if(a=u.stateNode,r===null)try{a.componentDidMount()}catch(O){St(u,u.return,O)}else{var v=mr(u.type,r.memoizedProps);r=r.memoizedState;try{a.componentDidUpdate(v,r,a.__reactInternalSnapshotBeforeUpdate)}catch(O){St(u,u.return,O)}}h&64&&Ax(u),h&512&&_o(u,u.return);break;case 3:if(Za(a,u),h&64&&(a=u.updateQueue,a!==null)){if(r=null,u.child!==null)switch(u.child.tag){case 27:case 5:r=u.child.stateNode;break;case 1:r=u.child.stateNode}try{g1(a,r)}catch(O){St(u,u.return,O)}}break;case 27:r===null&&h&4&&Mx(u);case 26:case 5:Za(a,u),r===null&&h&4&&Nx(u),h&512&&_o(u,u.return);break;case 12:Za(a,u);break;case 31:Za(a,u),h&4&&Ix(a,u);break;case 13:Za(a,u),h&4&&jx(a,u),h&64&&(a=u.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(u=aA.bind(null,u),SA(a,u))));break;case 22:if(h=u.memoizedState!==null||Qa,!h){r=r!==null&&r.memoizedState!==null||Jt,v=Qa;var S=Jt;Qa=h,(Jt=r)&&!S?Ja(a,u,(u.subtreeFlags&8772)!==0):Za(a,u),Qa=v,Jt=S}break;case 30:break;default:Za(a,u)}}function Lx(a){var r=a.alternate;r!==null&&(a.alternate=null,Lx(r)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(r=a.stateNode,r!==null&&Vr(r)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var Pt=null,An=!1;function Wa(a,r,u){for(u=u.child;u!==null;)Ox(a,r,u),u=u.sibling}function Ox(a,r,u){if(se&&typeof se.onCommitFiberUnmount=="function")try{se.onCommitFiberUnmount(We,u)}catch{}switch(u.tag){case 26:Jt||Sa(u,r),Wa(a,r,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Jt||Sa(u,r);var h=Pt,v=An;Mi(u.type)&&(Pt=u.stateNode,An=!1),Wa(a,r,u),Bo(u.stateNode),Pt=h,An=v;break;case 5:Jt||Sa(u,r);case 6:if(h=Pt,v=An,Pt=null,Wa(a,r,u),Pt=h,An=v,Pt!==null)if(An)try{(Pt.nodeType===9?Pt.body:Pt.nodeName==="HTML"?Pt.ownerDocument.body:Pt).removeChild(u.stateNode)}catch(S){St(u,r,S)}else try{Pt.removeChild(u.stateNode)}catch(S){St(u,r,S)}break;case 18:Pt!==null&&(An?(a=Pt,Ab(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,u.stateNode),Ts(a)):Ab(Pt,u.stateNode));break;case 4:h=Pt,v=An,Pt=u.stateNode.containerInfo,An=!0,Wa(a,r,u),Pt=h,An=v;break;case 0:case 11:case 14:case 15:Si(2,u,r),Jt||Si(4,u,r),Wa(a,r,u);break;case 1:Jt||(Sa(u,r),h=u.stateNode,typeof h.componentWillUnmount=="function"&&Cx(u,r,h)),Wa(a,r,u);break;case 21:Wa(a,r,u);break;case 22:Jt=(h=Jt)||u.memoizedState!==null,Wa(a,r,u),Jt=h;break;default:Wa(a,r,u)}}function Ix(a,r){if(r.memoizedState===null&&(a=r.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Ts(a)}catch(u){St(r,r.return,u)}}}function jx(a,r){if(r.memoizedState===null&&(a=r.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Ts(a)}catch(u){St(r,r.return,u)}}function $3(a){switch(a.tag){case 31:case 13:case 19:var r=a.stateNode;return r===null&&(r=a.stateNode=new Rx),r;case 22:return a=a.stateNode,r=a._retryCache,r===null&&(r=a._retryCache=new Rx),r;default:throw Error(i(435,a.tag))}}function Pu(a,r){var u=$3(a);r.forEach(function(h){if(!u.has(h)){u.add(h);var v=iA.bind(null,a,h);h.then(v,v)}})}function Cn(a,r){var u=r.deletions;if(u!==null)for(var h=0;h<u.length;h++){var v=u[h],S=a,O=r,V=O;e:for(;V!==null;){switch(V.tag){case 27:if(Mi(V.type)){Pt=V.stateNode,An=!1;break e}break;case 5:Pt=V.stateNode,An=!1;break e;case 3:case 4:Pt=V.stateNode.containerInfo,An=!0;break e}V=V.return}if(Pt===null)throw Error(i(160));Ox(S,O,v),Pt=null,An=!1,S=v.alternate,S!==null&&(S.return=null),v.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Px(r,a),r=r.sibling}var da=null;function Px(a,r){var u=a.alternate,h=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Cn(r,a),Nn(a),h&4&&(Si(3,a,a.return),No(3,a),Si(5,a,a.return));break;case 1:Cn(r,a),Nn(a),h&512&&(Jt||u===null||Sa(u,u.return)),h&64&&Qa&&(a=a.updateQueue,a!==null&&(h=a.callbacks,h!==null&&(u=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var v=da;if(Cn(r,a),Nn(a),h&512&&(Jt||u===null||Sa(u,u.return)),h&4){var S=u!==null?u.memoizedState:null;if(h=a.memoizedState,u===null)if(h===null)if(a.stateNode===null){e:{h=a.type,u=a.memoizedProps,v=v.ownerDocument||v;t:switch(h){case"title":S=v.getElementsByTagName("title")[0],(!S||S[Ji]||S[nn]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=v.createElement(h),v.head.insertBefore(S,v.querySelector("head > title"))),fn(S,h,u),S[nn]=a,Gt(S),h=S;break e;case"link":var O=Pb("link","href",v).get(h+(u.href||""));if(O){for(var V=0;V<O.length;V++)if(S=O[V],S.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&S.getAttribute("rel")===(u.rel==null?null:u.rel)&&S.getAttribute("title")===(u.title==null?null:u.title)&&S.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){O.splice(V,1);break t}}S=v.createElement(h),fn(S,h,u),v.head.appendChild(S);break;case"meta":if(O=Pb("meta","content",v).get(h+(u.content||""))){for(V=0;V<O.length;V++)if(S=O[V],S.getAttribute("content")===(u.content==null?null:""+u.content)&&S.getAttribute("name")===(u.name==null?null:u.name)&&S.getAttribute("property")===(u.property==null?null:u.property)&&S.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&S.getAttribute("charset")===(u.charSet==null?null:u.charSet)){O.splice(V,1);break t}}S=v.createElement(h),fn(S,h,u),v.head.appendChild(S);break;default:throw Error(i(468,h))}S[nn]=a,Gt(S),h=S}a.stateNode=h}else Bb(v,a.type,a.stateNode);else a.stateNode=jb(v,h,a.memoizedProps);else S!==h?(S===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):S.count--,h===null?Bb(v,a.type,a.stateNode):jb(v,h,a.memoizedProps)):h===null&&a.stateNode!==null&&oh(a,a.memoizedProps,u.memoizedProps)}break;case 27:Cn(r,a),Nn(a),h&512&&(Jt||u===null||Sa(u,u.return)),u!==null&&h&4&&oh(a,a.memoizedProps,u.memoizedProps);break;case 5:if(Cn(r,a),Nn(a),h&512&&(Jt||u===null||Sa(u,u.return)),a.flags&32){v=a.stateNode;try{Yr(v,"")}catch(Pe){St(a,a.return,Pe)}}h&4&&a.stateNode!=null&&(v=a.memoizedProps,oh(a,v,u!==null?u.memoizedProps:v)),h&1024&&(ch=!0);break;case 6:if(Cn(r,a),Nn(a),h&4){if(a.stateNode===null)throw Error(i(162));h=a.memoizedProps,u=a.stateNode;try{u.nodeValue=h}catch(Pe){St(a,a.return,Pe)}}break;case 3:if(Ju=null,v=da,da=Wu(r.containerInfo),Cn(r,a),da=v,Nn(a),h&4&&u!==null&&u.memoizedState.isDehydrated)try{Ts(r.containerInfo)}catch(Pe){St(a,a.return,Pe)}ch&&(ch=!1,Bx(a));break;case 4:h=da,da=Wu(a.stateNode.containerInfo),Cn(r,a),Nn(a),da=h;break;case 12:Cn(r,a),Nn(a);break;case 31:Cn(r,a),Nn(a),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,Pu(a,h)));break;case 13:Cn(r,a),Nn(a),a.child.flags&8192&&a.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(zu=st()),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,Pu(a,h)));break;case 22:v=a.memoizedState!==null;var te=u!==null&&u.memoizedState!==null,de=Qa,be=Jt;if(Qa=de||v,Jt=be||te,Cn(r,a),Jt=be,Qa=de,Nn(a),h&8192)e:for(r=a.stateNode,r._visibility=v?r._visibility&-2:r._visibility|1,v&&(u===null||te||Qa||Jt||pr(a)),u=null,r=a;;){if(r.tag===5||r.tag===26){if(u===null){te=u=r;try{if(S=te.stateNode,v)O=S.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{V=te.stateNode;var ke=te.memoizedProps.style,he=ke!=null&&ke.hasOwnProperty("display")?ke.display:null;V.style.display=he==null||typeof he=="boolean"?"":(""+he).trim()}}catch(Pe){St(te,te.return,Pe)}}}else if(r.tag===6){if(u===null){te=r;try{te.stateNode.nodeValue=v?"":te.memoizedProps}catch(Pe){St(te,te.return,Pe)}}}else if(r.tag===18){if(u===null){te=r;try{var ge=te.stateNode;v?Cb(ge,!0):Cb(te.stateNode,!1)}catch(Pe){St(te,te.return,Pe)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===a)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break e;for(;r.sibling===null;){if(r.return===null||r.return===a)break e;u===r&&(u=null),r=r.return}u===r&&(u=null),r.sibling.return=r.return,r=r.sibling}h&4&&(h=a.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,Pu(a,u))));break;case 19:Cn(r,a),Nn(a),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,Pu(a,h)));break;case 30:break;case 21:break;default:Cn(r,a),Nn(a)}}function Nn(a){var r=a.flags;if(r&2){try{for(var u,h=a.return;h!==null;){if(_x(h)){u=h;break}h=h.return}if(u==null)throw Error(i(160));switch(u.tag){case 27:var v=u.stateNode,S=lh(a);ju(a,S,v);break;case 5:var O=u.stateNode;u.flags&32&&(Yr(O,""),u.flags&=-33);var V=lh(a);ju(a,V,O);break;case 3:case 4:var te=u.stateNode.containerInfo,de=lh(a);uh(a,de,te);break;default:throw Error(i(161))}}catch(be){St(a,a.return,be)}a.flags&=-3}r&4096&&(a.flags&=-4097)}function Bx(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var r=a;Bx(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),a=a.sibling}}function Za(a,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Dx(a,r.alternate,r),r=r.sibling}function pr(a){for(a=a.child;a!==null;){var r=a;switch(r.tag){case 0:case 11:case 14:case 15:Si(4,r,r.return),pr(r);break;case 1:Sa(r,r.return);var u=r.stateNode;typeof u.componentWillUnmount=="function"&&Cx(r,r.return,u),pr(r);break;case 27:Bo(r.stateNode);case 26:case 5:Sa(r,r.return),pr(r);break;case 22:r.memoizedState===null&&pr(r);break;case 30:pr(r);break;default:pr(r)}a=a.sibling}}function Ja(a,r,u){for(u=u&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var h=r.alternate,v=a,S=r,O=S.flags;switch(S.tag){case 0:case 11:case 15:Ja(v,S,u),No(4,S);break;case 1:if(Ja(v,S,u),h=S,v=h.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(de){St(h,h.return,de)}if(h=S,v=h.updateQueue,v!==null){var V=h.stateNode;try{var te=v.shared.hiddenCallbacks;if(te!==null)for(v.shared.hiddenCallbacks=null,v=0;v<te.length;v++)p1(te[v],V)}catch(de){St(h,h.return,de)}}u&&O&64&&Ax(S),_o(S,S.return);break;case 27:Mx(S);case 26:case 5:Ja(v,S,u),u&&h===null&&O&4&&Nx(S),_o(S,S.return);break;case 12:Ja(v,S,u);break;case 31:Ja(v,S,u),u&&O&4&&Ix(v,S);break;case 13:Ja(v,S,u),u&&O&4&&jx(v,S);break;case 22:S.memoizedState===null&&Ja(v,S,u),_o(S,S.return);break;case 30:break;default:Ja(v,S,u)}r=r.sibling}}function dh(a,r){var u=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==u&&(a!=null&&a.refCount++,u!=null&&po(u))}function fh(a,r){a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&po(a))}function fa(a,r,u,h){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)zx(a,r,u,h),r=r.sibling}function zx(a,r,u,h){var v=r.flags;switch(r.tag){case 0:case 11:case 15:fa(a,r,u,h),v&2048&&No(9,r);break;case 1:fa(a,r,u,h);break;case 3:fa(a,r,u,h),v&2048&&(a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&po(a)));break;case 12:if(v&2048){fa(a,r,u,h),a=r.stateNode;try{var S=r.memoizedProps,O=S.id,V=S.onPostCommit;typeof V=="function"&&V(O,r.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(te){St(r,r.return,te)}}else fa(a,r,u,h);break;case 31:fa(a,r,u,h);break;case 13:fa(a,r,u,h);break;case 23:break;case 22:S=r.stateNode,O=r.alternate,r.memoizedState!==null?S._visibility&2?fa(a,r,u,h):Mo(a,r):S._visibility&2?fa(a,r,u,h):(S._visibility|=2,ds(a,r,u,h,(r.subtreeFlags&10256)!==0||!1)),v&2048&&dh(O,r);break;case 24:fa(a,r,u,h),v&2048&&fh(r.alternate,r);break;default:fa(a,r,u,h)}}function ds(a,r,u,h,v){for(v=v&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var S=a,O=r,V=u,te=h,de=O.flags;switch(O.tag){case 0:case 11:case 15:ds(S,O,V,te,v),No(8,O);break;case 23:break;case 22:var be=O.stateNode;O.memoizedState!==null?be._visibility&2?ds(S,O,V,te,v):Mo(S,O):(be._visibility|=2,ds(S,O,V,te,v)),v&&de&2048&&dh(O.alternate,O);break;case 24:ds(S,O,V,te,v),v&&de&2048&&fh(O.alternate,O);break;default:ds(S,O,V,te,v)}r=r.sibling}}function Mo(a,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var u=a,h=r,v=h.flags;switch(h.tag){case 22:Mo(u,h),v&2048&&dh(h.alternate,h);break;case 24:Mo(u,h),v&2048&&fh(h.alternate,h);break;default:Mo(u,h)}r=r.sibling}}var Ro=8192;function fs(a,r,u){if(a.subtreeFlags&Ro)for(a=a.child;a!==null;)Ux(a,r,u),a=a.sibling}function Ux(a,r,u){switch(a.tag){case 26:fs(a,r,u),a.flags&Ro&&a.memoizedState!==null&&IA(u,da,a.memoizedState,a.memoizedProps);break;case 5:fs(a,r,u);break;case 3:case 4:var h=da;da=Wu(a.stateNode.containerInfo),fs(a,r,u),da=h;break;case 22:a.memoizedState===null&&(h=a.alternate,h!==null&&h.memoizedState!==null?(h=Ro,Ro=16777216,fs(a,r,u),Ro=h):fs(a,r,u));break;default:fs(a,r,u)}}function Hx(a){var r=a.alternate;if(r!==null&&(a=r.child,a!==null)){r.child=null;do r=a.sibling,a.sibling=null,a=r;while(a!==null)}}function Do(a){var r=a.deletions;if((a.flags&16)!==0){if(r!==null)for(var u=0;u<r.length;u++){var h=r[u];sn=h,Vx(h,a)}Hx(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Fx(a),a=a.sibling}function Fx(a){switch(a.tag){case 0:case 11:case 15:Do(a),a.flags&2048&&Si(9,a,a.return);break;case 3:Do(a);break;case 12:Do(a);break;case 22:var r=a.stateNode;a.memoizedState!==null&&r._visibility&2&&(a.return===null||a.return.tag!==13)?(r._visibility&=-3,Bu(a)):Do(a);break;default:Do(a)}}function Bu(a){var r=a.deletions;if((a.flags&16)!==0){if(r!==null)for(var u=0;u<r.length;u++){var h=r[u];sn=h,Vx(h,a)}Hx(a)}for(a=a.child;a!==null;){switch(r=a,r.tag){case 0:case 11:case 15:Si(8,r,r.return),Bu(r);break;case 22:u=r.stateNode,u._visibility&2&&(u._visibility&=-3,Bu(r));break;default:Bu(r)}a=a.sibling}}function Vx(a,r){for(;sn!==null;){var u=sn;switch(u.tag){case 0:case 11:case 15:Si(8,u,r);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var h=u.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:po(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,sn=h;else e:for(u=a;sn!==null;){h=sn;var v=h.sibling,S=h.return;if(Lx(h),h===u){sn=null;break e}if(v!==null){v.return=S,sn=v;break e}sn=S}}}var Q3={getCacheForType:function(a){var r=cn(Qt),u=r.data.get(a);return u===void 0&&(u=a(),r.data.set(a,u)),u},cacheSignal:function(){return cn(Qt).controller.signal}},W3=typeof WeakMap=="function"?WeakMap:Map,Et=0,_t=null,ut=null,ft=0,Tt=0,zn=null,ki=!1,hs=!1,hh=!1,ei=0,qt=0,wi=0,gr=0,mh=0,Un=0,ms=0,Lo=null,_n=null,ph=!1,zu=0,qx=0,Uu=1/0,Hu=null,Ai=null,an=0,Ci=null,ps=null,ti=0,gh=0,xh=null,Yx=null,Oo=0,bh=null;function Hn(){return(Et&2)!==0&&ft!==0?ft&-ft:H.T!==null?kh():Zs()}function Gx(){if(Un===0)if((ft&536870912)===0||mt){var a=ci;ci<<=1,(ci&3932160)===0&&(ci=262144),Un=a}else Un=536870912;return a=Pn.current,a!==null&&(a.flags|=32),Un}function Mn(a,r,u){(a===_t&&(Tt===2||Tt===9)||a.cancelPendingCommit!==null)&&(gs(a,0),Ni(a,ft,Un,!1)),Qi(a,u),((Et&2)===0||a!==_t)&&(a===_t&&((Et&2)===0&&(gr|=u),qt===4&&Ni(a,ft,Un,!1)),ka(a))}function Xx(a,r,u){if((Et&6)!==0)throw Error(i(327));var h=!u&&(r&127)===0&&(r&a.expiredLanes)===0||di(a,r),v=h?eA(a,r):vh(a,r,!0),S=h;do{if(v===0){hs&&!h&&Ni(a,r,0,!1);break}else{if(u=a.current.alternate,S&&!Z3(u)){v=vh(a,r,!1),S=!1;continue}if(v===2){if(S=r,a.errorRecoveryDisabledLanes&S)var O=0;else O=a.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){r=O;e:{var V=a;v=Lo;var te=V.current.memoizedState.isDehydrated;if(te&&(gs(V,O).flags|=256),O=vh(V,O,!1),O!==2){if(hh&&!te){V.errorRecoveryDisabledLanes|=S,gr|=S,v=4;break e}S=_n,_n=v,S!==null&&(_n===null?_n=S:_n.push.apply(_n,S))}v=O}if(S=!1,v!==2)continue}}if(v===1){gs(a,0),Ni(a,r,0,!0);break}e:{switch(h=a,S=v,S){case 0:case 1:throw Error(i(345));case 4:if((r&4194048)!==r)break;case 6:Ni(h,r,Un,!ki);break e;case 2:_n=null;break;case 3:case 5:break;default:throw Error(i(329))}if((r&62914560)===r&&(v=zu+300-st(),10<v)){if(Ni(h,r,Un,!ki),Ki(h,0,!0)!==0)break e;ti=r,h.timeoutHandle=kb(Kx.bind(null,h,u,_n,Hu,ph,r,Un,gr,ms,ki,S,"Throttled",-0,0),v);break e}Kx(h,u,_n,Hu,ph,r,Un,gr,ms,ki,S,null,-0,0)}}break}while(!0);ka(a)}function Kx(a,r,u,h,v,S,O,V,te,de,be,ke,he,ge){if(a.timeoutHandle=-1,ke=r.subtreeFlags,ke&8192||(ke&16785408)===16785408){ke={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ua},Ux(r,S,ke);var Pe=(S&62914560)===S?zu-st():(S&4194048)===S?qx-st():0;if(Pe=jA(ke,Pe),Pe!==null){ti=S,a.cancelPendingCommit=Pe(nb.bind(null,a,r,S,u,h,v,O,V,te,be,ke,null,he,ge)),Ni(a,S,O,!de);return}}nb(a,r,S,u,h,v,O,V,te)}function Z3(a){for(var r=a;;){var u=r.tag;if((u===0||u===11||u===15)&&r.flags&16384&&(u=r.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var h=0;h<u.length;h++){var v=u[h],S=v.getSnapshot;v=v.value;try{if(!In(S(),v))return!1}catch{return!1}}if(u=r.child,r.subtreeFlags&16384&&u!==null)u.return=r,r=u;else{if(r===a)break;for(;r.sibling===null;){if(r.return===null||r.return===a)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Ni(a,r,u,h){r&=~mh,r&=~gr,a.suspendedLanes|=r,a.pingedLanes&=~r,h&&(a.warmLanes|=r),h=a.expirationTimes;for(var v=r;0<v;){var S=31-Je(v),O=1<<S;h[S]=-1,v&=~O}u!==0&&Ql(a,u,r)}function Fu(){return(Et&6)===0?(Io(0),!1):!0}function yh(){if(ut!==null){if(Tt===0)var a=ut.return;else a=ut,qa=or=null,If(a),ss=null,xo=0,a=ut;for(;a!==null;)wx(a.alternate,a),a=a.return;ut=null}}function gs(a,r){var u=a.timeoutHandle;u!==-1&&(a.timeoutHandle=-1,bA(u)),u=a.cancelPendingCommit,u!==null&&(a.cancelPendingCommit=null,u()),ti=0,yh(),_t=a,ut=u=Fa(a.current,null),ft=r,Tt=0,zn=null,ki=!1,hs=di(a,r),hh=!1,ms=Un=mh=gr=wi=qt=0,_n=Lo=null,ph=!1,(r&8)!==0&&(r|=r&32);var h=a.entangledLanes;if(h!==0)for(a=a.entanglements,h&=r;0<h;){var v=31-Je(h),S=1<<v;r|=a[v],h&=~S}return ei=r,uu(),u}function $x(a,r){et=null,H.H=wo,r===rs||r===xu?(r=d1(),Tt=3):r===Sf?(r=d1(),Tt=4):Tt=r===Wf?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,zn=r,ut===null&&(qt=1,Ru(a,$n(r,a.current)))}function Qx(){var a=Pn.current;return a===null?!0:(ft&4194048)===ft?Jn===null:(ft&62914560)===ft||(ft&536870912)!==0?a===Jn:!1}function Wx(){var a=H.H;return H.H=wo,a===null?wo:a}function Zx(){var a=H.A;return H.A=Q3,a}function Vu(){qt=4,ki||(ft&4194048)!==ft&&Pn.current!==null||(hs=!0),(wi&134217727)===0&&(gr&134217727)===0||_t===null||Ni(_t,ft,Un,!1)}function vh(a,r,u){var h=Et;Et|=2;var v=Wx(),S=Zx();(_t!==a||ft!==r)&&(Hu=null,gs(a,r)),r=!1;var O=qt;e:do try{if(Tt!==0&&ut!==null){var V=ut,te=zn;switch(Tt){case 8:yh(),O=6;break e;case 3:case 2:case 9:case 6:Pn.current===null&&(r=!0);var de=Tt;if(Tt=0,zn=null,xs(a,V,te,de),u&&hs){O=0;break e}break;default:de=Tt,Tt=0,zn=null,xs(a,V,te,de)}}J3(),O=qt;break}catch(be){$x(a,be)}while(!0);return r&&a.shellSuspendCounter++,qa=or=null,Et=h,H.H=v,H.A=S,ut===null&&(_t=null,ft=0,uu()),O}function J3(){for(;ut!==null;)Jx(ut)}function eA(a,r){var u=Et;Et|=2;var h=Wx(),v=Zx();_t!==a||ft!==r?(Hu=null,Uu=st()+500,gs(a,r)):hs=di(a,r);e:do try{if(Tt!==0&&ut!==null){r=ut;var S=zn;t:switch(Tt){case 1:Tt=0,zn=null,xs(a,r,S,1);break;case 2:case 9:if(u1(S)){Tt=0,zn=null,eb(r);break}r=function(){Tt!==2&&Tt!==9||_t!==a||(Tt=7),ka(a)},S.then(r,r);break e;case 3:Tt=7;break e;case 4:Tt=5;break e;case 7:u1(S)?(Tt=0,zn=null,eb(r)):(Tt=0,zn=null,xs(a,r,S,7));break;case 5:var O=null;switch(ut.tag){case 26:O=ut.memoizedState;case 5:case 27:var V=ut;if(O?zb(O):V.stateNode.complete){Tt=0,zn=null;var te=V.sibling;if(te!==null)ut=te;else{var de=V.return;de!==null?(ut=de,qu(de)):ut=null}break t}}Tt=0,zn=null,xs(a,r,S,5);break;case 6:Tt=0,zn=null,xs(a,r,S,6);break;case 8:yh(),qt=6;break e;default:throw Error(i(462))}}tA();break}catch(be){$x(a,be)}while(!0);return qa=or=null,H.H=h,H.A=v,Et=u,ut!==null?0:(_t=null,ft=0,uu(),qt)}function tA(){for(;ut!==null&&!gt();)Jx(ut)}function Jx(a){var r=Sx(a.alternate,a,ei);a.memoizedProps=a.pendingProps,r===null?qu(a):ut=r}function eb(a){var r=a,u=r.alternate;switch(r.tag){case 15:case 0:r=xx(u,r,r.pendingProps,r.type,void 0,ft);break;case 11:r=xx(u,r,r.pendingProps,r.type.render,r.ref,ft);break;case 5:If(r);default:wx(u,r),r=ut=Zg(r,ei),r=Sx(u,r,ei)}a.memoizedProps=a.pendingProps,r===null?qu(a):ut=r}function xs(a,r,u,h){qa=or=null,If(r),ss=null,xo=0;var v=r.return;try{if(V3(a,v,r,u,ft)){qt=1,Ru(a,$n(u,a.current)),ut=null;return}}catch(S){if(v!==null)throw ut=v,S;qt=1,Ru(a,$n(u,a.current)),ut=null;return}r.flags&32768?(mt||h===1?a=!0:hs||(ft&536870912)!==0?a=!1:(ki=a=!0,(h===2||h===9||h===3||h===6)&&(h=Pn.current,h!==null&&h.tag===13&&(h.flags|=16384))),tb(r,a)):qu(r)}function qu(a){var r=a;do{if((r.flags&32768)!==0){tb(r,ki);return}a=r.return;var u=G3(r.alternate,r,ei);if(u!==null){ut=u;return}if(r=r.sibling,r!==null){ut=r;return}ut=r=a}while(r!==null);qt===0&&(qt=5)}function tb(a,r){do{var u=X3(a.alternate,a);if(u!==null){u.flags&=32767,ut=u;return}if(u=a.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!r&&(a=a.sibling,a!==null)){ut=a;return}ut=a=u}while(a!==null);qt=6,ut=null}function nb(a,r,u,h,v,S,O,V,te){a.cancelPendingCommit=null;do Yu();while(an!==0);if((Et&6)!==0)throw Error(i(327));if(r!==null){if(r===a.current)throw Error(i(177));if(S=r.lanes|r.childLanes,S|=lf,Bd(a,u,S,O,V,te),a===_t&&(ut=_t=null,ft=0),ps=r,Ci=a,ti=u,gh=S,xh=v,Yx=h,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,rA(je,function(){return ob(),null})):(a.callbackNode=null,a.callbackPriority=0),h=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||h){h=H.T,H.T=null,v=G.p,G.p=2,O=Et,Et|=4;try{K3(a,r,u)}finally{Et=O,G.p=v,H.T=h}}an=1,ab(),ib(),rb()}}function ab(){if(an===1){an=0;var a=Ci,r=ps,u=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||u){u=H.T,H.T=null;var h=G.p;G.p=2;var v=Et;Et|=4;try{Px(r,a);var S=Dh,O=Vg(a.containerInfo),V=S.focusedElem,te=S.selectionRange;if(O!==V&&V&&V.ownerDocument&&Fg(V.ownerDocument.documentElement,V)){if(te!==null&&nf(V)){var de=te.start,be=te.end;if(be===void 0&&(be=de),"selectionStart"in V)V.selectionStart=de,V.selectionEnd=Math.min(be,V.value.length);else{var ke=V.ownerDocument||document,he=ke&&ke.defaultView||window;if(he.getSelection){var ge=he.getSelection(),Pe=V.textContent.length,Ge=Math.min(te.start,Pe),Ct=te.end===void 0?Ge:Math.min(te.end,Pe);!ge.extend&&Ge>Ct&&(O=Ct,Ct=Ge,Ge=O);var oe=Hg(V,Ge),ie=Hg(V,Ct);if(oe&&ie&&(ge.rangeCount!==1||ge.anchorNode!==oe.node||ge.anchorOffset!==oe.offset||ge.focusNode!==ie.node||ge.focusOffset!==ie.offset)){var ce=ke.createRange();ce.setStart(oe.node,oe.offset),ge.removeAllRanges(),Ge>Ct?(ge.addRange(ce),ge.extend(ie.node,ie.offset)):(ce.setEnd(ie.node,ie.offset),ge.addRange(ce))}}}}for(ke=[],ge=V;ge=ge.parentNode;)ge.nodeType===1&&ke.push({element:ge,left:ge.scrollLeft,top:ge.scrollTop});for(typeof V.focus=="function"&&V.focus(),V=0;V<ke.length;V++){var Ee=ke[V];Ee.element.scrollLeft=Ee.left,Ee.element.scrollTop=Ee.top}}ac=!!Rh,Dh=Rh=null}finally{Et=v,G.p=h,H.T=u}}a.current=r,an=2}}function ib(){if(an===2){an=0;var a=Ci,r=ps,u=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||u){u=H.T,H.T=null;var h=G.p;G.p=2;var v=Et;Et|=4;try{Dx(a,r.alternate,r)}finally{Et=v,G.p=h,H.T=u}}an=3}}function rb(){if(an===4||an===3){an=0,lt();var a=Ci,r=ps,u=ti,h=Yx;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?an=5:(an=0,ps=Ci=null,sb(a,a.pendingLanes));var v=a.pendingLanes;if(v===0&&(Ai=null),Wi(u),r=r.stateNode,se&&typeof se.onCommitFiberRoot=="function")try{se.onCommitFiberRoot(We,r,void 0,(r.current.flags&128)===128)}catch{}if(h!==null){r=H.T,v=G.p,G.p=2,H.T=null;try{for(var S=a.onRecoverableError,O=0;O<h.length;O++){var V=h[O];S(V.value,{componentStack:V.stack})}}finally{H.T=r,G.p=v}}(ti&3)!==0&&Yu(),ka(a),v=a.pendingLanes,(u&261930)!==0&&(v&42)!==0?a===bh?Oo++:(Oo=0,bh=a):Oo=0,Io(0)}}function sb(a,r){(a.pooledCacheLanes&=r)===0&&(r=a.pooledCache,r!=null&&(a.pooledCache=null,po(r)))}function Yu(){return ab(),ib(),rb(),ob()}function ob(){if(an!==5)return!1;var a=Ci,r=gh;gh=0;var u=Wi(ti),h=H.T,v=G.p;try{G.p=32>u?32:u,H.T=null,u=xh,xh=null;var S=Ci,O=ti;if(an=0,ps=Ci=null,ti=0,(Et&6)!==0)throw Error(i(331));var V=Et;if(Et|=4,Fx(S.current),zx(S,S.current,O,u),Et=V,Io(0,!1),se&&typeof se.onPostCommitFiberRoot=="function")try{se.onPostCommitFiberRoot(We,S)}catch{}return!0}finally{G.p=v,H.T=h,sb(a,r)}}function lb(a,r,u){r=$n(u,r),r=Qf(a.stateNode,r,2),a=vi(a,r,2),a!==null&&(Qi(a,2),ka(a))}function St(a,r,u){if(a.tag===3)lb(a,a,u);else for(;r!==null;){if(r.tag===3){lb(r,a,u);break}else if(r.tag===1){var h=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Ai===null||!Ai.has(h))){a=$n(u,a),u=ux(2),h=vi(r,u,2),h!==null&&(cx(u,h,r,a),Qi(h,2),ka(h));break}}r=r.return}}function Eh(a,r,u){var h=a.pingCache;if(h===null){h=a.pingCache=new W3;var v=new Set;h.set(r,v)}else v=h.get(r),v===void 0&&(v=new Set,h.set(r,v));v.has(u)||(hh=!0,v.add(u),a=nA.bind(null,a,r,u),r.then(a,a))}function nA(a,r,u){var h=a.pingCache;h!==null&&h.delete(r),a.pingedLanes|=a.suspendedLanes&u,a.warmLanes&=~u,_t===a&&(ft&u)===u&&(qt===4||qt===3&&(ft&62914560)===ft&&300>st()-zu?(Et&2)===0&&gs(a,0):mh|=u,ms===ft&&(ms=0)),ka(a)}function ub(a,r){r===0&&(r=Fr()),a=ir(a,r),a!==null&&(Qi(a,r),ka(a))}function aA(a){var r=a.memoizedState,u=0;r!==null&&(u=r.retryLane),ub(a,u)}function iA(a,r){var u=0;switch(a.tag){case 31:case 13:var h=a.stateNode,v=a.memoizedState;v!==null&&(u=v.retryLane);break;case 19:h=a.stateNode;break;case 22:h=a.stateNode._retryCache;break;default:throw Error(i(314))}h!==null&&h.delete(r),ub(a,u)}function rA(a,r){return rt(a,r)}var Gu=null,bs=null,Th=!1,Xu=!1,Sh=!1,_i=0;function ka(a){a!==bs&&a.next===null&&(bs===null?Gu=bs=a:bs=bs.next=a),Xu=!0,Th||(Th=!0,oA())}function Io(a,r){if(!Sh&&Xu){Sh=!0;do for(var u=!1,h=Gu;h!==null;){if(a!==0){var v=h.pendingLanes;if(v===0)var S=0;else{var O=h.suspendedLanes,V=h.pingedLanes;S=(1<<31-Je(42|a)+1)-1,S&=v&~(O&~V),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(u=!0,hb(h,S))}else S=ft,S=Ki(h,h===_t?S:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(S&3)===0||di(h,S)||(u=!0,hb(h,S));h=h.next}while(u);Sh=!1}}function sA(){cb()}function cb(){Xu=Th=!1;var a=0;_i!==0&&xA()&&(a=_i);for(var r=st(),u=null,h=Gu;h!==null;){var v=h.next,S=db(h,r);S===0?(h.next=null,u===null?Gu=v:u.next=v,v===null&&(bs=u)):(u=h,(a!==0||(S&3)!==0)&&(Xu=!0)),h=v}an!==0&&an!==5||Io(a),_i!==0&&(_i=0)}function db(a,r){for(var u=a.suspendedLanes,h=a.pingedLanes,v=a.expirationTimes,S=a.pendingLanes&-62914561;0<S;){var O=31-Je(S),V=1<<O,te=v[O];te===-1?((V&u)===0||(V&h)!==0)&&(v[O]=Hr(V,r)):te<=r&&(a.expiredLanes|=V),S&=~V}if(r=_t,u=ft,u=Ki(a,a===r?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),h=a.callbackNode,u===0||a===r&&(Tt===2||Tt===9)||a.cancelPendingCommit!==null)return h!==null&&h!==null&&bt(h),a.callbackNode=null,a.callbackPriority=0;if((u&3)===0||di(a,u)){if(r=u&-u,r===a.callbackPriority)return r;switch(h!==null&&bt(h),Wi(u)){case 2:case 8:u=Ce;break;case 32:u=je;break;case 268435456:u=at;break;default:u=je}return h=fb.bind(null,a),u=rt(u,h),a.callbackPriority=r,a.callbackNode=u,r}return h!==null&&h!==null&&bt(h),a.callbackPriority=2,a.callbackNode=null,2}function fb(a,r){if(an!==0&&an!==5)return a.callbackNode=null,a.callbackPriority=0,null;var u=a.callbackNode;if(Yu()&&a.callbackNode!==u)return null;var h=ft;return h=Ki(a,a===_t?h:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),h===0?null:(Xx(a,h,r),db(a,st()),a.callbackNode!=null&&a.callbackNode===u?fb.bind(null,a):null)}function hb(a,r){if(Yu())return null;Xx(a,r,!0)}function oA(){yA(function(){(Et&6)!==0?rt(pe,sA):cb()})}function kh(){if(_i===0){var a=as;a===0&&(a=pn,pn<<=1,(pn&261888)===0&&(pn=256)),_i=a}return _i}function mb(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:tu(""+a)}function pb(a,r){var u=r.ownerDocument.createElement("input");return u.name=r.name,u.value=r.value,a.id&&u.setAttribute("form",a.id),r.parentNode.insertBefore(u,r),a=new FormData(a),u.parentNode.removeChild(u),a}function lA(a,r,u,h,v){if(r==="submit"&&u&&u.stateNode===v){var S=mb((v[kt]||null).action),O=h.submitter;O&&(r=(r=O[kt]||null)?mb(r.formAction):O.getAttribute("formAction"),r!==null&&(S=r,O=null));var V=new ru("action","action",null,h,v);a.push({event:V,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(_i!==0){var te=O?pb(v,O):new FormData(v);qf(u,{pending:!0,data:te,method:v.method,action:S},null,te)}}else typeof S=="function"&&(V.preventDefault(),te=O?pb(v,O):new FormData(v),qf(u,{pending:!0,data:te,method:v.method,action:S},S,te))},currentTarget:v}]})}}for(var wh=0;wh<of.length;wh++){var Ah=of[wh],uA=Ah.toLowerCase(),cA=Ah[0].toUpperCase()+Ah.slice(1);ca(uA,"on"+cA)}ca(Gg,"onAnimationEnd"),ca(Xg,"onAnimationIteration"),ca(Kg,"onAnimationStart"),ca("dblclick","onDoubleClick"),ca("focusin","onFocus"),ca("focusout","onBlur"),ca(A3,"onTransitionRun"),ca(C3,"onTransitionStart"),ca(N3,"onTransitionCancel"),ca($g,"onTransitionEnd"),fi("onMouseEnter",["mouseout","mouseover"]),fi("onMouseLeave",["mouseout","mouseover"]),fi("onPointerEnter",["pointerout","pointerover"]),fi("onPointerLeave",["pointerout","pointerover"]),ua("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ua("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ua("onBeforeInput",["compositionend","keypress","textInput","paste"]),ua("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ua("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ua("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var jo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),dA=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(jo));function gb(a,r){r=(r&4)!==0;for(var u=0;u<a.length;u++){var h=a[u],v=h.event;h=h.listeners;e:{var S=void 0;if(r)for(var O=h.length-1;0<=O;O--){var V=h[O],te=V.instance,de=V.currentTarget;if(V=V.listener,te!==S&&v.isPropagationStopped())break e;S=V,v.currentTarget=de;try{S(v)}catch(be){lu(be)}v.currentTarget=null,S=te}else for(O=0;O<h.length;O++){if(V=h[O],te=V.instance,de=V.currentTarget,V=V.listener,te!==S&&v.isPropagationStopped())break e;S=V,v.currentTarget=de;try{S(v)}catch(be){lu(be)}v.currentTarget=null,S=te}}}}function ct(a,r){var u=r[Ut];u===void 0&&(u=r[Ut]=new Set);var h=a+"__bubble";u.has(h)||(xb(r,a,2,!1),u.add(h))}function Ch(a,r,u){var h=0;r&&(h|=4),xb(u,a,h,r)}var Ku="_reactListening"+Math.random().toString(36).slice(2);function Nh(a){if(!a[Ku]){a[Ku]=!0,to.forEach(function(u){u!=="selectionchange"&&(dA.has(u)||Ch(u,!1,a),Ch(u,!0,a))});var r=a.nodeType===9?a:a.ownerDocument;r===null||r[Ku]||(r[Ku]=!0,Ch("selectionchange",!1,r))}}function xb(a,r,u,h){switch(Gb(r)){case 2:var v=zA;break;case 8:v=UA;break;default:v=Vh}u=v.bind(null,r,u,a),v=void 0,!Xd||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(v=!0),h?v!==void 0?a.addEventListener(r,u,{capture:!0,passive:v}):a.addEventListener(r,u,!0):v!==void 0?a.addEventListener(r,u,{passive:v}):a.addEventListener(r,u,!1)}function _h(a,r,u,h,v){var S=h;if((r&1)===0&&(r&2)===0&&h!==null)e:for(;;){if(h===null)return;var O=h.tag;if(O===3||O===4){var V=h.stateNode.containerInfo;if(V===v)break;if(O===4)for(O=h.return;O!==null;){var te=O.tag;if((te===3||te===4)&&O.stateNode.containerInfo===v)return;O=O.return}for(;V!==null;){if(O=Gn(V),O===null)return;if(te=O.tag,te===5||te===6||te===26||te===27){h=S=O;continue e}V=V.parentNode}}h=h.return}Tg(function(){var de=S,be=Yd(u),ke=[];e:{var he=Qg.get(a);if(he!==void 0){var ge=ru,Pe=a;switch(a){case"keypress":if(au(u)===0)break e;case"keydown":case"keyup":ge=i3;break;case"focusin":Pe="focus",ge=Wd;break;case"focusout":Pe="blur",ge=Wd;break;case"beforeblur":case"afterblur":ge=Wd;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ge=wg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=Gw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=o3;break;case Gg:case Xg:case Kg:ge=$w;break;case $g:ge=u3;break;case"scroll":case"scrollend":ge=qw;break;case"wheel":ge=d3;break;case"copy":case"cut":case"paste":ge=Ww;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=Cg;break;case"toggle":case"beforetoggle":ge=h3}var Ge=(r&4)!==0,Ct=!Ge&&(a==="scroll"||a==="scrollend"),oe=Ge?he!==null?he+"Capture":null:he;Ge=[];for(var ie=de,ce;ie!==null;){var Ee=ie;if(ce=Ee.stateNode,Ee=Ee.tag,Ee!==5&&Ee!==26&&Ee!==27||ce===null||oe===null||(Ee=ao(ie,oe),Ee!=null&&Ge.push(Po(ie,Ee,ce))),Ct)break;ie=ie.return}0<Ge.length&&(he=new ge(he,Pe,null,u,be),ke.push({event:he,listeners:Ge}))}}if((r&7)===0){e:{if(he=a==="mouseover"||a==="pointerover",ge=a==="mouseout"||a==="pointerout",he&&u!==qd&&(Pe=u.relatedTarget||u.fromElement)&&(Gn(Pe)||Pe[Pa]))break e;if((ge||he)&&(he=be.window===be?be:(he=be.ownerDocument)?he.defaultView||he.parentWindow:window,ge?(Pe=u.relatedTarget||u.toElement,ge=de,Pe=Pe?Gn(Pe):null,Pe!==null&&(Ct=s(Pe),Ge=Pe.tag,Pe!==Ct||Ge!==5&&Ge!==27&&Ge!==6)&&(Pe=null)):(ge=null,Pe=de),ge!==Pe)){if(Ge=wg,Ee="onMouseLeave",oe="onMouseEnter",ie="mouse",(a==="pointerout"||a==="pointerover")&&(Ge=Cg,Ee="onPointerLeave",oe="onPointerEnter",ie="pointer"),Ct=ge==null?he:er(ge),ce=Pe==null?he:er(Pe),he=new Ge(Ee,ie+"leave",ge,u,be),he.target=Ct,he.relatedTarget=ce,Ee=null,Gn(be)===de&&(Ge=new Ge(oe,ie+"enter",Pe,u,be),Ge.target=ce,Ge.relatedTarget=Ct,Ee=Ge),Ct=Ee,ge&&Pe)t:{for(Ge=fA,oe=ge,ie=Pe,ce=0,Ee=oe;Ee;Ee=Ge(Ee))ce++;Ee=0;for(var Ve=ie;Ve;Ve=Ge(Ve))Ee++;for(;0<ce-Ee;)oe=Ge(oe),ce--;for(;0<Ee-ce;)ie=Ge(ie),Ee--;for(;ce--;){if(oe===ie||ie!==null&&oe===ie.alternate){Ge=oe;break t}oe=Ge(oe),ie=Ge(ie)}Ge=null}else Ge=null;ge!==null&&bb(ke,he,ge,Ge,!1),Pe!==null&&Ct!==null&&bb(ke,Ct,Pe,Ge,!0)}}e:{if(he=de?er(de):window,ge=he.nodeName&&he.nodeName.toLowerCase(),ge==="select"||ge==="input"&&he.type==="file")var yt=Ig;else if(Lg(he))if(jg)yt=S3;else{yt=E3;var ze=v3}else ge=he.nodeName,!ge||ge.toLowerCase()!=="input"||he.type!=="checkbox"&&he.type!=="radio"?de&&Vd(de.elementType)&&(yt=Ig):yt=T3;if(yt&&(yt=yt(a,de))){Og(ke,yt,u,be);break e}ze&&ze(a,he,de),a==="focusout"&&de&&he.type==="number"&&de.memoizedProps.value!=null&&Fd(he,"number",he.value)}switch(ze=de?er(de):window,a){case"focusin":(Lg(ze)||ze.contentEditable==="true")&&($r=ze,af=de,fo=null);break;case"focusout":fo=af=$r=null;break;case"mousedown":rf=!0;break;case"contextmenu":case"mouseup":case"dragend":rf=!1,qg(ke,u,be);break;case"selectionchange":if(w3)break;case"keydown":case"keyup":qg(ke,u,be)}var nt;if(Jd)e:{switch(a){case"compositionstart":var ht="onCompositionStart";break e;case"compositionend":ht="onCompositionEnd";break e;case"compositionupdate":ht="onCompositionUpdate";break e}ht=void 0}else Kr?Rg(a,u)&&(ht="onCompositionEnd"):a==="keydown"&&u.keyCode===229&&(ht="onCompositionStart");ht&&(Ng&&u.locale!=="ko"&&(Kr||ht!=="onCompositionStart"?ht==="onCompositionEnd"&&Kr&&(nt=Sg()):(hi=be,Kd="value"in hi?hi.value:hi.textContent,Kr=!0)),ze=$u(de,ht),0<ze.length&&(ht=new Ag(ht,a,null,u,be),ke.push({event:ht,listeners:ze}),nt?ht.data=nt:(nt=Dg(u),nt!==null&&(ht.data=nt)))),(nt=p3?g3(a,u):x3(a,u))&&(ht=$u(de,"onBeforeInput"),0<ht.length&&(ze=new Ag("onBeforeInput","beforeinput",null,u,be),ke.push({event:ze,listeners:ht}),ze.data=nt)),lA(ke,a,de,u,be)}gb(ke,r)})}function Po(a,r,u){return{instance:a,listener:r,currentTarget:u}}function $u(a,r){for(var u=r+"Capture",h=[];a!==null;){var v=a,S=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||S===null||(v=ao(a,u),v!=null&&h.unshift(Po(a,v,S)),v=ao(a,r),v!=null&&h.push(Po(a,v,S))),a.tag===3)return h;a=a.return}return[]}function fA(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function bb(a,r,u,h,v){for(var S=r._reactName,O=[];u!==null&&u!==h;){var V=u,te=V.alternate,de=V.stateNode;if(V=V.tag,te!==null&&te===h)break;V!==5&&V!==26&&V!==27||de===null||(te=de,v?(de=ao(u,S),de!=null&&O.unshift(Po(u,de,te))):v||(de=ao(u,S),de!=null&&O.push(Po(u,de,te)))),u=u.return}O.length!==0&&a.push({event:r,listeners:O})}var hA=/\r\n?/g,mA=/\u0000|\uFFFD/g;function yb(a){return(typeof a=="string"?a:""+a).replace(hA,`
|
|
49
|
-
`).replace(mA,"")}function vb(a,r){return r=yb(r),yb(a)===r}function At(a,r,u,h,v,S){switch(u){case"children":typeof h=="string"?r==="body"||r==="textarea"&&h===""||Yr(a,h):(typeof h=="number"||typeof h=="bigint")&&r!=="body"&&Yr(a,""+h);break;case"className":xt(a,"class",h);break;case"tabIndex":xt(a,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":xt(a,u,h);break;case"style":vg(a,h,S);break;case"data":if(r!=="object"){xt(a,"data",h);break}case"src":case"href":if(h===""&&(r!=="a"||u!=="href")){a.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){a.removeAttribute(u);break}h=tu(""+h),a.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="function"){a.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof S=="function"&&(u==="formAction"?(r!=="input"&&At(a,r,"name",v.name,v,null),At(a,r,"formEncType",v.formEncType,v,null),At(a,r,"formMethod",v.formMethod,v,null),At(a,r,"formTarget",v.formTarget,v,null)):(At(a,r,"encType",v.encType,v,null),At(a,r,"method",v.method,v,null),At(a,r,"target",v.target,v,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){a.removeAttribute(u);break}h=tu(""+h),a.setAttribute(u,h);break;case"onClick":h!=null&&(a.onclick=Ua);break;case"onScroll":h!=null&&ct("scroll",a);break;case"onScrollEnd":h!=null&&ct("scrollend",a);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(i(61));if(u=h.__html,u!=null){if(v.children!=null)throw Error(i(60));a.innerHTML=u}}break;case"multiple":a.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":a.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){a.removeAttribute("xlink:href");break}u=tu(""+h),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(u,""+h):a.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":h&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(u,""):a.removeAttribute(u);break;case"capture":case"download":h===!0?a.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(u,h):a.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?a.setAttribute(u,h):a.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?a.removeAttribute(u):a.setAttribute(u,h);break;case"popover":ct("beforetoggle",a),ct("toggle",a),He(a,"popover",h);break;case"xlinkActuate":Ht(a,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":Ht(a,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":Ht(a,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":Ht(a,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":Ht(a,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":Ht(a,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":Ht(a,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":Ht(a,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":Ht(a,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":He(a,"is",h);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=Fw.get(u)||u,He(a,u,h))}}function Mh(a,r,u,h,v,S){switch(u){case"style":vg(a,h,S);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(i(61));if(u=h.__html,u!=null){if(v.children!=null)throw Error(i(60));a.innerHTML=u}}break;case"children":typeof h=="string"?Yr(a,h):(typeof h=="number"||typeof h=="bigint")&&Yr(a,""+h);break;case"onScroll":h!=null&&ct("scroll",a);break;case"onScrollEnd":h!=null&&ct("scrollend",a);break;case"onClick":h!=null&&(a.onclick=Ua);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Jl.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(v=u.endsWith("Capture"),r=u.slice(2,v?u.length-7:void 0),S=a[kt]||null,S=S!=null?S[u]:null,typeof S=="function"&&a.removeEventListener(r,S,v),typeof h=="function")){typeof S!="function"&&S!==null&&(u in a?a[u]=null:a.hasAttribute(u)&&a.removeAttribute(u)),a.addEventListener(r,h,v);break e}u in a?a[u]=h:h===!0?a.setAttribute(u,""):He(a,u,h)}}}function fn(a,r,u){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ct("error",a),ct("load",a);var h=!1,v=!1,S;for(S in u)if(u.hasOwnProperty(S)){var O=u[S];if(O!=null)switch(S){case"src":h=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:At(a,r,S,O,u,null)}}v&&At(a,r,"srcSet",u.srcSet,u,null),h&&At(a,r,"src",u.src,u,null);return;case"input":ct("invalid",a);var V=S=O=v=null,te=null,de=null;for(h in u)if(u.hasOwnProperty(h)){var be=u[h];if(be!=null)switch(h){case"name":v=be;break;case"type":O=be;break;case"checked":te=be;break;case"defaultChecked":de=be;break;case"value":S=be;break;case"defaultValue":V=be;break;case"children":case"dangerouslySetInnerHTML":if(be!=null)throw Error(i(137,r));break;default:At(a,r,h,be,u,null)}}gg(a,S,V,te,de,O,v,!1);return;case"select":ct("invalid",a),h=O=S=null;for(v in u)if(u.hasOwnProperty(v)&&(V=u[v],V!=null))switch(v){case"value":S=V;break;case"defaultValue":O=V;break;case"multiple":h=V;default:At(a,r,v,V,u,null)}r=S,u=O,a.multiple=!!h,r!=null?qr(a,!!h,r,!1):u!=null&&qr(a,!!h,u,!0);return;case"textarea":ct("invalid",a),S=v=h=null;for(O in u)if(u.hasOwnProperty(O)&&(V=u[O],V!=null))switch(O){case"value":h=V;break;case"defaultValue":v=V;break;case"children":S=V;break;case"dangerouslySetInnerHTML":if(V!=null)throw Error(i(91));break;default:At(a,r,O,V,u,null)}bg(a,h,v,S);return;case"option":for(te in u)if(u.hasOwnProperty(te)&&(h=u[te],h!=null))switch(te){case"selected":a.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:At(a,r,te,h,u,null)}return;case"dialog":ct("beforetoggle",a),ct("toggle",a),ct("cancel",a),ct("close",a);break;case"iframe":case"object":ct("load",a);break;case"video":case"audio":for(h=0;h<jo.length;h++)ct(jo[h],a);break;case"image":ct("error",a),ct("load",a);break;case"details":ct("toggle",a);break;case"embed":case"source":case"link":ct("error",a),ct("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(de in u)if(u.hasOwnProperty(de)&&(h=u[de],h!=null))switch(de){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:At(a,r,de,h,u,null)}return;default:if(Vd(r)){for(be in u)u.hasOwnProperty(be)&&(h=u[be],h!==void 0&&Mh(a,r,be,h,u,void 0));return}}for(V in u)u.hasOwnProperty(V)&&(h=u[V],h!=null&&At(a,r,V,h,u,null))}function pA(a,r,u,h){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var v=null,S=null,O=null,V=null,te=null,de=null,be=null;for(ge in u){var ke=u[ge];if(u.hasOwnProperty(ge)&&ke!=null)switch(ge){case"checked":break;case"value":break;case"defaultValue":te=ke;default:h.hasOwnProperty(ge)||At(a,r,ge,null,h,ke)}}for(var he in h){var ge=h[he];if(ke=u[he],h.hasOwnProperty(he)&&(ge!=null||ke!=null))switch(he){case"type":S=ge;break;case"name":v=ge;break;case"checked":de=ge;break;case"defaultChecked":be=ge;break;case"value":O=ge;break;case"defaultValue":V=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(i(137,r));break;default:ge!==ke&&At(a,r,he,ge,h,ke)}}Hd(a,O,V,te,de,be,S,v);return;case"select":ge=O=V=he=null;for(S in u)if(te=u[S],u.hasOwnProperty(S)&&te!=null)switch(S){case"value":break;case"multiple":ge=te;default:h.hasOwnProperty(S)||At(a,r,S,null,h,te)}for(v in h)if(S=h[v],te=u[v],h.hasOwnProperty(v)&&(S!=null||te!=null))switch(v){case"value":he=S;break;case"defaultValue":V=S;break;case"multiple":O=S;default:S!==te&&At(a,r,v,S,h,te)}r=V,u=O,h=ge,he!=null?qr(a,!!u,he,!1):!!h!=!!u&&(r!=null?qr(a,!!u,r,!0):qr(a,!!u,u?[]:"",!1));return;case"textarea":ge=he=null;for(V in u)if(v=u[V],u.hasOwnProperty(V)&&v!=null&&!h.hasOwnProperty(V))switch(V){case"value":break;case"children":break;default:At(a,r,V,null,h,v)}for(O in h)if(v=h[O],S=u[O],h.hasOwnProperty(O)&&(v!=null||S!=null))switch(O){case"value":he=v;break;case"defaultValue":ge=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(i(91));break;default:v!==S&&At(a,r,O,v,h,S)}xg(a,he,ge);return;case"option":for(var Pe in u)if(he=u[Pe],u.hasOwnProperty(Pe)&&he!=null&&!h.hasOwnProperty(Pe))switch(Pe){case"selected":a.selected=!1;break;default:At(a,r,Pe,null,h,he)}for(te in h)if(he=h[te],ge=u[te],h.hasOwnProperty(te)&&he!==ge&&(he!=null||ge!=null))switch(te){case"selected":a.selected=he&&typeof he!="function"&&typeof he!="symbol";break;default:At(a,r,te,he,h,ge)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ge in u)he=u[Ge],u.hasOwnProperty(Ge)&&he!=null&&!h.hasOwnProperty(Ge)&&At(a,r,Ge,null,h,he);for(de in h)if(he=h[de],ge=u[de],h.hasOwnProperty(de)&&he!==ge&&(he!=null||ge!=null))switch(de){case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(i(137,r));break;default:At(a,r,de,he,h,ge)}return;default:if(Vd(r)){for(var Ct in u)he=u[Ct],u.hasOwnProperty(Ct)&&he!==void 0&&!h.hasOwnProperty(Ct)&&Mh(a,r,Ct,void 0,h,he);for(be in h)he=h[be],ge=u[be],!h.hasOwnProperty(be)||he===ge||he===void 0&&ge===void 0||Mh(a,r,be,he,h,ge);return}}for(var oe in u)he=u[oe],u.hasOwnProperty(oe)&&he!=null&&!h.hasOwnProperty(oe)&&At(a,r,oe,null,h,he);for(ke in h)he=h[ke],ge=u[ke],!h.hasOwnProperty(ke)||he===ge||he==null&&ge==null||At(a,r,ke,he,h,ge)}function Eb(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function gA(){if(typeof performance.getEntriesByType=="function"){for(var a=0,r=0,u=performance.getEntriesByType("resource"),h=0;h<u.length;h++){var v=u[h],S=v.transferSize,O=v.initiatorType,V=v.duration;if(S&&V&&Eb(O)){for(O=0,V=v.responseEnd,h+=1;h<u.length;h++){var te=u[h],de=te.startTime;if(de>V)break;var be=te.transferSize,ke=te.initiatorType;be&&Eb(ke)&&(te=te.responseEnd,O+=be*(te<V?1:(V-de)/(te-de)))}if(--h,r+=8*(S+O)/(v.duration/1e3),a++,10<a)break}}if(0<a)return r/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var Rh=null,Dh=null;function Qu(a){return a.nodeType===9?a:a.ownerDocument}function Tb(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Sb(a,r){if(a===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&r==="foreignObject"?0:a}function Lh(a,r){return a==="textarea"||a==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Oh=null;function xA(){var a=window.event;return a&&a.type==="popstate"?a===Oh?!1:(Oh=a,!0):(Oh=null,!1)}var kb=typeof setTimeout=="function"?setTimeout:void 0,bA=typeof clearTimeout=="function"?clearTimeout:void 0,wb=typeof Promise=="function"?Promise:void 0,yA=typeof queueMicrotask=="function"?queueMicrotask:typeof wb<"u"?function(a){return wb.resolve(null).then(a).catch(vA)}:kb;function vA(a){setTimeout(function(){throw a})}function Mi(a){return a==="head"}function Ab(a,r){var u=r,h=0;do{var v=u.nextSibling;if(a.removeChild(u),v&&v.nodeType===8)if(u=v.data,u==="/$"||u==="/&"){if(h===0){a.removeChild(v),Ts(r);return}h--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")h++;else if(u==="html")Bo(a.ownerDocument.documentElement);else if(u==="head"){u=a.ownerDocument.head,Bo(u);for(var S=u.firstChild;S;){var O=S.nextSibling,V=S.nodeName;S[Ji]||V==="SCRIPT"||V==="STYLE"||V==="LINK"&&S.rel.toLowerCase()==="stylesheet"||u.removeChild(S),S=O}}else u==="body"&&Bo(a.ownerDocument.body);u=v}while(u);Ts(r)}function Cb(a,r){var u=a;a=0;do{var h=u.nextSibling;if(u.nodeType===1?r?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(r?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),h&&h.nodeType===8)if(u=h.data,u==="/$"){if(a===0)break;a--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||a++;u=h}while(u)}function Ih(a){var r=a.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var u=r;switch(r=r.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Ih(u),Vr(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}a.removeChild(u)}}function EA(a,r,u,h){for(;a.nodeType===1;){var v=u;if(a.nodeName.toLowerCase()!==r.toLowerCase()){if(!h&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(h){if(!a[Ji])switch(r){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(S=a.getAttribute("rel"),S==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(S!==v.rel||a.getAttribute("href")!==(v.href==null||v.href===""?null:v.href)||a.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin)||a.getAttribute("title")!==(v.title==null?null:v.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(S=a.getAttribute("src"),(S!==(v.src==null?null:v.src)||a.getAttribute("type")!==(v.type==null?null:v.type)||a.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin))&&S&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(r==="input"&&a.type==="hidden"){var S=v.name==null?null:""+v.name;if(v.type==="hidden"&&a.getAttribute("name")===S)return a}else return a;if(a=ea(a.nextSibling),a===null)break}return null}function TA(a,r,u){if(r==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!u||(a=ea(a.nextSibling),a===null))return null;return a}function Nb(a,r){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!r||(a=ea(a.nextSibling),a===null))return null;return a}function jh(a){return a.data==="$?"||a.data==="$~"}function Ph(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function SA(a,r){var u=a.ownerDocument;if(a.data==="$~")a._reactRetry=r;else if(a.data!=="$?"||u.readyState!=="loading")r();else{var h=function(){r(),u.removeEventListener("DOMContentLoaded",h)};u.addEventListener("DOMContentLoaded",h),a._reactRetry=h}}function ea(a){for(;a!=null;a=a.nextSibling){var r=a.nodeType;if(r===1||r===3)break;if(r===8){if(r=a.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return a}var Bh=null;function _b(a){a=a.nextSibling;for(var r=0;a;){if(a.nodeType===8){var u=a.data;if(u==="/$"||u==="/&"){if(r===0)return ea(a.nextSibling);r--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||r++}a=a.nextSibling}return null}function Mb(a){a=a.previousSibling;for(var r=0;a;){if(a.nodeType===8){var u=a.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(r===0)return a;r--}else u!=="/$"&&u!=="/&"||r++}a=a.previousSibling}return null}function Rb(a,r,u){switch(r=Qu(u),a){case"html":if(a=r.documentElement,!a)throw Error(i(452));return a;case"head":if(a=r.head,!a)throw Error(i(453));return a;case"body":if(a=r.body,!a)throw Error(i(454));return a;default:throw Error(i(451))}}function Bo(a){for(var r=a.attributes;r.length;)a.removeAttributeNode(r[0]);Vr(a)}var ta=new Map,Db=new Set;function Wu(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var ni=G.d;G.d={f:kA,r:wA,D:AA,C:CA,L:NA,m:_A,X:RA,S:MA,M:DA};function kA(){var a=ni.f(),r=Fu();return a||r}function wA(a){var r=Ba(a);r!==null&&r.tag===5&&r.type==="form"?$1(r):ni.r(a)}var ys=typeof document>"u"?null:document;function Lb(a,r,u){var h=ys;if(h&&typeof r=="string"&&r){var v=Xn(r);v='link[rel="'+a+'"][href="'+v+'"]',typeof u=="string"&&(v+='[crossorigin="'+u+'"]'),Db.has(v)||(Db.add(v),a={rel:a,crossOrigin:u,href:r},h.querySelector(v)===null&&(r=h.createElement("link"),fn(r,"link",a),Gt(r),h.head.appendChild(r)))}}function AA(a){ni.D(a),Lb("dns-prefetch",a,null)}function CA(a,r){ni.C(a,r),Lb("preconnect",a,r)}function NA(a,r,u){ni.L(a,r,u);var h=ys;if(h&&a&&r){var v='link[rel="preload"][as="'+Xn(r)+'"]';r==="image"&&u&&u.imageSrcSet?(v+='[imagesrcset="'+Xn(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(v+='[imagesizes="'+Xn(u.imageSizes)+'"]')):v+='[href="'+Xn(a)+'"]';var S=v;switch(r){case"style":S=vs(a);break;case"script":S=Es(a)}ta.has(S)||(a=x({rel:"preload",href:r==="image"&&u&&u.imageSrcSet?void 0:a,as:r},u),ta.set(S,a),h.querySelector(v)!==null||r==="style"&&h.querySelector(zo(S))||r==="script"&&h.querySelector(Uo(S))||(r=h.createElement("link"),fn(r,"link",a),Gt(r),h.head.appendChild(r)))}}function _A(a,r){ni.m(a,r);var u=ys;if(u&&a){var h=r&&typeof r.as=="string"?r.as:"script",v='link[rel="modulepreload"][as="'+Xn(h)+'"][href="'+Xn(a)+'"]',S=v;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=Es(a)}if(!ta.has(S)&&(a=x({rel:"modulepreload",href:a},r),ta.set(S,a),u.querySelector(v)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Uo(S)))return}h=u.createElement("link"),fn(h,"link",a),Gt(h),u.head.appendChild(h)}}}function MA(a,r,u){ni.S(a,r,u);var h=ys;if(h&&a){var v=za(h).hoistableStyles,S=vs(a);r=r||"default";var O=v.get(S);if(!O){var V={loading:0,preload:null};if(O=h.querySelector(zo(S)))V.loading=5;else{a=x({rel:"stylesheet",href:a,"data-precedence":r},u),(u=ta.get(S))&&zh(a,u);var te=O=h.createElement("link");Gt(te),fn(te,"link",a),te._p=new Promise(function(de,be){te.onload=de,te.onerror=be}),te.addEventListener("load",function(){V.loading|=1}),te.addEventListener("error",function(){V.loading|=2}),V.loading|=4,Zu(O,r,h)}O={type:"stylesheet",instance:O,count:1,state:V},v.set(S,O)}}}function RA(a,r){ni.X(a,r);var u=ys;if(u&&a){var h=za(u).hoistableScripts,v=Es(a),S=h.get(v);S||(S=u.querySelector(Uo(v)),S||(a=x({src:a,async:!0},r),(r=ta.get(v))&&Uh(a,r),S=u.createElement("script"),Gt(S),fn(S,"link",a),u.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},h.set(v,S))}}function DA(a,r){ni.M(a,r);var u=ys;if(u&&a){var h=za(u).hoistableScripts,v=Es(a),S=h.get(v);S||(S=u.querySelector(Uo(v)),S||(a=x({src:a,async:!0,type:"module"},r),(r=ta.get(v))&&Uh(a,r),S=u.createElement("script"),Gt(S),fn(S,"link",a),u.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},h.set(v,S))}}function Ob(a,r,u,h){var v=(v=ne.current)?Wu(v):null;if(!v)throw Error(i(446));switch(a){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(r=vs(u.href),u=za(v).hoistableStyles,h=u.get(r),h||(h={type:"style",instance:null,count:0,state:null},u.set(r,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){a=vs(u.href);var S=za(v).hoistableStyles,O=S.get(a);if(O||(v=v.ownerDocument||v,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(a,O),(S=v.querySelector(zo(a)))&&!S._p&&(O.instance=S,O.state.loading=5),ta.has(a)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},ta.set(a,u),S||LA(v,a,u,O.state))),r&&h===null)throw Error(i(528,""));return O}if(r&&h!==null)throw Error(i(529,""));return null;case"script":return r=u.async,u=u.src,typeof u=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Es(u),u=za(v).hoistableScripts,h=u.get(r),h||(h={type:"script",instance:null,count:0,state:null},u.set(r,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,a))}}function vs(a){return'href="'+Xn(a)+'"'}function zo(a){return'link[rel="stylesheet"]['+a+"]"}function Ib(a){return x({},a,{"data-precedence":a.precedence,precedence:null})}function LA(a,r,u,h){a.querySelector('link[rel="preload"][as="style"]['+r+"]")?h.loading=1:(r=a.createElement("link"),h.preload=r,r.addEventListener("load",function(){return h.loading|=1}),r.addEventListener("error",function(){return h.loading|=2}),fn(r,"link",u),Gt(r),a.head.appendChild(r))}function Es(a){return'[src="'+Xn(a)+'"]'}function Uo(a){return"script[async]"+a}function jb(a,r,u){if(r.count++,r.instance===null)switch(r.type){case"style":var h=a.querySelector('style[data-href~="'+Xn(u.href)+'"]');if(h)return r.instance=h,Gt(h),h;var v=x({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(a.ownerDocument||a).createElement("style"),Gt(h),fn(h,"style",v),Zu(h,u.precedence,a),r.instance=h;case"stylesheet":v=vs(u.href);var S=a.querySelector(zo(v));if(S)return r.state.loading|=4,r.instance=S,Gt(S),S;h=Ib(u),(v=ta.get(v))&&zh(h,v),S=(a.ownerDocument||a).createElement("link"),Gt(S);var O=S;return O._p=new Promise(function(V,te){O.onload=V,O.onerror=te}),fn(S,"link",h),r.state.loading|=4,Zu(S,u.precedence,a),r.instance=S;case"script":return S=Es(u.src),(v=a.querySelector(Uo(S)))?(r.instance=v,Gt(v),v):(h=u,(v=ta.get(S))&&(h=x({},u),Uh(h,v)),a=a.ownerDocument||a,v=a.createElement("script"),Gt(v),fn(v,"link",h),a.head.appendChild(v),r.instance=v);case"void":return null;default:throw Error(i(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(h=r.instance,r.state.loading|=4,Zu(h,u.precedence,a));return r.instance}function Zu(a,r,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=h.length?h[h.length-1]:null,S=v,O=0;O<h.length;O++){var V=h[O];if(V.dataset.precedence===r)S=V;else if(S!==v)break}S?S.parentNode.insertBefore(a,S.nextSibling):(r=u.nodeType===9?u.head:u,r.insertBefore(a,r.firstChild))}function zh(a,r){a.crossOrigin==null&&(a.crossOrigin=r.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=r.referrerPolicy),a.title==null&&(a.title=r.title)}function Uh(a,r){a.crossOrigin==null&&(a.crossOrigin=r.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=r.referrerPolicy),a.integrity==null&&(a.integrity=r.integrity)}var Ju=null;function Pb(a,r,u){if(Ju===null){var h=new Map,v=Ju=new Map;v.set(u,h)}else v=Ju,h=v.get(u),h||(h=new Map,v.set(u,h));if(h.has(a))return h;for(h.set(a,null),u=u.getElementsByTagName(a),v=0;v<u.length;v++){var S=u[v];if(!(S[Ji]||S[nn]||a==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var O=S.getAttribute(r)||"";O=a+O;var V=h.get(O);V?V.push(S):h.set(O,[S])}}return h}function Bb(a,r,u){a=a.ownerDocument||a,a.head.insertBefore(u,r==="title"?a.querySelector("head > title"):null)}function OA(a,r,u){if(u===1||r.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return a=r.disabled,typeof r.precedence=="string"&&a==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function zb(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function IA(a,r,u,h){if(u.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var v=vs(h.href),S=r.querySelector(zo(v));if(S){r=S._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(a.count++,a=ec.bind(a),r.then(a,a)),u.state.loading|=4,u.instance=S,Gt(S);return}S=r.ownerDocument||r,h=Ib(h),(v=ta.get(v))&&zh(h,v),S=S.createElement("link"),Gt(S);var O=S;O._p=new Promise(function(V,te){O.onload=V,O.onerror=te}),fn(S,"link",h),u.instance=S}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(u,r),(r=u.state.preload)&&(u.state.loading&3)===0&&(a.count++,u=ec.bind(a),r.addEventListener("load",u),r.addEventListener("error",u))}}var Hh=0;function jA(a,r){return a.stylesheets&&a.count===0&&nc(a,a.stylesheets),0<a.count||0<a.imgCount?function(u){var h=setTimeout(function(){if(a.stylesheets&&nc(a,a.stylesheets),a.unsuspend){var S=a.unsuspend;a.unsuspend=null,S()}},6e4+r);0<a.imgBytes&&Hh===0&&(Hh=62500*gA());var v=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&nc(a,a.stylesheets),a.unsuspend)){var S=a.unsuspend;a.unsuspend=null,S()}},(a.imgBytes>Hh?50:800)+r);return a.unsuspend=u,function(){a.unsuspend=null,clearTimeout(h),clearTimeout(v)}}:null}function ec(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)nc(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var tc=null;function nc(a,r){a.stylesheets=null,a.unsuspend!==null&&(a.count++,tc=new Map,r.forEach(PA,a),tc=null,ec.call(a))}function PA(a,r){if(!(r.state.loading&4)){var u=tc.get(a);if(u)var h=u.get(null);else{u=new Map,tc.set(a,u);for(var v=a.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<v.length;S++){var O=v[S];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(u.set(O.dataset.precedence,O),h=O)}h&&u.set(null,h)}v=r.instance,O=v.getAttribute("data-precedence"),S=u.get(O)||h,S===h&&u.set(null,v),u.set(O,v),this.count++,h=ec.bind(this),v.addEventListener("load",h),v.addEventListener("error",h),S?S.parentNode.insertBefore(v,S.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(v,a.firstChild)),r.state.loading|=4}}var Ho={$$typeof:_,Provider:null,Consumer:null,_currentValue:Q,_currentValue2:Q,_threadCount:0};function BA(a,r,u,h,v,S,O,V,te){this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=$i(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$i(0),this.hiddenUpdates=$i(null),this.identifierPrefix=h,this.onUncaughtError=v,this.onCaughtError=S,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=te,this.incompleteTransitions=new Map}function Ub(a,r,u,h,v,S,O,V,te,de,be,ke){return a=new BA(a,r,u,O,te,de,be,ke,V),r=1,S===!0&&(r|=24),S=jn(3,null,null,r),a.current=S,S.stateNode=a,r=vf(),r.refCount++,a.pooledCache=r,r.refCount++,S.memoizedState={element:h,isDehydrated:u,cache:r},kf(S),a}function Hb(a){return a?(a=Zr,a):Zr}function Fb(a,r,u,h,v,S){v=Hb(v),h.context===null?h.context=v:h.pendingContext=v,h=yi(r),h.payload={element:u},S=S===void 0?null:S,S!==null&&(h.callback=S),u=vi(a,h,r),u!==null&&(Mn(u,a,r),yo(u,a,r))}function Vb(a,r){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var u=a.retryLane;a.retryLane=u!==0&&u<r?u:r}}function Fh(a,r){Vb(a,r),(a=a.alternate)&&Vb(a,r)}function qb(a){if(a.tag===13||a.tag===31){var r=ir(a,67108864);r!==null&&Mn(r,a,67108864),Fh(a,67108864)}}function Yb(a){if(a.tag===13||a.tag===31){var r=Hn();r=Ws(r);var u=ir(a,r);u!==null&&Mn(u,a,r),Fh(a,r)}}var ac=!0;function zA(a,r,u,h){var v=H.T;H.T=null;var S=G.p;try{G.p=2,Vh(a,r,u,h)}finally{G.p=S,H.T=v}}function UA(a,r,u,h){var v=H.T;H.T=null;var S=G.p;try{G.p=8,Vh(a,r,u,h)}finally{G.p=S,H.T=v}}function Vh(a,r,u,h){if(ac){var v=qh(h);if(v===null)_h(a,r,h,ic,u),Xb(a,h);else if(FA(v,a,r,u,h))h.stopPropagation();else if(Xb(a,h),r&4&&-1<HA.indexOf(a)){for(;v!==null;){var S=Ba(v);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var O=la(S.pendingLanes);if(O!==0){var V=S;for(V.pendingLanes|=2,V.entangledLanes|=2;O;){var te=1<<31-Je(O);V.entanglements[1]|=te,O&=~te}ka(S),(Et&6)===0&&(Uu=st()+500,Io(0))}}break;case 31:case 13:V=ir(S,2),V!==null&&Mn(V,S,2),Fu(),Fh(S,2)}if(S=qh(h),S===null&&_h(a,r,h,ic,u),S===v)break;v=S}v!==null&&h.stopPropagation()}else _h(a,r,h,null,u)}}function qh(a){return a=Yd(a),Yh(a)}var ic=null;function Yh(a){if(ic=null,a=Gn(a),a!==null){var r=s(a);if(r===null)a=null;else{var u=r.tag;if(u===13){if(a=l(r),a!==null)return a;a=null}else if(u===31){if(a=c(r),a!==null)return a;a=null}else if(u===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;a=null}else r!==a&&(a=null)}}return ic=a,null}function Gb(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ue()){case pe:return 2;case Ce:return 8;case je:case Le:return 32;case at:return 268435456;default:return 32}default:return 32}}var Gh=!1,Ri=null,Di=null,Li=null,Fo=new Map,Vo=new Map,Oi=[],HA="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Xb(a,r){switch(a){case"focusin":case"focusout":Ri=null;break;case"dragenter":case"dragleave":Di=null;break;case"mouseover":case"mouseout":Li=null;break;case"pointerover":case"pointerout":Fo.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vo.delete(r.pointerId)}}function qo(a,r,u,h,v,S){return a===null||a.nativeEvent!==S?(a={blockedOn:r,domEventName:u,eventSystemFlags:h,nativeEvent:S,targetContainers:[v]},r!==null&&(r=Ba(r),r!==null&&qb(r)),a):(a.eventSystemFlags|=h,r=a.targetContainers,v!==null&&r.indexOf(v)===-1&&r.push(v),a)}function FA(a,r,u,h,v){switch(r){case"focusin":return Ri=qo(Ri,a,r,u,h,v),!0;case"dragenter":return Di=qo(Di,a,r,u,h,v),!0;case"mouseover":return Li=qo(Li,a,r,u,h,v),!0;case"pointerover":var S=v.pointerId;return Fo.set(S,qo(Fo.get(S)||null,a,r,u,h,v)),!0;case"gotpointercapture":return S=v.pointerId,Vo.set(S,qo(Vo.get(S)||null,a,r,u,h,v)),!0}return!1}function Kb(a){var r=Gn(a.target);if(r!==null){var u=s(r);if(u!==null){if(r=u.tag,r===13){if(r=l(u),r!==null){a.blockedOn=r,Zi(a.priority,function(){Yb(u)});return}}else if(r===31){if(r=c(u),r!==null){a.blockedOn=r,Zi(a.priority,function(){Yb(u)});return}}else if(r===3&&u.stateNode.current.memoizedState.isDehydrated){a.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}a.blockedOn=null}function rc(a){if(a.blockedOn!==null)return!1;for(var r=a.targetContainers;0<r.length;){var u=qh(a.nativeEvent);if(u===null){u=a.nativeEvent;var h=new u.constructor(u.type,u);qd=h,u.target.dispatchEvent(h),qd=null}else return r=Ba(u),r!==null&&qb(r),a.blockedOn=u,!1;r.shift()}return!0}function $b(a,r,u){rc(a)&&u.delete(r)}function VA(){Gh=!1,Ri!==null&&rc(Ri)&&(Ri=null),Di!==null&&rc(Di)&&(Di=null),Li!==null&&rc(Li)&&(Li=null),Fo.forEach($b),Vo.forEach($b)}function sc(a,r){a.blockedOn===r&&(a.blockedOn=null,Gh||(Gh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,VA)))}var oc=null;function Qb(a){oc!==a&&(oc=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){oc===a&&(oc=null);for(var r=0;r<a.length;r+=3){var u=a[r],h=a[r+1],v=a[r+2];if(typeof h!="function"){if(Yh(h||u)===null)continue;break}var S=Ba(u);S!==null&&(a.splice(r,3),r-=3,qf(S,{pending:!0,data:v,method:u.method,action:h},h,v))}}))}function Ts(a){function r(te){return sc(te,a)}Ri!==null&&sc(Ri,a),Di!==null&&sc(Di,a),Li!==null&&sc(Li,a),Fo.forEach(r),Vo.forEach(r);for(var u=0;u<Oi.length;u++){var h=Oi[u];h.blockedOn===a&&(h.blockedOn=null)}for(;0<Oi.length&&(u=Oi[0],u.blockedOn===null);)Kb(u),u.blockedOn===null&&Oi.shift();if(u=(a.ownerDocument||a).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var v=u[h],S=u[h+1],O=v[kt]||null;if(typeof S=="function")O||Qb(u);else if(O){var V=null;if(S&&S.hasAttribute("formAction")){if(v=S,O=S[kt]||null)V=O.formAction;else if(Yh(v)!==null)continue}else V=O.action;typeof V=="function"?u[h+1]=V:(u.splice(h,3),h-=3),Qb(u)}}}function Wb(){function a(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(O){return v=O})},focusReset:"manual",scroll:"manual"})}function r(){v!==null&&(v(),v=null),h||setTimeout(u,20)}function u(){if(!h&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,v=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(u,100),function(){h=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),v!==null&&(v(),v=null)}}}function Xh(a){this._internalRoot=a}lc.prototype.render=Xh.prototype.render=function(a){var r=this._internalRoot;if(r===null)throw Error(i(409));var u=r.current,h=Hn();Fb(u,h,a,r,null,null)},lc.prototype.unmount=Xh.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var r=a.containerInfo;Fb(a.current,2,null,a,null,null),Fu(),r[Pa]=null}};function lc(a){this._internalRoot=a}lc.prototype.unstable_scheduleHydration=function(a){if(a){var r=Zs();a={blockedOn:null,target:a,priority:r};for(var u=0;u<Oi.length&&r!==0&&r<Oi[u].priority;u++);Oi.splice(u,0,a),u===0&&Kb(a)}};var Zb=t.version;if(Zb!=="19.2.8")throw Error(i(527,Zb,"19.2.8"));G.findDOMNode=function(a){var r=a._reactInternals;if(r===void 0)throw typeof a.render=="function"?Error(i(188)):(a=Object.keys(a).join(","),Error(i(268,a)));return a=f(r),a=a!==null?p(a):null,a=a===null?null:a.stateNode,a};var qA={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var uc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!uc.isDisabled&&uc.supportsFiber)try{We=uc.inject(qA),se=uc}catch{}}return Go.createRoot=function(a,r){if(!o(a))throw Error(i(299));var u=!1,h="",v=rx,S=sx,O=ox;return r!=null&&(r.unstable_strictMode===!0&&(u=!0),r.identifierPrefix!==void 0&&(h=r.identifierPrefix),r.onUncaughtError!==void 0&&(v=r.onUncaughtError),r.onCaughtError!==void 0&&(S=r.onCaughtError),r.onRecoverableError!==void 0&&(O=r.onRecoverableError)),r=Ub(a,1,!1,null,null,u,h,null,v,S,O,Wb),a[Pa]=r.current,Nh(a),new Xh(r)},Go.hydrateRoot=function(a,r,u){if(!o(a))throw Error(i(299));var h=!1,v="",S=rx,O=sx,V=ox,te=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(v=u.identifierPrefix),u.onUncaughtError!==void 0&&(S=u.onUncaughtError),u.onCaughtError!==void 0&&(O=u.onCaughtError),u.onRecoverableError!==void 0&&(V=u.onRecoverableError),u.formState!==void 0&&(te=u.formState)),r=Ub(a,1,!0,r,u??null,h,v,te,S,O,V,Wb),r.context=Hb(null),u=r.current,h=Hn(),h=Ws(h),v=yi(h),v.callback=null,vi(u,v,h),u=h,r.current.lanes=u,Qi(r,u),ka(r),a[Pa]=r.current,Nh(a),new lc(r)},Go.version="19.2.8",Go}var cy;function aC(){if(cy)return Wh.exports;cy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Wh.exports=nC(),Wh.exports}var iC=aC();const rC=Ol(iC);/**
|
|
50
|
-
* @license lucide-react v0.468.0 - ISC
|
|
51
|
-
*
|
|
52
|
-
* This source code is licensed under the ISC license.
|
|
53
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
-
*/const sC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),bE=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim();/**
|
|
55
|
-
* @license lucide-react v0.468.0 - ISC
|
|
56
|
-
*
|
|
57
|
-
* This source code is licensed under the ISC license.
|
|
58
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
-
*/var oC={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"};/**
|
|
60
|
-
* @license lucide-react v0.468.0 - ISC
|
|
61
|
-
*
|
|
62
|
-
* This source code is licensed under the ISC license.
|
|
63
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
-
*/const lC=C.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:o="",children:s,iconNode:l,...c},d)=>C.createElement("svg",{ref:d,...oC,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:bE("lucide",o),...c},[...l.map(([f,p])=>C.createElement(f,p)),...Array.isArray(s)?s:[s]]));/**
|
|
65
|
-
* @license lucide-react v0.468.0 - ISC
|
|
66
|
-
*
|
|
67
|
-
* This source code is licensed under the ISC license.
|
|
68
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
-
*/const De=(e,t)=>{const n=C.forwardRef(({className:i,...o},s)=>C.createElement(lC,{ref:s,iconNode:t,className:bE(`lucide-${sC(e)}`,i),...o}));return n.displayName=`${e}`,n};/**
|
|
70
|
-
* @license lucide-react v0.468.0 - ISC
|
|
71
|
-
*
|
|
72
|
-
* This source code is licensed under the ISC license.
|
|
73
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
-
*/const uC=De("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"}]]);/**
|
|
75
|
-
* @license lucide-react v0.468.0 - ISC
|
|
76
|
-
*
|
|
77
|
-
* This source code is licensed under the ISC license.
|
|
78
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
-
*/const o0=De("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
80
|
-
* @license lucide-react v0.468.0 - ISC
|
|
81
|
-
*
|
|
82
|
-
* This source code is licensed under the ISC license.
|
|
83
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
-
*/const cC=De("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
85
|
-
* @license lucide-react v0.468.0 - ISC
|
|
86
|
-
*
|
|
87
|
-
* This source code is licensed under the ISC license.
|
|
88
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
-
*/const dC=De("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"}]]);/**
|
|
90
|
-
* @license lucide-react v0.468.0 - ISC
|
|
91
|
-
*
|
|
92
|
-
* This source code is licensed under the ISC license.
|
|
93
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
-
*/const La=De("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"}]]);/**
|
|
95
|
-
* @license lucide-react v0.468.0 - ISC
|
|
96
|
-
*
|
|
97
|
-
* This source code is licensed under the ISC license.
|
|
98
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
-
*/const fC=De("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"}]]);/**
|
|
100
|
-
* @license lucide-react v0.468.0 - ISC
|
|
101
|
-
*
|
|
102
|
-
* This source code is licensed under the ISC license.
|
|
103
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
-
*/const hC=De("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"}]]);/**
|
|
105
|
-
* @license lucide-react v0.468.0 - ISC
|
|
106
|
-
*
|
|
107
|
-
* This source code is licensed under the ISC license.
|
|
108
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
-
*/const Vn=De("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
110
|
-
* @license lucide-react v0.468.0 - ISC
|
|
111
|
-
*
|
|
112
|
-
* This source code is licensed under the ISC license.
|
|
113
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
-
*/const op=De("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
115
|
-
* @license lucide-react v0.468.0 - ISC
|
|
116
|
-
*
|
|
117
|
-
* This source code is licensed under the ISC license.
|
|
118
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
-
*/const mC=De("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
120
|
-
* @license lucide-react v0.468.0 - ISC
|
|
121
|
-
*
|
|
122
|
-
* This source code is licensed under the ISC license.
|
|
123
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
-
*/const yE=De("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
125
|
-
* @license lucide-react v0.468.0 - ISC
|
|
126
|
-
*
|
|
127
|
-
* This source code is licensed under the ISC license.
|
|
128
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
-
*/const l0=De("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"}]]);/**
|
|
130
|
-
* @license lucide-react v0.468.0 - ISC
|
|
131
|
-
*
|
|
132
|
-
* This source code is licensed under the ISC license.
|
|
133
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
-
*/const ga=De("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
135
|
-
* @license lucide-react v0.468.0 - ISC
|
|
136
|
-
*
|
|
137
|
-
* This source code is licensed under the ISC license.
|
|
138
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
-
*/const pC=De("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"}]]);/**
|
|
140
|
-
* @license lucide-react v0.468.0 - ISC
|
|
141
|
-
*
|
|
142
|
-
* This source code is licensed under the ISC license.
|
|
143
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
-
*/const gC=De("CircleSlash",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]]);/**
|
|
145
|
-
* @license lucide-react v0.468.0 - ISC
|
|
146
|
-
*
|
|
147
|
-
* This source code is licensed under the ISC license.
|
|
148
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
-
*/const Ir=De("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"}]]);/**
|
|
150
|
-
* @license lucide-react v0.468.0 - ISC
|
|
151
|
-
*
|
|
152
|
-
* This source code is licensed under the ISC license.
|
|
153
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
-
*/const vE=De("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"}]]);/**
|
|
155
|
-
* @license lucide-react v0.468.0 - ISC
|
|
156
|
-
*
|
|
157
|
-
* This source code is licensed under the ISC license.
|
|
158
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
-
*/const EE=De("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"}]]);/**
|
|
160
|
-
* @license lucide-react v0.468.0 - ISC
|
|
161
|
-
*
|
|
162
|
-
* This source code is licensed under the ISC license.
|
|
163
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
-
*/const xC=De("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"}]]);/**
|
|
165
|
-
* @license lucide-react v0.468.0 - ISC
|
|
166
|
-
*
|
|
167
|
-
* This source code is licensed under the ISC license.
|
|
168
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
-
*/const TE=De("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"}]]);/**
|
|
170
|
-
* @license lucide-react v0.468.0 - ISC
|
|
171
|
-
*
|
|
172
|
-
* This source code is licensed under the ISC license.
|
|
173
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
-
*/const bC=De("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"}]]);/**
|
|
175
|
-
* @license lucide-react v0.468.0 - ISC
|
|
176
|
-
*
|
|
177
|
-
* This source code is licensed under the ISC license.
|
|
178
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
-
*/const yC=De("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"}]]);/**
|
|
180
|
-
* @license lucide-react v0.468.0 - ISC
|
|
181
|
-
*
|
|
182
|
-
* This source code is licensed under the ISC license.
|
|
183
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
-
*/const Il=De("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"}]]);/**
|
|
185
|
-
* @license lucide-react v0.468.0 - ISC
|
|
186
|
-
*
|
|
187
|
-
* This source code is licensed under the ISC license.
|
|
188
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
-
*/const SE=De("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"}]]);/**
|
|
190
|
-
* @license lucide-react v0.468.0 - ISC
|
|
191
|
-
*
|
|
192
|
-
* This source code is licensed under the ISC license.
|
|
193
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
-
*/const vC=De("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"}]]);/**
|
|
195
|
-
* @license lucide-react v0.468.0 - ISC
|
|
196
|
-
*
|
|
197
|
-
* This source code is licensed under the ISC license.
|
|
198
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
-
*/const EC=De("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"}]]);/**
|
|
200
|
-
* @license lucide-react v0.468.0 - ISC
|
|
201
|
-
*
|
|
202
|
-
* This source code is licensed under the ISC license.
|
|
203
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
-
*/const TC=De("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"}]]);/**
|
|
205
|
-
* @license lucide-react v0.468.0 - ISC
|
|
206
|
-
*
|
|
207
|
-
* This source code is licensed under the ISC license.
|
|
208
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
-
*/const kE=De("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"}]]);/**
|
|
210
|
-
* @license lucide-react v0.468.0 - ISC
|
|
211
|
-
*
|
|
212
|
-
* This source code is licensed under the ISC license.
|
|
213
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
214
|
-
*/const SC=De("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"}]]);/**
|
|
215
|
-
* @license lucide-react v0.468.0 - ISC
|
|
216
|
-
*
|
|
217
|
-
* This source code is licensed under the ISC license.
|
|
218
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
-
*/const kC=De("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"}]]);/**
|
|
220
|
-
* @license lucide-react v0.468.0 - ISC
|
|
221
|
-
*
|
|
222
|
-
* This source code is licensed under the ISC license.
|
|
223
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
224
|
-
*/const wC=De("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
225
|
-
* @license lucide-react v0.468.0 - ISC
|
|
226
|
-
*
|
|
227
|
-
* This source code is licensed under the ISC license.
|
|
228
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
-
*/const AC=De("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"}]]);/**
|
|
230
|
-
* @license lucide-react v0.468.0 - ISC
|
|
231
|
-
*
|
|
232
|
-
* This source code is licensed under the ISC license.
|
|
233
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
234
|
-
*/const Yc=De("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"}]]);/**
|
|
235
|
-
* @license lucide-react v0.468.0 - ISC
|
|
236
|
-
*
|
|
237
|
-
* This source code is licensed under the ISC license.
|
|
238
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
239
|
-
*/const CC=De("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"}]]);/**
|
|
240
|
-
* @license lucide-react v0.468.0 - ISC
|
|
241
|
-
*
|
|
242
|
-
* This source code is licensed under the ISC license.
|
|
243
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
-
*/const lp=De("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"}]]);/**
|
|
245
|
-
* @license lucide-react v0.468.0 - ISC
|
|
246
|
-
*
|
|
247
|
-
* This source code is licensed under the ISC license.
|
|
248
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
249
|
-
*/const NC=De("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
250
|
-
* @license lucide-react v0.468.0 - ISC
|
|
251
|
-
*
|
|
252
|
-
* This source code is licensed under the ISC license.
|
|
253
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
254
|
-
*/const _C=De("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"}]]);/**
|
|
255
|
-
* @license lucide-react v0.468.0 - ISC
|
|
256
|
-
*
|
|
257
|
-
* This source code is licensed under the ISC license.
|
|
258
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
259
|
-
*/const up=De("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"}]]);/**
|
|
260
|
-
* @license lucide-react v0.468.0 - ISC
|
|
261
|
-
*
|
|
262
|
-
* This source code is licensed under the ISC license.
|
|
263
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
-
*/const jl=De("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"}]]);/**
|
|
265
|
-
* @license lucide-react v0.468.0 - ISC
|
|
266
|
-
*
|
|
267
|
-
* This source code is licensed under the ISC license.
|
|
268
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
269
|
-
*/const wE=De("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
|
|
270
|
-
* @license lucide-react v0.468.0 - ISC
|
|
271
|
-
*
|
|
272
|
-
* This source code is licensed under the ISC license.
|
|
273
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
274
|
-
*/const MC=De("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"}]]);/**
|
|
275
|
-
* @license lucide-react v0.468.0 - ISC
|
|
276
|
-
*
|
|
277
|
-
* This source code is licensed under the ISC license.
|
|
278
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
279
|
-
*/const ll=De("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"}]]);/**
|
|
280
|
-
* @license lucide-react v0.468.0 - ISC
|
|
281
|
-
*
|
|
282
|
-
* This source code is licensed under the ISC license.
|
|
283
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
284
|
-
*/const RC=De("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
|
|
285
|
-
* @license lucide-react v0.468.0 - ISC
|
|
286
|
-
*
|
|
287
|
-
* This source code is licensed under the ISC license.
|
|
288
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
289
|
-
*/const DC=De("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"}]]);/**
|
|
290
|
-
* @license lucide-react v0.468.0 - ISC
|
|
291
|
-
*
|
|
292
|
-
* This source code is licensed under the ISC license.
|
|
293
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
294
|
-
*/const dy=De("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"}]]);/**
|
|
295
|
-
* @license lucide-react v0.468.0 - ISC
|
|
296
|
-
*
|
|
297
|
-
* This source code is licensed under the ISC license.
|
|
298
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
299
|
-
*/const LC=De("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
|
|
300
|
-
* @license lucide-react v0.468.0 - ISC
|
|
301
|
-
*
|
|
302
|
-
* This source code is licensed under the ISC license.
|
|
303
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
304
|
-
*/const OC=De("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
|
|
305
|
-
* @license lucide-react v0.468.0 - ISC
|
|
306
|
-
*
|
|
307
|
-
* This source code is licensed under the ISC license.
|
|
308
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
309
|
-
*/const IC=De("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"}]]);/**
|
|
310
|
-
* @license lucide-react v0.468.0 - ISC
|
|
311
|
-
*
|
|
312
|
-
* This source code is licensed under the ISC license.
|
|
313
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
314
|
-
*/const jC=De("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"}]]);/**
|
|
315
|
-
* @license lucide-react v0.468.0 - ISC
|
|
316
|
-
*
|
|
317
|
-
* This source code is licensed under the ISC license.
|
|
318
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
319
|
-
*/const kl=De("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"}]]);/**
|
|
320
|
-
* @license lucide-react v0.468.0 - ISC
|
|
321
|
-
*
|
|
322
|
-
* This source code is licensed under the ISC license.
|
|
323
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
324
|
-
*/const fy=De("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"}]]);/**
|
|
325
|
-
* @license lucide-react v0.468.0 - ISC
|
|
326
|
-
*
|
|
327
|
-
* This source code is licensed under the ISC license.
|
|
328
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
329
|
-
*/const md=De("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
330
|
-
* @license lucide-react v0.468.0 - ISC
|
|
331
|
-
*
|
|
332
|
-
* This source code is licensed under the ISC license.
|
|
333
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
334
|
-
*/const tm=De("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"}]]);/**
|
|
335
|
-
* @license lucide-react v0.468.0 - ISC
|
|
336
|
-
*
|
|
337
|
-
* This source code is licensed under the ISC license.
|
|
338
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
339
|
-
*/const AE=De("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"}]]);/**
|
|
340
|
-
* @license lucide-react v0.468.0 - ISC
|
|
341
|
-
*
|
|
342
|
-
* This source code is licensed under the ISC license.
|
|
343
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
344
|
-
*/const PC=De("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"}]]);/**
|
|
345
|
-
* @license lucide-react v0.468.0 - ISC
|
|
346
|
-
*
|
|
347
|
-
* This source code is licensed under the ISC license.
|
|
348
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
349
|
-
*/const BC=De("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"}]]);/**
|
|
350
|
-
* @license lucide-react v0.468.0 - ISC
|
|
351
|
-
*
|
|
352
|
-
* This source code is licensed under the ISC license.
|
|
353
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
354
|
-
*/const ul=De("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"}]]);/**
|
|
355
|
-
* @license lucide-react v0.468.0 - ISC
|
|
356
|
-
*
|
|
357
|
-
* This source code is licensed under the ISC license.
|
|
358
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
359
|
-
*/const zC=De("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"}]]);/**
|
|
360
|
-
* @license lucide-react v0.468.0 - ISC
|
|
361
|
-
*
|
|
362
|
-
* This source code is licensed under the ISC license.
|
|
363
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
364
|
-
*/const UC=De("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"}]]);/**
|
|
365
|
-
* @license lucide-react v0.468.0 - ISC
|
|
366
|
-
*
|
|
367
|
-
* This source code is licensed under the ISC license.
|
|
368
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
369
|
-
*/const cp=De("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
370
|
-
* @license lucide-react v0.468.0 - ISC
|
|
371
|
-
*
|
|
372
|
-
* This source code is licensed under the ISC license.
|
|
373
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
374
|
-
*/const HC=De("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"}]]);/**
|
|
375
|
-
* @license lucide-react v0.468.0 - ISC
|
|
376
|
-
*
|
|
377
|
-
* This source code is licensed under the ISC license.
|
|
378
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
379
|
-
*/const FC=De("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"}]]);/**
|
|
380
|
-
* @license lucide-react v0.468.0 - ISC
|
|
381
|
-
*
|
|
382
|
-
* This source code is licensed under the ISC license.
|
|
383
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
384
|
-
*/const Gc=De("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"}]]);/**
|
|
385
|
-
* @license lucide-react v0.468.0 - ISC
|
|
386
|
-
*
|
|
387
|
-
* This source code is licensed under the ISC license.
|
|
388
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
389
|
-
*/const dp=De("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"}]]);/**
|
|
390
|
-
* @license lucide-react v0.468.0 - ISC
|
|
391
|
-
*
|
|
392
|
-
* This source code is licensed under the ISC license.
|
|
393
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
394
|
-
*/const VC=De("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"}]]);/**
|
|
395
|
-
* @license lucide-react v0.468.0 - ISC
|
|
396
|
-
*
|
|
397
|
-
* This source code is licensed under the ISC license.
|
|
398
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
399
|
-
*/const qC=De("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"}]]);/**
|
|
400
|
-
* @license lucide-react v0.468.0 - ISC
|
|
401
|
-
*
|
|
402
|
-
* This source code is licensed under the ISC license.
|
|
403
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
404
|
-
*/const u0=De("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"}]]);/**
|
|
405
|
-
* @license lucide-react v0.468.0 - ISC
|
|
406
|
-
*
|
|
407
|
-
* This source code is licensed under the ISC license.
|
|
408
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
409
|
-
*/const YC=De("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"}]]);/**
|
|
410
|
-
* @license lucide-react v0.468.0 - ISC
|
|
411
|
-
*
|
|
412
|
-
* This source code is licensed under the ISC license.
|
|
413
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
414
|
-
*/const fp=De("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
415
|
-
* @license lucide-react v0.468.0 - ISC
|
|
416
|
-
*
|
|
417
|
-
* This source code is licensed under the ISC license.
|
|
418
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
419
|
-
*/const GC=De("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"}]]);/**
|
|
420
|
-
* @license lucide-react v0.468.0 - ISC
|
|
421
|
-
*
|
|
422
|
-
* This source code is licensed under the ISC license.
|
|
423
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
424
|
-
*/const CE=De("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"}]]);/**
|
|
425
|
-
* @license lucide-react v0.468.0 - ISC
|
|
426
|
-
*
|
|
427
|
-
* This source code is licensed under the ISC license.
|
|
428
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
429
|
-
*/const Is=De("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"}]]);/**
|
|
430
|
-
* @license lucide-react v0.468.0 - ISC
|
|
431
|
-
*
|
|
432
|
-
* This source code is licensed under the ISC license.
|
|
433
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
434
|
-
*/const XC=De("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"}]]);/**
|
|
435
|
-
* @license lucide-react v0.468.0 - ISC
|
|
436
|
-
*
|
|
437
|
-
* This source code is licensed under the ISC license.
|
|
438
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
439
|
-
*/const NE=De("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"}]]);/**
|
|
440
|
-
* @license lucide-react v0.468.0 - ISC
|
|
441
|
-
*
|
|
442
|
-
* This source code is licensed under the ISC license.
|
|
443
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
444
|
-
*/const c0=De("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"}]]);/**
|
|
445
|
-
* @license lucide-react v0.468.0 - ISC
|
|
446
|
-
*
|
|
447
|
-
* This source code is licensed under the ISC license.
|
|
448
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
449
|
-
*/const li=De("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"}]]);/**
|
|
450
|
-
* @license lucide-react v0.468.0 - ISC
|
|
451
|
-
*
|
|
452
|
-
* This source code is licensed under the ISC license.
|
|
453
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
454
|
-
*/const KC=De("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"}]]);/**
|
|
455
|
-
* @license lucide-react v0.468.0 - ISC
|
|
456
|
-
*
|
|
457
|
-
* This source code is licensed under the ISC license.
|
|
458
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
459
|
-
*/const _E=De("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"}]]);/**
|
|
460
|
-
* @license lucide-react v0.468.0 - ISC
|
|
461
|
-
*
|
|
462
|
-
* This source code is licensed under the ISC license.
|
|
463
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
464
|
-
*/const $C=De("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"}]]);/**
|
|
465
|
-
* @license lucide-react v0.468.0 - ISC
|
|
466
|
-
*
|
|
467
|
-
* This source code is licensed under the ISC license.
|
|
468
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
469
|
-
*/const Pl=De("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"}]]);/**
|
|
470
|
-
* @license lucide-react v0.468.0 - ISC
|
|
471
|
-
*
|
|
472
|
-
* This source code is licensed under the ISC license.
|
|
473
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
474
|
-
*/const oa=De("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
475
|
-
* @license lucide-react v0.468.0 - ISC
|
|
476
|
-
*
|
|
477
|
-
* This source code is licensed under the ISC license.
|
|
478
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
479
|
-
*/const d0=De("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"}]]),fe=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}}),ai=typeof navigator<"u"&&navigator.userAgent.includes("Electron"),QC=/[\u2E80-\u9FFF\uF900-\uFAFF\u3000-\u303F\uFF00-\uFFEF]/g;function ME(e){if(!e)return 0;const t=(e.match(QC)??[]).length,n=e.length-t;return Math.ceil(t*11/10+n/4)}function WC(e,t){return!t||t<=0?null:e<=0?0:Math.min(100,Math.round(e/t*100))}function ZC(e,t){const n=e.reduce((i,o)=>i+o,0);return n<=0||t<=0?e.map(()=>0):e.map(i=>t*i/n)}function Ss(e){return e<1e3?String(Math.round(e)):e<1e4?`${(e/1e3).toFixed(1)}k`:`${Math.round(e/1e3)}k`}const RE=.5,JC=.9,eN=.85;var hp=xE();const DE="lookatstudy-lang";let Xc=typeof localStorage>"u"?"zh-CN":localStorage.getItem(DE)||"zh-CN";const f0=new Set;function LE(e){return f0.add(e),()=>{f0.delete(e)}}const hy={"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}」。但我现在没什么劲——别直接讲概念,也别出计分题考我。请这样开场:
|
|
480
|
-
1. 先用一两句散文抛个钩子(反直觉的、或跟我日常有关的,让我产生好奇);
|
|
481
|
-
2. 然后调用 pose_guess 工具,给我一个二选一的小猜测(就是玩,不是考试);
|
|
482
|
-
3. 我会点选项猜,你【下一回合】再揭晓,顺带把这课最核心的一点讲清楚。
|
|
483
|
-
铁律:起手不要讲座、不要用 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":`
|
|
484
|
-
|
|
485
|
-
网络受限或私有仓库请改用「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.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.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.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.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}}。下面是逐题情况:
|
|
486
|
-
请根据我的表现决定下一步:答错的题讲清为什么错和正确思路;全对的话判断我是否可以进入下一部分。不要重新出同一组题,也不要只说一句做得好。`,"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:
|
|
487
|
-
1. First hook me with a sentence or two of prose (counter-intuitive, or tied to daily life — make me curious);
|
|
488
|
-
2. Then call the pose_guess tool with a small two-option guess (just for fun, not a test);
|
|
489
|
-
3. I'll pick an option and guess; in your NEXT turn, reveal the answer and teach the one core idea of this lesson.
|
|
490
|
-
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":`
|
|
491
|
-
|
|
492
|
-
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.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.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.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.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:
|
|
493
|
-
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 js(){return Xc}function tN(e){e!==Xc&&(Xc=e,typeof localStorage<"u"&&localStorage.setItem(DE,e),f0.forEach(t=>t()))}function mp(e,t=Xc,n){var o,s;let i=((o=hy[t])==null?void 0:o[e])??((s=hy["zh-CN"])==null?void 0:s[e])??e;if(n)for(const[l,c]of Object.entries(n))i=i.replaceAll(`{${l}}`,String(c));return i}function Xe(){const e=C.useSyncExternalStore(LE,js,js);return C.useCallback((t,n)=>mp(t,e,n),[e])}function OE(){return C.useSyncExternalStore(LE,js,js)}const nN=["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 my(e){return Array.from(e.querySelectorAll(nN)).filter(t=>t.offsetParent!==null||t===document.activeElement)}function Fs(e,t){C.useEffect(()=>{if(!t)return;const n=e.current;if(!n)return;const i=document.activeElement,s=my(n)[0]??n,l=window.setTimeout(()=>s.focus(),0),c=d=>{if(d.key!=="Tab")return;const f=my(n);if(f.length===0){d.preventDefault(),n.focus();return}const p=f[0],x=f[f.length-1];d.shiftKey?(document.activeElement===p||!n.contains(document.activeElement))&&(d.preventDefault(),x.focus()):document.activeElement===x&&(d.preventDefault(),p.focus())};return n.addEventListener("keydown",c),()=>{if(window.clearTimeout(l),n.removeEventListener("keydown",c),i&&document.body.contains(i))try{i.focus()}catch{}}},[e,t])}const cc=220;function pd({anchorRect:e,message:t,onConfirm:n,onCancel:i,confirmLabel:o,cancelLabel:s,danger:l=!1,testid:c="confirm-card"}){const d=Xe(),f=C.useRef(null);Fs(f,!0);const p=o??d("action.confirm"),x=s??d("action.cancel");C.useEffect(()=>{const w=_=>{f.current&&!f.current.contains(_.target)&&i()},M=_=>{_.key==="Escape"&&i(),_.key==="Enter"&&(_.preventDefault(),n())};return document.addEventListener("mousedown",w),document.addEventListener("keydown",M),()=>{document.removeEventListener("mousedown",w),document.removeEventListener("keydown",M)}},[i,n]);const b=window.innerWidth,g=window.innerHeight,y=e.right-cc,E=Math.max(8,Math.min(y,b-cc-8)),T=e.bottom+4+cc>g?Math.max(8,e.top-4-cc):e.bottom+4;return hp.createPortal(m.jsxs("div",{ref:f,className:`confirm-card fixed z-[60] w-[220px] bg-surface-0 rounded-xl shadow-elevated border p-3 ${l?"border-warning/50":"border-[var(--border)]"}`,style:{left:E,top:T},role:"alertdialog","aria-modal":"false","data-testid":c,onClick:w=>w.stopPropagation(),children:[m.jsx("p",{className:"text-body text-ink-muted leading-relaxed mb-3",children:t}),m.jsxs("div",{className:"flex gap-2 justify-end",children:[m.jsx("button",{onClick:i,"data-testid":`${c}-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:x}),m.jsx("button",{onClick:n,"data-testid":`${c}-confirm`,className:"btn-3d-brand px-2.5 py-1 text-label",style:l?{background:"var(--warning)",boxShadow:"0 3px 0 0 var(--warning-dark)"}:void 0,children:p})]})]}),document.body)}function aN(e,t,n){return[...e].sort((i,o)=>i.orderIdx-o.orderIdx).map(i=>{const o=t.filter(c=>c.parentId===i.id).sort((c,d)=>c.orderIdx-d.orderIdx),s=o.filter(c=>c.type==="lesson"),l=s.length>0&&s.every(c=>{var d;return(((d=n[c.id])==null?void 0:d.mastery)??0)>=RE});return{section:i,lessons:o,chapterLessonsMastered:l}})}function h0(e,t,n){var i;return e.type==="exam"?!n:(((i=t[e.id])==null?void 0:i.status)??"locked")==="locked"}function iN(e,t){const n=t.trim().toLowerCase().split(/\s+/).filter(Boolean);if(n.length===0)return e;const i=o=>{const s=o.toLowerCase();return n.every(l=>s.includes(l))};return e.map(o=>{if(i(o.section.title))return o;const s=o.lessons.filter(l=>i(l.title));return s.length>0?{...o,lessons:s}:null}).filter(o=>o!==null)}function rN(e,t){const n=t.trim().split(/\s+/).filter(Boolean)[0];if(!n)return null;const i=e.toLowerCase().indexOf(n.toLowerCase());return i>=0?[i,i+n.length]:null}function sN(e){const t=Xe(),[n,i]=C.useState(""),[o,s]=C.useState([]),l=C.useRef(null);C.useEffect(()=>{var E;(E=l.current)==null||E.focus()},[]);const c=C.useMemo(()=>aN(e.sections,e.tree,e.progressMap),[e.sections,e.tree,e.progressMap]),d=C.useMemo(()=>iN(c,n),[c,n]),f=C.useMemo(()=>new Set(e.tree.map(E=>E.id)),[e.tree]),p=C.useMemo(()=>new Set(d.flatMap(E=>E.lessons.map(T=>T.id))),[d]),x=C.useMemo(()=>new Map(e.tree.map(E=>[E.id,E])),[e.tree]),b=C.useMemo(()=>new Map(c.map(E=>[E.section.id,E.chapterLessonsMastered])),[c]);C.useEffect(()=>{const E=n.trim();if(E.length<2){s([]);return}const T=setTimeout(()=>{fe.searchContent(E).then(w=>{s(w.filter(M=>f.has(M.nodeId)&&!p.has(M.nodeId)).slice(0,8))}).catch(()=>s([]))},250);return()=>clearTimeout(T)},[n,f,p]);const g=C.useMemo(()=>{for(const E of d){const T=E.lessons.find(w=>!h0(w,e.progressMap,E.chapterLessonsMastered));if(T)return T}return null},[d,e.progressMap]),y=d.length>0||o.length>0;return m.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:E=>{E.key==="Escape"&&e.onClose()},children:[m.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:[m.jsx(cp,{className:"w-4 h-4 text-white/50 shrink-0"}),m.jsx("input",{ref:l,value:n,onChange:E=>i(E.target.value),onKeyDown:E=>{E.key==="Enter"&&g&&e.onJump(g)},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&&m.jsx("button",{onClick:()=>{var E;i(""),(E=l.current)==null||E.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:m.jsx(oa,{className:"w-3.5 h-3.5"})}),m.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:m.jsx(oa,{className:"w-3.5 h-3.5"})})]}),m.jsxs("div",{className:"flex-1 overflow-y-auto px-2 pb-3 space-y-2",children:[!y&&m.jsx("div",{"data-testid":"course-search-empty",className:"text-center text-label text-white/60 mt-8 px-4",children:t("map.search.noResults")}),d.map((E,T)=>m.jsx(oN,{row:E,sectionIndex:T,query:n,progressMap:e.progressMap,selectedNodeId:e.selectedNodeId,onPick:e.onJump},E.section.id)),o.length>0&&m.jsxs("div",{"data-testid":"course-search-content-group",className:"pt-1",children:[m.jsx("div",{className:"px-1.5 py-1 text-caption font-bold text-white/50 uppercase tracking-wider",children:t("map.search.contentGroup")}),o.map(E=>{const T=x.get(E.nodeId);if(!T)return null;const w=h0(T,e.progressMap,b.get(T.parentId??"")??!1);return m.jsxs("button",{disabled:w,"data-testid":`search-content-row-${T.id.slice(0,8)}`,onClick:()=>!w&&e.onJump(T),className:`w-full text-left px-2 py-1.5 rounded-lg transition-colors ${w?"opacity-45 cursor-not-allowed":"hover:bg-white/10 cursor-pointer"} ${T.id===e.selectedNodeId?"bg-accent/15 ring-1 ring-accent/40":""}`,children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(La,{className:"w-3.5 h-3.5 text-white/70 shrink-0"}),m.jsx("span",{className:"flex-1 text-label font-bold text-white truncate",children:m.jsx(m0,{text:E.title,query:n})})]}),m.jsx("div",{className:"text-caption text-white/55 line-clamp-2 leading-snug pl-5.5",children:E.snippet})]},E.nodeId)})]})]})]})}function oN({row:e,sectionIndex:t,query:n,progressMap:i,selectedNodeId:o,onPick:s}){const l=Xe(),c=(e.section.world??"study")==="practice";return m.jsxs("div",{"data-testid":`search-section-${e.section.id.slice(0,8)}`,children:[m.jsxs("div",{className:"flex items-center gap-2 px-1.5 py-1",children:[m.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}),m.jsx("span",{className:"text-label font-bold text-white truncate flex-1",children:m.jsx(m0,{text:e.section.title,query:n})}),c&&m.jsx("span",{className:"shrink-0 px-1.5 py-0.5 rounded-full bg-accent/20 text-accent text-caption font-bold",children:l("map.world.practice")})]}),e.lessons.map(d=>{var b;const f=h0(d,i,e.chapterLessonsMastered),p=((b=i[d.id])==null?void 0:b.status)??"locked",x=d.type==="exam";return m.jsxs("button",{disabled:f,"data-testid":`search-row-${d.id.slice(0,8)}`,onClick:()=>!f&&s(d),className:`w-full flex items-center gap-2 px-2 py-1.5 rounded-lg text-left transition-colors ${f?"opacity-45 cursor-not-allowed":"hover:bg-white/10 cursor-pointer"} ${d.id===o?"bg-accent/15 ring-1 ring-accent/40":""}`,children:[f?m.jsx(_C,{className:"w-3.5 h-3.5 text-white/50 shrink-0"}):x?m.jsx(Is,{className:"w-3.5 h-3.5 text-accent shrink-0"}):p==="mastered"?m.jsx(TE,{className:"w-3.5 h-3.5 text-gold shrink-0"}):m.jsx(La,{className:"w-3.5 h-3.5 text-white/70 shrink-0"}),m.jsx("span",{className:"flex-1 text-label text-white truncate",children:m.jsx(m0,{text:d.title,query:n})})]},d.id)})]})}function m0({text:e,query:t}){const n=rN(e,t);return n?m.jsxs(m.Fragment,{children:[e.slice(0,n[0]),m.jsx("span",{className:"text-brand font-extrabold",children:e.slice(n[0],n[1])}),e.slice(n[1])]}):m.jsx(m.Fragment,{children:e})}const lN=268,pp=28,uN=20,IE=pp*2+uN,cN=IE+8,dN=104,fN=18,nm=pp+6,hN=26,mN=22;function p0(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 pN(e,t=lN,n=""){const i=[],o=t/2,s=t/2-fN-pp;for(let d=0;d<e;d++){const f=nm+d*dN,x=p0(`${n}:${d}`)/4294967295*2-1,b=o+x*s,y=p0(`${n}:${d}:y`)/4294967295*2-1,E=f+y*hN;i.push({x:b,y:E,index:d})}if(i.length>0){i[0].y<nm&&(i[0].y=nm);for(let d=1;d<i.length;d++){const f=i[d-1].y+cN;i[d].y<f&&(i[d].y=f)}}const l=[];for(let d=0;d<i.length-1;d++)l.push({from:i[d],to:i[d+1],index:d});const c=i.length===0?40:i[i.length-1].y+IE/2+10;return{nodes:i,segments:l,height:c}}function gN(e){const{from:t,to:n}=e,i=(t.y+n.y)/2+mN;return`M ${t.x} ${t.y} C ${t.x} ${i}, ${n.x} ${i}, ${n.x} ${n.y}`}var Rc={exports:{}};/*!
|
|
494
|
-
* matter-js 0.19.0 by @liabru
|
|
495
|
-
* http://brm.io/matter-js/
|
|
496
|
-
* License MIT
|
|
497
|
-
*
|
|
498
|
-
* The MIT License (MIT)
|
|
499
|
-
*
|
|
500
|
-
* Copyright (c) Liam Brummitt and contributors.
|
|
501
|
-
*
|
|
502
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
503
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
504
|
-
* in the Software without restriction, including without limitation the rights
|
|
505
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
506
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
507
|
-
* furnished to do so, subject to the following conditions:
|
|
508
|
-
*
|
|
509
|
-
* The above copyright notice and this permission notice shall be included in
|
|
510
|
-
* all copies or substantial portions of the Software.
|
|
511
|
-
*
|
|
512
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
513
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
514
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
515
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
516
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
517
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
518
|
-
* THE SOFTWARE.
|
|
519
|
-
*/var xN=Rc.exports,py;function bN(){return py||(py=1,(function(e,t){(function(i,o){e.exports=o()})(xN,function(){return(function(n){var i={};function o(s){if(i[s])return i[s].exports;var l=i[s]={i:s,l:!1,exports:{}};return n[s].call(l.exports,l,l.exports,o),l.l=!0,l.exports}return o.m=n,o.c=i,o.d=function(s,l,c){o.o(s,l)||Object.defineProperty(s,l,{enumerable:!0,get:c})},o.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},o.t=function(s,l){if(l&1&&(s=o(s)),l&8||l&4&&typeof s=="object"&&s&&s.__esModule)return s;var c=Object.create(null);if(o.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:s}),l&2&&typeof s!="string")for(var d in s)o.d(c,d,(function(f){return s[f]}).bind(null,d));return c},o.n=function(s){var l=s&&s.__esModule?function(){return s.default}:function(){return s};return o.d(l,"a",l),l},o.o=function(s,l){return Object.prototype.hasOwnProperty.call(s,l)},o.p="",o(o.s=20)})([(function(n,i){var o={};n.exports=o,(function(){o._baseDelta=1e3/60,o._nextId=0,o._seed=0,o._nowStartTime=+new Date,o._warnedOnce={},o._decomp=null,o.extend=function(l,c){var d,f;typeof c=="boolean"?(d=2,f=c):(d=1,f=!0);for(var p=d;p<arguments.length;p++){var x=arguments[p];if(x)for(var b in x)f&&x[b]&&x[b].constructor===Object&&(!l[b]||l[b].constructor===Object)?(l[b]=l[b]||{},o.extend(l[b],f,x[b])):l[b]=x[b]}return l},o.clone=function(l,c){return o.extend({},c,l)},o.keys=function(l){if(Object.keys)return Object.keys(l);var c=[];for(var d in l)c.push(d);return c},o.values=function(l){var c=[];if(Object.keys){for(var d=Object.keys(l),f=0;f<d.length;f++)c.push(l[d[f]]);return c}for(var p in l)c.push(l[p]);return c},o.get=function(l,c,d,f){c=c.split(".").slice(d,f);for(var p=0;p<c.length;p+=1)l=l[c[p]];return l},o.set=function(l,c,d,f,p){var x=c.split(".").slice(f,p);return o.get(l,c,0,-1)[x[x.length-1]]=d,d},o.shuffle=function(l){for(var c=l.length-1;c>0;c--){var d=Math.floor(o.random()*(c+1)),f=l[c];l[c]=l[d],l[d]=f}return l},o.choose=function(l){return l[Math.floor(o.random()*l.length)]},o.isElement=function(l){return typeof HTMLElement<"u"?l instanceof HTMLElement:!!(l&&l.nodeType&&l.nodeName)},o.isArray=function(l){return Object.prototype.toString.call(l)==="[object Array]"},o.isFunction=function(l){return typeof l=="function"},o.isPlainObject=function(l){return typeof l=="object"&&l.constructor===Object},o.isString=function(l){return toString.call(l)==="[object String]"},o.clamp=function(l,c,d){return l<c?c:l>d?d:l},o.sign=function(l){return l<0?-1:1},o.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-o._nowStartTime},o.random=function(l,c){return l=typeof l<"u"?l:0,c=typeof c<"u"?c:1,l+s()*(c-l)};var s=function(){return o._seed=(o._seed*9301+49297)%233280,o._seed/233280};o.colorToNumber=function(l){return l=l.replace("#",""),l.length==3&&(l=l.charAt(0)+l.charAt(0)+l.charAt(1)+l.charAt(1)+l.charAt(2)+l.charAt(2)),parseInt(l,16)},o.logLevel=1,o.log=function(){console&&o.logLevel>0&&o.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},o.info=function(){console&&o.logLevel>0&&o.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},o.warn=function(){console&&o.logLevel>0&&o.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},o.warnOnce=function(){var l=Array.prototype.slice.call(arguments).join(" ");o._warnedOnce[l]||(o.warn(l),o._warnedOnce[l]=!0)},o.deprecated=function(l,c,d){l[c]=o.chain(function(){o.warnOnce("🔅 deprecated 🔅",d)},l[c])},o.nextId=function(){return o._nextId++},o.indexOf=function(l,c){if(l.indexOf)return l.indexOf(c);for(var d=0;d<l.length;d++)if(l[d]===c)return d;return-1},o.map=function(l,c){if(l.map)return l.map(c);for(var d=[],f=0;f<l.length;f+=1)d.push(c(l[f]));return d},o.topologicalSort=function(l){var c=[],d=[],f=[];for(var p in l)!d[p]&&!f[p]&&o._topologicalSort(p,d,f,l,c);return c},o._topologicalSort=function(l,c,d,f,p){var x=f[l]||[];d[l]=!0;for(var b=0;b<x.length;b+=1){var g=x[b];d[g]||c[g]||o._topologicalSort(g,c,d,f,p)}d[l]=!1,c[l]=!0,p.push(l)},o.chain=function(){for(var l=[],c=0;c<arguments.length;c+=1){var d=arguments[c];d._chained?l.push.apply(l,d._chained):l.push(d)}var f=function(){for(var p,x=new Array(arguments.length),b=0,g=arguments.length;b<g;b++)x[b]=arguments[b];for(b=0;b<l.length;b+=1){var y=l[b].apply(p,x);typeof y<"u"&&(p=y)}return p};return f._chained=l,f},o.chainPathBefore=function(l,c,d){return o.set(l,c,o.chain(d,o.get(l,c)))},o.chainPathAfter=function(l,c,d){return o.set(l,c,o.chain(o.get(l,c),d))},o.setDecomp=function(l){o._decomp=l},o.getDecomp=function(){var l=o._decomp;try{!l&&typeof window<"u"&&(l=window.decomp),!l&&typeof ey<"u"&&(l=ey.decomp)}catch{l=null}return l}})()}),(function(n,i){var o={};n.exports=o,(function(){o.create=function(s){var l={min:{x:0,y:0},max:{x:0,y:0}};return s&&o.update(l,s),l},o.update=function(s,l,c){s.min.x=1/0,s.max.x=-1/0,s.min.y=1/0,s.max.y=-1/0;for(var d=0;d<l.length;d++){var f=l[d];f.x>s.max.x&&(s.max.x=f.x),f.x<s.min.x&&(s.min.x=f.x),f.y>s.max.y&&(s.max.y=f.y),f.y<s.min.y&&(s.min.y=f.y)}c&&(c.x>0?s.max.x+=c.x:s.min.x+=c.x,c.y>0?s.max.y+=c.y:s.min.y+=c.y)},o.contains=function(s,l){return l.x>=s.min.x&&l.x<=s.max.x&&l.y>=s.min.y&&l.y<=s.max.y},o.overlaps=function(s,l){return s.min.x<=l.max.x&&s.max.x>=l.min.x&&s.max.y>=l.min.y&&s.min.y<=l.max.y},o.translate=function(s,l){s.min.x+=l.x,s.max.x+=l.x,s.min.y+=l.y,s.max.y+=l.y},o.shift=function(s,l){var c=s.max.x-s.min.x,d=s.max.y-s.min.y;s.min.x=l.x,s.max.x=l.x+c,s.min.y=l.y,s.max.y=l.y+d}})()}),(function(n,i){var o={};n.exports=o,(function(){o.create=function(s,l){return{x:s||0,y:l||0}},o.clone=function(s){return{x:s.x,y:s.y}},o.magnitude=function(s){return Math.sqrt(s.x*s.x+s.y*s.y)},o.magnitudeSquared=function(s){return s.x*s.x+s.y*s.y},o.rotate=function(s,l,c){var d=Math.cos(l),f=Math.sin(l);c||(c={});var p=s.x*d-s.y*f;return c.y=s.x*f+s.y*d,c.x=p,c},o.rotateAbout=function(s,l,c,d){var f=Math.cos(l),p=Math.sin(l);d||(d={});var x=c.x+((s.x-c.x)*f-(s.y-c.y)*p);return d.y=c.y+((s.x-c.x)*p+(s.y-c.y)*f),d.x=x,d},o.normalise=function(s){var l=o.magnitude(s);return l===0?{x:0,y:0}:{x:s.x/l,y:s.y/l}},o.dot=function(s,l){return s.x*l.x+s.y*l.y},o.cross=function(s,l){return s.x*l.y-s.y*l.x},o.cross3=function(s,l,c){return(l.x-s.x)*(c.y-s.y)-(l.y-s.y)*(c.x-s.x)},o.add=function(s,l,c){return c||(c={}),c.x=s.x+l.x,c.y=s.y+l.y,c},o.sub=function(s,l,c){return c||(c={}),c.x=s.x-l.x,c.y=s.y-l.y,c},o.mult=function(s,l){return{x:s.x*l,y:s.y*l}},o.div=function(s,l){return{x:s.x/l,y:s.y/l}},o.perp=function(s,l){return l=l===!0?-1:1,{x:l*-s.y,y:l*s.x}},o.neg=function(s){return{x:-s.x,y:-s.y}},o.angle=function(s,l){return Math.atan2(l.y-s.y,l.x-s.x)},o._temp=[o.create(),o.create(),o.create(),o.create(),o.create(),o.create()]})()}),(function(n,i,o){var s={};n.exports=s;var l=o(2),c=o(0);(function(){s.create=function(d,f){for(var p=[],x=0;x<d.length;x++){var b=d[x],g={x:b.x,y:b.y,index:x,body:f,isInternal:!1};p.push(g)}return p},s.fromPath=function(d,f){var p=/L?\s*([-\d.e]+)[\s,]*([-\d.e]+)*/ig,x=[];return d.replace(p,function(b,g,y){x.push({x:parseFloat(g),y:parseFloat(y)})}),s.create(x,f)},s.centre=function(d){for(var f=s.area(d,!0),p={x:0,y:0},x,b,g,y=0;y<d.length;y++)g=(y+1)%d.length,x=l.cross(d[y],d[g]),b=l.mult(l.add(d[y],d[g]),x),p=l.add(p,b);return l.div(p,6*f)},s.mean=function(d){for(var f={x:0,y:0},p=0;p<d.length;p++)f.x+=d[p].x,f.y+=d[p].y;return l.div(f,d.length)},s.area=function(d,f){for(var p=0,x=d.length-1,b=0;b<d.length;b++)p+=(d[x].x-d[b].x)*(d[x].y+d[b].y),x=b;return f?p/2:Math.abs(p)/2},s.inertia=function(d,f){for(var p=0,x=0,b=d,g,y,E=0;E<b.length;E++)y=(E+1)%b.length,g=Math.abs(l.cross(b[y],b[E])),p+=g*(l.dot(b[y],b[y])+l.dot(b[y],b[E])+l.dot(b[E],b[E])),x+=g;return f/6*(p/x)},s.translate=function(d,f,p){p=typeof p<"u"?p:1;var x=d.length,b=f.x*p,g=f.y*p,y;for(y=0;y<x;y++)d[y].x+=b,d[y].y+=g;return d},s.rotate=function(d,f,p){if(f!==0){var x=Math.cos(f),b=Math.sin(f),g=p.x,y=p.y,E=d.length,T,w,M,_;for(_=0;_<E;_++)T=d[_],w=T.x-g,M=T.y-y,T.x=g+(w*x-M*b),T.y=y+(w*b+M*x);return d}},s.contains=function(d,f){for(var p=f.x,x=f.y,b=d.length,g=d[b-1],y,E=0;E<b;E++){if(y=d[E],(p-g.x)*(y.y-g.y)+(x-g.y)*(g.x-y.x)>0)return!1;g=y}return!0},s.scale=function(d,f,p,x){if(f===1&&p===1)return d;x=x||s.centre(d);for(var b,g,y=0;y<d.length;y++)b=d[y],g=l.sub(b,x),d[y].x=x.x+g.x*f,d[y].y=x.y+g.y*p;return d},s.chamfer=function(d,f,p,x,b){typeof f=="number"?f=[f]:f=f||[8],p=typeof p<"u"?p:-1,x=x||2,b=b||14;for(var g=[],y=0;y<d.length;y++){var E=d[y-1>=0?y-1:d.length-1],T=d[y],w=d[(y+1)%d.length],M=f[y<f.length?y:f.length-1];if(M===0){g.push(T);continue}var _=l.normalise({x:T.y-E.y,y:E.x-T.x}),L=l.normalise({x:w.y-T.y,y:T.x-w.x}),A=Math.sqrt(2*Math.pow(M,2)),R=l.mult(c.clone(_),M),j=l.normalise(l.mult(l.add(_,L),.5)),N=l.sub(T,l.mult(j,A)),I=p;p===-1&&(I=Math.pow(M,.32)*1.75),I=c.clamp(I,x,b),I%2===1&&(I+=1);for(var D=Math.acos(l.dot(_,L)),P=D/I,z=0;z<I;z++)g.push(l.add(l.rotate(R,P*z),N))}return g},s.clockwiseSort=function(d){var f=s.mean(d);return d.sort(function(p,x){return l.angle(f,p)-l.angle(f,x)}),d},s.isConvex=function(d){var f=0,p=d.length,x,b,g,y;if(p<3)return null;for(x=0;x<p;x++)if(b=(x+1)%p,g=(x+2)%p,y=(d[b].x-d[x].x)*(d[g].y-d[b].y),y-=(d[b].y-d[x].y)*(d[g].x-d[b].x),y<0?f|=1:y>0&&(f|=2),f===3)return!1;return f!==0?!0:null},s.hull=function(d){var f=[],p=[],x,b;for(d=d.slice(0),d.sort(function(g,y){var E=g.x-y.x;return E!==0?E:g.y-y.y}),b=0;b<d.length;b+=1){for(x=d[b];p.length>=2&&l.cross3(p[p.length-2],p[p.length-1],x)<=0;)p.pop();p.push(x)}for(b=d.length-1;b>=0;b-=1){for(x=d[b];f.length>=2&&l.cross3(f[f.length-2],f[f.length-1],x)<=0;)f.pop();f.push(x)}return f.pop(),p.pop(),f.concat(p)}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(3),c=o(2),d=o(7),f=o(0),p=o(1),x=o(11);(function(){s._timeCorrection=!0,s._inertiaScale=4,s._nextCollidingGroupId=1,s._nextNonCollidingGroupId=-1,s._nextCategory=1,s._baseDelta=1e3/60,s.create=function(g){var y={id:f.nextId(),type:"body",label:"Body",parts:[],plugin:{},angle:0,vertices:l.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},E=f.extend(y,g);return b(E,g),E},s.nextGroup=function(g){return g?s._nextNonCollidingGroupId--:s._nextCollidingGroupId++},s.nextCategory=function(){return s._nextCategory=s._nextCategory<<1,s._nextCategory};var b=function(g,y){y=y||{},s.set(g,{bounds:g.bounds||p.create(g.vertices),positionPrev:g.positionPrev||c.clone(g.position),anglePrev:g.anglePrev||g.angle,vertices:g.vertices,parts:g.parts||[g],isStatic:g.isStatic,isSleeping:g.isSleeping,parent:g.parent||g}),l.rotate(g.vertices,g.angle,g.position),x.rotate(g.axes,g.angle),p.update(g.bounds,g.vertices,g.velocity),s.set(g,{axes:y.axes||g.axes,area:y.area||g.area,mass:y.mass||g.mass,inertia:y.inertia||g.inertia});var E=g.isStatic?"#14151f":f.choose(["#f19648","#f5d259","#f55a3c","#063e7b","#ececd1"]),T=g.isStatic?"#555":"#ccc",w=g.isStatic&&g.render.fillStyle===null?1:0;g.render.fillStyle=g.render.fillStyle||E,g.render.strokeStyle=g.render.strokeStyle||T,g.render.lineWidth=g.render.lineWidth||w,g.render.sprite.xOffset+=-(g.bounds.min.x-g.position.x)/(g.bounds.max.x-g.bounds.min.x),g.render.sprite.yOffset+=-(g.bounds.min.y-g.position.y)/(g.bounds.max.y-g.bounds.min.y)};s.set=function(g,y,E){var T;typeof y=="string"&&(T=y,y={},y[T]=E);for(T in y)if(Object.prototype.hasOwnProperty.call(y,T))switch(E=y[T],T){case"isStatic":s.setStatic(g,E);break;case"isSleeping":d.set(g,E);break;case"mass":s.setMass(g,E);break;case"density":s.setDensity(g,E);break;case"inertia":s.setInertia(g,E);break;case"vertices":s.setVertices(g,E);break;case"position":s.setPosition(g,E);break;case"angle":s.setAngle(g,E);break;case"velocity":s.setVelocity(g,E);break;case"angularVelocity":s.setAngularVelocity(g,E);break;case"speed":s.setSpeed(g,E);break;case"angularSpeed":s.setAngularSpeed(g,E);break;case"parts":s.setParts(g,E);break;case"centre":s.setCentre(g,E);break;default:g[T]=E}},s.setStatic=function(g,y){for(var E=0;E<g.parts.length;E++){var T=g.parts[E];T.isStatic=y,y?(T._original={restitution:T.restitution,friction:T.friction,mass:T.mass,inertia:T.inertia,density:T.density,inverseMass:T.inverseMass,inverseInertia:T.inverseInertia},T.restitution=0,T.friction=1,T.mass=T.inertia=T.density=1/0,T.inverseMass=T.inverseInertia=0,T.positionPrev.x=T.position.x,T.positionPrev.y=T.position.y,T.anglePrev=T.angle,T.angularVelocity=0,T.speed=0,T.angularSpeed=0,T.motion=0):T._original&&(T.restitution=T._original.restitution,T.friction=T._original.friction,T.mass=T._original.mass,T.inertia=T._original.inertia,T.density=T._original.density,T.inverseMass=T._original.inverseMass,T.inverseInertia=T._original.inverseInertia,T._original=null)}},s.setMass=function(g,y){var E=g.inertia/(g.mass/6);g.inertia=E*(y/6),g.inverseInertia=1/g.inertia,g.mass=y,g.inverseMass=1/g.mass,g.density=g.mass/g.area},s.setDensity=function(g,y){s.setMass(g,y*g.area),g.density=y},s.setInertia=function(g,y){g.inertia=y,g.inverseInertia=1/g.inertia},s.setVertices=function(g,y){y[0].body===g?g.vertices=y:g.vertices=l.create(y,g),g.axes=x.fromVertices(g.vertices),g.area=l.area(g.vertices),s.setMass(g,g.density*g.area);var E=l.centre(g.vertices);l.translate(g.vertices,E,-1),s.setInertia(g,s._inertiaScale*l.inertia(g.vertices,g.mass)),l.translate(g.vertices,g.position),p.update(g.bounds,g.vertices,g.velocity)},s.setParts=function(g,y,E){var T;for(y=y.slice(0),g.parts.length=0,g.parts.push(g),g.parent=g,T=0;T<y.length;T++){var w=y[T];w!==g&&(w.parent=g,g.parts.push(w))}if(g.parts.length!==1){if(E=typeof E<"u"?E:!0,E){var M=[];for(T=0;T<y.length;T++)M=M.concat(y[T].vertices);l.clockwiseSort(M);var _=l.hull(M),L=l.centre(_);s.setVertices(g,_),l.translate(g.vertices,L)}var A=s._totalProperties(g);g.area=A.area,g.parent=g,g.position.x=A.centre.x,g.position.y=A.centre.y,g.positionPrev.x=A.centre.x,g.positionPrev.y=A.centre.y,s.setMass(g,A.mass),s.setInertia(g,A.inertia),s.setPosition(g,A.centre)}},s.setCentre=function(g,y,E){E?(g.positionPrev.x+=y.x,g.positionPrev.y+=y.y,g.position.x+=y.x,g.position.y+=y.y):(g.positionPrev.x=y.x-(g.position.x-g.positionPrev.x),g.positionPrev.y=y.y-(g.position.y-g.positionPrev.y),g.position.x=y.x,g.position.y=y.y)},s.setPosition=function(g,y,E){var T=c.sub(y,g.position);E?(g.positionPrev.x=g.position.x,g.positionPrev.y=g.position.y,g.velocity.x=T.x,g.velocity.y=T.y,g.speed=c.magnitude(T)):(g.positionPrev.x+=T.x,g.positionPrev.y+=T.y);for(var w=0;w<g.parts.length;w++){var M=g.parts[w];M.position.x+=T.x,M.position.y+=T.y,l.translate(M.vertices,T),p.update(M.bounds,M.vertices,g.velocity)}},s.setAngle=function(g,y,E){var T=y-g.angle;E?(g.anglePrev=g.angle,g.angularVelocity=T,g.angularSpeed=Math.abs(T)):g.anglePrev+=T;for(var w=0;w<g.parts.length;w++){var M=g.parts[w];M.angle+=T,l.rotate(M.vertices,T,g.position),x.rotate(M.axes,T),p.update(M.bounds,M.vertices,g.velocity),w>0&&c.rotateAbout(M.position,T,g.position,M.position)}},s.setVelocity=function(g,y){var E=g.deltaTime/s._baseDelta;g.positionPrev.x=g.position.x-y.x*E,g.positionPrev.y=g.position.y-y.y*E,g.velocity.x=(g.position.x-g.positionPrev.x)/E,g.velocity.y=(g.position.y-g.positionPrev.y)/E,g.speed=c.magnitude(g.velocity)},s.getVelocity=function(g){var y=s._baseDelta/g.deltaTime;return{x:(g.position.x-g.positionPrev.x)*y,y:(g.position.y-g.positionPrev.y)*y}},s.getSpeed=function(g){return c.magnitude(s.getVelocity(g))},s.setSpeed=function(g,y){s.setVelocity(g,c.mult(c.normalise(s.getVelocity(g)),y))},s.setAngularVelocity=function(g,y){var E=g.deltaTime/s._baseDelta;g.anglePrev=g.angle-y*E,g.angularVelocity=(g.angle-g.anglePrev)/E,g.angularSpeed=Math.abs(g.angularVelocity)},s.getAngularVelocity=function(g){return(g.angle-g.anglePrev)*s._baseDelta/g.deltaTime},s.getAngularSpeed=function(g){return Math.abs(s.getAngularVelocity(g))},s.setAngularSpeed=function(g,y){s.setAngularVelocity(g,f.sign(s.getAngularVelocity(g))*y)},s.translate=function(g,y,E){s.setPosition(g,c.add(g.position,y),E)},s.rotate=function(g,y,E,T){if(!E)s.setAngle(g,g.angle+y,T);else{var w=Math.cos(y),M=Math.sin(y),_=g.position.x-E.x,L=g.position.y-E.y;s.setPosition(g,{x:E.x+(_*w-L*M),y:E.y+(_*M+L*w)},T),s.setAngle(g,g.angle+y,T)}},s.scale=function(g,y,E,T){var w=0,M=0;T=T||g.position;for(var _=0;_<g.parts.length;_++){var L=g.parts[_];l.scale(L.vertices,y,E,T),L.axes=x.fromVertices(L.vertices),L.area=l.area(L.vertices),s.setMass(L,g.density*L.area),l.translate(L.vertices,{x:-L.position.x,y:-L.position.y}),s.setInertia(L,s._inertiaScale*l.inertia(L.vertices,L.mass)),l.translate(L.vertices,{x:L.position.x,y:L.position.y}),_>0&&(w+=L.area,M+=L.inertia),L.position.x=T.x+(L.position.x-T.x)*y,L.position.y=T.y+(L.position.y-T.y)*E,p.update(L.bounds,L.vertices,g.velocity)}g.parts.length>1&&(g.area=w,g.isStatic||(s.setMass(g,g.density*w),s.setInertia(g,M))),g.circleRadius&&(y===E?g.circleRadius*=y:g.circleRadius=null)},s.update=function(g,y){y=(typeof y<"u"?y:1e3/60)*g.timeScale;var E=y*y,T=s._timeCorrection?y/(g.deltaTime||y):1,w=1-g.frictionAir*(y/f._baseDelta),M=(g.position.x-g.positionPrev.x)*T,_=(g.position.y-g.positionPrev.y)*T;g.velocity.x=M*w+g.force.x/g.mass*E,g.velocity.y=_*w+g.force.y/g.mass*E,g.positionPrev.x=g.position.x,g.positionPrev.y=g.position.y,g.position.x+=g.velocity.x,g.position.y+=g.velocity.y,g.deltaTime=y,g.angularVelocity=(g.angle-g.anglePrev)*w*T+g.torque/g.inertia*E,g.anglePrev=g.angle,g.angle+=g.angularVelocity;for(var L=0;L<g.parts.length;L++){var A=g.parts[L];l.translate(A.vertices,g.velocity),L>0&&(A.position.x+=g.velocity.x,A.position.y+=g.velocity.y),g.angularVelocity!==0&&(l.rotate(A.vertices,g.angularVelocity,g.position),x.rotate(A.axes,g.angularVelocity),L>0&&c.rotateAbout(A.position,g.angularVelocity,g.position,A.position)),p.update(A.bounds,A.vertices,g.velocity)}},s.updateVelocities=function(g){var y=s._baseDelta/g.deltaTime,E=g.velocity;E.x=(g.position.x-g.positionPrev.x)*y,E.y=(g.position.y-g.positionPrev.y)*y,g.speed=Math.sqrt(E.x*E.x+E.y*E.y),g.angularVelocity=(g.angle-g.anglePrev)*y,g.angularSpeed=Math.abs(g.angularVelocity)},s.applyForce=function(g,y,E){var T={x:y.x-g.position.x,y:y.y-g.position.y};g.force.x+=E.x,g.force.y+=E.y,g.torque+=T.x*E.y-T.y*E.x},s._totalProperties=function(g){for(var y={mass:0,area:0,inertia:0,centre:{x:0,y:0}},E=g.parts.length===1?0:1;E<g.parts.length;E++){var T=g.parts[E],w=T.mass!==1/0?T.mass:1;y.mass+=w,y.area+=T.area,y.inertia+=T.inertia,y.centre=c.add(y.centre,c.mult(T.position,w))}return y.centre=c.div(y.centre,y.mass),y}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(0);(function(){s.on=function(c,d,f){for(var p=d.split(" "),x,b=0;b<p.length;b++)x=p[b],c.events=c.events||{},c.events[x]=c.events[x]||[],c.events[x].push(f);return f},s.off=function(c,d,f){if(!d){c.events={};return}typeof d=="function"&&(f=d,d=l.keys(c.events).join(" "));for(var p=d.split(" "),x=0;x<p.length;x++){var b=c.events[p[x]],g=[];if(f&&b)for(var y=0;y<b.length;y++)b[y]!==f&&g.push(b[y]);c.events[p[x]]=g}},s.trigger=function(c,d,f){var p,x,b,g,y=c.events;if(y&&l.keys(y).length>0){f||(f={}),p=d.split(" ");for(var E=0;E<p.length;E++)if(x=p[E],b=y[x],b){g=l.clone(f,!1),g.name=x,g.source=c;for(var T=0;T<b.length;T++)b[T].apply(c,[g])}}}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(5),c=o(0),d=o(1),f=o(4);(function(){s.create=function(p){return c.extend({id:c.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{},cache:{allBodies:null,allConstraints:null,allComposites:null}},p)},s.setModified=function(p,x,b,g){if(p.isModified=x,x&&p.cache&&(p.cache.allBodies=null,p.cache.allConstraints=null,p.cache.allComposites=null),b&&p.parent&&s.setModified(p.parent,x,b,g),g)for(var y=0;y<p.composites.length;y++){var E=p.composites[y];s.setModified(E,x,b,g)}},s.add=function(p,x){var b=[].concat(x);l.trigger(p,"beforeAdd",{object:x});for(var g=0;g<b.length;g++){var y=b[g];switch(y.type){case"body":if(y.parent!==y){c.warn("Composite.add: skipped adding a compound body part (you must add its parent instead)");break}s.addBody(p,y);break;case"constraint":s.addConstraint(p,y);break;case"composite":s.addComposite(p,y);break;case"mouseConstraint":s.addConstraint(p,y.constraint);break}}return l.trigger(p,"afterAdd",{object:x}),p},s.remove=function(p,x,b){var g=[].concat(x);l.trigger(p,"beforeRemove",{object:x});for(var y=0;y<g.length;y++){var E=g[y];switch(E.type){case"body":s.removeBody(p,E,b);break;case"constraint":s.removeConstraint(p,E,b);break;case"composite":s.removeComposite(p,E,b);break;case"mouseConstraint":s.removeConstraint(p,E.constraint);break}}return l.trigger(p,"afterRemove",{object:x}),p},s.addComposite=function(p,x){return p.composites.push(x),x.parent=p,s.setModified(p,!0,!0,!1),p},s.removeComposite=function(p,x,b){var g=c.indexOf(p.composites,x);if(g!==-1&&s.removeCompositeAt(p,g),b)for(var y=0;y<p.composites.length;y++)s.removeComposite(p.composites[y],x,!0);return p},s.removeCompositeAt=function(p,x){return p.composites.splice(x,1),s.setModified(p,!0,!0,!1),p},s.addBody=function(p,x){return p.bodies.push(x),s.setModified(p,!0,!0,!1),p},s.removeBody=function(p,x,b){var g=c.indexOf(p.bodies,x);if(g!==-1&&s.removeBodyAt(p,g),b)for(var y=0;y<p.composites.length;y++)s.removeBody(p.composites[y],x,!0);return p},s.removeBodyAt=function(p,x){return p.bodies.splice(x,1),s.setModified(p,!0,!0,!1),p},s.addConstraint=function(p,x){return p.constraints.push(x),s.setModified(p,!0,!0,!1),p},s.removeConstraint=function(p,x,b){var g=c.indexOf(p.constraints,x);if(g!==-1&&s.removeConstraintAt(p,g),b)for(var y=0;y<p.composites.length;y++)s.removeConstraint(p.composites[y],x,!0);return p},s.removeConstraintAt=function(p,x){return p.constraints.splice(x,1),s.setModified(p,!0,!0,!1),p},s.clear=function(p,x,b){if(b)for(var g=0;g<p.composites.length;g++)s.clear(p.composites[g],x,!0);return x?p.bodies=p.bodies.filter(function(y){return y.isStatic}):p.bodies.length=0,p.constraints.length=0,p.composites.length=0,s.setModified(p,!0,!0,!1),p},s.allBodies=function(p){if(p.cache&&p.cache.allBodies)return p.cache.allBodies;for(var x=[].concat(p.bodies),b=0;b<p.composites.length;b++)x=x.concat(s.allBodies(p.composites[b]));return p.cache&&(p.cache.allBodies=x),x},s.allConstraints=function(p){if(p.cache&&p.cache.allConstraints)return p.cache.allConstraints;for(var x=[].concat(p.constraints),b=0;b<p.composites.length;b++)x=x.concat(s.allConstraints(p.composites[b]));return p.cache&&(p.cache.allConstraints=x),x},s.allComposites=function(p){if(p.cache&&p.cache.allComposites)return p.cache.allComposites;for(var x=[].concat(p.composites),b=0;b<p.composites.length;b++)x=x.concat(s.allComposites(p.composites[b]));return p.cache&&(p.cache.allComposites=x),x},s.get=function(p,x,b){var g,y;switch(b){case"body":g=s.allBodies(p);break;case"constraint":g=s.allConstraints(p);break;case"composite":g=s.allComposites(p).concat(p);break}return g?(y=g.filter(function(E){return E.id.toString()===x.toString()}),y.length===0?null:y[0]):null},s.move=function(p,x,b){return s.remove(p,x),s.add(b,x),p},s.rebase=function(p){for(var x=s.allBodies(p).concat(s.allConstraints(p)).concat(s.allComposites(p)),b=0;b<x.length;b++)x[b].id=c.nextId();return p},s.translate=function(p,x,b){for(var g=b?s.allBodies(p):p.bodies,y=0;y<g.length;y++)f.translate(g[y],x);return p},s.rotate=function(p,x,b,g){for(var y=Math.cos(x),E=Math.sin(x),T=g?s.allBodies(p):p.bodies,w=0;w<T.length;w++){var M=T[w],_=M.position.x-b.x,L=M.position.y-b.y;f.setPosition(M,{x:b.x+(_*y-L*E),y:b.y+(_*E+L*y)}),f.rotate(M,x)}return p},s.scale=function(p,x,b,g,y){for(var E=y?s.allBodies(p):p.bodies,T=0;T<E.length;T++){var w=E[T],M=w.position.x-g.x,_=w.position.y-g.y;f.setPosition(w,{x:g.x+M*x,y:g.y+_*b}),f.scale(w,x,b)}return p},s.bounds=function(p){for(var x=s.allBodies(p),b=[],g=0;g<x.length;g+=1){var y=x[g];b.push(y.bounds.min,y.bounds.max)}return d.create(b)}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(4),c=o(5),d=o(0);(function(){s._motionWakeThreshold=.18,s._motionSleepThreshold=.08,s._minBias=.9,s.update=function(f,p){for(var x=p/d._baseDelta,b=s._motionSleepThreshold,g=0;g<f.length;g++){var y=f[g],E=l.getSpeed(y),T=l.getAngularSpeed(y),w=E*E+T*T;if(y.force.x!==0||y.force.y!==0){s.set(y,!1);continue}var M=Math.min(y.motion,w),_=Math.max(y.motion,w);y.motion=s._minBias*M+(1-s._minBias)*_,y.sleepThreshold>0&&y.motion<b?(y.sleepCounter+=1,y.sleepCounter>=y.sleepThreshold/x&&s.set(y,!0)):y.sleepCounter>0&&(y.sleepCounter-=1)}},s.afterCollisions=function(f){for(var p=s._motionSleepThreshold,x=0;x<f.length;x++){var b=f[x];if(b.isActive){var g=b.collision,y=g.bodyA.parent,E=g.bodyB.parent;if(!(y.isSleeping&&E.isSleeping||y.isStatic||E.isStatic)&&(y.isSleeping||E.isSleeping)){var T=y.isSleeping&&!y.isStatic?y:E,w=T===y?E:y;!T.isStatic&&w.motion>p&&s.set(T,!1)}}}},s.set=function(f,p){var x=f.isSleeping;p?(f.isSleeping=!0,f.sleepCounter=f.sleepThreshold,f.positionImpulse.x=0,f.positionImpulse.y=0,f.positionPrev.x=f.position.x,f.positionPrev.y=f.position.y,f.anglePrev=f.angle,f.speed=0,f.angularSpeed=0,f.motion=0,x||c.trigger(f,"sleepStart")):(f.isSleeping=!1,f.sleepCounter=0,x&&c.trigger(f,"sleepEnd"))}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(3),c=o(9);(function(){var d=[],f={overlap:0,axis:null},p={overlap:0,axis:null};s.create=function(x,b){return{pair:null,collided:!1,bodyA:x,bodyB:b,parentA:x.parent,parentB:b.parent,depth:0,normal:{x:0,y:0},tangent:{x:0,y:0},penetration:{x:0,y:0},supports:[]}},s.collides=function(x,b,g){if(s._overlapAxes(f,x.vertices,b.vertices,x.axes),f.overlap<=0||(s._overlapAxes(p,b.vertices,x.vertices,b.axes),p.overlap<=0))return null;var y=g&&g.table[c.id(x,b)],E;y?E=y.collision:(E=s.create(x,b),E.collided=!0,E.bodyA=x.id<b.id?x:b,E.bodyB=x.id<b.id?b:x,E.parentA=E.bodyA.parent,E.parentB=E.bodyB.parent),x=E.bodyA,b=E.bodyB;var T;f.overlap<p.overlap?T=f:T=p;var w=E.normal,M=E.supports,_=T.axis,L=_.x,A=_.y;L*(b.position.x-x.position.x)+A*(b.position.y-x.position.y)<0?(w.x=L,w.y=A):(w.x=-L,w.y=-A),E.tangent.x=-w.y,E.tangent.y=w.x,E.depth=T.overlap,E.penetration.x=w.x*E.depth,E.penetration.y=w.y*E.depth;var R=s._findSupports(x,b,w,1),j=0;if(l.contains(x.vertices,R[0])&&(M[j++]=R[0]),l.contains(x.vertices,R[1])&&(M[j++]=R[1]),j<2){var N=s._findSupports(b,x,w,-1);l.contains(b.vertices,N[0])&&(M[j++]=N[0]),j<2&&l.contains(b.vertices,N[1])&&(M[j++]=N[1])}return j===0&&(M[j++]=R[0]),M.length=j,E},s._overlapAxes=function(x,b,g,y){var E=b.length,T=g.length,w=b[0].x,M=b[0].y,_=g[0].x,L=g[0].y,A=y.length,R=Number.MAX_VALUE,j=0,N,I,D,P,z,K;for(z=0;z<A;z++){var q=y[z],B=q.x,H=q.y,G=w*B+M*H,Q=_*B+L*H,re=G,F=Q;for(K=1;K<E;K+=1)P=b[K].x*B+b[K].y*H,P>re?re=P:P<G&&(G=P);for(K=1;K<T;K+=1)P=g[K].x*B+g[K].y*H,P>F?F=P:P<Q&&(Q=P);if(I=re-Q,D=F-G,N=I<D?I:D,N<R&&(R=N,j=z,N<=0))break}x.axis=y[j],x.overlap=R},s._projectToAxis=function(x,b,g){for(var y=b[0].x*g.x+b[0].y*g.y,E=y,T=1;T<b.length;T+=1){var w=b[T].x*g.x+b[T].y*g.y;w>E?E=w:w<y&&(y=w)}x.min=y,x.max=E},s._findSupports=function(x,b,g,y){var E=b.vertices,T=E.length,w=x.position.x,M=x.position.y,_=g.x*y,L=g.y*y,A=Number.MAX_VALUE,R,j,N,I,D;for(D=0;D<T;D+=1)j=E[D],I=_*(w-j.x)+L*(M-j.y),I<A&&(A=I,R=j);return N=E[(T+R.index-1)%T],A=_*(w-N.x)+L*(M-N.y),j=E[(R.index+1)%T],_*(w-j.x)+L*(M-j.y)<A?(d[0]=R,d[1]=j,d):(d[0]=R,d[1]=N,d)}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(16);(function(){s.create=function(c,d){var f=c.bodyA,p=c.bodyB,x={id:s.id(f,p),bodyA:f,bodyB:p,collision:c,contacts:[],activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:f.isSensor||p.isSensor,timeCreated:d,timeUpdated:d,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return s.update(x,c,d),x},s.update=function(c,d,f){var p=c.contacts,x=d.supports,b=c.activeContacts,g=d.parentA,y=d.parentB,E=g.vertices.length;c.isActive=!0,c.timeUpdated=f,c.collision=d,c.separation=d.depth,c.inverseMass=g.inverseMass+y.inverseMass,c.friction=g.friction<y.friction?g.friction:y.friction,c.frictionStatic=g.frictionStatic>y.frictionStatic?g.frictionStatic:y.frictionStatic,c.restitution=g.restitution>y.restitution?g.restitution:y.restitution,c.slop=g.slop>y.slop?g.slop:y.slop,d.pair=c,b.length=0;for(var T=0;T<x.length;T++){var w=x[T],M=w.body===g?w.index:E+w.index,_=p[M];_?b.push(_):b.push(p[M]=l.create(w))}},s.setActive=function(c,d,f){d?(c.isActive=!0,c.timeUpdated=f):(c.isActive=!1,c.activeContacts.length=0)},s.id=function(c,d){return c.id<d.id?"A"+c.id+"B"+d.id:"A"+d.id+"B"+c.id}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(3),c=o(2),d=o(7),f=o(1),p=o(11),x=o(0);(function(){s._warming=.4,s._torqueDampen=1,s._minLength=1e-6,s.create=function(b){var g=b;g.bodyA&&!g.pointA&&(g.pointA={x:0,y:0}),g.bodyB&&!g.pointB&&(g.pointB={x:0,y:0});var y=g.bodyA?c.add(g.bodyA.position,g.pointA):g.pointA,E=g.bodyB?c.add(g.bodyB.position,g.pointB):g.pointB,T=c.magnitude(c.sub(y,E));g.length=typeof g.length<"u"?g.length:T,g.id=g.id||x.nextId(),g.label=g.label||"Constraint",g.type="constraint",g.stiffness=g.stiffness||(g.length>0?1:.7),g.damping=g.damping||0,g.angularStiffness=g.angularStiffness||0,g.angleA=g.bodyA?g.bodyA.angle:g.angleA,g.angleB=g.bodyB?g.bodyB.angle:g.angleB,g.plugin={};var w={visible:!0,lineWidth:2,strokeStyle:"#ffffff",type:"line",anchors:!0};return g.length===0&&g.stiffness>.1?(w.type="pin",w.anchors=!1):g.stiffness<.9&&(w.type="spring"),g.render=x.extend(w,g.render),g},s.preSolveAll=function(b){for(var g=0;g<b.length;g+=1){var y=b[g],E=y.constraintImpulse;y.isStatic||E.x===0&&E.y===0&&E.angle===0||(y.position.x+=E.x,y.position.y+=E.y,y.angle+=E.angle)}},s.solveAll=function(b,g){for(var y=x.clamp(g/x._baseDelta,0,1),E=0;E<b.length;E+=1){var T=b[E],w=!T.bodyA||T.bodyA&&T.bodyA.isStatic,M=!T.bodyB||T.bodyB&&T.bodyB.isStatic;(w||M)&&s.solve(b[E],y)}for(E=0;E<b.length;E+=1)T=b[E],w=!T.bodyA||T.bodyA&&T.bodyA.isStatic,M=!T.bodyB||T.bodyB&&T.bodyB.isStatic,!w&&!M&&s.solve(b[E],y)},s.solve=function(b,g){var y=b.bodyA,E=b.bodyB,T=b.pointA,w=b.pointB;if(!(!y&&!E)){y&&!y.isStatic&&(c.rotate(T,y.angle-b.angleA,T),b.angleA=y.angle),E&&!E.isStatic&&(c.rotate(w,E.angle-b.angleB,w),b.angleB=E.angle);var M=T,_=w;if(y&&(M=c.add(y.position,T)),E&&(_=c.add(E.position,w)),!(!M||!_)){var L=c.sub(M,_),A=c.magnitude(L);A<s._minLength&&(A=s._minLength);var R=(A-b.length)/A,j=b.stiffness>=1||b.length===0,N=j?b.stiffness*g:b.stiffness*g*g,I=b.damping*g,D=c.mult(L,R*N),P=(y?y.inverseMass:0)+(E?E.inverseMass:0),z=(y?y.inverseInertia:0)+(E?E.inverseInertia:0),K=P+z,q,B,H,G,Q;if(I>0){var re=c.create();H=c.div(L,A),Q=c.sub(E&&c.sub(E.position,E.positionPrev)||re,y&&c.sub(y.position,y.positionPrev)||re),G=c.dot(H,Q)}y&&!y.isStatic&&(B=y.inverseMass/P,y.constraintImpulse.x-=D.x*B,y.constraintImpulse.y-=D.y*B,y.position.x-=D.x*B,y.position.y-=D.y*B,I>0&&(y.positionPrev.x-=I*H.x*G*B,y.positionPrev.y-=I*H.y*G*B),q=c.cross(T,D)/K*s._torqueDampen*y.inverseInertia*(1-b.angularStiffness),y.constraintImpulse.angle-=q,y.angle-=q),E&&!E.isStatic&&(B=E.inverseMass/P,E.constraintImpulse.x+=D.x*B,E.constraintImpulse.y+=D.y*B,E.position.x+=D.x*B,E.position.y+=D.y*B,I>0&&(E.positionPrev.x+=I*H.x*G*B,E.positionPrev.y+=I*H.y*G*B),q=c.cross(w,D)/K*s._torqueDampen*E.inverseInertia*(1-b.angularStiffness),E.constraintImpulse.angle+=q,E.angle+=q)}}},s.postSolveAll=function(b){for(var g=0;g<b.length;g++){var y=b[g],E=y.constraintImpulse;if(!(y.isStatic||E.x===0&&E.y===0&&E.angle===0)){d.set(y,!1);for(var T=0;T<y.parts.length;T++){var w=y.parts[T];l.translate(w.vertices,E),T>0&&(w.position.x+=E.x,w.position.y+=E.y),E.angle!==0&&(l.rotate(w.vertices,E.angle,y.position),p.rotate(w.axes,E.angle),T>0&&c.rotateAbout(w.position,E.angle,y.position,w.position)),f.update(w.bounds,w.vertices,y.velocity)}E.angle*=s._warming,E.x*=s._warming,E.y*=s._warming}}},s.pointAWorld=function(b){return{x:(b.bodyA?b.bodyA.position.x:0)+(b.pointA?b.pointA.x:0),y:(b.bodyA?b.bodyA.position.y:0)+(b.pointA?b.pointA.y:0)}},s.pointBWorld=function(b){return{x:(b.bodyB?b.bodyB.position.x:0)+(b.pointB?b.pointB.x:0),y:(b.bodyB?b.bodyB.position.y:0)+(b.pointB?b.pointB.y:0)}}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(2),c=o(0);(function(){s.fromVertices=function(d){for(var f={},p=0;p<d.length;p++){var x=(p+1)%d.length,b=l.normalise({x:d[x].y-d[p].y,y:d[p].x-d[x].x}),g=b.y===0?1/0:b.x/b.y;g=g.toFixed(3).toString(),f[g]=b}return c.values(f)},s.rotate=function(d,f){if(f!==0)for(var p=Math.cos(f),x=Math.sin(f),b=0;b<d.length;b++){var g=d[b],y;y=g.x*p-g.y*x,g.y=g.x*x+g.y*p,g.x=y}}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(3),c=o(0),d=o(4),f=o(1),p=o(2);(function(){s.rectangle=function(x,b,g,y,E){E=E||{};var T={label:"Rectangle Body",position:{x,y:b},vertices:l.fromPath("L 0 0 L "+g+" 0 L "+g+" "+y+" L 0 "+y)};if(E.chamfer){var w=E.chamfer;T.vertices=l.chamfer(T.vertices,w.radius,w.quality,w.qualityMin,w.qualityMax),delete E.chamfer}return d.create(c.extend({},T,E))},s.trapezoid=function(x,b,g,y,E,T){T=T||{},E*=.5;var w=(1-E*2)*g,M=g*E,_=M+w,L=_+M,A;E<.5?A="L 0 0 L "+M+" "+-y+" L "+_+" "+-y+" L "+L+" 0":A="L 0 0 L "+_+" "+-y+" L "+L+" 0";var R={label:"Trapezoid Body",position:{x,y:b},vertices:l.fromPath(A)};if(T.chamfer){var j=T.chamfer;R.vertices=l.chamfer(R.vertices,j.radius,j.quality,j.qualityMin,j.qualityMax),delete T.chamfer}return d.create(c.extend({},R,T))},s.circle=function(x,b,g,y,E){y=y||{};var T={label:"Circle Body",circleRadius:g};E=E||25;var w=Math.ceil(Math.max(10,Math.min(E,g)));return w%2===1&&(w+=1),s.polygon(x,b,w,g,c.extend({},T,y))},s.polygon=function(x,b,g,y,E){if(E=E||{},g<3)return s.circle(x,b,y,E);for(var T=2*Math.PI/g,w="",M=T*.5,_=0;_<g;_+=1){var L=M+_*T,A=Math.cos(L)*y,R=Math.sin(L)*y;w+="L "+A.toFixed(3)+" "+R.toFixed(3)+" "}var j={label:"Polygon Body",position:{x,y:b},vertices:l.fromPath(w)};if(E.chamfer){var N=E.chamfer;j.vertices=l.chamfer(j.vertices,N.radius,N.quality,N.qualityMin,N.qualityMax),delete E.chamfer}return d.create(c.extend({},j,E))},s.fromVertices=function(x,b,g,y,E,T,w,M){var _=c.getDecomp(),L,A,R,j,N,I,D,P,z,K,q;for(L=!!(_&&_.quickDecomp),y=y||{},R=[],E=typeof E<"u"?E:!1,T=typeof T<"u"?T:.01,w=typeof w<"u"?w:10,M=typeof M<"u"?M:.01,c.isArray(g[0])||(g=[g]),K=0;K<g.length;K+=1)if(I=g[K],j=l.isConvex(I),N=!j,N&&!L&&c.warnOnce("Bodies.fromVertices: Install the 'poly-decomp' library and use Common.setDecomp or provide 'decomp' as a global to decompose concave vertices."),j||!L)j?I=l.clockwiseSort(I):I=l.hull(I),R.push({position:{x,y:b},vertices:I});else{var B=I.map(function(ne){return[ne.x,ne.y]});_.makeCCW(B),T!==!1&&_.removeCollinearPoints(B,T),M!==!1&&_.removeDuplicatePoints&&_.removeDuplicatePoints(B,M);var H=_.quickDecomp(B);for(D=0;D<H.length;D++){var G=H[D],Q=G.map(function(ne){return{x:ne[0],y:ne[1]}});w>0&&l.area(Q)<w||R.push({position:l.centre(Q),vertices:Q})}}for(D=0;D<R.length;D++)R[D]=d.create(c.extend(R[D],y));if(E){var re=5;for(D=0;D<R.length;D++){var F=R[D];for(P=D+1;P<R.length;P++){var Y=R[P];if(f.overlaps(F.bounds,Y.bounds)){var W=F.vertices,U=Y.vertices;for(z=0;z<F.vertices.length;z++)for(q=0;q<Y.vertices.length;q++){var ae=p.magnitudeSquared(p.sub(W[(z+1)%W.length],U[q])),J=p.magnitudeSquared(p.sub(W[z],U[(q+1)%U.length]));ae<re&&J<re&&(W[z].isInternal=!0,U[q].isInternal=!0)}}}}}return R.length>1?(A=d.create(c.extend({parts:R.slice(0)},y)),d.setPosition(A,{x,y:b}),A):R[0]}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(0),c=o(8);(function(){s.create=function(d){var f={bodies:[],pairs:null};return l.extend(f,d)},s.setBodies=function(d,f){d.bodies=f.slice(0)},s.clear=function(d){d.bodies=[]},s.collisions=function(d){var f=[],p=d.pairs,x=d.bodies,b=x.length,g=s.canCollide,y=c.collides,E,T;for(x.sort(s._compareBoundsX),E=0;E<b;E++){var w=x[E],M=w.bounds,_=w.bounds.max.x,L=w.bounds.max.y,A=w.bounds.min.y,R=w.isStatic||w.isSleeping,j=w.parts.length,N=j===1;for(T=E+1;T<b;T++){var I=x[T],D=I.bounds;if(D.min.x>_)break;if(!(L<D.min.y||A>D.max.y)&&!(R&&(I.isStatic||I.isSleeping))&&g(w.collisionFilter,I.collisionFilter)){var P=I.parts.length;if(N&&P===1){var z=y(w,I,p);z&&f.push(z)}else for(var K=j>1?1:0,q=P>1?1:0,B=K;B<j;B++)for(var H=w.parts[B],M=H.bounds,G=q;G<P;G++){var Q=I.parts[G],D=Q.bounds;if(!(M.min.x>D.max.x||M.max.x<D.min.x||M.max.y<D.min.y||M.min.y>D.max.y)){var z=y(H,Q,p);z&&f.push(z)}}}}}return f},s.canCollide=function(d,f){return d.group===f.group&&d.group!==0?d.group>0:(d.mask&f.category)!==0&&(f.mask&d.category)!==0},s._compareBoundsX=function(d,f){return d.bounds.min.x-f.bounds.min.x}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(0);(function(){s.create=function(c){var d={};return c||l.log("Mouse.create: element was undefined, defaulting to document.body","warn"),d.element=c||document.body,d.absolute={x:0,y:0},d.position={x:0,y:0},d.mousedownPosition={x:0,y:0},d.mouseupPosition={x:0,y:0},d.offset={x:0,y:0},d.scale={x:1,y:1},d.wheelDelta=0,d.button=-1,d.pixelRatio=parseInt(d.element.getAttribute("data-pixel-ratio"),10)||1,d.sourceEvents={mousemove:null,mousedown:null,mouseup:null,mousewheel:null},d.mousemove=function(f){var p=s._getRelativeMousePosition(f,d.element,d.pixelRatio),x=f.changedTouches;x&&(d.button=0,f.preventDefault()),d.absolute.x=p.x,d.absolute.y=p.y,d.position.x=d.absolute.x*d.scale.x+d.offset.x,d.position.y=d.absolute.y*d.scale.y+d.offset.y,d.sourceEvents.mousemove=f},d.mousedown=function(f){var p=s._getRelativeMousePosition(f,d.element,d.pixelRatio),x=f.changedTouches;x?(d.button=0,f.preventDefault()):d.button=f.button,d.absolute.x=p.x,d.absolute.y=p.y,d.position.x=d.absolute.x*d.scale.x+d.offset.x,d.position.y=d.absolute.y*d.scale.y+d.offset.y,d.mousedownPosition.x=d.position.x,d.mousedownPosition.y=d.position.y,d.sourceEvents.mousedown=f},d.mouseup=function(f){var p=s._getRelativeMousePosition(f,d.element,d.pixelRatio),x=f.changedTouches;x&&f.preventDefault(),d.button=-1,d.absolute.x=p.x,d.absolute.y=p.y,d.position.x=d.absolute.x*d.scale.x+d.offset.x,d.position.y=d.absolute.y*d.scale.y+d.offset.y,d.mouseupPosition.x=d.position.x,d.mouseupPosition.y=d.position.y,d.sourceEvents.mouseup=f},d.mousewheel=function(f){d.wheelDelta=Math.max(-1,Math.min(1,f.wheelDelta||-f.detail)),f.preventDefault()},s.setElement(d,d.element),d},s.setElement=function(c,d){c.element=d,d.addEventListener("mousemove",c.mousemove),d.addEventListener("mousedown",c.mousedown),d.addEventListener("mouseup",c.mouseup),d.addEventListener("mousewheel",c.mousewheel),d.addEventListener("DOMMouseScroll",c.mousewheel),d.addEventListener("touchmove",c.mousemove),d.addEventListener("touchstart",c.mousedown),d.addEventListener("touchend",c.mouseup)},s.clearSourceEvents=function(c){c.sourceEvents.mousemove=null,c.sourceEvents.mousedown=null,c.sourceEvents.mouseup=null,c.sourceEvents.mousewheel=null,c.wheelDelta=0},s.setOffset=function(c,d){c.offset.x=d.x,c.offset.y=d.y,c.position.x=c.absolute.x*c.scale.x+c.offset.x,c.position.y=c.absolute.y*c.scale.y+c.offset.y},s.setScale=function(c,d){c.scale.x=d.x,c.scale.y=d.y,c.position.x=c.absolute.x*c.scale.x+c.offset.x,c.position.y=c.absolute.y*c.scale.y+c.offset.y},s._getRelativeMousePosition=function(c,d,f){var p=d.getBoundingClientRect(),x=document.documentElement||document.body.parentNode||document.body,b=window.pageXOffset!==void 0?window.pageXOffset:x.scrollLeft,g=window.pageYOffset!==void 0?window.pageYOffset:x.scrollTop,y=c.changedTouches,E,T;return y?(E=y[0].pageX-p.left-b,T=y[0].pageY-p.top-g):(E=c.pageX-p.left-b,T=c.pageY-p.top-g),{x:E/(d.clientWidth/(d.width||d.clientWidth)*f),y:T/(d.clientHeight/(d.height||d.clientHeight)*f)}}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(0);(function(){s._registry={},s.register=function(c){if(s.isPlugin(c)||l.warn("Plugin.register:",s.toString(c),"does not implement all required fields."),c.name in s._registry){var d=s._registry[c.name],f=s.versionParse(c.version).number,p=s.versionParse(d.version).number;f>p?(l.warn("Plugin.register:",s.toString(d),"was upgraded to",s.toString(c)),s._registry[c.name]=c):f<p?l.warn("Plugin.register:",s.toString(d),"can not be downgraded to",s.toString(c)):c!==d&&l.warn("Plugin.register:",s.toString(c),"is already registered to different plugin object")}else s._registry[c.name]=c;return c},s.resolve=function(c){return s._registry[s.dependencyParse(c).name]},s.toString=function(c){return typeof c=="string"?c:(c.name||"anonymous")+"@"+(c.version||c.range||"0.0.0")},s.isPlugin=function(c){return c&&c.name&&c.version&&c.install},s.isUsed=function(c,d){return c.used.indexOf(d)>-1},s.isFor=function(c,d){var f=c.for&&s.dependencyParse(c.for);return!c.for||d.name===f.name&&s.versionSatisfies(d.version,f.range)},s.use=function(c,d){if(c.uses=(c.uses||[]).concat(d||[]),c.uses.length===0){l.warn("Plugin.use:",s.toString(c),"does not specify any dependencies to install.");return}for(var f=s.dependencies(c),p=l.topologicalSort(f),x=[],b=0;b<p.length;b+=1)if(p[b]!==c.name){var g=s.resolve(p[b]);if(!g){x.push("❌ "+p[b]);continue}s.isUsed(c,g.name)||(s.isFor(g,c)||(l.warn("Plugin.use:",s.toString(g),"is for",g.for,"but installed on",s.toString(c)+"."),g._warned=!0),g.install?g.install(c):(l.warn("Plugin.use:",s.toString(g),"does not specify an install function."),g._warned=!0),g._warned?(x.push("🔶 "+s.toString(g)),delete g._warned):x.push("✅ "+s.toString(g)),c.used.push(g.name))}x.length>0&&l.info(x.join(" "))},s.dependencies=function(c,d){var f=s.dependencyParse(c),p=f.name;if(d=d||{},!(p in d)){c=s.resolve(c)||c,d[p]=l.map(c.uses||[],function(b){s.isPlugin(b)&&s.register(b);var g=s.dependencyParse(b),y=s.resolve(b);return y&&!s.versionSatisfies(y.version,g.range)?(l.warn("Plugin.dependencies:",s.toString(y),"does not satisfy",s.toString(g),"used by",s.toString(f)+"."),y._warned=!0,c._warned=!0):y||(l.warn("Plugin.dependencies:",s.toString(b),"used by",s.toString(f),"could not be resolved."),c._warned=!0),g.name});for(var x=0;x<d[p].length;x+=1)s.dependencies(d[p][x],d);return d}},s.dependencyParse=function(c){if(l.isString(c)){var d=/^[\w-]+(@(\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-+]+)?))?$/;return d.test(c)||l.warn("Plugin.dependencyParse:",c,"is not a valid dependency string."),{name:c.split("@")[0],range:c.split("@")[1]||"*"}}return{name:c.name,range:c.range||c.version}},s.versionParse=function(c){var d=/^(\*)|(\^|~|>=|>)?\s*((\d+)\.(\d+)\.(\d+))(-[0-9A-Za-z-+]+)?$/;d.test(c)||l.warn("Plugin.versionParse:",c,"is not a valid version or range.");var f=d.exec(c),p=Number(f[4]),x=Number(f[5]),b=Number(f[6]);return{isRange:!!(f[1]||f[2]),version:f[3],range:c,operator:f[1]||f[2]||"",major:p,minor:x,patch:b,parts:[p,x,b],prerelease:f[7],number:p*1e8+x*1e4+b}},s.versionSatisfies=function(c,d){d=d||"*";var f=s.versionParse(d),p=s.versionParse(c);if(f.isRange){if(f.operator==="*"||c==="*")return!0;if(f.operator===">")return p.number>f.number;if(f.operator===">=")return p.number>=f.number;if(f.operator==="~")return p.major===f.major&&p.minor===f.minor&&p.patch>=f.patch;if(f.operator==="^")return f.major>0?p.major===f.major&&p.number>=f.number:f.minor>0?p.minor===f.minor&&p.patch>=f.patch:p.patch===f.patch}return c===d||c==="*"}})()}),(function(n,i){var o={};n.exports=o,(function(){o.create=function(s){return{vertex:s,normalImpulse:0,tangentImpulse:0}}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(7),c=o(18),d=o(13),f=o(19),p=o(5),x=o(6),b=o(10),g=o(0),y=o(4);(function(){s.create=function(E){E=E||{};var T={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}},w=g.extend(T,E);return w.world=E.world||x.create({label:"World"}),w.pairs=E.pairs||f.create(),w.detector=E.detector||d.create(),w.grid={buckets:[]},w.world.gravity=w.gravity,w.broadphase=w.grid,w.metrics={},w},s.update=function(E,T){var w=g.now(),M=E.world,_=E.detector,L=E.pairs,A=E.timing,R=A.timestamp,j;T=typeof T<"u"?T:g._baseDelta,T*=A.timeScale,A.timestamp+=T,A.lastDelta=T;var N={timestamp:A.timestamp,delta:T};p.trigger(E,"beforeUpdate",N);var I=x.allBodies(M),D=x.allConstraints(M);for(M.isModified&&(d.setBodies(_,I),x.setModified(M,!1,!1,!0)),E.enableSleeping&&l.update(I,T),s._bodiesApplyGravity(I,E.gravity),T>0&&s._bodiesUpdate(I,T),b.preSolveAll(I),j=0;j<E.constraintIterations;j++)b.solveAll(D,T);b.postSolveAll(I),_.pairs=E.pairs;var P=d.collisions(_);f.update(L,P,R),E.enableSleeping&&l.afterCollisions(L.list),L.collisionStart.length>0&&p.trigger(E,"collisionStart",{pairs:L.collisionStart});var z=g.clamp(20/E.positionIterations,0,1);for(c.preSolvePosition(L.list),j=0;j<E.positionIterations;j++)c.solvePosition(L.list,T,z);for(c.postSolvePosition(I),b.preSolveAll(I),j=0;j<E.constraintIterations;j++)b.solveAll(D,T);for(b.postSolveAll(I),c.preSolveVelocity(L.list),j=0;j<E.velocityIterations;j++)c.solveVelocity(L.list,T);return s._bodiesUpdateVelocities(I),L.collisionActive.length>0&&p.trigger(E,"collisionActive",{pairs:L.collisionActive}),L.collisionEnd.length>0&&p.trigger(E,"collisionEnd",{pairs:L.collisionEnd}),s._bodiesClearForces(I),p.trigger(E,"afterUpdate",N),E.timing.lastElapsed=g.now()-w,E},s.merge=function(E,T){if(g.extend(E,T),T.world){E.world=T.world,s.clear(E);for(var w=x.allBodies(E.world),M=0;M<w.length;M++){var _=w[M];l.set(_,!1),_.id=g.nextId()}}},s.clear=function(E){f.clear(E.pairs),d.clear(E.detector)},s._bodiesClearForces=function(E){for(var T=E.length,w=0;w<T;w++){var M=E[w];M.force.x=0,M.force.y=0,M.torque=0}},s._bodiesApplyGravity=function(E,T){var w=typeof T.scale<"u"?T.scale:.001,M=E.length;if(!(T.x===0&&T.y===0||w===0))for(var _=0;_<M;_++){var L=E[_];L.isStatic||L.isSleeping||(L.force.y+=L.mass*T.y*w,L.force.x+=L.mass*T.x*w)}},s._bodiesUpdate=function(E,T){for(var w=E.length,M=0;M<w;M++){var _=E[M];_.isStatic||_.isSleeping||y.update(_,T)}},s._bodiesUpdateVelocities=function(E){for(var T=E.length,w=0;w<T;w++)y.updateVelocities(E[w])}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(3),c=o(0),d=o(1);(function(){s._restingThresh=2,s._restingThreshTangent=Math.sqrt(6),s._positionDampen=.9,s._positionWarming=.8,s._frictionNormalMultiplier=5,s._frictionMaxStatic=Number.MAX_VALUE,s.preSolvePosition=function(f){var p,x,b,g=f.length;for(p=0;p<g;p++)x=f[p],x.isActive&&(b=x.activeContacts.length,x.collision.parentA.totalContacts+=b,x.collision.parentB.totalContacts+=b)},s.solvePosition=function(f,p,x){var b,g,y,E,T,w,M,_,L=s._positionDampen*(x||1),A=c.clamp(p/c._baseDelta,0,1),R=f.length;for(b=0;b<R;b++)g=f[b],!(!g.isActive||g.isSensor)&&(y=g.collision,E=y.parentA,T=y.parentB,w=y.normal,g.separation=w.x*(T.positionImpulse.x+y.penetration.x-E.positionImpulse.x)+w.y*(T.positionImpulse.y+y.penetration.y-E.positionImpulse.y));for(b=0;b<R;b++)g=f[b],!(!g.isActive||g.isSensor)&&(y=g.collision,E=y.parentA,T=y.parentB,w=y.normal,_=g.separation-g.slop*A,(E.isStatic||T.isStatic)&&(_*=2),E.isStatic||E.isSleeping||(M=L/E.totalContacts,E.positionImpulse.x+=w.x*_*M,E.positionImpulse.y+=w.y*_*M),T.isStatic||T.isSleeping||(M=L/T.totalContacts,T.positionImpulse.x-=w.x*_*M,T.positionImpulse.y-=w.y*_*M))},s.postSolvePosition=function(f){for(var p=s._positionWarming,x=f.length,b=l.translate,g=d.update,y=0;y<x;y++){var E=f[y],T=E.positionImpulse,w=T.x,M=T.y,_=E.velocity;if(E.totalContacts=0,w!==0||M!==0){for(var L=0;L<E.parts.length;L++){var A=E.parts[L];b(A.vertices,T),g(A.bounds,A.vertices,_),A.position.x+=w,A.position.y+=M}E.positionPrev.x+=w,E.positionPrev.y+=M,w*_.x+M*_.y<0?(T.x=0,T.y=0):(T.x*=p,T.y*=p)}}},s.preSolveVelocity=function(f){var p=f.length,x,b;for(x=0;x<p;x++){var g=f[x];if(!(!g.isActive||g.isSensor)){var y=g.activeContacts,E=y.length,T=g.collision,w=T.parentA,M=T.parentB,_=T.normal,L=T.tangent;for(b=0;b<E;b++){var A=y[b],R=A.vertex,j=A.normalImpulse,N=A.tangentImpulse;if(j!==0||N!==0){var I=_.x*j+L.x*N,D=_.y*j+L.y*N;w.isStatic||w.isSleeping||(w.positionPrev.x+=I*w.inverseMass,w.positionPrev.y+=D*w.inverseMass,w.anglePrev+=w.inverseInertia*((R.x-w.position.x)*D-(R.y-w.position.y)*I)),M.isStatic||M.isSleeping||(M.positionPrev.x-=I*M.inverseMass,M.positionPrev.y-=D*M.inverseMass,M.anglePrev-=M.inverseInertia*((R.x-M.position.x)*D-(R.y-M.position.y)*I))}}}}},s.solveVelocity=function(f,p){var x=p/c._baseDelta,b=x*x,g=b*x,y=-s._restingThresh*x,E=s._restingThreshTangent,T=s._frictionNormalMultiplier*x,w=s._frictionMaxStatic,M=f.length,_,L,A,R;for(A=0;A<M;A++){var j=f[A];if(!(!j.isActive||j.isSensor)){var N=j.collision,I=N.parentA,D=N.parentB,P=I.velocity,z=D.velocity,K=N.normal.x,q=N.normal.y,B=N.tangent.x,H=N.tangent.y,G=j.activeContacts,Q=G.length,re=1/Q,F=I.inverseMass+D.inverseMass,Y=j.friction*j.frictionStatic*T;for(P.x=I.position.x-I.positionPrev.x,P.y=I.position.y-I.positionPrev.y,z.x=D.position.x-D.positionPrev.x,z.y=D.position.y-D.positionPrev.y,I.angularVelocity=I.angle-I.anglePrev,D.angularVelocity=D.angle-D.anglePrev,R=0;R<Q;R++){var W=G[R],U=W.vertex,ae=U.x-I.position.x,J=U.y-I.position.y,ne=U.x-D.position.x,me=U.y-D.position.y,Z=P.x-J*I.angularVelocity,we=P.y+ae*I.angularVelocity,Fe=z.x-me*D.angularVelocity,Se=z.y+ne*D.angularVelocity,ve=Z-Fe,Oe=we-Se,Ie=K*ve+q*Oe,$e=B*ve+H*Oe,Nt=j.separation+Ie,Ot=Math.min(Nt,1);Ot=Nt<0?0:Ot;var Te=Ot*Y;$e<-Te||$e>Te?(L=$e>0?$e:-$e,_=j.friction*($e>0?1:-1)*g,_<-L?_=-L:_>L&&(_=L)):(_=$e,L=w);var Ze=ae*q-J*K,rt=ne*q-me*K,bt=re/(F+I.inverseInertia*Ze*Ze+D.inverseInertia*rt*rt),gt=(1+j.restitution)*Ie*bt;if(_*=bt,Ie<y)W.normalImpulse=0;else{var lt=W.normalImpulse;W.normalImpulse+=gt,W.normalImpulse>0&&(W.normalImpulse=0),gt=W.normalImpulse-lt}if($e<-E||$e>E)W.tangentImpulse=0;else{var st=W.tangentImpulse;W.tangentImpulse+=_,W.tangentImpulse<-L&&(W.tangentImpulse=-L),W.tangentImpulse>L&&(W.tangentImpulse=L),_=W.tangentImpulse-st}var Ue=K*gt+B*_,pe=q*gt+H*_;I.isStatic||I.isSleeping||(I.positionPrev.x+=Ue*I.inverseMass,I.positionPrev.y+=pe*I.inverseMass,I.anglePrev+=(ae*pe-J*Ue)*I.inverseInertia),D.isStatic||D.isSleeping||(D.positionPrev.x-=Ue*D.inverseMass,D.positionPrev.y-=pe*D.inverseMass,D.anglePrev-=(ne*pe-me*Ue)*D.inverseInertia)}}}}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(9),c=o(0);(function(){s.create=function(d){return c.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},d)},s.update=function(d,f,p){var x=d.list,b=x.length,g=d.table,y=f.length,E=d.collisionStart,T=d.collisionEnd,w=d.collisionActive,M,_,L,A;for(E.length=0,T.length=0,w.length=0,A=0;A<b;A++)x[A].confirmedActive=!1;for(A=0;A<y;A++)M=f[A],L=M.pair,L?(L.isActive?w.push(L):E.push(L),l.update(L,M,p),L.confirmedActive=!0):(L=l.create(M,p),g[L.id]=L,E.push(L),x.push(L));var R=[];for(b=x.length,A=0;A<b;A++)L=x[A],L.confirmedActive||(l.setActive(L,!1,p),T.push(L),!L.collision.bodyA.isSleeping&&!L.collision.bodyB.isSleeping&&R.push(A));for(A=0;A<R.length;A++)_=R[A]-A,L=x[_],x.splice(_,1),delete g[L.id]},s.clear=function(d){return d.table={},d.list.length=0,d.collisionStart.length=0,d.collisionActive.length=0,d.collisionEnd.length=0,d}})()}),(function(n,i,o){var s=n.exports=o(21);s.Axes=o(11),s.Bodies=o(12),s.Body=o(4),s.Bounds=o(1),s.Collision=o(8),s.Common=o(0),s.Composite=o(6),s.Composites=o(22),s.Constraint=o(10),s.Contact=o(16),s.Detector=o(13),s.Engine=o(17),s.Events=o(5),s.Grid=o(23),s.Mouse=o(14),s.MouseConstraint=o(24),s.Pair=o(9),s.Pairs=o(19),s.Plugin=o(15),s.Query=o(25),s.Render=o(26),s.Resolver=o(18),s.Runner=o(27),s.SAT=o(28),s.Sleeping=o(7),s.Svg=o(29),s.Vector=o(2),s.Vertices=o(3),s.World=o(30),s.Engine.run=s.Runner.run,s.Common.deprecated(s.Engine,"run","Engine.run ➤ use Matter.Runner.run(engine) instead")}),(function(n,i,o){var s={};n.exports=s;var l=o(15),c=o(0);(function(){s.name="matter-js",s.version="0.19.0",s.uses=[],s.used=[],s.use=function(){l.use(s,Array.prototype.slice.call(arguments))},s.before=function(d,f){return d=d.replace(/^Matter./,""),c.chainPathBefore(s,d,f)},s.after=function(d,f){return d=d.replace(/^Matter./,""),c.chainPathAfter(s,d,f)}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(6),c=o(10),d=o(0),f=o(4),p=o(12),x=d.deprecated;(function(){s.stack=function(b,g,y,E,T,w,M){for(var _=l.create({label:"Stack"}),L=b,A=g,R,j=0,N=0;N<E;N++){for(var I=0,D=0;D<y;D++){var P=M(L,A,D,N,R,j);if(P){var z=P.bounds.max.y-P.bounds.min.y,K=P.bounds.max.x-P.bounds.min.x;z>I&&(I=z),f.translate(P,{x:K*.5,y:z*.5}),L=P.bounds.max.x+T,l.addBody(_,P),R=P,j+=1}else L+=T}A+=I+w,L=b}return _},s.chain=function(b,g,y,E,T,w){for(var M=b.bodies,_=1;_<M.length;_++){var L=M[_-1],A=M[_],R=L.bounds.max.y-L.bounds.min.y,j=L.bounds.max.x-L.bounds.min.x,N=A.bounds.max.y-A.bounds.min.y,I=A.bounds.max.x-A.bounds.min.x,D={bodyA:L,pointA:{x:j*g,y:R*y},bodyB:A,pointB:{x:I*E,y:N*T}},P=d.extend(D,w);l.addConstraint(b,c.create(P))}return b.label+=" Chain",b},s.mesh=function(b,g,y,E,T){var w=b.bodies,M,_,L,A,R;for(M=0;M<y;M++){for(_=1;_<g;_++)L=w[_-1+M*g],A=w[_+M*g],l.addConstraint(b,c.create(d.extend({bodyA:L,bodyB:A},T)));if(M>0)for(_=0;_<g;_++)L=w[_+(M-1)*g],A=w[_+M*g],l.addConstraint(b,c.create(d.extend({bodyA:L,bodyB:A},T))),E&&_>0&&(R=w[_-1+(M-1)*g],l.addConstraint(b,c.create(d.extend({bodyA:R,bodyB:A},T)))),E&&_<g-1&&(R=w[_+1+(M-1)*g],l.addConstraint(b,c.create(d.extend({bodyA:R,bodyB:A},T))))}return b.label+=" Mesh",b},s.pyramid=function(b,g,y,E,T,w,M){return s.stack(b,g,y,E,T,w,function(_,L,A,R,j,N){var I=Math.min(E,Math.ceil(y/2)),D=j?j.bounds.max.x-j.bounds.min.x:0;if(!(R>I)){R=I-R;var P=R,z=y-1-R;if(!(A<P||A>z)){N===1&&f.translate(j,{x:(A+(y%2===1?1:-1))*D,y:0});var K=j?A*D:0;return M(b+K+A*T,L,A,R,j,N)}}})},s.newtonsCradle=function(b,g,y,E,T){for(var w=l.create({label:"Newtons Cradle"}),M=0;M<y;M++){var _=1.9,L=p.circle(b+M*(E*_),g+T,E,{inertia:1/0,restitution:1,friction:0,frictionAir:1e-4,slop:1}),A=c.create({pointA:{x:b+M*(E*_),y:g},bodyB:L});l.addBody(w,L),l.addConstraint(w,A)}return w},x(s,"newtonsCradle","Composites.newtonsCradle ➤ moved to newtonsCradle example"),s.car=function(b,g,y,E,T){var w=f.nextGroup(!0),M=20,_=-y*.5+M,L=y*.5-M,A=0,R=l.create({label:"Car"}),j=p.rectangle(b,g,y,E,{collisionFilter:{group:w},chamfer:{radius:E*.5},density:2e-4}),N=p.circle(b+_,g+A,T,{collisionFilter:{group:w},friction:.8}),I=p.circle(b+L,g+A,T,{collisionFilter:{group:w},friction:.8}),D=c.create({bodyB:j,pointB:{x:_,y:A},bodyA:N,stiffness:1,length:0}),P=c.create({bodyB:j,pointB:{x:L,y:A},bodyA:I,stiffness:1,length:0});return l.addBody(R,j),l.addBody(R,N),l.addBody(R,I),l.addConstraint(R,D),l.addConstraint(R,P),R},x(s,"car","Composites.car ➤ moved to car example"),s.softBody=function(b,g,y,E,T,w,M,_,L,A){L=d.extend({inertia:1/0},L),A=d.extend({stiffness:.2,render:{type:"line",anchors:!1}},A);var R=s.stack(b,g,y,E,T,w,function(j,N){return p.circle(j,N,_,L)});return s.mesh(R,y,E,M,A),R.label="Soft Body",R},x(s,"softBody","Composites.softBody ➤ moved to softBody and cloth examples")})()}),(function(n,i,o){var s={};n.exports=s;var l=o(9),c=o(0),d=c.deprecated;(function(){s.create=function(f){var p={buckets:{},pairs:{},pairsList:[],bucketWidth:48,bucketHeight:48};return c.extend(p,f)},s.update=function(f,p,x,b){var g,y,E,T=x.world,w=f.buckets,M,_,L=!1;for(g=0;g<p.length;g++){var A=p[g];if(!(A.isSleeping&&!b)&&!(T.bounds&&(A.bounds.max.x<T.bounds.min.x||A.bounds.min.x>T.bounds.max.x||A.bounds.max.y<T.bounds.min.y||A.bounds.min.y>T.bounds.max.y))){var R=s._getRegion(f,A);if(!A.region||R.id!==A.region.id||b){(!A.region||b)&&(A.region=R);var j=s._regionUnion(R,A.region);for(y=j.startCol;y<=j.endCol;y++)for(E=j.startRow;E<=j.endRow;E++){_=s._getBucketId(y,E),M=w[_];var N=y>=R.startCol&&y<=R.endCol&&E>=R.startRow&&E<=R.endRow,I=y>=A.region.startCol&&y<=A.region.endCol&&E>=A.region.startRow&&E<=A.region.endRow;!N&&I&&I&&M&&s._bucketRemoveBody(f,M,A),(A.region===R||N&&!I||b)&&(M||(M=s._createBucket(w,_)),s._bucketAddBody(f,M,A))}A.region=R,L=!0}}}L&&(f.pairsList=s._createActivePairsList(f))},d(s,"update","Grid.update ➤ replaced by Matter.Detector"),s.clear=function(f){f.buckets={},f.pairs={},f.pairsList=[]},d(s,"clear","Grid.clear ➤ replaced by Matter.Detector"),s._regionUnion=function(f,p){var x=Math.min(f.startCol,p.startCol),b=Math.max(f.endCol,p.endCol),g=Math.min(f.startRow,p.startRow),y=Math.max(f.endRow,p.endRow);return s._createRegion(x,b,g,y)},s._getRegion=function(f,p){var x=p.bounds,b=Math.floor(x.min.x/f.bucketWidth),g=Math.floor(x.max.x/f.bucketWidth),y=Math.floor(x.min.y/f.bucketHeight),E=Math.floor(x.max.y/f.bucketHeight);return s._createRegion(b,g,y,E)},s._createRegion=function(f,p,x,b){return{id:f+","+p+","+x+","+b,startCol:f,endCol:p,startRow:x,endRow:b}},s._getBucketId=function(f,p){return"C"+f+"R"+p},s._createBucket=function(f,p){var x=f[p]=[];return x},s._bucketAddBody=function(f,p,x){var b=f.pairs,g=l.id,y=p.length,E;for(E=0;E<y;E++){var T=p[E];if(!(x.id===T.id||x.isStatic&&T.isStatic)){var w=g(x,T),M=b[w];M?M[2]+=1:b[w]=[x,T,1]}}p.push(x)},s._bucketRemoveBody=function(f,p,x){var b=f.pairs,g=l.id,y;p.splice(c.indexOf(p,x),1);var E=p.length;for(y=0;y<E;y++){var T=b[g(x,p[y])];T&&(T[2]-=1)}},s._createActivePairsList=function(f){var p,x=f.pairs,b=c.keys(x),g=b.length,y=[],E;for(E=0;E<g;E++)p=x[b[E]],p[2]>0?y.push(p):delete x[b[E]];return y}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(3),c=o(7),d=o(14),f=o(5),p=o(13),x=o(10),b=o(6),g=o(0),y=o(1);(function(){s.create=function(E,T){var w=(E?E.mouse:null)||(T?T.mouse:null);w||(E&&E.render&&E.render.canvas?w=d.create(E.render.canvas):T&&T.element?w=d.create(T.element):(w=d.create(),g.warn("MouseConstraint.create: options.mouse was undefined, options.element was undefined, may not function as expected")));var M=x.create({label:"Mouse Constraint",pointA:w.position,pointB:{x:0,y:0},length:.01,stiffness:.1,angularStiffness:1,render:{strokeStyle:"#90EE90",lineWidth:3}}),_={type:"mouseConstraint",mouse:w,element:null,body:null,constraint:M,collisionFilter:{category:1,mask:4294967295,group:0}},L=g.extend(_,T);return f.on(E,"beforeUpdate",function(){var A=b.allBodies(E.world);s.update(L,A),s._triggerEvents(L)}),L},s.update=function(E,T){var w=E.mouse,M=E.constraint,_=E.body;if(w.button===0){if(M.bodyB)c.set(M.bodyB,!1),M.pointA=w.position;else for(var L=0;L<T.length;L++)if(_=T[L],y.contains(_.bounds,w.position)&&p.canCollide(_.collisionFilter,E.collisionFilter))for(var A=_.parts.length>1?1:0;A<_.parts.length;A++){var R=_.parts[A];if(l.contains(R.vertices,w.position)){M.pointA=w.position,M.bodyB=E.body=_,M.pointB={x:w.position.x-_.position.x,y:w.position.y-_.position.y},M.angleB=_.angle,c.set(_,!1),f.trigger(E,"startdrag",{mouse:w,body:_});break}}}else M.bodyB=E.body=null,M.pointB=null,_&&f.trigger(E,"enddrag",{mouse:w,body:_})},s._triggerEvents=function(E){var T=E.mouse,w=T.sourceEvents;w.mousemove&&f.trigger(E,"mousemove",{mouse:T}),w.mousedown&&f.trigger(E,"mousedown",{mouse:T}),w.mouseup&&f.trigger(E,"mouseup",{mouse:T}),d.clearSourceEvents(T)}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(2),c=o(8),d=o(1),f=o(12),p=o(3);(function(){s.collides=function(x,b){for(var g=[],y=b.length,E=x.bounds,T=c.collides,w=d.overlaps,M=0;M<y;M++){var _=b[M],L=_.parts.length,A=L===1?0:1;if(w(_.bounds,E))for(var R=A;R<L;R++){var j=_.parts[R];if(w(j.bounds,E)){var N=T(j,x);if(N){g.push(N);break}}}}return g},s.ray=function(x,b,g,y){y=y||1e-100;for(var E=l.angle(b,g),T=l.magnitude(l.sub(b,g)),w=(g.x+b.x)*.5,M=(g.y+b.y)*.5,_=f.rectangle(w,M,T,y,{angle:E}),L=s.collides(_,x),A=0;A<L.length;A+=1){var R=L[A];R.body=R.bodyB=R.bodyA}return L},s.region=function(x,b,g){for(var y=[],E=0;E<x.length;E++){var T=x[E],w=d.overlaps(T.bounds,b);(w&&!g||!w&&g)&&y.push(T)}return y},s.point=function(x,b){for(var g=[],y=0;y<x.length;y++){var E=x[y];if(d.contains(E.bounds,b))for(var T=E.parts.length===1?0:1;T<E.parts.length;T++){var w=E.parts[T];if(d.contains(w.bounds,b)&&p.contains(w.vertices,b)){g.push(E);break}}}return g}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(4),c=o(0),d=o(6),f=o(1),p=o(5),x=o(2),b=o(14);(function(){var g,y;typeof window<"u"&&(g=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(A){window.setTimeout(function(){A(c.now())},1e3/60)},y=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame),s._goodFps=30,s._goodDelta=1e3/60,s.create=function(A){var R={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:!!A.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}},j=c.extend(R,A);return j.canvas&&(j.canvas.width=j.options.width||j.canvas.width,j.canvas.height=j.options.height||j.canvas.height),j.mouse=A.mouse,j.engine=A.engine,j.canvas=j.canvas||w(j.options.width,j.options.height),j.context=j.canvas.getContext("2d"),j.textures={},j.bounds=j.bounds||{min:{x:0,y:0},max:{x:j.canvas.width,y:j.canvas.height}},j.controller=s,j.options.showBroadphase=!1,j.options.pixelRatio!==1&&s.setPixelRatio(j,j.options.pixelRatio),c.isElement(j.element)&&j.element.appendChild(j.canvas),j},s.run=function(A){(function R(j){A.frameRequestId=g(R),E(A,j),s.world(A,j),(A.options.showStats||A.options.showDebug)&&s.stats(A,A.context,j),(A.options.showPerformance||A.options.showDebug)&&s.performance(A,A.context,j)})()},s.stop=function(A){y(A.frameRequestId)},s.setPixelRatio=function(A,R){var j=A.options,N=A.canvas;R==="auto"&&(R=M(N)),j.pixelRatio=R,N.setAttribute("data-pixel-ratio",R),N.width=j.width*R,N.height=j.height*R,N.style.width=j.width+"px",N.style.height=j.height+"px"},s.lookAt=function(A,R,j,N){N=typeof N<"u"?N:!0,R=c.isArray(R)?R:[R],j=j||{x:0,y:0};for(var I={min:{x:1/0,y:1/0},max:{x:-1/0,y:-1/0}},D=0;D<R.length;D+=1){var P=R[D],z=P.bounds?P.bounds.min:P.min||P.position||P,K=P.bounds?P.bounds.max:P.max||P.position||P;z&&K&&(z.x<I.min.x&&(I.min.x=z.x),K.x>I.max.x&&(I.max.x=K.x),z.y<I.min.y&&(I.min.y=z.y),K.y>I.max.y&&(I.max.y=K.y))}var q=I.max.x-I.min.x+2*j.x,B=I.max.y-I.min.y+2*j.y,H=A.canvas.height,G=A.canvas.width,Q=G/H,re=q/B,F=1,Y=1;re>Q?Y=re/Q:F=Q/re,A.options.hasBounds=!0,A.bounds.min.x=I.min.x,A.bounds.max.x=I.min.x+q*F,A.bounds.min.y=I.min.y,A.bounds.max.y=I.min.y+B*Y,N&&(A.bounds.min.x+=q*.5-q*F*.5,A.bounds.max.x+=q*.5-q*F*.5,A.bounds.min.y+=B*.5-B*Y*.5,A.bounds.max.y+=B*.5-B*Y*.5),A.bounds.min.x-=j.x,A.bounds.max.x-=j.x,A.bounds.min.y-=j.y,A.bounds.max.y-=j.y,A.mouse&&(b.setScale(A.mouse,{x:(A.bounds.max.x-A.bounds.min.x)/A.canvas.width,y:(A.bounds.max.y-A.bounds.min.y)/A.canvas.height}),b.setOffset(A.mouse,A.bounds.min))},s.startViewTransform=function(A){var R=A.bounds.max.x-A.bounds.min.x,j=A.bounds.max.y-A.bounds.min.y,N=R/A.options.width,I=j/A.options.height;A.context.setTransform(A.options.pixelRatio/N,0,0,A.options.pixelRatio/I,0,0),A.context.translate(-A.bounds.min.x,-A.bounds.min.y)},s.endViewTransform=function(A){A.context.setTransform(A.options.pixelRatio,0,0,A.options.pixelRatio,0,0)},s.world=function(A,R){var j=c.now(),N=A.engine,I=N.world,D=A.canvas,P=A.context,z=A.options,K=A.timing,q=d.allBodies(I),B=d.allConstraints(I),H=z.wireframes?z.wireframeBackground:z.background,G=[],Q=[],re,F={timestamp:N.timing.timestamp};if(p.trigger(A,"beforeRender",F),A.currentBackground!==H&&L(A,H),P.globalCompositeOperation="source-in",P.fillStyle="transparent",P.fillRect(0,0,D.width,D.height),P.globalCompositeOperation="source-over",z.hasBounds){for(re=0;re<q.length;re++){var Y=q[re];f.overlaps(Y.bounds,A.bounds)&&G.push(Y)}for(re=0;re<B.length;re++){var W=B[re],U=W.bodyA,ae=W.bodyB,J=W.pointA,ne=W.pointB;U&&(J=x.add(U.position,W.pointA)),ae&&(ne=x.add(ae.position,W.pointB)),!(!J||!ne)&&(f.contains(A.bounds,J)||f.contains(A.bounds,ne))&&Q.push(W)}s.startViewTransform(A),A.mouse&&(b.setScale(A.mouse,{x:(A.bounds.max.x-A.bounds.min.x)/A.options.width,y:(A.bounds.max.y-A.bounds.min.y)/A.options.height}),b.setOffset(A.mouse,A.bounds.min))}else Q=B,G=q,A.options.pixelRatio!==1&&A.context.setTransform(A.options.pixelRatio,0,0,A.options.pixelRatio,0,0);!z.wireframes||N.enableSleeping&&z.showSleeping?s.bodies(A,G,P):(z.showConvexHulls&&s.bodyConvexHulls(A,G,P),s.bodyWireframes(A,G,P)),z.showBounds&&s.bodyBounds(A,G,P),(z.showAxes||z.showAngleIndicator)&&s.bodyAxes(A,G,P),z.showPositions&&s.bodyPositions(A,G,P),z.showVelocity&&s.bodyVelocity(A,G,P),z.showIds&&s.bodyIds(A,G,P),z.showSeparations&&s.separations(A,N.pairs.list,P),z.showCollisions&&s.collisions(A,N.pairs.list,P),z.showVertexNumbers&&s.vertexNumbers(A,G,P),z.showMousePosition&&s.mousePosition(A,A.mouse,P),s.constraints(Q,P),z.hasBounds&&s.endViewTransform(A),p.trigger(A,"afterRender",F),K.lastElapsed=c.now()-j},s.stats=function(A,R,j){for(var N=A.engine,I=N.world,D=d.allBodies(I),P=0,z=55,K=44,q=0,B=0,H=0;H<D.length;H+=1)P+=D[H].parts.length;var G={Part:P,Body:D.length,Cons:d.allConstraints(I).length,Comp:d.allComposites(I).length,Pair:N.pairs.list.length};R.fillStyle="#0e0f19",R.fillRect(q,B,z*5.5,K),R.font="12px Arial",R.textBaseline="top",R.textAlign="right";for(var Q in G){var re=G[Q];R.fillStyle="#aaa",R.fillText(Q,q+z,B+8),R.fillStyle="#eee",R.fillText(re,q+z,B+26),q+=z}},s.performance=function(A,R){var j=A.engine,N=A.timing,I=N.deltaHistory,D=N.elapsedHistory,P=N.timestampElapsedHistory,z=N.engineDeltaHistory,K=N.engineElapsedHistory,q=j.timing.lastDelta,B=T(I),H=T(D),G=T(z),Q=T(K),re=T(P),F=re/B||0,Y=1e3/B||0,W=4,U=12,ae=60,J=34,ne=10,me=69;R.fillStyle="#0e0f19",R.fillRect(0,50,U*4+ae*5+22,J),s.status(R,ne,me,ae,W,I.length,Math.round(Y)+" fps",Y/s._goodFps,function(Z){return I[Z]/B-1}),s.status(R,ne+U+ae,me,ae,W,z.length,q.toFixed(2)+" dt",s._goodDelta/q,function(Z){return z[Z]/G-1}),s.status(R,ne+(U+ae)*2,me,ae,W,K.length,Q.toFixed(2)+" ut",1-Q/s._goodFps,function(Z){return K[Z]/Q-1}),s.status(R,ne+(U+ae)*3,me,ae,W,D.length,H.toFixed(2)+" rt",1-H/s._goodFps,function(Z){return D[Z]/H-1}),s.status(R,ne+(U+ae)*4,me,ae,W,P.length,F.toFixed(2)+" x",F*F*F,function(Z){return(P[Z]/I[Z]/F||0)-1})},s.status=function(A,R,j,N,I,D,P,z,K){A.strokeStyle="#888",A.fillStyle="#444",A.lineWidth=1,A.fillRect(R,j+7,N,1),A.beginPath(),A.moveTo(R,j+7-I*c.clamp(.4*K(0),-2,2));for(var q=0;q<N;q+=1)A.lineTo(R+q,j+7-(q<D?I*c.clamp(.4*K(q),-2,2):0));A.stroke(),A.fillStyle="hsl("+c.clamp(25+95*z,0,120)+",100%,60%)",A.fillRect(R,j-7,4,4),A.font="12px Arial",A.textBaseline="middle",A.textAlign="right",A.fillStyle="#eee",A.fillText(P,R+N,j-5)},s.constraints=function(A,R){for(var j=R,N=0;N<A.length;N++){var I=A[N];if(!(!I.render.visible||!I.pointA||!I.pointB)){var D=I.bodyA,P=I.bodyB,z,K;if(D?z=x.add(D.position,I.pointA):z=I.pointA,I.render.type==="pin")j.beginPath(),j.arc(z.x,z.y,3,0,2*Math.PI),j.closePath();else{if(P?K=x.add(P.position,I.pointB):K=I.pointB,j.beginPath(),j.moveTo(z.x,z.y),I.render.type==="spring")for(var q=x.sub(K,z),B=x.perp(x.normalise(q)),H=Math.ceil(c.clamp(I.length/5,12,20)),G,Q=1;Q<H;Q+=1)G=Q%2===0?1:-1,j.lineTo(z.x+q.x*(Q/H)+B.x*G*4,z.y+q.y*(Q/H)+B.y*G*4);j.lineTo(K.x,K.y)}I.render.lineWidth&&(j.lineWidth=I.render.lineWidth,j.strokeStyle=I.render.strokeStyle,j.stroke()),I.render.anchors&&(j.fillStyle=I.render.strokeStyle,j.beginPath(),j.arc(z.x,z.y,3,0,2*Math.PI),j.arc(K.x,K.y,3,0,2*Math.PI),j.closePath(),j.fill())}}},s.bodies=function(A,R,j){var N=j;A.engine;var I=A.options,D=I.showInternalEdges||!I.wireframes,P,z,K,q;for(K=0;K<R.length;K++)if(P=R[K],!!P.render.visible){for(q=P.parts.length>1?1:0;q<P.parts.length;q++)if(z=P.parts[q],!!z.render.visible){if(I.showSleeping&&P.isSleeping?N.globalAlpha=.5*z.render.opacity:z.render.opacity!==1&&(N.globalAlpha=z.render.opacity),z.render.sprite&&z.render.sprite.texture&&!I.wireframes){var B=z.render.sprite,H=_(A,B.texture);N.translate(z.position.x,z.position.y),N.rotate(z.angle),N.drawImage(H,H.width*-B.xOffset*B.xScale,H.height*-B.yOffset*B.yScale,H.width*B.xScale,H.height*B.yScale),N.rotate(-z.angle),N.translate(-z.position.x,-z.position.y)}else{if(z.circleRadius)N.beginPath(),N.arc(z.position.x,z.position.y,z.circleRadius,0,2*Math.PI);else{N.beginPath(),N.moveTo(z.vertices[0].x,z.vertices[0].y);for(var G=1;G<z.vertices.length;G++)!z.vertices[G-1].isInternal||D?N.lineTo(z.vertices[G].x,z.vertices[G].y):N.moveTo(z.vertices[G].x,z.vertices[G].y),z.vertices[G].isInternal&&!D&&N.moveTo(z.vertices[(G+1)%z.vertices.length].x,z.vertices[(G+1)%z.vertices.length].y);N.lineTo(z.vertices[0].x,z.vertices[0].y),N.closePath()}I.wireframes?(N.lineWidth=1,N.strokeStyle="#bbb",N.stroke()):(N.fillStyle=z.render.fillStyle,z.render.lineWidth&&(N.lineWidth=z.render.lineWidth,N.strokeStyle=z.render.strokeStyle,N.stroke()),N.fill())}N.globalAlpha=1}}},s.bodyWireframes=function(A,R,j){var N=j,I=A.options.showInternalEdges,D,P,z,K,q;for(N.beginPath(),z=0;z<R.length;z++)if(D=R[z],!!D.render.visible)for(q=D.parts.length>1?1:0;q<D.parts.length;q++){for(P=D.parts[q],N.moveTo(P.vertices[0].x,P.vertices[0].y),K=1;K<P.vertices.length;K++)!P.vertices[K-1].isInternal||I?N.lineTo(P.vertices[K].x,P.vertices[K].y):N.moveTo(P.vertices[K].x,P.vertices[K].y),P.vertices[K].isInternal&&!I&&N.moveTo(P.vertices[(K+1)%P.vertices.length].x,P.vertices[(K+1)%P.vertices.length].y);N.lineTo(P.vertices[0].x,P.vertices[0].y)}N.lineWidth=1,N.strokeStyle="#bbb",N.stroke()},s.bodyConvexHulls=function(A,R,j){var N=j,I,D,P;for(N.beginPath(),D=0;D<R.length;D++)if(I=R[D],!(!I.render.visible||I.parts.length===1)){for(N.moveTo(I.vertices[0].x,I.vertices[0].y),P=1;P<I.vertices.length;P++)N.lineTo(I.vertices[P].x,I.vertices[P].y);N.lineTo(I.vertices[0].x,I.vertices[0].y)}N.lineWidth=1,N.strokeStyle="rgba(255,255,255,0.2)",N.stroke()},s.vertexNumbers=function(A,R,j){var N=j,I,D,P;for(I=0;I<R.length;I++){var z=R[I].parts;for(P=z.length>1?1:0;P<z.length;P++){var K=z[P];for(D=0;D<K.vertices.length;D++)N.fillStyle="rgba(255,255,255,0.2)",N.fillText(I+"_"+D,K.position.x+(K.vertices[D].x-K.position.x)*.8,K.position.y+(K.vertices[D].y-K.position.y)*.8)}}},s.mousePosition=function(A,R,j){var N=j;N.fillStyle="rgba(255,255,255,0.8)",N.fillText(R.position.x+" "+R.position.y,R.position.x+5,R.position.y-5)},s.bodyBounds=function(A,R,j){var N=j;A.engine;var I=A.options;N.beginPath();for(var D=0;D<R.length;D++){var P=R[D];if(P.render.visible)for(var z=R[D].parts,K=z.length>1?1:0;K<z.length;K++){var q=z[K];N.rect(q.bounds.min.x,q.bounds.min.y,q.bounds.max.x-q.bounds.min.x,q.bounds.max.y-q.bounds.min.y)}}I.wireframes?N.strokeStyle="rgba(255,255,255,0.08)":N.strokeStyle="rgba(0,0,0,0.1)",N.lineWidth=1,N.stroke()},s.bodyAxes=function(A,R,j){var N=j;A.engine;var I=A.options,D,P,z,K;for(N.beginPath(),P=0;P<R.length;P++){var q=R[P],B=q.parts;if(q.render.visible)if(I.showAxes)for(z=B.length>1?1:0;z<B.length;z++)for(D=B[z],K=0;K<D.axes.length;K++){var H=D.axes[K];N.moveTo(D.position.x,D.position.y),N.lineTo(D.position.x+H.x*20,D.position.y+H.y*20)}else for(z=B.length>1?1:0;z<B.length;z++)for(D=B[z],K=0;K<D.axes.length;K++)N.moveTo(D.position.x,D.position.y),N.lineTo((D.vertices[0].x+D.vertices[D.vertices.length-1].x)/2,(D.vertices[0].y+D.vertices[D.vertices.length-1].y)/2)}I.wireframes?(N.strokeStyle="indianred",N.lineWidth=1):(N.strokeStyle="rgba(255, 255, 255, 0.4)",N.globalCompositeOperation="overlay",N.lineWidth=2),N.stroke(),N.globalCompositeOperation="source-over"},s.bodyPositions=function(A,R,j){var N=j;A.engine;var I=A.options,D,P,z,K;for(N.beginPath(),z=0;z<R.length;z++)if(D=R[z],!!D.render.visible)for(K=0;K<D.parts.length;K++)P=D.parts[K],N.arc(P.position.x,P.position.y,3,0,2*Math.PI,!1),N.closePath();for(I.wireframes?N.fillStyle="indianred":N.fillStyle="rgba(0,0,0,0.5)",N.fill(),N.beginPath(),z=0;z<R.length;z++)D=R[z],D.render.visible&&(N.arc(D.positionPrev.x,D.positionPrev.y,2,0,2*Math.PI,!1),N.closePath());N.fillStyle="rgba(255,165,0,0.8)",N.fill()},s.bodyVelocity=function(A,R,j){var N=j;N.beginPath();for(var I=0;I<R.length;I++){var D=R[I];if(D.render.visible){var P=l.getVelocity(D);N.moveTo(D.position.x,D.position.y),N.lineTo(D.position.x+P.x,D.position.y+P.y)}}N.lineWidth=3,N.strokeStyle="cornflowerblue",N.stroke()},s.bodyIds=function(A,R,j){var N=j,I,D;for(I=0;I<R.length;I++)if(R[I].render.visible){var P=R[I].parts;for(D=P.length>1?1:0;D<P.length;D++){var z=P[D];N.font="12px Arial",N.fillStyle="rgba(255,255,255,0.5)",N.fillText(z.id,z.position.x+10,z.position.y-10)}}},s.collisions=function(A,R,j){var N=j,I=A.options,D,P,z,K;for(N.beginPath(),z=0;z<R.length;z++)if(D=R[z],!!D.isActive)for(P=D.collision,K=0;K<D.activeContacts.length;K++){var q=D.activeContacts[K],B=q.vertex;N.rect(B.x-1.5,B.y-1.5,3.5,3.5)}for(I.wireframes?N.fillStyle="rgba(255,255,255,0.7)":N.fillStyle="orange",N.fill(),N.beginPath(),z=0;z<R.length;z++)if(D=R[z],!!D.isActive&&(P=D.collision,D.activeContacts.length>0)){var H=D.activeContacts[0].vertex.x,G=D.activeContacts[0].vertex.y;D.activeContacts.length===2&&(H=(D.activeContacts[0].vertex.x+D.activeContacts[1].vertex.x)/2,G=(D.activeContacts[0].vertex.y+D.activeContacts[1].vertex.y)/2),P.bodyB===P.supports[0].body||P.bodyA.isStatic===!0?N.moveTo(H-P.normal.x*8,G-P.normal.y*8):N.moveTo(H+P.normal.x*8,G+P.normal.y*8),N.lineTo(H,G)}I.wireframes?N.strokeStyle="rgba(255,165,0,0.7)":N.strokeStyle="orange",N.lineWidth=1,N.stroke()},s.separations=function(A,R,j){var N=j,I=A.options,D,P,z,K,q;for(N.beginPath(),q=0;q<R.length;q++)if(D=R[q],!!D.isActive){P=D.collision,z=P.bodyA,K=P.bodyB;var B=1;!K.isStatic&&!z.isStatic&&(B=.5),K.isStatic&&(B=0),N.moveTo(K.position.x,K.position.y),N.lineTo(K.position.x-P.penetration.x*B,K.position.y-P.penetration.y*B),B=1,!K.isStatic&&!z.isStatic&&(B=.5),z.isStatic&&(B=0),N.moveTo(z.position.x,z.position.y),N.lineTo(z.position.x+P.penetration.x*B,z.position.y+P.penetration.y*B)}I.wireframes?N.strokeStyle="rgba(255,165,0,0.5)":N.strokeStyle="orange",N.stroke()},s.inspector=function(A,R){A.engine;var j=A.selected,N=A.render,I=N.options,D;if(I.hasBounds){var P=N.bounds.max.x-N.bounds.min.x,z=N.bounds.max.y-N.bounds.min.y,K=P/N.options.width,q=z/N.options.height;R.scale(1/K,1/q),R.translate(-N.bounds.min.x,-N.bounds.min.y)}for(var B=0;B<j.length;B++){var H=j[B].data;switch(R.translate(.5,.5),R.lineWidth=1,R.strokeStyle="rgba(255,165,0,0.9)",R.setLineDash([1,2]),H.type){case"body":D=H.bounds,R.beginPath(),R.rect(Math.floor(D.min.x-3),Math.floor(D.min.y-3),Math.floor(D.max.x-D.min.x+6),Math.floor(D.max.y-D.min.y+6)),R.closePath(),R.stroke();break;case"constraint":var G=H.pointA;H.bodyA&&(G=H.pointB),R.beginPath(),R.arc(G.x,G.y,10,0,2*Math.PI),R.closePath(),R.stroke();break}R.setLineDash([]),R.translate(-.5,-.5)}A.selectStart!==null&&(R.translate(.5,.5),R.lineWidth=1,R.strokeStyle="rgba(255,165,0,0.6)",R.fillStyle="rgba(255,165,0,0.1)",D=A.selectBounds,R.beginPath(),R.rect(Math.floor(D.min.x),Math.floor(D.min.y),Math.floor(D.max.x-D.min.x),Math.floor(D.max.y-D.min.y)),R.closePath(),R.stroke(),R.fill(),R.translate(-.5,-.5)),I.hasBounds&&R.setTransform(1,0,0,1,0,0)};var E=function(A,R){var j=A.engine,N=A.timing,I=N.historySize,D=j.timing.timestamp;N.delta=R-N.lastTime||s._goodDelta,N.lastTime=R,N.timestampElapsed=D-N.lastTimestamp||0,N.lastTimestamp=D,N.deltaHistory.unshift(N.delta),N.deltaHistory.length=Math.min(N.deltaHistory.length,I),N.engineDeltaHistory.unshift(j.timing.lastDelta),N.engineDeltaHistory.length=Math.min(N.engineDeltaHistory.length,I),N.timestampElapsedHistory.unshift(N.timestampElapsed),N.timestampElapsedHistory.length=Math.min(N.timestampElapsedHistory.length,I),N.engineElapsedHistory.unshift(j.timing.lastElapsed),N.engineElapsedHistory.length=Math.min(N.engineElapsedHistory.length,I),N.elapsedHistory.unshift(N.lastElapsed),N.elapsedHistory.length=Math.min(N.elapsedHistory.length,I)},T=function(A){for(var R=0,j=0;j<A.length;j+=1)R+=A[j];return R/A.length||0},w=function(A,R){var j=document.createElement("canvas");return j.width=A,j.height=R,j.oncontextmenu=function(){return!1},j.onselectstart=function(){return!1},j},M=function(A){var R=A.getContext("2d"),j=window.devicePixelRatio||1,N=R.webkitBackingStorePixelRatio||R.mozBackingStorePixelRatio||R.msBackingStorePixelRatio||R.oBackingStorePixelRatio||R.backingStorePixelRatio||1;return j/N},_=function(A,R){var j=A.textures[R];return j||(j=A.textures[R]=new Image,j.src=R,j)},L=function(A,R){var j=R;/(jpg|gif|png)$/.test(R)&&(j="url("+R+")"),A.canvas.style.background=j,A.canvas.style.backgroundSize="contain",A.currentBackground=R}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(5),c=o(17),d=o(0);(function(){var f,p;if(typeof window<"u"&&(f=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame,p=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame),!f){var x;f=function(b){x=setTimeout(function(){b(d.now())},1e3/60)},p=function(){clearTimeout(x)}}s.create=function(b){var g={fps:60,deltaSampleSize:60,counterTimestamp:0,frameCounter:0,deltaHistory:[],timePrev:null,frameRequestId:null,isFixed:!1,enabled:!0},y=d.extend(g,b);return y.delta=y.delta||1e3/y.fps,y.deltaMin=y.deltaMin||1e3/y.fps,y.deltaMax=y.deltaMax||1e3/(y.fps*.5),y.fps=1e3/y.delta,y},s.run=function(b,g){return typeof b.positionIterations<"u"&&(g=b,b=s.create()),(function y(E){b.frameRequestId=f(y),E&&b.enabled&&s.tick(b,g,E)})(),b},s.tick=function(b,g,y){var E=g.timing,T;b.isFixed?T=b.delta:(T=y-b.timePrev||b.delta,b.timePrev=y,b.deltaHistory.push(T),b.deltaHistory=b.deltaHistory.slice(-b.deltaSampleSize),T=Math.min.apply(null,b.deltaHistory),T=T<b.deltaMin?b.deltaMin:T,T=T>b.deltaMax?b.deltaMax:T,b.delta=T);var w={timestamp:E.timestamp};l.trigger(b,"beforeTick",w),b.frameCounter+=1,y-b.counterTimestamp>=1e3&&(b.fps=b.frameCounter*((y-b.counterTimestamp)/1e3),b.counterTimestamp=y,b.frameCounter=0),l.trigger(b,"tick",w),l.trigger(b,"beforeUpdate",w),c.update(g,T),l.trigger(b,"afterUpdate",w),l.trigger(b,"afterTick",w)},s.stop=function(b){p(b.frameRequestId)},s.start=function(b,g){s.run(b,g)}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(8),c=o(0),d=c.deprecated;(function(){s.collides=function(f,p){return l.collides(f,p)},d(s,"collides","SAT.collides ➤ replaced by Collision.collides")})()}),(function(n,i,o){var s={};n.exports=s,o(1);var l=o(0);(function(){s.pathToVertices=function(c,d){typeof window<"u"&&!("SVGPathSeg"in window)&&l.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var f,p,x,b,g,y,E,T,w,M,_=[],L,A,R=0,j=0,N=0;d=d||15;var I=function(P,z,K){var q=K%2===1&&K>1;if(!w||P!=w.x||z!=w.y){w&&q?(L=w.x,A=w.y):(L=0,A=0);var B={x:L+P,y:A+z};(q||!w)&&(w=B),_.push(B),j=L+P,N=A+z}},D=function(P){var z=P.pathSegTypeAsLetter.toUpperCase();if(z!=="Z"){switch(z){case"M":case"L":case"T":case"C":case"S":case"Q":j=P.x,N=P.y;break;case"H":j=P.x;break;case"V":N=P.y;break}I(j,N,P.pathSegType)}};for(s._svgPathToAbsolute(c),x=c.getTotalLength(),y=[],f=0;f<c.pathSegList.numberOfItems;f+=1)y.push(c.pathSegList.getItem(f));for(E=y.concat();R<x;){if(M=c.getPathSegAtLength(R),g=y[M],g!=T){for(;E.length&&E[0]!=g;)D(E.shift());T=g}switch(g.pathSegTypeAsLetter.toUpperCase()){case"C":case"T":case"S":case"Q":case"A":b=c.getPointAtLength(R),I(b.x,b.y,0);break}R+=d}for(f=0,p=E.length;f<p;++f)D(E[f]);return _},s._svgPathToAbsolute=function(c){for(var d,f,p,x,b,g,y=c.pathSegList,E=0,T=0,w=y.numberOfItems,M=0;M<w;++M){var _=y.getItem(M),L=_.pathSegTypeAsLetter;if(/[MLHVCSQTA]/.test(L))"x"in _&&(E=_.x),"y"in _&&(T=_.y);else switch("x1"in _&&(p=E+_.x1),"x2"in _&&(b=E+_.x2),"y1"in _&&(x=T+_.y1),"y2"in _&&(g=T+_.y2),"x"in _&&(E+=_.x),"y"in _&&(T+=_.y),L){case"m":y.replaceItem(c.createSVGPathSegMovetoAbs(E,T),M);break;case"l":y.replaceItem(c.createSVGPathSegLinetoAbs(E,T),M);break;case"h":y.replaceItem(c.createSVGPathSegLinetoHorizontalAbs(E),M);break;case"v":y.replaceItem(c.createSVGPathSegLinetoVerticalAbs(T),M);break;case"c":y.replaceItem(c.createSVGPathSegCurvetoCubicAbs(E,T,p,x,b,g),M);break;case"s":y.replaceItem(c.createSVGPathSegCurvetoCubicSmoothAbs(E,T,b,g),M);break;case"q":y.replaceItem(c.createSVGPathSegCurvetoQuadraticAbs(E,T,p,x),M);break;case"t":y.replaceItem(c.createSVGPathSegCurvetoQuadraticSmoothAbs(E,T),M);break;case"a":y.replaceItem(c.createSVGPathSegArcAbs(E,T,_.r1,_.r2,_.angle,_.largeArcFlag,_.sweepFlag),M);break;case"z":case"Z":E=d,T=f;break}(L=="M"||L=="m")&&(d=E,f=T)}}})()}),(function(n,i,o){var s={};n.exports=s;var l=o(6);o(0),(function(){s.create=l.create,s.add=l.add,s.remove=l.remove,s.clear=l.clear,s.addComposite=l.addComposite,s.addBody=l.addBody,s.addConstraint=l.addConstraint})()})])})})(Rc)),Rc.exports}var yN=bN();const jE=Ol(yN);{const e=jE.Resolver;e&&typeof e._restingThresh=="number"&&(e._restingThresh=1.4)}const vN=6,Ca=28,ri=.92,am=1.12,EN=34;function gy(e,t,n){return Math.hypot(t-e.startX,n-e.startY)<vN?"click":"drag"}function TN(e){const t=e.length;if(t===0)return"";const n=o=>`${o.x.toFixed(1)} ${o.y.toFixed(1)}`;if(t===1)return`M ${n(e[0])}`;if(t===2)return`M ${n(e[0])} L ${n(e[1])}`;let i=`M ${n(e[0])}`;for(let o=1;o<t-1;o++){const s=e[o],l=e[o+1];i+=` Q ${n(s)} ${((s.x+l.x)/2).toFixed(1)} ${((s.y+l.y)/2).toFixed(1)}`}return`${i} L ${n(e[t-1])}`}function SN(e,t){return e*Math.exp(-t/90)}function kN(e,t,n,i){const o=`translate3d(${e.toFixed(1)}px, ${t.toFixed(1)}px, 0)`;if(n<.01)return o;const s=i*180/Math.PI,l=Math.min(.35,n);return`${o} rotate(${s.toFixed(1)}deg) scale(${(1+l).toFixed(3)}, ${(1-l).toFixed(3)}) rotate(${(-s).toFixed(1)}deg)`}const wN=4e-5,AN=5e-4;function CN(e,t,n){return Math.sin(n*37e-5+t*.0013)*.6+Math.sin(n*19e-5+e*7e-4+1.7)*.4}function NN(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 PE(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 Xo=120,_N=.9,xy=.7,MN=.09,RN=2.2,DN=2,im=Ca*2.45,LN=.006,rm=22,sm=.06;function ON(e){var K;const t=e.ballRadius??Ca,n=NN(e.weather??"clear"),{Engine:i,Bodies:o,Body:s,Composite:l,Constraint:c,Events:d}=jE,f=i.create();f.gravity.y=1,f.positionIterations=8,f.velocityIterations=4;const p=e.nodes.map(q=>{var Q,re;const B=((Q=q.spawn)==null?void 0:Q.x)??q.x,H=((re=q.spawn)==null?void 0:re.y)??q.y,G=o.circle(B,H,t,{restitution:.5,friction:.01,frictionAir:.03*n.airDrag,density:q.isExam?.0016:.001,inertia:1/0,isStatic:!!q.locked,collisionFilter:{group:0,category:2,mask:6}});return{nodeId:q.id,body:G,layoutX:q.x,layoutY:q.y,isExam:!!q.isExam,snow:0,field:0,squash:0,squashAngle:0}});for(const q of p){l.add(f.world,q.body);const B=(K=e.nodes.find(H=>H.id===q.nodeId))==null?void 0:K.spawn;B&&(B.vx!==void 0||B.vy!==void 0)&&s.setVelocity(q.body,{x:B.vx??0,y:B.vy??0})}const x=Xo/2,b={isStatic:!0,restitution:.4,friction:.05,collisionFilter:{category:4,mask:2}},g=(q,B)=>({x:Math.min(e.width-t,Math.max(t,q)),y:Math.min(e.height-t,Math.max(t,B))});l.add(f.world,[o.rectangle(e.width/2,-x,e.width*3,Xo,b),o.rectangle(e.width/2,e.height+x,e.width*3,Xo,b),o.rectangle(-x,e.height/2,Xo,e.height*3,b),o.rectangle(e.width+x,e.height/2,Xo,e.height*3,b)]);const y=q=>({x:q.body.position.x,y:q.body.position.y+t*ri}),E=[];function T(q,B,H,G,Q){return"body"in q?c.create({bodyA:q.body,pointA:q.offset,bodyB:B,pointB:H,length:G,stiffness:Q,damping:.05}):c.create({pointA:q.point,bodyB:B,pointB:H,length:G,stiffness:Q,damping:.05})}function w(q,B,H,G){const Q={x:H.body.position.x,y:H.body.position.y+t*ri},re=Q.x-q.x,F=Q.y-q.y,Y=Math.max(60,Math.hypot(re,F)),W=Math.max(5,Math.min(14,Math.round(Y/EN))),U=Y*am/W,ae=[];let J=B?{body:B,offset:{x:q.x-B.position.x,y:q.y-B.position.y}}:{point:q},ne=!0;for(let me=1;me<W;me++){const Z=me/W,we=Math.sin(Math.PI*Z)*Y*(am-1)*.85,Fe=o.circle(q.x+re*Z,q.y+F*Z+we,3.5,{density:7e-4,frictionAir:.1*n.airDrag,collisionFilter:{category:8,mask:0}});ae.push(Fe),l.add(f.world,Fe),l.add(f.world,T(J,Fe,void 0,U,ne?xy:_N)),ne=!1,J={body:Fe,offset:{x:0,y:0}}}l.add(f.world,T(J,H.body,{x:0,y:t*ri},U,xy)),E.push({from:G,to:H.nodeId,restLen:Y*am,particles:ae})}const M=p[0],_=M?{x:e.anchorKnotX??M.layoutX,y:Kc}:{x:e.width/2,y:Kc};M&&w(_,null,M,"__anchor");for(let q=0;q<p.length-1;q++){const B=p[q],H=p[q+1];w(y(B),B.body,H,B.nodeId)}const L=p[p.length-1],A=e.nextKnot&&(L!=null&&L.isExam)?e.nextKnot:void 0;A&&L&&w(A,null,L,"__next");const R=new Map;for(const q of p){let B=0;for(const G of E)if(G.from===q.nodeId||G.to===q.nodeId)for(const Q of G.particles)B+=Q.mass*.5;const H=Math.min(.25,B/q.body.mass);R.set(q.nodeId,(1+H)*(.96+PE(q.nodeId)*.08))}let j=0,N=1;d.on(f,"beforeUpdate",()=>{const q=f.timing.timestamp;j*=.97,n.gust>0&&Math.random()<.0025*n.gust&&(j=n.gust*(.6+Math.random()*.4),N=Math.random()<.5?-1:1);for(const B of p){const H=B.body.mass,G=f.gravity.y*f.gravity.scale,Q=CN(B.body.position.x,B.body.position.y,q)*n.wind*wN*H+N*j*AN*H;let re=-H*G*(R.get(B.nodeId)??1);n.rainRate>0&&Math.random()<n.rainRate&&(re+=H*G*.35,s.applyForce(B.body,B.body.position,{x:(Math.random()-.5)*H*G*.3,y:0})),s.applyForce(B.body,B.body.position,{x:Q,y:re})}});const I=[],D=(q,B,H,G)=>{if(q.snow<=sm)return;const Q=Math.max(1,Math.min(G,Math.round(q.snow*G)+1));for(let re=0;re<Q;re++){const F=-(.35+Math.random()*1.9),Y=t*(.55+Math.random()*.45);I.push({x:q.body.position.x+Math.cos(F)*Y,y:q.body.position.y+Math.sin(F)*Y,vx:q.body.velocity.x*.75+B.x*(.5+Math.random()*1.8)+(Math.random()-.5)*1.2,vy:q.body.velocity.y*.75+B.y*(.5+Math.random()*1.8)-.6-Math.random()*.8,amount:.02+Math.min(.05,H*.004)})}q.snow=Math.max(sm*.5,q.snow-Q*(.03+Math.min(.07,H*.005))),I.length>96&&I.splice(0,I.length-96)},P=[];d.on(f,"collisionStart",q=>{var B;for(const H of q.pairs){const{bodyA:G,bodyB:Q}=H,re=p.find(ne=>ne.body===G),F=p.find(ne=>ne.body===Q);if(!re&&!F)continue;const Y={x:G.velocity.x-Q.velocity.x,y:G.velocity.y-Q.velocity.y},W=Math.hypot(Y.x,Y.y);if(W<RN)continue;const U=H.collision.normal,ae=(B=H.collision.supports)==null?void 0:B[0];P.push(ae?{x:ae.x,y:ae.y,speed:W}:{x:(G.position.x+Q.position.x)/2,y:(G.position.y+Q.position.y)/2,speed:W}),P.length>64&&P.shift();const J=Math.min(.32,W*.028);re&&J>re.squash&&(re.squash=J,re.squashAngle=Math.atan2(U.y,U.x)),F&&J>F.squash&&(F.squash=J,F.squashAngle=Math.atan2(-U.y,-U.x)),re&&D(re,{x:U.x,y:U.y},W,5),F&&D(F,{x:-U.x,y:-U.y},W,5)}}),d.on(f,"afterUpdate",()=>{if(!(n.snowRate<=0))for(const q of p)q.snow=Math.min(1,q.snow+n.snowRate)});let z=null;return{balls:p,links:E,anchor:_,nextKnot:A,ball(q){return p.find(B=>B.nodeId===q)},step(q){i.update(f,Math.min(33,Math.max(8,q)));for(let B=0;B<p.length;B++){const H=p[B];for(let G=B+1;G<p.length;G++){const Q=p[G],re=Q.body.position.x-H.body.position.x,F=Q.body.position.y-H.body.position.y,Y=re*re+F*F;if(Y>=im*im||Y<.01)continue;const W=Math.sqrt(Y),U=(W-2*t)/(im-2*t),ae=U<=0?1:U>=1?0:1-U,ne=Math.hypot(H.body.velocity.x-Q.body.velocity.x,H.body.velocity.y-Q.body.velocity.y)<1.2?LN*ae*ae:0,me=re/W,Z=F/W;H.body.isStatic||s.applyForce(H.body,H.body.position,{x:-me*ne*H.body.mass,y:-Z*ne*H.body.mass}),Q.body.isStatic||s.applyForce(Q.body,Q.body.position,{x:me*ne*Q.body.mass,y:Z*ne*Q.body.mass}),H.field=Math.max(H.field,ae),Q.field=Math.max(Q.field,ae)}}for(const B of p)B.field*=.88;for(const B of p){if(B.body.isStatic)continue;const H=B.body.velocity,G=Math.hypot(H.x,H.y);G>rm&&s.setVelocity(B.body,{x:H.x/G*rm,y:H.y/G*rm})}for(let B=0;B<p.length;B++){const H=p[B];for(let G=B+1;G<p.length;G++){const Q=p[G];let re=Q.body.position.x-H.body.position.x,F=Q.body.position.y-H.body.position.y,Y=Math.hypot(re,F);if(Y>=t*2)continue;Y<.01&&(re=1,F=0,Y=1);const W=t*2-Y+.05,U=re/Y,ae=F/Y;H.body.isStatic&&Q.body.isStatic||(H.body.isStatic?s.setPosition(Q.body,{x:Q.body.position.x+U*W,y:Q.body.position.y+ae*W}):Q.body.isStatic?s.setPosition(H.body,{x:H.body.position.x-U*W,y:H.body.position.y-ae*W}):(s.setPosition(H.body,{x:H.body.position.x-U*W/2,y:H.body.position.y-ae*W/2}),s.setPosition(Q.body,{x:Q.body.position.x+U*W/2,y:Q.body.position.y+ae*W/2})))}}for(const B of p){const H=Math.hypot(B.body.velocity.x,B.body.velocity.y);B.snow>sm&&H>DN&&D(B,{x:B.body.velocity.x/H,y:B.body.velocity.y/H},H,2)}for(const B of p){if(B.body.isStatic)continue;const H=B.body.position.x,G=B.body.position.y,Q=Math.min(e.width-t,Math.max(t,H)),re=Math.min(e.height-t,Math.max(t,G));(Q!==H||re!==G)&&(s.setPosition(B.body,{x:Q,y:re}),s.setVelocity(B.body,{x:H<t||H>e.width-t?0:B.body.velocity.x,y:G<t||G>e.height-t?0:B.body.velocity.y}))}},beginDrag(q,B,H){this.endDrag();const G=this.ball(q);if(!G)return;const Q=c.create({pointA:g(B,H),bodyB:G.body,length:0,stiffness:MN,damping:.12});l.add(f.world,Q),z={constraint:Q,nodeId:q}},moveDrag(q,B){if(!z)return;const H=g(q,B);z.constraint.pointA=H},endDrag(){z&&(l.remove(f.world,z.constraint),z=null)},isDragging(){return z!==null},drainImpacts(){const q=P.slice();return P.length=0,q},drainFlakes(){const q=I.slice();return I.length=0,q},dispose(){this.endDrag(),d.off(f,"beforeUpdate"),d.off(f,"afterUpdate"),d.off(f,"collisionStart"),l.clear(f.world,!1),i.clear(f)}}}const Kc=-12;function dc(e,t,n=20){return t<=n*2?t/2:n+PE(e)*(t-n*2)}function IN(e,t,n,i=Ca){if(t<=0||Math.abs(t-n)<=1)return e;const o=n/t,s={x:Math.min(n-i,Math.max(i,e.x*o)),y:e.y,vy:e.vy};return e.vx!==void 0&&(s.vx=e.vx*o),s}const Nr=(e,t,n)=>e+(t-e)*n,gd=(e,t,n)=>e<t?t:e>n?n:e,wl=e=>e<0?0:e>1?1:e*e*(3-2*e);function _r(e,t,n){return[Nr(e[0],t[0],n),Nr(e[1],t[1],n),Nr(e[2],t[2],n)]}const om=e=>`rgb(${e[0]|0},${e[1]|0},${e[2]|0})`,Ps=(e,t)=>`rgba(${e[0]|0},${e[1]|0},${e[2]|0},${t})`;function xd(){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 bd(e,t){return e.map(n=>({t:n.t,top:t(n.top),mid:t(n.mid),hor:t(n.hor)}))}const lm=()=>bd(xd(),e=>[e[0]*1,e[1]*1.15,e[2]*.7]),fc=()=>bd(xd(),e=>[e[0]*.75,e[1]*1,Math.min(255,e[2]*1.25)]),um=()=>bd(xd(),e=>[Math.min(255,e[0]*1.35),e[1]*.8,e[2]*.55]),by=()=>bd(xd(),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]}),cm={far:[28,50,36],near:[56,110,52],snowy:!1},hc={far:[20,48,30],near:[34,82,40],snowy:!1},dm={far:[54,36,24],near:[128,78,36],snowy:!1},yy={far:[60,66,82],near:[232,236,244],snowy:!0};function na(e){return t=>{let n=e;return t>.3&&t<.5?n=Nr(n,Math.min(1,n+.2),wl((t-.3)/.2)):t>=.5&&t<.74?n=Math.min(1,n+.15):t>=.74&&t<.84&&(n=Nr(n,Math.max(0,n-.3),wl((t-.74)/.1))),gd(n,0,1)}}const BE={"spring|clear":{season:"spring",weather:"clear",sky:lm(),cloudCover:na(.1),particles:"none",lightning:!1,fogAlpha:0,ground:cm},"spring|cloudy":{season:"spring",weather:"cloudy",sky:lm(),cloudCover:na(.5),particles:"none",lightning:!1,fogAlpha:0,ground:cm},"spring|rain":{season:"spring",weather:"rain",sky:lm(),cloudCover:na(.85),particles:"rain",lightning:!1,fogAlpha:0,ground:cm},"summer|clear":{season:"summer",weather:"clear",sky:fc(),cloudCover:na(.1),particles:"none",lightning:!1,fogAlpha:0,ground:hc},"summer|cloudy":{season:"summer",weather:"cloudy",sky:fc(),cloudCover:na(.5),particles:"none",lightning:!1,fogAlpha:0,ground:hc},"summer|rain":{season:"summer",weather:"rain",sky:fc(),cloudCover:na(.85),particles:"rain",lightning:!1,fogAlpha:0,ground:hc},"summer|storm":{season:"summer",weather:"storm",sky:fc(),cloudCover:na(1),particles:"rain",lightning:!0,fogAlpha:0,ground:hc},"autumn|clear":{season:"autumn",weather:"clear",sky:um(),cloudCover:na(.15),particles:"none",lightning:!1,fogAlpha:0,ground:dm,sunTint:[255,180,110]},"autumn|cloudy":{season:"autumn",weather:"cloudy",sky:um(),cloudCover:na(.55),particles:"none",lightning:!1,fogAlpha:0,ground:dm},"autumn|storm":{season:"autumn",weather:"storm",sky:um(),cloudCover:na(1),particles:"rain",lightning:!0,fogAlpha:0,ground:dm},"winter|clear":{season:"winter",weather:"clear",sky:by(),cloudCover:na(.2),particles:"none",lightning:!1,fogAlpha:0,ground:yy,sunTint:[220,230,245]},"winter|snow":{season:"winter",weather:"snow",sky:by(),cloudCover:na(.9),particles:"snow",lightning:!1,fogAlpha:.2,ground:yy}},vy=Object.keys(BE);function jN(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 PN(e){const t=`${e??"none"}:${Math.floor(performance.now()/1e3)}`;return vy[jN(t)%vy.length]}function BN(e,t){let n=0;for(;n<t.length-1&&e>t[n+1].t;)n++;const i=t[n],o=t[Math.min(n+1,t.length-1)],s=wl(gd((e-i.t)/(o.t-i.t||1),0,1));return{top:_r(i.top,o.top,s),mid:_r(i.mid,o.mid,s),hor:_r(i.hor,o.hor,s)}}function zN(e,t,n,i,o){if(e<i||e>o)return null;const s=(e-i)/(o-i),l=Nr(.1,.9,s),c=n*.26,d=n*.98,f=d-Math.sin(s*Math.PI)*(d-c);return{x:l*t,y:f,peakness:Math.sin(s*Math.PI)}}function UN(e,t,n,i,o){let s;if(e>=i)s=(e-i)/(1-i+o);else if(e<=o)s=(1-i+e)/(1-i+o);else return null;const l=Nr(.12,.88,s),c=n*.26,d=n*.98,f=d-Math.sin(s*Math.PI)*(d-c);return{x:l*t,y:f,peakness:Math.sin(s*Math.PI)}}function zE(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 Ey(e,t){const n=zE(20260809),i=Math.max(28,Math.round(e*t/7e3)),o=[];for(let s=0;s<i;s++)o.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 o}function HN(){const e=zE(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 FN(e,t,n,i){const o=e.createLinearGradient(0,0,0,i);o.addColorStop(0,om(t.top)),o.addColorStop(.55,om(t.mid)),o.addColorStop(1,om(t.hor)),e.fillStyle=o,e.fillRect(0,0,n,i)}function VN(e,t,n,i,o,s){let l=0;if(t<.22?l=wl(1-t/.22):t>.8&&(l=wl((t-.8)/.2)),!(l<=.01))for(const c of n){const d=.55+.45*Math.sin(s*c.sp+c.tw),f=l*d;if(f<.02)continue;e.fillStyle=`rgba(255,248,228,${f})`;const p=c.big?c.r*1.8:c.r;e.beginPath(),e.arc(c.x*i,c.y*o,p,0,Math.PI*2),e.fill(),c.big&&(e.fillStyle=`rgba(255,240,210,${f*.35})`,e.fillRect(c.x*i-p*4,c.y*o-.4,p*8,.8),e.fillRect(c.x*i-.4,c.y*o-p*4,.8,p*8))}}function qN(e,t,n){if(!t)return;const{x:i,y:o,peakness:s}=t,l=28+s*8,c=e.createRadialGradient(i,o,l*.4,i,o,l*5);c.addColorStop(0,"rgba(255,236,190,0.55)"),c.addColorStop(.4,"rgba(255,210,150,0.16)"),c.addColorStop(1,"rgba(255,200,140,0)"),e.fillStyle=c,e.fillRect(i-l*5,o-l*5,l*10,l*10);const d=e.createRadialGradient(i,o,0,i,o,l),f=n??[255,236,180],p=n?_r(n,[255,214,150],.5):[255,214,150];d.addColorStop(0,"rgba(255,252,238,1)"),d.addColorStop(.7,Ps(f,1)),d.addColorStop(1,Ps(p,.9)),e.fillStyle=d,e.beginPath(),e.arc(i,o,l,0,Math.PI*2),e.fill()}function YN(e,t){if(!t)return;const{x:n,y:i}=t,o=24,s=e.createRadialGradient(n,i,o*.8,n,i,o*5);s.addColorStop(0,"rgba(220,232,255,0.38)"),s.addColorStop(.5,"rgba(220,232,255,0.1)"),s.addColorStop(1,"rgba(220,232,255,0)"),e.fillStyle=s,e.fillRect(n-o*5,i-o*5,o*10,o*10);const l=e.createRadialGradient(n-o*.25,i-o*.3,o*.2,n,i,o);l.addColorStop(0,"rgba(255,254,247,1)"),l.addColorStop(.7,"rgba(244,242,232,1)"),l.addColorStop(1,"rgba(214,222,236,1)"),e.fillStyle=l,e.beginPath(),e.arc(n,i,o,0,Math.PI*2),e.fill(),e.fillStyle="rgba(150,160,180,0.16)";const c=[[-10,-6,4],[5,3,5],[-3,9,3],[11,-8,3]];for(const[d,f,p]of c)e.beginPath(),e.arc(n+d,i+f,p,0,Math.PI*2),e.fill()}function GN(e,t,n,i,o,s){const l=18*i,c=[[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=Ps([o[0]*.7,o[1]*.7,o[2]*.78],s*.9);for(const[d,f,p]of c)e.beginPath(),e.arc(d*l,f*l*1.1+l*.45,l*p*1.05,0,Math.PI*2),e.fill();e.fillStyle=Ps(o,s);for(const[d,f,p]of c)e.beginPath(),e.arc(d*l,f*l,l*p,0,Math.PI*2),e.fill();e.restore()}function XN(e,t,n,i,o,s,l,c,d){const f=l(t);if(f<.02)return;const p=_r(c.hor,[255,255,255],.35),x=_r(c.mid,[20,20,30],.45),b=d?x:p;for(let g=0;g<n.length;g++){const y=n[g],E=(y.x+s*y.speed)%1.2-.1,T=y.y+Math.sin(s*1e-4+y.seed)*y.drift;g/n.length<f&&GN(e,E*i,T*o,y.s,b,gd(f*.92,0,.92))}}const Ns=[];let Er=[];const al=[];let Tr=[];const mc=[],Ko=[];let il=[];function KN(e,t,n,i,o,s){if(o<.04)return;const l=i*(.02+o*.07),c=.12+o*.73,d=t-i*c,f=t+i*c,p=n-Math.sqrt(Math.max(0,i*i-i*c*(i*c))),x=n-i-l,b=(p+x)/2;e.save(),e.beginPath(),e.moveTo(d,p),e.bezierCurveTo(d,b,t-i*.3,x,t,x),e.bezierCurveTo(t+i*.3,x,f,b,f,p),e.quadraticCurveTo(t,n-i*.78,d,p),e.closePath();const g=e.createLinearGradient(0,x,0,p);g.addColorStop(0,"rgba(255,255,255,0.98)"),g.addColorStop(.65,"rgba(245,250,255,0.95)"),g.addColorStop(1,"rgba(218,230,246,0.9)"),e.fillStyle=g,e.fill(),e.strokeStyle="rgba(168,192,225,0.28)",e.lineWidth=1.5,e.beginPath(),e.moveTo(d,p),e.quadraticCurveTo(t,n-i*.78,f,p),e.stroke(),e.restore()}function fm(e,t,n,i,o){const s=Math.sin(i),l=Math.cos(i);return{x:e+Math.sin(o)*s*n,y:t-l*n}}function $N(e,t,n,i){e.save(),e.beginPath(),e.arc(t,n,i*.99,0,Math.PI*2),e.clip();const o=e.createRadialGradient(t-i*.35,n-i*.4,0,t-i*.35,n-i*.4,i*.8);o.addColorStop(0,"rgba(255,255,255,0.4)"),o.addColorStop(.5,"rgba(255,255,255,0.12)"),o.addColorStop(1,"rgba(255,255,255,0)"),e.fillStyle=o,e.fillRect(t-i,n-i,i*2,i*2),e.strokeStyle="rgba(255,255,255,0.55)",e.lineWidth=1.8,e.beginPath(),e.arc(t,n,i*.92,Math.PI*1.15,Math.PI*1.5),e.stroke(),e.restore()}function QN(e,t){if(t.length!==0){e.save();for(let n=t.length-1;n>=0;n--){const i=t[n];if(i.x+=i.vx,i.y+=i.vy,i.vy+=.14,i.vx*=.985,i.vy*=.99,i.life--,i.life<=0){t.splice(n,1);continue}const o=i.life/i.maxLife;e.fillStyle=`rgba(248,250,255,${(.9*o).toFixed(3)})`,e.beginPath(),e.arc(i.x,i.y,i.r*(.5+.5*o),0,Math.PI*2),e.fill()}e.restore()}}function UE(e,t){e.save();for(let n=t.length-1;n>=0;n--){const i=t[n];if(i.x+=i.vx,i.y+=i.vy,i.vy+=.18,i.life--,i.life<=0){t.splice(n,1);continue}const o=Math.min(1,i.life/20)*.8;e.fillStyle=`rgba(215,238,255,${o})`,e.beginPath(),e.arc(i.x,i.y,1.3,0,Math.PI*2),e.fill()}e.restore()}function WN(e,t,n,i,o,s){e.save(),e.beginPath(),e.arc(t,n,i*.99,0,Math.PI*2),e.clip();for(let l=o.length-1;l>=0;l--){const c=o[l];if(c.prog+=c.speed,c.life--,c.prog>Math.PI*1.05||c.life<=0){o.splice(l,1);continue}const d=7;for(let x=0;x<d;x++){const b=c.prog-c.len*(x/d),g=c.prog-c.len*((x+1)/d),y=fm(t,n,i,b,c.theta),E=fm(t,n,i,g,c.theta),T=(1-x/d)*.42;e.strokeStyle=`rgba(200,228,250,${T})`,e.lineWidth=c.thick*(1-x/d*.7),e.lineCap="round",e.beginPath(),e.moveTo(y.x,y.y),e.lineTo(E.x,E.y),e.stroke()}const f=fm(t,n,i,c.prog,c.theta),p=e.createRadialGradient(f.x-1.2,f.y-1.2,0,f.x,f.y,c.thick*1.3);p.addColorStop(0,"rgba(255,255,255,0.85)"),p.addColorStop(.4,"rgba(180,215,240,0.5)"),p.addColorStop(1,"rgba(120,165,205,0.25)"),e.fillStyle=p,e.beginPath(),e.arc(f.x,f.y,c.thick*1.1,0,Math.PI*2),e.fill()}e.restore()}function ZN(e,t,n,i){for(;Ns.length<t.length;)Ns.push([]);for(;Er.length<t.length;)Er.push(0);for(;il.length<t.length;)il.push(.3);for(;al.length<t.length;)al.push([]);for(;Tr.length<t.length;)Tr.push(0);for(let o=0;o<t.length;o++){const s=t[o];if(n.particles==="snow"){const l=s.snow!==void 0?s.snow:Math.min(1,(il[o]??.3)+8e-4);il[o]=l,KN(e,s.x,s.y,s.r,l)}else if(n.particles==="rain"){if($N(e,s.x,s.y,s.r),Er[o]=Er[o]-1,Er[o]<=0&&Ns[o].length<3){const l=Math.random()<.5?-1:1;Ns[o].push({theta:l*(.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}),Er[o]=40+Math.random()*60}if(WN(e,s.x,s.y,s.r,Ns[o]),Tr[o]=Tr[o]-1,Tr[o]<=0){const l=s.x+(Math.random()-.5)*s.r*1.2,c=l-s.x,d=s.y-Math.sqrt(Math.max(0,s.r*s.r-c*c)),f=4+Math.floor(Math.random()*3);for(let p=0;p<f;p++){const x=c<0?-1:1;al[o].push({x:l,y:d,vx:x*(.5+Math.random()*2)*(Math.random()<.5?-1:1),vy:-(1.5+Math.random()*2.5),life:18+Math.floor(Math.random()*14)})}Tr[o]=30+Math.floor(Math.random()*50)}UE(e,al[o])}}}function JN(e,t,n,i,o){e.save(),e.strokeStyle=o?"rgba(205,224,244,0.42)":"rgba(210,224,238,0.3)",e.lineWidth=o?1:.7,e.lineCap="round";const s=o?.013:.007;for(const l of i){l.y+=l.v*s,l.y>1&&(l.y-=1,l.x=Math.random());const c=l.x*t,d=l.y*n;e.beginPath(),e.moveTo(c,d),e.lineTo(c,d+l.len),e.stroke()}e.restore()}function e5(e,t,n,i,o){e.save(),e.fillStyle="rgba(250,250,255,0.85)";for(const s of i){s.y+=s.v*.004;const l=(s.x+Math.sin(o*5e-4+s.phase)*.02)*t,c=s.y*n;s.y>1&&(s.y-=1),e.beginPath(),e.arc(l,c,s.r,0,Math.PI*2),e.fill()}e.restore()}function t5(e,t,n,i,o){const s=e.createLinearGradient(0,n*.4,0,n),l=_r(o.hor,[255,255,255],.3);s.addColorStop(0,Ps(l,0)),s.addColorStop(1,Ps(l,i)),e.fillStyle=s,e.fillRect(0,n*.4,t,n*.6)}let ks=0,Ty=0;function n5(e,t,n,i,o){if(o>Ty&&(ks=1,Ty=o+1400+Math.random()*2600),ks*=.86,ks<.02){ks=0;return}if(e.fillStyle=`rgba(255,255,255,${ks*.5})`,e.fillRect(0,0,t,n),ks>.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 s=t*(.3+Math.random()*.4),l=0;for(e.beginPath(),e.moveTo(s,l);l<n*.6;)s+=(Math.random()-.5)*60,l+=24+Math.random()*30,e.lineTo(s,l);e.stroke(),e.restore()}}function a5(e,t,n,i){const o=e.getContext("2d");if(!o)return()=>{};const s=o,l=n;let c=0,d=0,f=1,p=Ey(1,1);const x=HN();let b=[],g=[],y=0,E=0,T=!0;const w=performance.now(),M=window.matchMedia("(prefers-reduced-motion: reduce)").matches;function _(){const I=l.getBoundingClientRect();if(f=Math.min(window.devicePixelRatio||1,2),c=Math.max(1,I.width),d=Math.max(1,I.height),e.width=Math.floor(c*f),e.height=Math.floor(d*f),e.style.width=c+"px",e.style.height=d+"px",s.setTransform(f,0,0,f,0,0),p=Ey(c,d),i.particles==="rain"&&b.length===0){const D=i.weather==="storm",P=D?140:70;for(let z=0;z<P;z++)b.push({x:Math.random(),y:Math.random(),len:D?12+Math.random()*14:6+Math.random()*8,v:D?.9+Math.random()*.4:.5+Math.random()*.3})}if(i.particles==="snow"&&g.length===0)for(let D=0;D<120;D++)g.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 L(){const I=t.scrollHeight-t.clientHeight;y=I>0?gd(t.scrollTop/I,0,1):0}function A(I){if(!T)return;const D=y,P=M?0:(I-w)/1e3,z=BN(D,i.sky);FN(s,z,c,d),VN(s,D,p,c,d,P),YN(s,UN(D,c,d,.92,.08)),qN(s,zN(D,c,d,.16,.88),i.sunTint),XN(s,D,x,c,d,I,i.cloudCover,z,i.weather==="storm"),i.particles==="rain"&&JN(s,c,d,b,i.weather==="storm"),i.particles==="snow"&&e5(s,c,d,g,I),i.fogAlpha>0&&t5(s,c,d,i.fogAlpha,z),i.lightning&&n5(s,c,d,!0,I),M||(E=requestAnimationFrame(A))}const R=()=>L(),j=new ResizeObserver(()=>{_(),L()});j.observe(l),_(),L();let N;if(M){let I=!1;N=()=>{L(),I||(I=!0,requestAnimationFrame(()=>{I=!1,A(performance.now())}))},t.addEventListener("scroll",N,{passive:!0}),A(performance.now())}else N=R,t.addEventListener("scroll",N,{passive:!0}),E=requestAnimationFrame(A);return()=>{T=!1,cancelAnimationFrame(E),j.disconnect(),t.removeEventListener("scroll",N)}}function i5(e,t,n,i,o,s){const l=()=>{Ns.length=0,il.length=0,Er.length=0,al.length=0,Tr.length=0,mc.length=0,Ko.length=0;const M=e.getContext("2d");M&&M.clearRect(0,0,e.width,e.height)};if(l(),window.matchMedia("(prefers-reduced-motion: reduce)").matches)return()=>{};if(n.particles!=="rain"&&n.particles!=="snow")return()=>{};const d=e.getContext("2d");if(!d)return()=>{};const f=d;let p=0,x=0,b=1,g=0,y=!0;function E(){const M=t.getBoundingClientRect();b=Math.min(window.devicePixelRatio||1,2),p=Math.max(1,M.width),x=Math.max(1,M.height),e.width=Math.floor(p*b),e.height=Math.floor(x*b),e.style.width=p+"px",e.style.height=x+"px",f.setTransform(b,0,0,b,0,0)}function T(M){if(!y)return;f.clearRect(0,0,p,x);const _=i();if(ZN(f,_,n),o){for(const L of o()){const A=3+Math.min(5,Math.floor(L.speed/3));for(let R=0;R<A;R++)mc.push({x:L.x,y:L.y,vx:(Math.random()-.5)*3.2,vy:-(1.5+Math.random()*2.5),life:16+Math.floor(Math.random()*12)})}mc.length>0&&UE(f,mc)}if(s){for(const L of s()){const A=1+Math.min(2,Math.round(L.amount*40));for(let R=0;R<A;R++){const j=55+Math.floor(Math.random()*40);Ko.push({x:L.x+(Math.random()-.5)*8,y:L.y+(Math.random()-.5)*6,vx:L.vx*.6+(Math.random()-.5)*.8,vy:L.vy*.6-Math.random()*.5,life:j,maxLife:j,r:1.2+Math.random()*2.2})}}for(;Ko.length>240;)Ko.shift();QN(f,Ko)}g=requestAnimationFrame(T)}const w=new ResizeObserver(E);return w.observe(t),E(),g=requestAnimationFrame(T),()=>{y=!1,cancelAnimationFrame(g),w.disconnect(),l()}}const g0=new Set;function Mr(e,t){const n={kind:e,intensity:t==null?void 0:t.intensity,origin:t==null?void 0:t.origin,ts:performance.now()};for(const i of g0)i(n)}function Sy(e){return g0.add(e),()=>{g0.delete(e)}}function r5(e){switch(e){case"correct":return{particles:28,durationMs:700,colors:["#58cc02","#7ed957","#ffc800"]};case"mastery":case"level-up":return{particles:48,durationMs:1100,colors:["#ffc800","#ffe680","#fff7c2"]};case"unlock":return{particles:32,durationMs:800,colors:["#58cc02","#1cb0f6","#ffffff"]};case"exam-pass":return{particles:56,durationMs:1200,colors:["#a855f7","#c084fc","#ffc800"]};case"lesson-complete":return{particles:40,durationMs:1e3,colors:["#58cc02","#ffc800","#1cb0f6"]};case"energy-full":return{particles:36,durationMs:900,colors:["#58cc02","#7ed957","#ffffff"]};case"streak":return{particles:24,durationMs:700,colors:["#ff7a1a","#ffc800","#ffffff"]};case"wrong":return{particles:12,durationMs:450,colors:["#ff4b4b","#ff7a7a"]};default:return{particles:20,durationMs:600,colors:["#58cc02","#ffffff"]}}}const HE="(prefers-reduced-motion: reduce)";function s5(e){const t=window.matchMedia(HE);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function o5(){return window.matchMedia(HE).matches}function l5(){return!1}function FE(){return C.useSyncExternalStore(s5,o5,l5)}function u5(e){const t=Xe(),[n,i]=C.useState("import"),[o,s]=C.useState("study"),l=C.useRef(null),c=C.useRef(null),d=Math.round(e.overallMastery*100),p=!FE(),x=C.useRef([]),b=C.useRef(P=>{x.current.push(...P),x.current.length>64&&x.current.splice(0,x.current.length-64)}).current,g=C.useRef([]),y=C.useRef(new Map),E=C.useRef(P=>{g.current.push(...P),g.current.length>96&&g.current.splice(0,g.current.length-96)}).current,T=e.sections.filter(P=>(P.world??"study")===o),w=e.sections.some(P=>P.world==="practice"),[M,_]=C.useState(null);C.useEffect(()=>{_(PN(e.courseId))},[e.courseId]);const L=M?BE[M]??null:null,[A,R]=C.useState(!1);C.useEffect(()=>{if(!e.selectedNodeId)return;const P=c.current;if(!P)return;const z=P.querySelector(`[data-node-id="${CSS.escape(e.selectedNodeId)}"]`);if(!z)return;const K=P.getBoundingClientRect(),q=z.getBoundingClientRect();(q.top<K.top+60||q.bottom>K.bottom-60)&&z.scrollIntoView({behavior:"smooth",block:"center"})},[e.selectedNodeId]);const j=C.useRef(null);C.useEffect(()=>{R(!1),e.courseId&&(j.current===null||j.current!==e.courseId)&&(i("map"),s("study")),!e.courseId&&j.current!==null&&(i("import"),s("study")),j.current=e.courseId},[e.courseId]);const[N,I]=C.useState(null),D=C.useRef({});return C.useEffect(()=>{var q;const P=D.current,z={};let K=!1;for(const B of e.tree){const H=((q=e.progressMap[B.id])==null?void 0:q.status)??"locked";z[B.id]=H,P[B.id]==="locked"&&H!=="locked"&&(K=!0)}K&&Object.keys(P).length>0&&Mr("unlock"),D.current=z},[e.tree,e.progressMap]),m.jsxs("nav",{ref:l,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:[L&&m.jsxs(m.Fragment,{children:[m.jsx(d5,{scrollRef:c,navRef:l,preset:L}),m.jsx(f5,{scrollRef:c,navRef:l,preset:L,getImpacts:()=>x.current.splice(0),getFlakes:()=>g.current.splice(0),orbSnowRef:y})]}),m.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",children:[m.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:[m.jsxs("button",{onClick:()=>i("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:[m.jsx(up,{className:"w-3 h-3"})," ",t("map.tab.map")]}),m.jsxs("button",{onClick:()=>i("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:[m.jsx(Il,{className:"w-3 h-3"})," ",t("map.tab.import")]})]}),n==="map"&&m.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:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.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&&m.jsx(b5,{available:e.availableLanguages,current:e.currentLocale,onChange:e.onLocaleChange}),e.courseId&&m.jsx("button",{onClick:P=>{const z=P.currentTarget.getBoundingClientRect();I({id:e.courseId,title:e.courseTitle??"",rect:z})},"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:m.jsx(NE,{className:"w-3 h-3"})})]}),m.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[m.jsx("div",{className:"flex-1 h-2.5 bg-black/40 rounded-full overflow-hidden ring-1 ring-white/10",children:m.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${d>=100?"bg-gold":"bg-brand"}`,style:{width:`${Math.max(3,d)}%`}})}),m.jsxs("span",{className:"text-label font-extrabold tabular-nums text-white drop-shadow-[0_1px_3px_rgba(0,0,0,0.6)]",children:[d,"%"]})]}),m.jsxs("div",{className:"flex items-center justify-end gap-1.5 mt-1.5 text-caption",children:[m.jsxs("button",{onClick:()=>R(!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:[m.jsx(cp,{className:"w-3 h-3 text-white/50"}),m.jsx("span",{className:"font-bold text-white/60",children:t("map.search.label")})]}),m.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:[m.jsx(La,{className:`w-3 h-3 ${e.dueCount>0?"text-review":"text-white/50"}`}),m.jsx("span",{className:`font-bold ${e.dueCount>0?"text-review":"text-white/60"}`,children:t("map.review.label")}),e.dueCount>0&&m.jsx("span",{className:"font-extrabold text-review tabular-nums",children:e.dueCount})]})]}),w&&m.jsxs("div",{className:"flex gap-1 mt-1.5 p-0.5 rounded-lg bg-black/30",children:[m.jsxs("button",{onClick:()=>s("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 ${o==="study"?"bg-brand/30 text-brand":"text-white/50 hover:text-white/80"}`,children:[m.jsx(La,{className:"w-3 h-3"})," ",t("map.world.study")]}),m.jsxs("button",{onClick:()=>s("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 ${o==="practice"?"bg-accent/30 text-accent":"text-white/50 hover:text-white/80"}`,children:[m.jsx(Pl,{className:"w-3 h-3"})," ",t("map.world.practice")]})]})]})]}),m.jsx("div",{className:"absolute inset-0 overflow-hidden z-10",children:m.jsxs("div",{className:"flex h-full transition-transform duration-300",style:{transform:n==="map"?"translateX(0)":"translateX(-50%)",width:"200%"},children:[m.jsx("div",{className:"w-1/2 h-full relative",children:m.jsx("div",{ref:c,className:"map-path h-full overflow-y-auto overflow-x-hidden px-2 pt-48 pb-4","data-testid":"map-path",children:m.jsxs("div",{className:`map-sky-content ${L?`env-${L.season} env-${L.weather}`:""}`,children:[e.streaming&&m.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:[m.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?m.jsxs("div",{className:"text-center text-label text-white/60 mt-8 px-4 flex items-center justify-center gap-2",children:[m.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),t("map.generating")]}):m.jsxs("button",{onClick:()=>i("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:[m.jsx("div",{className:"text-3xl mb-2 group-hover:scale-110 transition-transform",children:"🗺️"}),m.jsx("div",{className:"text-body font-bold text-white/90 mb-1",children:t("map.empty.cta.title")}),m.jsx("div",{className:"text-label text-white/60 leading-relaxed",children:t("map.empty.cta.desc")}),m.jsx("div",{className:"mt-2 text-caption text-brand font-bold",children:t("map.empty.cta.btn")})]}):T.length===0?m.jsx("div",{className:"text-center text-label text-white/60 mt-8 px-4",children:t(o==="practice"?"map.empty.practice":"map.generating")}):m.jsx("div",{className:"space-y-6 pt-2",children:T.map((P,z)=>m.jsx(h5,{section:P,sectionIndex:z,tree:e.tree,progressMap:e.progressMap,selectedNodeId:e.selectedNodeId,dueNodeIds:e.dueNodeIds,onJumpNode:e.onJumpNode,physics:p,physicsWeather:(L==null?void 0:L.weather)??"clear",scrollRef:c,navRef:l,onImpacts:b,onFlakes:E,orbSnowRef:y},P.id))})]})})}),m.jsx("div",{className:"w-1/2 h-full overflow-y-auto px-3 pt-20 pb-3 space-y-2.5",children:m.jsx(c5,{courses:e.courses,selectedCourseId:e.courseId,onSelectCourse:P=>{e.onSelectCourse(P),i("map")},onDeleteCourse:(P,z,K)=>I({id:P,title:z,rect:K}),onCoursesChanged:e.onCoursesChanged})})]})}),A&&e.courseId&&m.jsx(sN,{sections:e.sections,tree:e.tree,progressMap:e.progressMap,selectedNodeId:e.selectedNodeId,onJump:P=>{s(P.world??"study"),R(!1),e.onJumpNode(P.id)},onClose:()=>R(!1)}),N&&m.jsx(pd,{anchorRect:N.rect,message:`${N.title} — ${t("import.delete.confirm")}`,danger:!0,confirmLabel:t("import.delete"),testid:"course-delete-confirm",onConfirm:()=>{e.onDeleteCourse(N.id),I(null)},onCancel:()=>I(null)})]})}function c5({courses:e,selectedCourseId:t,onSelectCourse:n,onDeleteCourse:i,onCoursesChanged:o}){const s=Xe(),[l,c]=C.useState("url"),[d,f]=C.useState(!1),[p,x]=C.useState(""),[b,g]=C.useState(""),y=C.useRef(null),E=C.useRef(null),T=C.useRef(null),[w,M]=C.useState(""),[_,L]=C.useState(""),[A,R]=C.useState(!1),[j,N]=C.useState(null),[I,D]=C.useState(null),[P,z]=C.useState(null),[K,q]=C.useState(null),[B,H]=C.useState([]),[,G]=C.useState(0),Q=C.useRef(null);C.useEffect(()=>{const Se=fe.on("import:progress",Oe=>{H(Ie=>{const $e=/\d+\/\d+/.test(Oe),Nt=Ie[Ie.length-1];if($e&&Nt&&Nt.status==="working"){const Te=[...Ie];return Te[Te.length-1]={...Nt,msg:Oe},Te}const Ot=Ie.map(Te=>Te.status==="working"?{...Te,status:"done"}:Te);return Ot.push({msg:Oe,status:"working",ts:Date.now()}),Ot})}),ve=setInterval(()=>G(Oe=>Oe+1),1e3);return()=>{Se(),clearInterval(ve)}},[]),C.useEffect(()=>fe.on("import:done",ve=>{R(!1),z(ve.ok?null:ve.planId??null),ve.ok?(D(`${s("import.success.folder")}: ${ve.title??""}${ve.reused?`(${s("import.success.reused")})`:""}`),q(ve.courseId?{courseId:ve.courseId,packable:ve.packable??!1}:null),o()):ve.cancelled?(H([]),N(null),D(s("import.cancelled"))):N(ve.error??"导入失败")}),[o,s]),C.useEffect(()=>{const Se=Q.current;Se&&(Se.scrollTop=Se.scrollHeight)},[B]);const re=async()=>{if(!(!p.trim()||A)){N(null),D(null),H([]);try{await fe.importUrl(p.trim()),R(!0)}catch(Se){N(Se instanceof Error?Se.message:String(Se))}}},F=async()=>{if(!(!w.trim()||A)){N(null),D(null),H([]);try{await fe.importText({name:_.trim()||void 0,text:w.trim()}),R(!0)}catch(Se){N(Se instanceof Error?Se.message:String(Se))}}},Y=async()=>{var ve;if(A)return;if(N(null),D(null),H([]),!ai){(ve=E.current)==null||ve.click();return}await fe.importEpub().catch(Oe=>(N(Oe instanceof Error?Oe.message:String(Oe)),null))&&R(!0)},W=async Se=>{if(!(!Se||A)){N(null),D(null),H([]);try{const ve=new Uint8Array(await Se.arrayBuffer());let Oe="";for(let $e=0;$e<ve.length;$e+=32768)Oe+=String.fromCharCode(...ve.subarray($e,$e+32768));await fe.importEpub({fileName:Se.name,contentBase64:btoa(Oe)})&&R(!0)}catch(ve){N(ve instanceof Error?ve.message:String(ve))}}},U=async()=>{if(A)return;if(N(null),D(null),H([]),!ai){const ve=b.trim();if(!ve){N(s("import.folder.pathRequired"));return}try{await fe.importLocalFolder(ve)&&R(!0)}catch(Oe){N(Oe instanceof Error?Oe.message:String(Oe))}return}await fe.importLocalFolder()&&R(!0)},ae=async()=>{var ve;if(A)return;if(N(null),D(null),H([]),!ai){(ve=y.current)==null||ve.click();return}await fe.importPack().catch(Oe=>(N(Oe instanceof Error?Oe.message:String(Oe)),null))&&R(!0)},J=async Se=>{if(!(!Se||A)){N(null),D(null),H([]);try{const ve=await Se.text();await fe.importPack({fileName:Se.name,content:ve})&&R(!0)}catch(ve){N(ve instanceof Error?ve.message:String(ve))}}},ne=async()=>{var ve;if(A)return;if(N(null),D(null),H([]),!ai){(ve=T.current)==null||ve.click();return}await fe.importAudio().catch(Oe=>(N(Oe instanceof Error?Oe.message:String(Oe)),null))&&R(!0)},me=async Se=>{if(!(!Se||Se.length===0||A)){N(null),D(null),H([]);try{const ve=[];for(const Ie of Array.from(Se)){const $e=new Uint8Array(await Ie.arrayBuffer());let Nt="";for(let Ot=0;Ot<$e.length;Ot+=32768)Nt+=String.fromCharCode(...$e.subarray(Ot,Ot+32768));ve.push({fileName:Ie.name,contentBase64:btoa(Nt)})}await fe.importAudio(ve)&&R(!0)}catch(ve){N(ve instanceof Error?ve.message:String(ve))}}},Z=async Se=>{if(!A){N(null),H([]);try{await fe.importResume(Se),R(!0)}catch(ve){N(ve instanceof Error?ve.message:String(ve))}}},we=async Se=>{try{const ve=await fe.exportPack(Se);ve!=null&&ve.content&&ve.fileName?(Fe(ve.fileName,ve.content),D(s("import.pack.exported",{path:ve.fileName}))):ve!=null&&ve.path&&D(s("import.pack.exported",{path:ve.path}))}catch(ve){N(ve instanceof Error?ve.message:String(ve))}},Fe=(Se,ve)=>{const Oe=new Blob([ve],{type:"application/json"}),Ie=URL.createObjectURL(Oe),$e=document.createElement("a");$e.href=Ie,$e.download=Se,$e.click(),setTimeout(()=>URL.revokeObjectURL(Ie),5e3)};return m.jsxs(m.Fragment,{children:[e.length===0?m.jsxs("div",{className:"text-center py-10",children:[m.jsx("div",{className:"text-3xl mb-2 opacity-30",children:"📚"}),m.jsx("p",{className:"text-label text-white/45 leading-relaxed",children:s("import.empty")})]}):m.jsx("div",{className:"space-y-2","data-testid":"course-list",children:e.map(Se=>{const ve=Se.id===t;return m.jsxs("div",{"data-testid":"course-row",className:`relative rounded-xl transition-all duration-150 group ${ve?"bg-brand/12 ring-1 ring-brand/40":"bg-white/5 hover:bg-white/10 hover:-translate-y-0.5"}`,children:[m.jsx("button",{onClick:()=>n(Se.id),className:"w-full text-left p-3",children:m.jsxs("div",{className:"flex items-start justify-between gap-2",children:[m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsx("div",{className:`text-body font-bold truncate ${ve?"text-brand":"text-white/90"}`,children:Se.title}),m.jsx("div",{className:"text-caption text-white/40 truncate mt-0.5",children:Se.repoName})]}),ve&&m.jsx("span",{className:"shrink-0 w-5 h-5 rounded-full bg-brand flex items-center justify-center",children:m.jsx(Vn,{className:"w-3 h-3 text-white"})})]})}),m.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:[m.jsxs("button",{onClick:Oe=>{Oe.stopPropagation(),N(null),D(null),fe.exportPack(Se.id).then(Ie=>{Ie!=null&&Ie.content&&Ie.fileName?(Fe(Ie.fileName,Ie.content),D(s("import.pack.exported",{path:Ie.fileName}))):Ie!=null&&Ie.path&&D(s("import.pack.exported",{path:Ie.path}))}).catch(Ie=>{N(Ie instanceof Error?Ie.message:String(Ie))})},"data-testid":"course-row-export",className:"text-caption text-white/40 hover:text-brand flex items-center gap-0.5",children:[m.jsx(dy,{className:"w-2.5 h-2.5"})," ",s("import.export")]}),m.jsxs("button",{onClick:Oe=>{Oe.stopPropagation();const Ie=Oe.currentTarget.getBoundingClientRect();i(Se.id,Se.title,Ie)},"data-testid":"course-row-delete",className:"text-caption text-white/40 hover:text-warning flex items-center gap-0.5",children:[m.jsx(NE,{className:"w-2.5 h-2.5"})," ",s("import.delete")]})]})]},Se.id)})}),m.jsxs("div",{className:e.length>0?"mt-6":"",children:[m.jsxs("button",{onClick:()=>f(!d),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 ${d?"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:[m.jsx(md,{className:`w-4 h-4 transition-transform ${d?"rotate-45":""}`})," ",s("import.cta")]}),d&&m.jsxs("div",{className:"mt-3 space-y-3",children:[A?m.jsxs("div",{className:"rounded-xl bg-black/30 border border-brand/30 p-4","data-testid":"import-progress",children:[m.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[m.jsx("span",{className:"inline-block w-4 h-4 border-2 border-brand border-t-transparent rounded-full animate-spin shrink-0"}),m.jsx("span",{className:"text-body font-bold text-white/90",children:s("import.progress.title")}),m.jsx("button",{onClick:()=>{fe.importCancel()},"data-testid":"import-cancel-btn",className:"ml-auto text-caption text-white/50 hover:text-warning transition-colors",children:s("import.progress.cancel")})]}),m.jsx("div",{className:"text-caption text-white/40 mb-2.5",children:s("import.progress.note")}),(l==="url"?p.trim():l==="markdown"&&_.trim())?m.jsx("div",{className:"text-caption text-white/40 font-mono truncate mb-2.5",children:l==="url"?p.trim():_.trim()}):null,m.jsx("div",{ref:Q,className:"space-y-1.5 max-h-[40vh] overflow-y-auto pr-1",children:B.length===0?m.jsx("div",{className:"text-caption text-white/50 py-1",children:s("import.progress.starting")}):B.map((Se,ve)=>m.jsxs("div",{className:"flex items-start gap-1.5 text-caption",children:[Se.status==="done"?m.jsx(Vn,{className:"w-3 h-3 text-brand shrink-0 mt-px"}):m.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"}),m.jsxs("span",{className:Se.status==="done"?"text-white/40":"text-white/90",children:[Se.msg,Se.status==="working"&&m.jsxs("span",{className:"text-white/35 ml-1",children:["(",s("import.progress.elapsed",{s:Math.floor((Date.now()-Se.ts)/1e3)}),")"]})]})]},ve))})]}):m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"@container flex gap-1 p-1 bg-white/5 rounded-lg",children:[{k:"url",label:s("import.tab.url"),icon:CC},{k:"markdown",label:s("import.tab.md"),icon:Il},{k:"folder",label:s("import.tab.folder"),icon:vC},{k:"epub",label:s("import.tab.epub"),icon:La},{k:"audio",label:s("import.tab.audio"),icon:ll},{k:"pack",label:s("import.tab.pack"),icon:dy}].map(({k:Se,label:ve,icon:Oe})=>m.jsxs("button",{onClick:()=>c(Se),className:`min-w-0 flex-1 flex items-center justify-center gap-0.5 py-1.5 px-0.5 rounded-md font-bold transition-colors ${l===Se?"bg-brand/15 text-brand":"text-white/50 hover:text-white/80"}`,children:[m.jsx(Oe,{className:"w-3 h-3 shrink-0"}),m.jsx("span",{className:"whitespace-nowrap",style:{fontSize:"clamp(0.75rem, 4cqi, 0.875rem)"},children:ve})]},Se))}),l==="url"?m.jsxs("section",{className:"space-y-2","data-testid":"import-url-section",children:[m.jsx("input",{type:"text",value:p,onChange:Se=>x(Se.target.value),placeholder:s("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"}),m.jsx("p",{className:"text-caption text-white/45 leading-relaxed",children:s("import.url.desc")}),m.jsx("button",{onClick:re,disabled:!p.trim()||A,"data-testid":"import-url-btn",className:"btn-3d-brand w-full px-3 py-2 text-body disabled:opacity-40",children:s("import.btn.url")})]}):l==="markdown"?m.jsxs("section",{className:"space-y-2","data-testid":"import-md-section",children:[m.jsx("input",{type:"text",value:_,onChange:Se=>L(Se.target.value),placeholder:s("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"}),m.jsx("textarea",{value:w,onChange:Se=>M(Se.target.value),placeholder:s("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"}),m.jsx("button",{onClick:F,disabled:!w.trim()||A,"data-testid":"import-md-btn",className:"btn-3d-brand w-full px-3 py-2 text-body disabled:opacity-40",children:s("import.btn.md")})]}):l==="folder"?m.jsxs("section",{className:"space-y-2","data-testid":"import-folder-section",children:[m.jsx("p",{className:"text-caption text-white/50 leading-relaxed",children:s("import.folder.desc")}),!ai&&m.jsx("input",{type:"text",value:b,onChange:Se=>g(Se.target.value),placeholder:s("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"}),m.jsx("button",{onClick:U,disabled:A||!ai&&!b.trim(),"data-testid":"import-folder-btn",className:"btn-3d-brand w-full px-3 py-2 text-body disabled:opacity-40",children:s("import.btn.folder")})]}):l==="epub"?m.jsxs("section",{className:"space-y-2","data-testid":"import-epub-section",children:[m.jsx("p",{className:"text-caption text-white/50 leading-relaxed",children:s("import.epub.desc")}),!ai&&m.jsx("input",{ref:E,type:"file",accept:".epub,application/epub+zip",className:"hidden","data-testid":"import-epub-file",onChange:Se=>{var ve;W((ve=Se.target.files)==null?void 0:ve[0]),Se.currentTarget.value=""}}),m.jsx("button",{onClick:Y,disabled:A,"data-testid":"import-epub-btn",className:"btn-3d-brand w-full px-3 py-2 text-body disabled:opacity-40",children:s("import.btn.epub")})]}):l==="audio"?m.jsxs("section",{className:"space-y-2","data-testid":"import-audio-section",children:[m.jsx("p",{className:"text-caption text-white/50 leading-relaxed",children:s("import.audio.desc")}),!ai&&m.jsx("input",{ref:T,type:"file",multiple:!0,accept:".wav,.mp3,.m4a,.flac,.aac,.ogg,.opus,audio/*",className:"hidden","data-testid":"import-audio-file",onChange:Se=>{me(Se.target.files),Se.currentTarget.value=""}}),m.jsx("button",{onClick:ne,disabled:A,"data-testid":"import-audio-btn",className:"btn-3d-brand w-full px-3 py-2 text-body disabled:opacity-40",children:s("import.btn.audio")})]}):m.jsxs("section",{className:"space-y-2","data-testid":"import-pack-section",children:[m.jsx("p",{className:"text-caption text-white/50 leading-relaxed",children:s("import.pack.desc")}),!ai&&m.jsx("input",{ref:y,type:"file",accept:".json,application/json",className:"hidden","data-testid":"import-pack-file",onChange:Se=>{var ve;J((ve=Se.target.files)==null?void 0:ve[0]),Se.currentTarget.value=""}}),m.jsx("button",{onClick:ae,disabled:A,"data-testid":"import-pack-btn",className:"btn-3d-brand w-full px-3 py-2 text-body disabled:opacity-40",children:s("import.btn.pack")})]})]}),j&&m.jsxs("div",{className:"border border-warning/40 text-warning-light text-label rounded-lg p-2 whitespace-pre-wrap","data-testid":"import-error",children:[j,P&&m.jsx("button",{onClick:()=>void Z(P),disabled:A,"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:s("import.error.resume")})]}),I&&m.jsxs("div",{className:"border border-brand/30 text-brand text-label rounded-lg p-2","data-testid":"import-success",children:[m.jsx(Vn,{className:"inline-block w-3.5 h-3.5 mr-1 align-[-3px]"}),I,(K==null?void 0:K.packable)&&m.jsx("button",{onClick:()=>void we(K.courseId),disabled:A,"data-testid":"import-export-pack-btn",className:"block mt-1.5 text-label font-bold hover:underline underline-offset-2 disabled:opacity-40",children:s("import.pack.export")})]})]})]})]})}function d5({scrollRef:e,navRef:t,preset:n}){const i=C.useRef(null);return C.useEffect(()=>{const o=i.current,s=e.current,l=t.current;return!o||!s||!l?void 0:a5(o,s,l,n)},[e,t,n]),m.jsx("canvas",{ref:i,className:"map-sky-canvas","aria-hidden":"true"})}function f5({scrollRef:e,navRef:t,preset:n,getImpacts:i,getFlakes:o,orbSnowRef:s}){const l=C.useRef(null);return C.useEffect(()=>{const c=l.current,d=t.current,f=e.current;if(!c||!d||!f)return;let p=null,x=null;const b=()=>{p=null,x=null},g=new MutationObserver(b);g.observe(f,{childList:!0,subtree:!0}),window.addEventListener("resize",b);const E=i5(c,d,n,()=>{var M,_;p||(p=Array.from(f.querySelectorAll(".lesson-bubble")));const T=x??d.getBoundingClientRect();x=T;const w=[];for(const L of p){const A=L.getBoundingClientRect();if(A.bottom<T.top||A.top>T.bottom)continue;const R=(M=L.closest("[data-node-id]"))==null?void 0:M.getAttribute("data-node-id"),j=R?(_=s==null?void 0:s.current)==null?void 0:_.get(R):void 0;w.push({x:A.left-T.left+A.width/2,y:A.top-T.top+A.height/2,r:A.width/2,...j!==void 0?{snow:j}:{}})}return w},i,o);return()=>{E(),g.disconnect(),window.removeEventListener("resize",b)}},[e,t,n,i,o]),m.jsx("canvas",{ref:l,className:"map-orb-weather-canvas","aria-hidden":"true"})}function h5({section:e,sectionIndex:t,tree:n,progressMap:i,selectedNodeId:o,dueNodeIds:s,onJumpNode:l,physics:c,physicsWeather:d,scrollRef:f,navRef:p,onImpacts:x,onFlakes:b,orbSnowRef:g}){const y=n.filter(J=>J.parentId===e.id).sort((J,ne)=>J.orderIdx-ne.orderIdx),E=y.filter(J=>J.type==="lesson"),T=E.length>0&&E.every(J=>{var ne;return(((ne=i[J.id])==null?void 0:ne.mastery)??0)>=RE}),w=C.useRef(null),[M,_]=C.useState(268);C.useEffect(()=>{if(!w.current)return;const J=()=>{var Z;const me=((Z=w.current)==null?void 0:Z.clientWidth)??268;_(me>0?me:268)};J();const ne=new ResizeObserver(J);return ne.observe(w.current),()=>ne.disconnect()},[]);const L=pN(y.length,M,e.id),A=L.height,R=110,j=76,N=C.useRef(null),I=C.useRef(new Map),D=C.useRef(0),P=C.useRef(null),z=C.useRef(0),K=y.map(J=>J.id).join(","),q=y.map(J=>{var ne;return(J.type==="exam"?!T:(((ne=i[J.id])==null?void 0:ne.status)??"locked")==="locked")?1:0}).join("");C.useEffect(()=>{var lt,st;if(!c||y.length===0||M<=0)return;const J=w.current,ne=f.current;if(!J||!ne)return;let me;const Z=y[y.length-1];if((Z==null?void 0:Z.type)==="exam"){const Ue=(st=(lt=J.closest("section"))==null?void 0:lt.nextElementSibling)==null?void 0:st.querySelector(".map-signpost");Ue&&(me={x:dc(`${e.id}:next`,M),y:Ue.getBoundingClientRect().top-J.getBoundingClientRect().top})}const we=ON({nodes:L.nodes.map((Ue,pe)=>{const Ce=y[pe];return{id:Ce.id,x:Ue.x,y:Ue.y,isExam:Ce.type==="exam",locked:B(Ce),spawn:(()=>{const je=I.current.get(Ce.id);return je?IN(je,D.current,M):void 0})()}}),width:M,height:L.height+40,weather:d,anchorKnotX:dc(`${e.id}:knot`,M),nextKnot:me});N.current=we;const Fe=J.querySelector("[data-next-knot]");Fe&&(we.nextKnot?(Fe.setAttribute("cx",String(we.nextKnot.x)),Fe.setAttribute("cy",String(we.nextKnot.y))):Fe.setAttribute("opacity","0"));const Se=J.querySelector("[data-exam-rope]");Se&&!we.nextKnot&&Se.setAttribute("opacity","0");const ve=new Map;for(const Ue of J.querySelectorAll("[data-node-id]"))Ue.dataset.nodeId&&ve.set(Ue.dataset.nodeId,Ue);const Oe=Array.from(J.querySelectorAll("[data-rope]")),Ie=Array.from(J.querySelectorAll("[data-pulse]")),$e=Array.from(J.querySelectorAll("[data-field]"));let Nt=!0;const Ot=new IntersectionObserver(Ue=>{for(const pe of Ue)Nt=pe.isIntersecting},{root:ne,rootMargin:"200px 0px 200px 0px"});Ot.observe(J);const Te=520,Ze=[];let rt=0,bt=performance.now();const gt=Ue=>{var at;rt=requestAnimationFrame(gt);const pe=Math.min(50,Ue-bt);if(bt=Ue,!Nt)return;we.step(pe);for(const Me of we.balls){const tt=ve.get(Me.nodeId);tt&&(tt.style.transform=kN(Me.body.position.x-Me.layoutX,Me.body.position.y-Me.layoutY,Me.squash,Me.squashAngle)),Me.squash=SN(Me.squash,pe),(at=g.current)==null||at.set(Me.nodeId,Me.snow)}const Ce=Me=>{if(Me==="__anchor")return we.anchor;if(Me==="__next")return we.nextKnot??we.anchor;const tt=we.ball(Me);if(tt)return{x:tt.body.position.x,y:tt.body.position.y+Ca*ri};const We=y.findIndex(qe=>qe.id===Me),se=We>=0?L.nodes[We]:void 0;return se?{x:se.x,y:se.y+Ca*ri}:{x:0,y:0}};for(let Me=0;Me<we.links.length&&Me<Oe.length;Me++){const tt=we.links[Me],We=[Ce(tt.from)];for(const se of tt.particles)We.push({x:se.position.x,y:se.position.y});We.push(Ce(tt.to)),Oe[Me].setAttribute("d",TN(We))}for(let Me=0;Me<we.balls.length&&Me<$e.length;Me++){const tt=we.balls[Me],We=$e[Me];tt.field>.03?(We.setAttribute("cx",String(tt.body.position.x)),We.setAttribute("cy",String(tt.body.position.y)),We.setAttribute("r",String(Ca+4+tt.field*5)),We.setAttribute("opacity",String((.3*tt.field).toFixed(3)))):We.setAttribute("opacity","0")}const je=we.drainImpacts();for(const Me of je)Ze.push({x:Me.x,y:Me.y,t0:Ue,s:Math.min(1,Me.speed/14)});for(let Me=Ze.length-1;Me>=0;Me--)Ue-Ze[Me].t0>Te&&Ze.splice(Me,1);for(let Me=0;Me<Ie.length;Me++){const tt=Ze[Me],We=Ie[Me];if(!tt){We.setAttribute("opacity","0");continue}const se=(Ue-tt.t0)/Te;We.setAttribute("cx",String(tt.x)),We.setAttribute("cy",String(tt.y)),We.setAttribute("r",String(6+se*(14+tt.s*14))),We.setAttribute("opacity",String(.55*(1-se))),We.setAttribute("stroke-width",String(2+tt.s*1.5))}const Le=we.drainFlakes();if((je.length>0||Le.length>0)&&p.current){const Me=J.getBoundingClientRect(),tt=p.current.getBoundingClientRect(),We=se=>({x:se.x+Me.left-tt.left,y:se.y+Me.top-tt.top});je.length>0&&x(je.map(se=>({...We(se),speed:se.speed}))),Le.length>0&&b(Le.map(se=>({...We(se),vx:se.vx,vy:se.vy,amount:se.amount})))}};return rt=requestAnimationFrame(gt),()=>{cancelAnimationFrame(rt),Ot.disconnect();for(const Ue of we.balls)I.current.set(Ue.nodeId,{x:Ue.body.position.x,y:Ue.body.position.y,vx:Ue.body.velocity.x,vy:Ue.body.velocity.y});D.current=M,we.dispose(),N.current=null;for(const Ue of ve.values())Ue.style.transform=""}},[c,M,K,q,e.id,d]);const B=J=>{var ne;return J?J.type==="exam"?!T:(((ne=i[J.id])==null?void 0:ne.status)??"locked")==="locked":!0},H=(J,ne)=>{if(!(!N.current||J.button!==0||B(y.find(we=>we.id===ne))||!w.current)){try{J.currentTarget.setPointerCapture(J.pointerId)}catch{}z.current=0,P.current={track:{startX:J.clientX,startY:J.clientY},id:J.pointerId,dragging:!1,nodeId:ne}}},G=J=>{const ne=P.current,me=N.current;if(!ne||!me||J.pointerId!==ne.id)return;const Z=w.current;if(!Z||(!ne.dragging&&gy(ne.track,J.clientX,J.clientY)==="drag"&&(ne.dragging=!0,J.currentTarget.style.zIndex="40",me.beginDrag(ne.nodeId,J.clientX-Z.getBoundingClientRect().left,J.clientY-Z.getBoundingClientRect().top)),!ne.dragging))return;const we=Z.getBoundingClientRect();me.moveDrag(J.clientX-we.left,J.clientY-we.top)},Q=J=>{var me;const ne=P.current;if(!(!ne||J.pointerId!==ne.id)){if((me=N.current)==null||me.endDrag(),J.currentTarget.style.zIndex="",gy(ne.track,J.clientX,J.clientY)==="drag")z.current=Date.now()+300;else{const Z=y.find(we=>we.id===ne.nodeId);Z&&Date.now()>=z.current&&!B(Z)&&l(Z.id)}P.current=null}},re=J=>{const ne=y[J],me=ne?i[ne.id]:void 0,Z=(me==null?void 0:me.status)==="mastered"||(me==null?void 0:me.status)==="in_progress"||(me==null?void 0:me.status)==="available";return{stroke:Z?"var(--brand)":"var(--ink-faint)",strokeWidth:Z?4:2.5,strokeOpacity:Z?.6:.5,strokeDasharray:Z?"none":"3 7"}},F=L.nodes[0]?{x:dc(`${e.id}:knot`,M),y:Kc}:{x:M/2,y:Kc},Y=y[y.length-1],W=(Y==null?void 0:Y.type)==="exam",U=L.nodes[L.nodes.length-1],ae=W&&U?{x:dc(`${e.id}:next`,M),y:A+24}:void 0;return m.jsxs("section",{"data-testid":`map-section-${e.id.slice(0,8)}`,className:"py-3 px-2",children:[m.jsxs("div",{className:"map-signpost flex items-center gap-2 mb-3 px-2.5 py-1.5 rounded-lg shadow-sm",children:[m.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}),m.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})]}),m.jsxs("div",{ref:w,className:"relative",style:{minHeight:A},children:[m.jsx("svg",{className:"absolute inset-0 w-full h-full pointer-events-none","aria-hidden":"true",style:{height:A,overflow:"visible"},children:c?m.jsxs(m.Fragment,{children:[L.nodes[0]&&m.jsx("circle",{cx:F.x,cy:F.y,r:3.5,fill:"#ffc800",opacity:.9}),L.nodes[0]&&m.jsx("path",{"data-rope":0,d:`M ${F.x} ${F.y} L ${L.nodes[0].x} ${L.nodes[0].y+Ca*ri}`,fill:"none",strokeLinecap:"round",strokeLinejoin:"round",style:re(0)}),L.segments.map((J,ne)=>m.jsx("path",{"data-rope":ne+1,d:`M ${J.from.x} ${J.from.y+Ca*ri} L ${J.to.x} ${J.to.y+Ca*ri}`,fill:"none",strokeLinecap:"round",strokeLinejoin:"round",style:re(J.index)},J.index)),ae&&U&&m.jsxs(m.Fragment,{children:[m.jsx("path",{"data-rope":L.segments.length+1,"data-exam-rope":!0,d:`M ${ae.x} ${ae.y} L ${U.x} ${U.y+Ca*ri}`,fill:"none",strokeLinecap:"round",strokeLinejoin:"round",style:re(y.length-1)}),m.jsx("circle",{"data-next-knot":!0,cx:ae.x,cy:ae.y,r:3.5,fill:"#ffc800",opacity:.9})]}),Array.from({length:8},(J,ne)=>m.jsx("circle",{"data-pulse":ne,cx:0,cy:0,r:0,fill:"none",stroke:"white",opacity:0},ne)),y.map((J,ne)=>m.jsx("circle",{"data-field":ne,cx:0,cy:0,r:0,fill:"none",stroke:"#1cb0f6",strokeWidth:2,opacity:0},`f-${J.id}`))]}):L.segments.map(J=>{const ne=m5(y[J.index],i);return m.jsx("path",{d:gN(J),stroke:ne?"var(--brand)":"var(--ink-faint)",strokeWidth:ne?4:2.5,strokeOpacity:ne?.6:.5,fill:"none",strokeLinecap:"round",strokeDasharray:ne?"none":"3 7",style:ne?{pathLength:1,animation:"path-draw 600ms var(--ease-out-expo)"}:void 0},J.index)})}),y.map((J,ne)=>{const me=L.nodes[ne];if(!me)return null;const Z=p0(J.id),we=`${Z%40/10}s`,Fe=`${5+Z%30/10}s`;return m.jsx("div",{"data-node-id":J.id,"data-noswipe":"",className:c?`absolute hover:z-30 will-change-transform ${B(J)?"cursor-not-allowed":"cursor-grab active:cursor-grabbing"}`:"absolute balloon-bob hover:z-30",style:{left:me.x-R/2,top:me.y-j/2+10,width:R,...c?{touchAction:"pan-y"}:{"--bob-delay":we,"--bob-duration":Fe}},onPointerDown:c?Se=>H(Se,J.id):void 0,onPointerMove:c?G:void 0,onPointerUp:c?Q:void 0,onPointerCancel:c?Q:void 0,children:m.jsx(p5,{lesson:J,progress:i[J.id],isSelected:J.id===o,isDue:s.has(J.id),chapterLessonsMastered:T,onClick:()=>{Date.now()<z.current||l(J.id)}})},J.id)})]})]})}function m5(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 p5({lesson:e,progress:t,isSelected:n,isDue:i,chapterLessonsMastered:o,onClick:s}){const l=Xe(),c=(t==null?void 0:t.status)??"locked",d=(t==null?void 0:t.crownLevel)??0,f=e.type==="exam",p=Math.min(3,d),x=f?!o:c==="locked",b=f&&x,g=!f&&(c==="in_progress"||c==="mastered"),y=c==="mastered"?100:c==="in_progress"?Math.round(((t==null?void 0:t.mastery)??0)*100):0;return m.jsxs("div",{className:"group relative flex flex-col items-center w-full",children:[m.jsxs("button",{onClick:()=>!x&&s(),disabled:x,"data-testid":`${f?"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 ${f?b?"lesson-bubble exam-bubble-locked":x5(d>0):g5(c)} ${x?"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":b?`🔒 ${e.title}${l("node.locked.chapterHint")}`:f?`🎯 ${e.title}`:x?`🔒 ${e.title}`:i?`📖 ${e.title}${l("node.due.hint")}`:e.title,children:[g&&m.jsxs("svg",{className:"absolute inset-0 w-full h-full -rotate-90 pointer-events-none",viewBox:"0 0 56 56","aria-hidden":"true",children:[m.jsx("circle",{cx:"28",cy:"28",r:"25",fill:"none",stroke:"rgb(255 255 255 / 0.2)",strokeWidth:"2.5"}),m.jsx("circle",{cx:"28",cy:"28",r:"25",fill:"none",stroke:c==="mastered"?"#ffc800":"white",strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${y/100*157} 157`,className:"transition-all duration-500"})]}),f?b?m.jsx("span",{"aria-label":"exam-locked",className:"relative z-10 opacity-60",children:"🔒"}):m.jsx(Is,{"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}):x?m.jsx("span",{"aria-label":"locked",className:"relative z-10 opacity-50",children:"🔒"}):c==="mastered"?m.jsx("span",{"aria-label":"mastered",className:"relative z-10 drop-shadow-lg crown-sparkle",children:"👑"}):c==="in_progress"?m.jsx(La,{"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}):m.jsx("span",{"aria-label":"available",className:"relative z-10 drop-shadow",children:"⭐"}),i&&!x&&!f&&m.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:"!"})]}),f&&m.jsx("div",{className:"flex gap-0.5 mt-1","data-testid":`map-stars-${e.id.slice(0,8)}`,children:[0,1,2].map(E=>m.jsx("span",{className:`text-caption ${E<p?"text-gold":"text-white/25"}`,children:"★"},E))}),n&&m.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 g5(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 x5(e){return e?"lesson-bubble exam-bubble-passed":"lesson-bubble exam-bubble"}function b5({available:e,current:t,onChange:n}){const i=Xe(),[o,s]=C.useState(!1),l={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"},c=t?l[t]??t:i("lang.original");return m.jsxs("div",{className:"relative shrink-0",children:[m.jsxs("button",{onClick:()=>s(!o),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:[m.jsx(TC,{className:"w-3 h-3"}),c]}),o&&m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>s(!1)}),m.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:[m.jsx("button",{"data-testid":"lang-option-original",onClick:()=>{n(null),s(!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:i("lang.original")}),e.map(d=>m.jsx("button",{"data-testid":`lang-option-${d}`,onClick:()=>{n(d),s(!1)},className:`w-full text-left px-2 py-1 rounded-md text-caption font-bold transition-colors ${t===d?"bg-brand/15 text-brand":"text-ink-muted hover:bg-neutral-100 dark:hover:bg-neutral-800"}`,children:l[d]??d},d))]})]})]})}const y5=500,xr=8;function v5(){const[e,t]=C.useState(null),[n,i]=C.useState({mode:"cursor",x:0,y:0}),[o,s]=C.useState({w:0,h:0}),l=C.useRef(null),c=C.useCallback(()=>window.matchMedia("(pointer: coarse)").matches,[]),d=C.useCallback(T=>{c()||i(w=>w.mode==="cursor"?{...w,x:T.clientX,y:T.clientY}:w)},[c]),f=C.useCallback(T=>{var _;if(c())return;const w=(_=T.target)==null?void 0:_.closest("[data-tooltip]"),M=w==null?void 0:w.getAttribute("data-tooltip");if(M){t(M),i({mode:"cursor",x:T.clientX,y:T.clientY});return}t(null)},[c]),p=C.useCallback(T=>{var M,_;if(c())return;((_=(M=T.target)==null?void 0:M.closest)==null?void 0:_.call(M,"[data-tooltip]"))&&t(null)},[c]);if(C.useEffect(()=>(document.addEventListener("mousemove",d,{passive:!0}),document.addEventListener("mouseover",f,{passive:!0}),document.addEventListener("mouseout",p,{passive:!0}),()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseover",f),document.removeEventListener("mouseout",p)}),[d,f,p]),C.useEffect(()=>{let T=null;const w=()=>{T&&(clearTimeout(T),T=null)},M=R=>{var D;if(!c()||R.touches.length!==1)return w();const j=(D=R.target)==null?void 0:D.closest("[data-tooltip]"),N=j==null?void 0:j.getAttribute("data-tooltip");if(!N||!j)return w();const I=j;w(),T=setTimeout(()=>{I.isConnected&&(t(N),i({mode:"rect",x:0,y:0,rect:I.getBoundingClientRect()}))},y5)},_=()=>{w(),t(R=>R&&null)},L=()=>w(),A=()=>{w(),t(null)};return document.addEventListener("touchstart",M,{passive:!0}),document.addEventListener("touchend",_,{passive:!0}),document.addEventListener("touchmove",L,{passive:!0}),document.addEventListener("touchcancel",A,{passive:!0}),()=>{w(),document.removeEventListener("touchstart",M),document.removeEventListener("touchend",_),document.removeEventListener("touchmove",L),document.removeEventListener("touchcancel",A)}},[c]),C.useLayoutEffect(()=>{l.current&&e&&s({w:l.current.offsetWidth,h:l.current.offsetHeight})},[e]),!e)return null;const x=window.innerWidth,b=window.innerHeight;let g,y,E;if(n.mode==="rect"&&n.rect){const T=n.rect;g=T.left+T.width/2-o.w/2,y=T.top-o.h-6,E="none",y<xr&&(y=T.bottom+6)}else g=n.x,y=n.y-6,E="translate(0, -100%)";return g=Math.min(Math.max(g,xr),Math.max(xr,x-o.w-xr)),y=Math.min(Math.max(y,xr),Math.max(xr,b-o.h-xr)),hp.createPortal(m.jsx("div",{ref:l,style:{position:"fixed",left:g,top:y,transform:E,zIndex:99999,pointerEvents:"none",visibility:o.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 ky(e){const t=[],n=String(e||"");let i=n.indexOf(","),o=0,s=!1;for(;!s;){i===-1&&(i=n.length,s=!0);const l=n.slice(o,i).trim();(l||!s)&&t.push(l),o=i+1,i=n.indexOf(",",o)}return t}function VE(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const E5=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,T5=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,S5={};function wy(e,t){return(S5.jsx?T5:E5).test(e)}const k5=/[ \t\n\f\r]/g;function w5(e){return typeof e=="object"?e.type==="text"?Ay(e.value):!1:Ay(e)}function Ay(e){return e.replace(k5,"")===""}class Bl{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}Bl.prototype.normal={};Bl.prototype.property={};Bl.prototype.space=void 0;function qE(e,t){const n={},i={};for(const o of e)Object.assign(n,o.property),Object.assign(i,o.normal);return new Bl(n,i,t)}function Al(e){return e.toLowerCase()}class Ln{constructor(t,n){this.attribute=n,this.property=t}}Ln.prototype.attribute="";Ln.prototype.booleanish=!1;Ln.prototype.boolean=!1;Ln.prototype.commaOrSpaceSeparated=!1;Ln.prototype.commaSeparated=!1;Ln.prototype.defined=!1;Ln.prototype.mustUseProperty=!1;Ln.prototype.number=!1;Ln.prototype.overloadedBoolean=!1;Ln.prototype.property="";Ln.prototype.spaceSeparated=!1;Ln.prototype.space=void 0;let A5=0;const Ke=Br(),en=Br(),x0=Br(),_e=Br(),Mt=Br(),Rr=Br(),Fn=Br();function Br(){return 2**++A5}const b0=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ke,booleanish:en,commaOrSpaceSeparated:Fn,commaSeparated:Rr,number:_e,overloadedBoolean:x0,spaceSeparated:Mt},Symbol.toStringTag,{value:"Module"})),hm=Object.keys(b0);class gp extends Ln{constructor(t,n,i,o){let s=-1;if(super(t,n),Cy(this,"space",o),typeof i=="number")for(;++s<hm.length;){const l=hm[s];Cy(this,hm[s],(i&b0[l])===b0[l])}}}gp.prototype.defined=!0;function Cy(e,t,n){n&&(e[t]=n)}function Vs(e){const t={},n={};for(const[i,o]of Object.entries(e.properties)){const s=new gp(i,e.transform(e.attributes||{},i),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(s.mustUseProperty=!0),t[i]=s,n[Al(i)]=i,n[Al(s.attribute)]=i}return new Bl(t,n,e.space)}const YE=Vs({properties:{ariaActiveDescendant:null,ariaAtomic:en,ariaAutoComplete:null,ariaBusy:en,ariaChecked:en,ariaColCount:_e,ariaColIndex:_e,ariaColSpan:_e,ariaControls:Mt,ariaCurrent:null,ariaDescribedBy:Mt,ariaDetails:null,ariaDisabled:en,ariaDropEffect:Mt,ariaErrorMessage:null,ariaExpanded:en,ariaFlowTo:Mt,ariaGrabbed:en,ariaHasPopup:null,ariaHidden:en,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Mt,ariaLevel:_e,ariaLive:null,ariaModal:en,ariaMultiLine:en,ariaMultiSelectable:en,ariaOrientation:null,ariaOwns:Mt,ariaPlaceholder:null,ariaPosInSet:_e,ariaPressed:en,ariaReadOnly:en,ariaRelevant:null,ariaRequired:en,ariaRoleDescription:Mt,ariaRowCount:_e,ariaRowIndex:_e,ariaRowSpan:_e,ariaSelected:en,ariaSetSize:_e,ariaSort:null,ariaValueMax:_e,ariaValueMin:_e,ariaValueNow:_e,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function GE(e,t){return t in e?e[t]:t}function XE(e,t){return GE(e,t.toLowerCase())}const C5=Vs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Rr,acceptCharset:Mt,accessKey:Mt,action:null,allow:null,allowFullScreen:Ke,allowPaymentRequest:Ke,allowUserMedia:Ke,alpha:Ke,alt:null,as:null,async:Ke,autoCapitalize:null,autoComplete:Mt,autoFocus:Ke,autoPlay:Ke,blocking:Mt,capture:null,charSet:null,checked:Ke,cite:null,className:Mt,closedBy:null,colorSpace:null,cols:_e,colSpan:_e,command:null,commandFor:null,content:null,contentEditable:en,controls:Ke,controlsList:Mt,coords:_e|Rr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ke,defer:Ke,dir:null,dirName:null,disabled:Ke,download:x0,draggable:en,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ke,formTarget:null,headers:Mt,height:_e,hidden:x0,high:_e,href:null,hrefLang:null,htmlFor:Mt,httpEquiv:Mt,id:null,imageSizes:null,imageSrcSet:null,inert:Ke,inputMode:null,integrity:null,is:null,isMap:Ke,itemId:null,itemProp:Mt,itemRef:Mt,itemScope:Ke,itemType:Mt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ke,low:_e,manifest:null,max:null,maxLength:_e,media:null,method:null,min:null,minLength:_e,multiple:Ke,muted:Ke,name:null,nonce:null,noModule:Ke,noValidate:Ke,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:Ke,optimum:_e,pattern:null,ping:Mt,placeholder:null,playsInline:Ke,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ke,referrerPolicy:null,rel:Mt,required:Ke,reversed:Ke,rows:_e,rowSpan:_e,sandbox:Mt,scope:null,scoped:Ke,seamless:Ke,selected:Ke,shadowRootClonable:Ke,shadowRootCustomElementRegistry:Ke,shadowRootDelegatesFocus:Ke,shadowRootMode:null,shadowRootSerializable:Ke,shape:null,size:_e,sizes:null,slot:null,span:_e,spellCheck:en,src:null,srcDoc:null,srcLang:null,srcSet:null,start:_e,step:null,style:null,tabIndex:_e,target:null,title:null,translate:null,type:null,typeMustMatch:Ke,useMap:null,value:en,width:_e,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Mt,axis:null,background:null,bgColor:null,border:_e,borderColor:null,bottomMargin:_e,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ke,declare:Ke,event:null,face:null,frame:null,frameBorder:null,hSpace:_e,leftMargin:_e,link:null,longDesc:null,lowSrc:null,marginHeight:_e,marginWidth:_e,noResize:Ke,noHref:Ke,noShade:Ke,noWrap:Ke,object:null,profile:null,prompt:null,rev:null,rightMargin:_e,rules:null,scheme:null,scrolling:en,standby:null,summary:null,text:null,topMargin:_e,valueType:null,version:null,vAlign:null,vLink:null,vSpace:_e,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ke,disablePictureInPicture:Ke,disableRemotePlayback:Ke,exportParts:Rr,part:Mt,prefix:null,property:null,results:_e,security:null,unselectable:null},space:"html",transform:XE}),N5=Vs({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:Fn,accentHeight:_e,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:_e,amplitude:_e,arabicForm:null,ascent:_e,attributeName:null,attributeType:null,azimuth:_e,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:_e,by:null,calcMode:null,capHeight:_e,className:Mt,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:_e,diffuseConstant:_e,direction:null,display:null,dur:null,divisor:_e,dominantBaseline:null,download:Ke,dx:null,dy:null,edgeMode:null,editable:null,elevation:_e,enableBackground:null,end:null,event:null,exponent:_e,externalResourcesRequired:null,fill:null,fillOpacity:_e,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:Rr,g2:Rr,glyphName:Rr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:_e,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:_e,horizOriginX:_e,horizOriginY:_e,id:null,ideographic:_e,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:_e,k:_e,k1:_e,k2:_e,k3:_e,k4:_e,kernelMatrix:Fn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:_e,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:_e,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:_e,overlineThickness:_e,paintOrder:null,panose1:null,path:null,pathLength:_e,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Mt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:_e,pointsAtY:_e,pointsAtZ:_e,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Fn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Fn,rev:Fn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Fn,requiredFeatures:Fn,requiredFonts:Fn,requiredFormats:Fn,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:_e,specularExponent:_e,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:_e,strikethroughThickness:_e,string:null,stroke:null,strokeDashArray:Fn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:_e,strokeOpacity:_e,strokeWidth:null,style:null,surfaceScale:_e,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Fn,tabIndex:_e,tableValues:null,target:null,targetX:_e,targetY:_e,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Fn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:_e,underlineThickness:_e,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:_e,values:null,vAlphabetic:_e,vMathematical:_e,vectorEffect:null,vHanging:_e,vIdeographic:_e,version:null,vertAdvY:_e,vertOriginX:_e,vertOriginY:_e,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:_e,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:GE}),KE=Vs({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()}}),$E=Vs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:XE}),QE=Vs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),_5={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"},M5=/[A-Z]/g,Ny=/-[a-z]/g,R5=/^data[-\w.:]+$/i;function yd(e,t){const n=Al(t);let i=t,o=Ln;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&R5.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(Ny,L5);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!Ny.test(s)){let l=s.replace(M5,D5);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}o=gp}return new o(i,t)}function D5(e){return"-"+e.toLowerCase()}function L5(e){return e.charAt(1).toUpperCase()}const zl=qE([YE,C5,KE,$E,QE],"html"),Yi=qE([YE,N5,KE,$E,QE],"svg");function _y(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function WE(e){return e.join(" ").trim()}var ws={},mm,My;function O5(){if(My)return mm;My=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
|
|
520
|
-
`,f="/",p="*",x="",b="comment",g="declaration";function y(T,w){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];w=w||{};var M=1,_=1;function L(q){var B=q.match(t);B&&(M+=B.length);var H=q.lastIndexOf(d);_=~H?q.length-H:_+q.length}function A(){var q={line:M,column:_};return function(B){return B.position=new R(q),I(),B}}function R(q){this.start=q,this.end={line:M,column:_},this.source=w.source}R.prototype.content=T;function j(q){var B=new Error(w.source+":"+M+":"+_+": "+q);if(B.reason=q,B.filename=w.source,B.line=M,B.column=_,B.source=T,!w.silent)throw B}function N(q){var B=q.exec(T);if(B){var H=B[0];return L(H),T=T.slice(H.length),B}}function I(){N(n)}function D(q){var B;for(q=q||[];B=P();)B!==!1&&q.push(B);return q}function P(){var q=A();if(!(f!=T.charAt(0)||p!=T.charAt(1))){for(var B=2;x!=T.charAt(B)&&(p!=T.charAt(B)||f!=T.charAt(B+1));)++B;if(B+=2,x===T.charAt(B-1))return j("End of comment missing");var H=T.slice(2,B-2);return _+=2,L(H),T=T.slice(B),_+=2,q({type:b,comment:H})}}function z(){var q=A(),B=N(i);if(B){if(P(),!N(o))return j("property missing ':'");var H=N(s),G=q({type:g,property:E(B[0].replace(e,x)),value:H?E(H[0].replace(e,x)):x});return N(l),G}}function K(){var q=[];D(q);for(var B;B=z();)B!==!1&&(q.push(B),D(q));return q}return I(),K()}function E(T){return T?T.replace(c,x):x}return mm=y,mm}var Ry;function I5(){if(Ry)return ws;Ry=1;var e=ws&&ws.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ws,"__esModule",{value:!0}),ws.default=n;const t=e(O5());function n(i,o){let s=null;if(!i||typeof i!="string")return s;const l=(0,t.default)(i),c=typeof o=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:p}=d;c?o(f,p,d):p&&(s=s||{},s[f]=p)}),s}return ws}var $o={},Dy;function j5(){if(Dy)return $o;Dy=1,Object.defineProperty($o,"__esModule",{value:!0}),$o.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,s=function(f){return!f||n.test(f)||e.test(f)},l=function(f,p){return p.toUpperCase()},c=function(f,p){return"".concat(p,"-")},d=function(f,p){return p===void 0&&(p={}),s(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(o,c):f=f.replace(i,c),f.replace(t,l))};return $o.camelCase=d,$o}var Qo,Ly;function P5(){if(Ly)return Qo;Ly=1;var e=Qo&&Qo.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(I5()),n=j5();function i(o,s){var l={};return!o||typeof o!="string"||(0,t.default)(o,function(c,d){c&&d&&(l[(0,n.camelCase)(c,s)]=d)}),l}return i.default=i,Qo=i,Qo}var B5=P5();const z5=Ol(B5),vd=ZE("end"),Ia=ZE("start");function ZE(e){return t;function t(n){const i=n&&n.position&&n.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function JE(e){const t=Ia(e),n=vd(e);if(t&&n)return{start:t,end:n}}function cl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Oy(e.position):"start"in e||"end"in e?Oy(e):"line"in e||"column"in e?y0(e):""}function y0(e){return Iy(e&&e.line)+":"+Iy(e&&e.column)}function Oy(e){return y0(e&&e.start)+"-"+y0(e&&e.end)}function Iy(e){return e&&typeof e=="number"?e:1}class bn extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let o="",s={},l=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?o=t:!s.cause&&t&&(l=!0,o=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof i=="string"){const d=i.indexOf(":");d===-1?s.ruleId=i:(s.source=i.slice(0,d),s.ruleId=i.slice(d+1))}if(!s.place&&s.ancestors&&s.ancestors){const d=s.ancestors[s.ancestors.length-1];d&&(s.place=d.position)}const c=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=c?c.line:void 0,this.name=cl(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=l&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}bn.prototype.file="";bn.prototype.name="";bn.prototype.reason="";bn.prototype.message="";bn.prototype.stack="";bn.prototype.column=void 0;bn.prototype.line=void 0;bn.prototype.ancestors=void 0;bn.prototype.cause=void 0;bn.prototype.fatal=void 0;bn.prototype.place=void 0;bn.prototype.ruleId=void 0;bn.prototype.source=void 0;const xp={}.hasOwnProperty,U5=new Map,H5=/[A-Z]/g,F5=new Set(["table","tbody","thead","tfoot","tr"]),V5=new Set(["td","th"]),eT="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function q5(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=Z5(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");i=W5(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,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"?Yi:zl,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=tT(o,e,void 0);return s&&typeof s!="string"?s:o.create(e,o.Fragment,{children:s||void 0},void 0)}function tT(e,t,n){if(t.type==="element")return Y5(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return G5(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return K5(e,t,n);if(t.type==="mdxjsEsm")return X5(e,t);if(t.type==="root")return $5(e,t,n);if(t.type==="text")return Q5(e,t)}function Y5(e,t,n){const i=e.schema;let o=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(o=Yi,e.schema=o),e.ancestors.push(t);const s=aT(e,t.tagName,!1),l=J5(e,t);let c=yp(e,t);return F5.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!w5(d):!0})),nT(e,l,s,t),bp(l,c),e.ancestors.pop(),e.schema=i,e.create(t,s,l,n)}function G5(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}Cl(e,t.position)}function X5(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Cl(e,t.position)}function K5(e,t,n){const i=e.schema;let o=i;t.name==="svg"&&i.space==="html"&&(o=Yi,e.schema=o),e.ancestors.push(t);const s=t.name===null?e.Fragment:aT(e,t.name,!0),l=e_(e,t),c=yp(e,t);return nT(e,l,s,t),bp(l,c),e.ancestors.pop(),e.schema=i,e.create(t,s,l,n)}function $5(e,t,n){const i={};return bp(i,yp(e,t)),e.create(t,e.Fragment,i,n)}function Q5(e,t){return t.value}function nT(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function bp(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function W5(e,t,n){return i;function i(o,s,l,c){const f=Array.isArray(l.children)?n:t;return c?f(s,l,c):f(s,l)}}function Z5(e,t){return n;function n(i,o,s,l){const c=Array.isArray(s.children),d=Ia(i);return t(o,s,l,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function J5(e,t){const n={};let i,o;for(o in t.properties)if(o!=="children"&&xp.call(t.properties,o)){const s=t_(e,o,t.properties[o]);if(s){const[l,c]=s;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&V5.has(t.tagName)?i=c:n[l]=c}}if(i){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function e_(e,t){const n={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const s=i.data.estree.body[0];s.type;const l=s.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Cl(e,t.position);else{const o=i.name;let s;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const c=i.value.data.estree.body[0];c.type,s=e.evaluater.evaluateExpression(c.expression)}else Cl(e,t.position);else s=i.value===null?!0:i.value;n[o]=s}return n}function yp(e,t){const n=[];let i=-1;const o=e.passKeys?new Map:U5;for(;++i<t.children.length;){const s=t.children[i];let l;if(e.passKeys){const d=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(d){const f=o.get(d)||0;l=d+"-"+f,o.set(d,f+1)}}const c=tT(e,s,l);c!==void 0&&n.push(c)}return n}function t_(e,t,n){const i=yd(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?VE(n):WE(n)),i.property==="style"){let o=typeof n=="object"?n:n_(e,String(n));return e.stylePropertyNameCase==="css"&&(o=a_(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&i.space?_5[i.property]||i.property:i.attribute,n]}}function n_(e,t){try{return z5(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const i=n,o=new bn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=eT+"#cannot-parse-style-attribute",o}}function aT(e,t,n){let i;if(!n)i={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let s=-1,l;for(;++s<o.length;){const c=wy(o[s])?{type:"Identifier",name:o[s]}:{type:"Literal",value:o[s]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(s&&c.type==="Literal"),optional:!1}:c}i=l}else i=wy(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const o=i.value;return xp.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(i);Cl(e)}function Cl(e,t){const n=new bn("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=eT+"#cannot-handle-mdx-estrees-without-createevaluater",n}function a_(e){const t={};let n;for(n in e)xp.call(e,n)&&(t[i_(n)]=e[n]);return t}function i_(e){let t=e.replace(H5,r_);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function r_(e){return"-"+e.toLowerCase()}const pm={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"]},s_={};function vp(e,t){const n=s_,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return iT(e,i,o)}function iT(e,t,n){if(o_(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 jy(e.children,t,n)}return Array.isArray(e)?jy(e,t,n):""}function jy(e,t,n){const i=[];let o=-1;for(;++o<e.length;)i[o]=iT(e[o],t,n);return i.join("")}function o_(e){return!!(e&&typeof e=="object")}const Py=document.createElement("i");function Ep(e){const t="&"+e+";";Py.innerHTML=t;const n=Py.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function qn(e,t,n,i){const o=e.length;let s=0,l;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,i.length<1e4)l=Array.from(i),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);s<i.length;)l=i.slice(s,s+1e4),l.unshift(t,0),e.splice(...l),s+=1e4,t+=1e4}function aa(e,t){return e.length>0?(qn(e,e.length,0,t),e):t}const By={}.hasOwnProperty;function rT(e){const t={};let n=-1;for(;++n<e.length;)l_(t,e[n]);return t}function l_(e,t){let n;for(n in t){const o=(By.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let l;if(s)for(l in s){By.call(o,l)||(o[l]=[]);const c=s[l];u_(o[l],Array.isArray(c)?c:c?[c]:[])}}}function u_(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);qn(e,0,0,i)}function sT(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 xa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const En=Gi(/[A-Za-z]/),xn=Gi(/[\dA-Za-z]/),c_=Gi(/[#-'*+\--9=?A-Z^-~]/);function $c(e){return e!==null&&(e<32||e===127)}const v0=Gi(/\d/),d_=Gi(/[\dA-Fa-f]/),f_=Gi(/[!-/:-@[-`{-~]/);function Ye(e){return e!==null&&e<-2}function Lt(e){return e!==null&&(e<0||e===32)}function dt(e){return e===-2||e===-1||e===32}const Ed=Gi(new RegExp("\\p{P}|\\p{S}","u")),jr=Gi(/\s/);function Gi(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function qs(e){const t=[];let n=-1,i=0,o=0;for(;++n<e.length;){const s=e.charCodeAt(n);let l="";if(s===37&&xn(e.charCodeAt(n+1))&&xn(e.charCodeAt(n+2)))o=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(l=String.fromCharCode(s));else if(s>55295&&s<57344){const c=e.charCodeAt(n+1);s<56320&&c>56319&&c<57344?(l=String.fromCharCode(s,c),o=1):l="�"}else l=String.fromCharCode(s);l&&(t.push(e.slice(i,n),encodeURIComponent(l)),i=n+o+1,l=""),o&&(n+=o,o=0)}return t.join("")+e.slice(i)}function pt(e,t,n,i){const o=i?i-1:Number.POSITIVE_INFINITY;let s=0;return l;function l(d){return dt(d)?(e.enter(n),c(d)):t(d)}function c(d){return dt(d)&&s++<o?(e.consume(d),c):(e.exit(n),t(d))}}const h_={tokenize:m_};function m_(e){const t=e.attempt(this.parser.constructs.contentInitial,i,o);let n;return t;function i(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),pt(e,t,"linePrefix")}function o(c){return e.enter("paragraph"),s(c)}function s(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return Ye(c)?(e.consume(c),e.exit("chunkText"),s):(e.consume(c),l)}}const p_={tokenize:g_},zy={tokenize:x_};function g_(e){const t=this,n=[];let i=0,o,s,l;return c;function c(_){if(i<n.length){const L=n[i];return t.containerState=L[1],e.attempt(L[0].continuation,d,f)(_)}return f(_)}function d(_){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&M();const L=t.events.length;let A=L,R;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){R=t.events[A][1].end;break}w(i);let j=L;for(;j<t.events.length;)t.events[j][1].end={...R},j++;return qn(t.events,A+1,0,t.events.slice(L)),t.events.length=j,f(_)}return c(_)}function f(_){if(i===n.length){if(!o)return b(_);if(o.currentConstruct&&o.currentConstruct.concrete)return y(_);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(zy,p,x)(_)}function p(_){return o&&M(),w(i),b(_)}function x(_){return t.parser.lazy[t.now().line]=i!==n.length,l=t.now().offset,y(_)}function b(_){return t.containerState={},e.attempt(zy,g,y)(_)}function g(_){return i++,n.push([t.currentConstruct,t.containerState]),b(_)}function y(_){if(_===null){o&&M(),w(0),e.consume(_);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:s}),E(_)}function E(_){if(_===null){T(e.exit("chunkFlow"),!0),w(0),e.consume(_);return}return Ye(_)?(e.consume(_),T(e.exit("chunkFlow")),i=0,t.interrupt=void 0,c):(e.consume(_),E)}function T(_,L){const A=t.sliceStream(_);if(L&&A.push(null),_.previous=s,s&&(s.next=_),s=_,o.defineSkip(_.start),o.write(A),t.parser.lazy[_.start.line]){let R=o.events.length;for(;R--;)if(o.events[R][1].start.offset<l&&(!o.events[R][1].end||o.events[R][1].end.offset>l))return;const j=t.events.length;let N=j,I,D;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){if(I){D=t.events[N][1].end;break}I=!0}for(w(i),R=j;R<t.events.length;)t.events[R][1].end={...D},R++;qn(t.events,N+1,0,t.events.slice(j)),t.events.length=R}}function w(_){let L=n.length;for(;L-- >_;){const A=n[L];t.containerState=A[1],A[0].exit.call(t,e)}n.length=_}function M(){o.write([null]),s=void 0,o=void 0,t.containerState._closeFlow=void 0}}function x_(e,t,n){return pt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Bs(e){if(e===null||Lt(e)||jr(e))return 1;if(Ed(e))return 2}function Td(e,t,n){const i=[];let o=-1;for(;++o<e.length;){const s=e[o].resolveAll;s&&!i.includes(s)&&(t=s(t,n),i.push(s))}return t}const E0={name:"attention",resolveAll:b_,tokenize:y_};function b_(e,t){let n=-1,i,o,s,l,c,d,f,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(i=n;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const x={...e[i][1].end},b={...e[n][1].start};Uy(x,-d),Uy(b,d),l={type:d>1?"strongSequence":"emphasisSequence",start:x,end:{...e[i][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},s={type:d>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},o={type:d>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[i][1].end={...l.start},e[n][1].start={...c.end},f=[],e[i][1].end.offset-e[i][1].start.offset&&(f=aa(f,[["enter",e[i][1],t],["exit",e[i][1],t]])),f=aa(f,[["enter",o,t],["enter",l,t],["exit",l,t],["enter",s,t]]),f=aa(f,Td(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),f=aa(f,[["exit",s,t],["enter",c,t],["exit",c,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=aa(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,qn(e,i-1,n-i+3,f),n=i+f.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function y_(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,o=Bs(i);let s;return l;function l(d){return s=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===s)return e.consume(d),c;const f=e.exit("attentionSequence"),p=Bs(d),x=!p||p===2&&o||n.includes(d),b=!o||o===2&&p||n.includes(i);return f._open=!!(s===42?x:x&&(o||!b)),f._close=!!(s===42?b:b&&(p||!x)),t(d)}}function Uy(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const v_={name:"autolink",tokenize:E_};function E_(e,t,n){let i=0;return o;function o(g){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(g){return En(g)?(e.consume(g),l):g===64?n(g):f(g)}function l(g){return g===43||g===45||g===46||xn(g)?(i=1,c(g)):f(g)}function c(g){return g===58?(e.consume(g),i=0,d):(g===43||g===45||g===46||xn(g))&&i++<32?(e.consume(g),c):(i=0,f(g))}function d(g){return g===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):g===null||g===32||g===60||$c(g)?n(g):(e.consume(g),d)}function f(g){return g===64?(e.consume(g),p):c_(g)?(e.consume(g),f):n(g)}function p(g){return xn(g)?x(g):n(g)}function x(g){return g===46?(e.consume(g),i=0,p):g===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):b(g)}function b(g){if((g===45||xn(g))&&i++<63){const y=g===45?b:x;return e.consume(g),y}return n(g)}}const Ul={partial:!0,tokenize:T_};function T_(e,t,n){return i;function i(s){return dt(s)?pt(e,o,"linePrefix")(s):o(s)}function o(s){return s===null||Ye(s)?t(s):n(s)}}const oT={continuation:{tokenize:k_},exit:w_,name:"blockQuote",tokenize:S_};function S_(e,t,n){const i=this;return o;function o(l){if(l===62){const c=i.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),s}return n(l)}function s(l){return dt(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function k_(e,t,n){const i=this;return o;function o(l){return dt(l)?pt(e,s,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):s(l)}function s(l){return e.attempt(oT,t,n)(l)}}function w_(e){e.exit("blockQuote")}const lT={name:"characterEscape",tokenize:A_};function A_(e,t,n){return i;function i(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),o}function o(s){return f_(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const uT={name:"characterReference",tokenize:C_};function C_(e,t,n){const i=this;let o=0,s,l;return c;function c(x){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),d}function d(x){return x===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(x),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),s=31,l=xn,p(x))}function f(x){return x===88||x===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(x),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,l=d_,p):(e.enter("characterReferenceValue"),s=7,l=v0,p(x))}function p(x){if(x===59&&o){const b=e.exit("characterReferenceValue");return l===xn&&!Ep(i.sliceSerialize(b))?n(x):(e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(x)&&o++<s?(e.consume(x),p):n(x)}}const Hy={partial:!0,tokenize:__},Fy={concrete:!0,name:"codeFenced",tokenize:N_};function N_(e,t,n){const i=this,o={partial:!0,tokenize:A};let s=0,l=0,c;return d;function d(R){return f(R)}function f(R){const j=i.events[i.events.length-1];return s=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[1],!0).length:0,c=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(R)}function p(R){return R===c?(l++,e.consume(R),p):l<3?n(R):(e.exit("codeFencedFenceSequence"),dt(R)?pt(e,x,"whitespace")(R):x(R))}function x(R){return R===null||Ye(R)?(e.exit("codeFencedFence"),i.interrupt?t(R):e.check(Hy,E,L)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(R))}function b(R){return R===null||Ye(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(R)):dt(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),pt(e,g,"whitespace")(R)):R===96&&R===c?n(R):(e.consume(R),b)}function g(R){return R===null||Ye(R)?x(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),y(R))}function y(R){return R===null||Ye(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),x(R)):R===96&&R===c?n(R):(e.consume(R),y)}function E(R){return e.attempt(o,L,T)(R)}function T(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),w}function w(R){return s>0&&dt(R)?pt(e,M,"linePrefix",s+1)(R):M(R)}function M(R){return R===null||Ye(R)?e.check(Hy,E,L)(R):(e.enter("codeFlowValue"),_(R))}function _(R){return R===null||Ye(R)?(e.exit("codeFlowValue"),M(R)):(e.consume(R),_)}function L(R){return e.exit("codeFenced"),t(R)}function A(R,j,N){let I=0;return D;function D(B){return R.enter("lineEnding"),R.consume(B),R.exit("lineEnding"),P}function P(B){return R.enter("codeFencedFence"),dt(B)?pt(R,z,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):z(B)}function z(B){return B===c?(R.enter("codeFencedFenceSequence"),K(B)):N(B)}function K(B){return B===c?(I++,R.consume(B),K):I>=l?(R.exit("codeFencedFenceSequence"),dt(B)?pt(R,q,"whitespace")(B):q(B)):N(B)}function q(B){return B===null||Ye(B)?(R.exit("codeFencedFence"),j(B)):N(B)}}}function __(e,t,n){const i=this;return o;function o(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s)}function s(l){return i.parser.lazy[i.now().line]?n(l):t(l)}}const gm={name:"codeIndented",tokenize:R_},M_={partial:!0,tokenize:D_};function R_(e,t,n){const i=this;return o;function o(f){return e.enter("codeIndented"),pt(e,s,"linePrefix",5)(f)}function s(f){const p=i.events[i.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?l(f):n(f)}function l(f){return f===null?d(f):Ye(f)?e.attempt(M_,l,d)(f):(e.enter("codeFlowValue"),c(f))}function c(f){return f===null||Ye(f)?(e.exit("codeFlowValue"),l(f)):(e.consume(f),c)}function d(f){return e.exit("codeIndented"),t(f)}}function D_(e,t,n){const i=this;return o;function o(l){return i.parser.lazy[i.now().line]?n(l):Ye(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):pt(e,s,"linePrefix",5)(l)}function s(l){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):Ye(l)?o(l):n(l)}}const L_={name:"codeText",previous:I_,resolve:O_,tokenize:j_};function O_(e){let t=e.length-4,n=3,i,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i<t;)if(e[i][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(i=n-1,t++;++i<=t;)o===void 0?i!==t&&e[i][1].type!=="lineEnding"&&(o=i):(i===t||e[i][1].type==="lineEnding")&&(e[o][1].type="codeTextData",i!==o+2&&(e[o][1].end=e[i-1][1].end,e.splice(o+2,i-o-2),t-=i-o-2,i=o+2),o=void 0);return e}function I_(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function j_(e,t,n){let i=0,o,s;return l;function l(x){return e.enter("codeText"),e.enter("codeTextSequence"),c(x)}function c(x){return x===96?(e.consume(x),i++,c):(e.exit("codeTextSequence"),d(x))}function d(x){return x===null?n(x):x===32?(e.enter("space"),e.consume(x),e.exit("space"),d):x===96?(s=e.enter("codeTextSequence"),o=0,p(x)):Ye(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),d):(e.enter("codeTextData"),f(x))}function f(x){return x===null||x===32||x===96||Ye(x)?(e.exit("codeTextData"),d(x)):(e.consume(x),f)}function p(x){return x===96?(e.consume(x),o++,p):o===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(x)):(s.type="codeTextData",f(x))}}class P_{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 i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(t,i):t>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const o=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return i&&Wo(this.left,i),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Wo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Wo(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);Wo(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Wo(this.left,n.reverse())}}}function Wo(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 cT(e){const t={};let n=-1,i,o,s,l,c,d,f;const p=new P_(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(i=p.get(n),n&&i[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(d=i[1]._tokenizer.events,s=0,s<d.length&&d[s][1].type==="lineEndingBlank"&&(s+=2),s<d.length&&d[s][1].type==="content"))for(;++s<d.length&&d[s][1].type!=="content";)d[s][1].type==="chunkText"&&(d[s][1]._isInFirstContentOfListItem=!0,s++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,B_(p,n)),n=t[n],f=!0);else if(i[1]._container){for(s=n,o=void 0;s--;)if(l=p.get(s),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(o&&(p.get(o)[1].type="lineEndingBlank"),l[1].type="lineEnding",o=s);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;o&&(i[1].end={...p.get(o)[1].start},c=p.slice(o,n),c.unshift(i),p.splice(o,n-o+1,c))}}return qn(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function B_(e,t){const n=e.get(t)[1],i=e.get(t)[2];let o=t-1;const s=[];let l=n._tokenizer;l||(l=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,d=[],f={};let p,x,b=-1,g=n,y=0,E=0;const T=[E];for(;g;){for(;e.get(++o)[1]!==g;);s.push(o),g._tokenizer||(p=i.sliceStream(g),g.next||p.push(null),x&&l.defineSkip(g.start),g._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(p),g._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),x=g,g=g.next}for(g=n;++b<c.length;)c[b][0]==="exit"&&c[b-1][0]==="enter"&&c[b][1].type===c[b-1][1].type&&c[b][1].start.line!==c[b][1].end.line&&(E=b+1,T.push(E),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(l.events=[],g?(g._tokenizer=void 0,g.previous=void 0):T.pop(),b=T.length;b--;){const w=c.slice(T[b],T[b+1]),M=s.pop();d.push([M,M+w.length-1]),e.splice(M,2,w)}for(d.reverse(),b=-1;++b<d.length;)f[y+d[b][0]]=y+d[b][1],y+=d[b][1]-d[b][0]-1;return f}const z_={resolve:H_,tokenize:F_},U_={partial:!0,tokenize:V_};function H_(e){return cT(e),e}function F_(e,t){let n;return i;function i(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(c)}function o(c){return c===null?s(c):Ye(c)?e.check(U_,l,s)(c):(e.consume(c),o)}function s(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function l(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function V_(e,t,n){const i=this;return o;function o(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),pt(e,s,"linePrefix")}function s(l){if(l===null||Ye(l))return n(l);const c=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):e.interrupt(i.parser.constructs.flow,n,t)(l)}}function dT(e,t,n,i,o,s,l,c,d){const f=d||Number.POSITIVE_INFINITY;let p=0;return x;function x(w){return w===60?(e.enter(i),e.enter(o),e.enter(s),e.consume(w),e.exit(s),b):w===null||w===32||w===41||$c(w)?n(w):(e.enter(i),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),E(w))}function b(w){return w===62?(e.enter(s),e.consume(w),e.exit(s),e.exit(o),e.exit(i),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===62?(e.exit("chunkString"),e.exit(c),b(w)):w===null||w===60||Ye(w)?n(w):(e.consume(w),w===92?y:g)}function y(w){return w===60||w===62||w===92?(e.consume(w),g):g(w)}function E(w){return!p&&(w===null||w===41||Lt(w))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(i),t(w)):p<f&&w===40?(e.consume(w),p++,E):w===41?(e.consume(w),p--,E):w===null||w===32||w===40||$c(w)?n(w):(e.consume(w),w===92?T:E)}function T(w){return w===40||w===41||w===92?(e.consume(w),E):E(w)}}function fT(e,t,n,i,o,s){const l=this;let c=0,d;return f;function f(g){return e.enter(i),e.enter(o),e.consume(g),e.exit(o),e.enter(s),p}function p(g){return c>999||g===null||g===91||g===93&&!d||g===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(g):g===93?(e.exit(s),e.enter(o),e.consume(g),e.exit(o),e.exit(i),t):Ye(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),x(g))}function x(g){return g===null||g===91||g===93||Ye(g)||c++>999?(e.exit("chunkString"),p(g)):(e.consume(g),d||(d=!dt(g)),g===92?b:x)}function b(g){return g===91||g===92||g===93?(e.consume(g),c++,x):x(g)}}function hT(e,t,n,i,o,s){let l;return c;function c(b){return b===34||b===39||b===40?(e.enter(i),e.enter(o),e.consume(b),e.exit(o),l=b===40?41:b,d):n(b)}function d(b){return b===l?(e.enter(o),e.consume(b),e.exit(o),e.exit(i),t):(e.enter(s),f(b))}function f(b){return b===l?(e.exit(s),d(l)):b===null?n(b):Ye(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),pt(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===l||b===null||Ye(b)?(e.exit("chunkString"),f(b)):(e.consume(b),b===92?x:p)}function x(b){return b===l||b===92?(e.consume(b),p):p(b)}}function dl(e,t){let n;return i;function i(o){return Ye(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,i):dt(o)?pt(e,i,n?"linePrefix":"lineSuffix")(o):t(o)}}const q_={name:"definition",tokenize:G_},Y_={partial:!0,tokenize:X_};function G_(e,t,n){const i=this;let o;return s;function s(g){return e.enter("definition"),l(g)}function l(g){return fT.call(i,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function c(g){return o=xa(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),d):n(g)}function d(g){return Lt(g)?dl(e,f)(g):f(g)}function f(g){return dT(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function p(g){return e.attempt(Y_,x,x)(g)}function x(g){return dt(g)?pt(e,b,"whitespace")(g):b(g)}function b(g){return g===null||Ye(g)?(e.exit("definition"),i.parser.defined.push(o),t(g)):n(g)}}function X_(e,t,n){return i;function i(c){return Lt(c)?dl(e,o)(c):n(c)}function o(c){return hT(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function s(c){return dt(c)?pt(e,l,"whitespace")(c):l(c)}function l(c){return c===null||Ye(c)?t(c):n(c)}}const K_={name:"hardBreakEscape",tokenize:$_};function $_(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return Ye(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const Q_={name:"headingAtx",resolve:W_,tokenize:Z_};function W_(e,t){let n=e.length-2,i=3,o,s;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(o={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},s={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},qn(e,i,n-i+1,[["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t]])),e}function Z_(e,t,n){let i=0;return o;function o(p){return e.enter("atxHeading"),s(p)}function s(p){return e.enter("atxHeadingSequence"),l(p)}function l(p){return p===35&&i++<6?(e.consume(p),l):p===null||Lt(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||Ye(p)?(e.exit("atxHeading"),t(p)):dt(p)?pt(e,c,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),c(p))}function f(p){return p===null||p===35||Lt(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),f)}}const J_=["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"],Vy=["pre","script","style","textarea"],e4={concrete:!0,name:"htmlFlow",resolveTo:a4,tokenize:i4},t4={partial:!0,tokenize:s4},n4={partial:!0,tokenize:r4};function a4(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 i4(e,t,n){const i=this;let o,s,l,c,d;return f;function f(U){return p(U)}function p(U){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(U),x}function x(U){return U===33?(e.consume(U),b):U===47?(e.consume(U),s=!0,E):U===63?(e.consume(U),o=3,i.interrupt?t:F):En(U)?(e.consume(U),l=String.fromCharCode(U),T):n(U)}function b(U){return U===45?(e.consume(U),o=2,g):U===91?(e.consume(U),o=5,c=0,y):En(U)?(e.consume(U),o=4,i.interrupt?t:F):n(U)}function g(U){return U===45?(e.consume(U),i.interrupt?t:F):n(U)}function y(U){const ae="CDATA[";return U===ae.charCodeAt(c++)?(e.consume(U),c===ae.length?i.interrupt?t:z:y):n(U)}function E(U){return En(U)?(e.consume(U),l=String.fromCharCode(U),T):n(U)}function T(U){if(U===null||U===47||U===62||Lt(U)){const ae=U===47,J=l.toLowerCase();return!ae&&!s&&Vy.includes(J)?(o=1,i.interrupt?t(U):z(U)):J_.includes(l.toLowerCase())?(o=6,ae?(e.consume(U),w):i.interrupt?t(U):z(U)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(U):s?M(U):_(U))}return U===45||xn(U)?(e.consume(U),l+=String.fromCharCode(U),T):n(U)}function w(U){return U===62?(e.consume(U),i.interrupt?t:z):n(U)}function M(U){return dt(U)?(e.consume(U),M):D(U)}function _(U){return U===47?(e.consume(U),D):U===58||U===95||En(U)?(e.consume(U),L):dt(U)?(e.consume(U),_):D(U)}function L(U){return U===45||U===46||U===58||U===95||xn(U)?(e.consume(U),L):A(U)}function A(U){return U===61?(e.consume(U),R):dt(U)?(e.consume(U),A):_(U)}function R(U){return U===null||U===60||U===61||U===62||U===96?n(U):U===34||U===39?(e.consume(U),d=U,j):dt(U)?(e.consume(U),R):N(U)}function j(U){return U===d?(e.consume(U),d=null,I):U===null||Ye(U)?n(U):(e.consume(U),j)}function N(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||Lt(U)?A(U):(e.consume(U),N)}function I(U){return U===47||U===62||dt(U)?_(U):n(U)}function D(U){return U===62?(e.consume(U),P):n(U)}function P(U){return U===null||Ye(U)?z(U):dt(U)?(e.consume(U),P):n(U)}function z(U){return U===45&&o===2?(e.consume(U),H):U===60&&o===1?(e.consume(U),G):U===62&&o===4?(e.consume(U),Y):U===63&&o===3?(e.consume(U),F):U===93&&o===5?(e.consume(U),re):Ye(U)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(t4,W,K)(U)):U===null||Ye(U)?(e.exit("htmlFlowData"),K(U)):(e.consume(U),z)}function K(U){return e.check(n4,q,W)(U)}function q(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),B}function B(U){return U===null||Ye(U)?K(U):(e.enter("htmlFlowData"),z(U))}function H(U){return U===45?(e.consume(U),F):z(U)}function G(U){return U===47?(e.consume(U),l="",Q):z(U)}function Q(U){if(U===62){const ae=l.toLowerCase();return Vy.includes(ae)?(e.consume(U),Y):z(U)}return En(U)&&l.length<8?(e.consume(U),l+=String.fromCharCode(U),Q):z(U)}function re(U){return U===93?(e.consume(U),F):z(U)}function F(U){return U===62?(e.consume(U),Y):U===45&&o===2?(e.consume(U),F):z(U)}function Y(U){return U===null||Ye(U)?(e.exit("htmlFlowData"),W(U)):(e.consume(U),Y)}function W(U){return e.exit("htmlFlow"),t(U)}}function r4(e,t,n){const i=this;return o;function o(l){return Ye(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):n(l)}function s(l){return i.parser.lazy[i.now().line]?n(l):t(l)}}function s4(e,t,n){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Ul,t,n)}}const o4={name:"htmlText",tokenize:l4};function l4(e,t,n){const i=this;let o,s,l;return c;function c(F){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(F),d}function d(F){return F===33?(e.consume(F),f):F===47?(e.consume(F),A):F===63?(e.consume(F),_):En(F)?(e.consume(F),N):n(F)}function f(F){return F===45?(e.consume(F),p):F===91?(e.consume(F),s=0,y):En(F)?(e.consume(F),M):n(F)}function p(F){return F===45?(e.consume(F),g):n(F)}function x(F){return F===null?n(F):F===45?(e.consume(F),b):Ye(F)?(l=x,G(F)):(e.consume(F),x)}function b(F){return F===45?(e.consume(F),g):x(F)}function g(F){return F===62?H(F):F===45?b(F):x(F)}function y(F){const Y="CDATA[";return F===Y.charCodeAt(s++)?(e.consume(F),s===Y.length?E:y):n(F)}function E(F){return F===null?n(F):F===93?(e.consume(F),T):Ye(F)?(l=E,G(F)):(e.consume(F),E)}function T(F){return F===93?(e.consume(F),w):E(F)}function w(F){return F===62?H(F):F===93?(e.consume(F),w):E(F)}function M(F){return F===null||F===62?H(F):Ye(F)?(l=M,G(F)):(e.consume(F),M)}function _(F){return F===null?n(F):F===63?(e.consume(F),L):Ye(F)?(l=_,G(F)):(e.consume(F),_)}function L(F){return F===62?H(F):_(F)}function A(F){return En(F)?(e.consume(F),R):n(F)}function R(F){return F===45||xn(F)?(e.consume(F),R):j(F)}function j(F){return Ye(F)?(l=j,G(F)):dt(F)?(e.consume(F),j):H(F)}function N(F){return F===45||xn(F)?(e.consume(F),N):F===47||F===62||Lt(F)?I(F):n(F)}function I(F){return F===47?(e.consume(F),H):F===58||F===95||En(F)?(e.consume(F),D):Ye(F)?(l=I,G(F)):dt(F)?(e.consume(F),I):H(F)}function D(F){return F===45||F===46||F===58||F===95||xn(F)?(e.consume(F),D):P(F)}function P(F){return F===61?(e.consume(F),z):Ye(F)?(l=P,G(F)):dt(F)?(e.consume(F),P):I(F)}function z(F){return F===null||F===60||F===61||F===62||F===96?n(F):F===34||F===39?(e.consume(F),o=F,K):Ye(F)?(l=z,G(F)):dt(F)?(e.consume(F),z):(e.consume(F),q)}function K(F){return F===o?(e.consume(F),o=void 0,B):F===null?n(F):Ye(F)?(l=K,G(F)):(e.consume(F),K)}function q(F){return F===null||F===34||F===39||F===60||F===61||F===96?n(F):F===47||F===62||Lt(F)?I(F):(e.consume(F),q)}function B(F){return F===47||F===62||Lt(F)?I(F):n(F)}function H(F){return F===62?(e.consume(F),e.exit("htmlTextData"),e.exit("htmlText"),t):n(F)}function G(F){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),Q}function Q(F){return dt(F)?pt(e,re,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):re(F)}function re(F){return e.enter("htmlTextData"),l(F)}}const Tp={name:"labelEnd",resolveAll:f4,resolveTo:h4,tokenize:m4},u4={tokenize:p4},c4={tokenize:g4},d4={tokenize:x4};function f4(e){let t=-1;const n=[];for(;++t<e.length;){const i=e[t][1];if(n.push(e[t]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const o=i.type==="labelImage"?4:2;i.type="data",t+=o}}return e.length!==n.length&&qn(e,0,e.length,n),e}function h4(e,t){let n=e.length,i=0,o,s,l,c;for(;n--;)if(o=e[n][1],s){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(s=n,o.type!=="labelLink")){i=2;break}}else o.type==="labelEnd"&&(l=n);const d={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[s][1].start},end:{...e[l][1].end}},p={type:"labelText",start:{...e[s+i+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",d,t],["enter",f,t]],c=aa(c,e.slice(s+1,s+i+3)),c=aa(c,[["enter",p,t]]),c=aa(c,Td(t.parser.constructs.insideSpan.null,e.slice(s+i+4,l-3),t)),c=aa(c,[["exit",p,t],e[l-2],e[l-1],["exit",f,t]]),c=aa(c,e.slice(l+1)),c=aa(c,[["exit",d,t]]),qn(e,s,e.length,c),e}function m4(e,t,n){const i=this;let o=i.events.length,s,l;for(;o--;)if((i.events[o][1].type==="labelImage"||i.events[o][1].type==="labelLink")&&!i.events[o][1]._balanced){s=i.events[o][1];break}return c;function c(b){return s?s._inactive?x(b):(l=i.parser.defined.includes(xa(i.sliceSerialize({start:s.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),d):n(b)}function d(b){return b===40?e.attempt(u4,p,l?p:x)(b):b===91?e.attempt(c4,p,l?f:x)(b):l?p(b):x(b)}function f(b){return e.attempt(d4,p,x)(b)}function p(b){return t(b)}function x(b){return s._balanced=!0,n(b)}}function p4(e,t,n){return i;function i(x){return e.enter("resource"),e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),o}function o(x){return Lt(x)?dl(e,s)(x):s(x)}function s(x){return x===41?p(x):dT(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function l(x){return Lt(x)?dl(e,d)(x):p(x)}function c(x){return n(x)}function d(x){return x===34||x===39||x===40?hT(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):p(x)}function f(x){return Lt(x)?dl(e,p)(x):p(x)}function p(x){return x===41?(e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),e.exit("resource"),t):n(x)}}function g4(e,t,n){const i=this;return o;function o(c){return fT.call(i,e,s,l,"reference","referenceMarker","referenceString")(c)}function s(c){return i.parser.defined.includes(xa(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function x4(e,t,n){return i;function i(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),o}function o(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const b4={name:"labelStartImage",resolveAll:Tp.resolveAll,tokenize:y4};function y4(e,t,n){const i=this;return o;function o(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),s}function s(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(c):t(c)}}const v4={name:"labelStartLink",resolveAll:Tp.resolveAll,tokenize:E4};function E4(e,t,n){const i=this;return o;function o(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),s}function s(l){return l===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(l):t(l)}}const xm={name:"lineEnding",tokenize:T4};function T4(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),pt(e,t,"linePrefix")}}const Dc={name:"thematicBreak",tokenize:S4};function S4(e,t,n){let i=0,o;return s;function s(f){return e.enter("thematicBreak"),l(f)}function l(f){return o=f,c(f)}function c(f){return f===o?(e.enter("thematicBreakSequence"),d(f)):i>=3&&(f===null||Ye(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===o?(e.consume(f),i++,d):(e.exit("thematicBreakSequence"),dt(f)?pt(e,c,"whitespace")(f):c(f))}}const Dn={continuation:{tokenize:C4},exit:_4,name:"list",tokenize:A4},k4={partial:!0,tokenize:M4},w4={partial:!0,tokenize:N4};function A4(e,t,n){const i=this,o=i.events[i.events.length-1];let s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,l=0;return c;function c(g){const y=i.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!i.containerState.marker||g===i.containerState.marker:v0(g)){if(i.containerState.type||(i.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(Dc,n,f)(g):f(g);if(!i.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(g)}return n(g)}function d(g){return v0(g)&&++l<10?(e.consume(g),d):(!i.interrupt||l<2)&&(i.containerState.marker?g===i.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),f(g)):n(g)}function f(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||g,e.check(Ul,i.interrupt?n:p,e.attempt(k4,b,x))}function p(g){return i.containerState.initialBlankLine=!0,s++,b(g)}function x(g){return dt(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),b):n(g)}function b(g){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function C4(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(Ul,o,s);function o(c){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,pt(e,t,"listItemIndent",i.containerState.size+1)(c)}function s(c){return i.containerState.furtherBlankLines||!dt(c)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,l(c)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(w4,t,l)(c))}function l(c){return i.containerState._closeFlow=!0,i.interrupt=void 0,pt(e,e.attempt(Dn,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function N4(e,t,n){const i=this;return pt(e,o,"listItemIndent",i.containerState.size+1);function o(s){const l=i.events[i.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===i.containerState.size?t(s):n(s)}}function _4(e){e.exit(this.containerState.type)}function M4(e,t,n){const i=this;return pt(e,o,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(s){const l=i.events[i.events.length-1];return!dt(s)&&l&&l[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const qy={name:"setextUnderline",resolveTo:R4,tokenize:D4};function R4(e,t){let n=e.length,i,o,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const l={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",s?(e.splice(o,0,["enter",l,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=l,e.push(["exit",l,t]),e}function D4(e,t,n){const i=this;let o;return s;function s(f){let p=i.events.length,x;for(;p--;)if(i.events[p][1].type!=="lineEnding"&&i.events[p][1].type!=="linePrefix"&&i.events[p][1].type!=="content"){x=i.events[p][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||x)?(e.enter("setextHeadingLine"),o=f,l(f)):n(f)}function l(f){return e.enter("setextHeadingLineSequence"),c(f)}function c(f){return f===o?(e.consume(f),c):(e.exit("setextHeadingLineSequence"),dt(f)?pt(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||Ye(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const L4={tokenize:O4};function O4(e){const t=this,n=e.attempt(Ul,i,e.attempt(this.parser.constructs.flowInitial,o,pt(e,e.attempt(this.parser.constructs.flow,o,e.attempt(z_,o)),"linePrefix")));return n;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const I4={resolveAll:pT()},j4=mT("string"),P4=mT("text");function mT(e){return{resolveAll:pT(e==="text"?B4:void 0),tokenize:t};function t(n){const i=this,o=this.parser.constructs[e],s=n.attempt(o,l,c);return l;function l(p){return f(p)?s(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return f(p)?(n.exit("data"),s(p)):(n.consume(p),d)}function f(p){if(p===null)return!0;const x=o[p];let b=-1;if(x)for(;++b<x.length;){const g=x[b];if(!g.previous||g.previous.call(i,i.previous))return!0}return!1}}}function pT(e){return t;function t(n,i){let o=-1,s;for(;++o<=n.length;)s===void 0?n[o]&&n[o][1].type==="data"&&(s=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==s+2&&(n[s][1].end=n[o-1][1].end,n.splice(s+2,o-s-2),o=s+2),s=void 0);return e?e(n,i):n}}function B4(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 i=e[n-1][1],o=t.sliceStream(i);let s=o.length,l=-1,c=0,d;for(;s--;){const f=o[s];if(typeof f=="string"){for(l=f.length;f.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(f===-2)d=!0,c++;else if(f!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const f={type:n===e.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?l:i.start._bufferIndex+l,_index:i.start._index+s,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...f.start},i.start.offset===i.end.offset?Object.assign(i,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const z4={42:Dn,43:Dn,45:Dn,48:Dn,49:Dn,50:Dn,51:Dn,52:Dn,53:Dn,54:Dn,55:Dn,56:Dn,57:Dn,62:oT},U4={91:q_},H4={[-2]:gm,[-1]:gm,32:gm},F4={35:Q_,42:Dc,45:[qy,Dc],60:e4,61:qy,95:Dc,96:Fy,126:Fy},V4={38:uT,92:lT},q4={[-5]:xm,[-4]:xm,[-3]:xm,33:b4,38:uT,42:E0,60:[v_,o4],91:v4,92:[K_,lT],93:Tp,95:E0,96:L_},Y4={null:[E0,I4]},G4={null:[42,95]},X4={null:[]},K4=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:G4,contentInitial:U4,disable:X4,document:z4,flow:F4,flowInitial:H4,insideSpan:Y4,string:V4,text:q4},Symbol.toStringTag,{value:"Module"}));function $4(e,t,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},s=[];let l=[],c=[];const d={attempt:j(A),check:j(R),consume:M,enter:_,exit:L,interrupt:j(R,{interrupt:!0})},f={code:null,containerState:{},defineSkip:E,events:[],now:y,parser:e,previous:null,sliceSerialize:b,sliceStream:g,write:x};let p=t.tokenize.call(f,d);return t.resolveAll&&s.push(t),f;function x(P){return l=aa(l,P),T(),l[l.length-1]!==null?[]:(N(t,0),f.events=Td(s,f.events,f),f.events)}function b(P,z){return W4(g(P),z)}function g(P){return Q4(l,P)}function y(){const{_bufferIndex:P,_index:z,line:K,column:q,offset:B}=i;return{_bufferIndex:P,_index:z,line:K,column:q,offset:B}}function E(P){o[P.line]=P.column,D()}function T(){let P;for(;i._index<l.length;){const z=l[i._index];if(typeof z=="string")for(P=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===P&&i._bufferIndex<z.length;)w(z.charCodeAt(i._bufferIndex));else w(z)}}function w(P){p=p(P)}function M(P){Ye(P)?(i.line++,i.column=1,i.offset+=P===-3?2:1,D()):P!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===l[i._index].length&&(i._bufferIndex=-1,i._index++)),f.previous=P}function _(P,z){const K=z||{};return K.type=P,K.start=y(),f.events.push(["enter",K,f]),c.push(K),K}function L(P){const z=c.pop();return z.end=y(),f.events.push(["exit",z,f]),z}function A(P,z){N(P,z.from)}function R(P,z){z.restore()}function j(P,z){return K;function K(q,B,H){let G,Q,re,F;return Array.isArray(q)?W(q):"tokenize"in q?W([q]):Y(q);function Y(ne){return me;function me(Z){const we=Z!==null&&ne[Z],Fe=Z!==null&&ne.null,Se=[...Array.isArray(we)?we:we?[we]:[],...Array.isArray(Fe)?Fe:Fe?[Fe]:[]];return W(Se)(Z)}}function W(ne){return G=ne,Q=0,ne.length===0?H:U(ne[Q])}function U(ne){return me;function me(Z){return F=I(),re=ne,ne.partial||(f.currentConstruct=ne),ne.name&&f.parser.constructs.disable.null.includes(ne.name)?J():ne.tokenize.call(z?Object.assign(Object.create(f),z):f,d,ae,J)(Z)}}function ae(ne){return P(re,F),B}function J(ne){return F.restore(),++Q<G.length?U(G[Q]):H}}}function N(P,z){P.resolveAll&&!s.includes(P)&&s.push(P),P.resolve&&qn(f.events,z,f.events.length-z,P.resolve(f.events.slice(z),f)),P.resolveTo&&(f.events=P.resolveTo(f.events,f))}function I(){const P=y(),z=f.previous,K=f.currentConstruct,q=f.events.length,B=Array.from(c);return{from:q,restore:H};function H(){i=P,f.previous=z,f.currentConstruct=K,f.events.length=q,c=B,D()}}function D(){i.line in o&&i.column<2&&(i.column=o[i.line],i.offset+=o[i.line]-1)}}function Q4(e,t){const n=t.start._index,i=t.start._bufferIndex,o=t.end._index,s=t.end._bufferIndex;let l;if(n===o)l=[e[n].slice(i,s)];else{if(l=e.slice(n,o),i>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(i):l.shift()}s>0&&l.push(e[o].slice(0,s))}return l}function W4(e,t){let n=-1;const i=[];let o;for(;++n<e.length;){const s=e[n];let l;if(typeof s=="string")l=s;else switch(s){case-5:{l="\r";break}case-4:{l=`
|
|
521
|
-
`;break}case-3:{l=`\r
|
|
522
|
-
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&o)continue;l=" ";break}default:l=String.fromCharCode(s)}o=s===-2,i.push(l)}return i.join("")}function Z4(e){const i={constructs:rT([K4,...(e||{}).extensions||[]]),content:o(h_),defined:[],document:o(p_),flow:o(L4),lazy:{},string:o(j4),text:o(P4)};return i;function o(s){return l;function l(c){return $4(i,s,c)}}}function J4(e){for(;!cT(e););return e}const Yy=/[\0\t\n\r]/g;function e6(){let e=1,t="",n=!0,i;return o;function o(s,l,c){const d=[];let f,p,x,b,g;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(l||void 0).decode(s)),x=0,t="",n&&(s.charCodeAt(0)===65279&&x++,n=void 0);x<s.length;){if(Yy.lastIndex=x,f=Yy.exec(s),b=f&&f.index!==void 0?f.index:s.length,g=s.charCodeAt(b),!f){t=s.slice(x);break}if(g===10&&x===b&&i)d.push(-3),i=void 0;else switch(i&&(d.push(-5),i=void 0),x<b&&(d.push(s.slice(x,b)),e+=b-x),g){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:i=!0,e=1}x=b+1}return c&&(i&&d.push(-5),t&&d.push(t),d.push(null)),d}}const t6=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function n6(e){return e.replace(t6,a6)}function a6(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),s=o===120||o===88;return sT(n.slice(s?2:1),s?16:10)}return Ep(n)||e}const gT={}.hasOwnProperty;function i6(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),r6(n)(J4(Z4(n).document().write(e6()(e,t,!0))))}function r6(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Ze),autolinkProtocol:I,autolinkEmail:I,atxHeading:s($e),blockQuote:s(Fe),characterEscape:I,characterReference:I,codeFenced:s(Se),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:s(Se,l),codeText:s(ve,l),codeTextData:I,data:I,codeFlowValue:I,definition:s(Oe),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:s(Ie),hardBreakEscape:s(Nt),hardBreakTrailing:s(Nt),htmlFlow:s(Ot,l),htmlFlowData:I,htmlText:s(Ot,l),htmlTextData:I,image:s(Te),label:l,link:s(Ze),listItem:s(bt),listItemValue:b,listOrdered:s(rt,x),listUnordered:s(rt),paragraph:s(gt),reference:U,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:s($e),strong:s(lt),thematicBreak:s(Ue)},exit:{atxHeading:d(),atxHeadingSequence:A,autolink:d(),autolinkEmail:we,autolinkProtocol:Z,blockQuote:d(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:J,characterReferenceMarkerNumeric:J,characterReferenceValue:ne,characterReference:me,codeFenced:d(T),codeFencedFence:E,codeFencedFenceInfo:g,codeFencedFenceMeta:y,codeFlowValue:D,codeIndented:d(w),codeText:d(B),codeTextData:D,data:D,definition:d(),definitionDestinationString:L,definitionLabelString:M,definitionTitleString:_,emphasis:d(),hardBreakEscape:d(z),hardBreakTrailing:d(z),htmlFlow:d(K),htmlFlowData:D,htmlText:d(q),htmlTextData:D,image:d(G),label:re,labelText:Q,lineEnding:P,link:d(H),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:ae,resourceDestinationString:F,resourceTitleString:Y,resource:W,setextHeading:d(N),setextHeadingLineSequence:j,setextHeadingText:R,strong:d(),thematicBreak:d()}};xT(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(pe){let Ce={type:"root",children:[]};const je={stack:[Ce],tokenStack:[],config:t,enter:c,exit:f,buffer:l,resume:p,data:n},Le=[];let at=-1;for(;++at<pe.length;)if(pe[at][1].type==="listOrdered"||pe[at][1].type==="listUnordered")if(pe[at][0]==="enter")Le.push(at);else{const Me=Le.pop();at=o(pe,Me,at)}for(at=-1;++at<pe.length;){const Me=t[pe[at][0]];gT.call(Me,pe[at][1].type)&&Me[pe[at][1].type].call(Object.assign({sliceSerialize:pe[at][2].sliceSerialize},je),pe[at][1])}if(je.tokenStack.length>0){const Me=je.tokenStack[je.tokenStack.length-1];(Me[1]||Gy).call(je,void 0,Me[0])}for(Ce.position={start:ji(pe.length>0?pe[0][1].start:{line:1,column:1,offset:0}),end:ji(pe.length>0?pe[pe.length-2][1].end:{line:1,column:1,offset:0})},at=-1;++at<t.transforms.length;)Ce=t.transforms[at](Ce)||Ce;return Ce}function o(pe,Ce,je){let Le=Ce-1,at=-1,Me=!1,tt,We,se,qe;for(;++Le<=je;){const Je=pe[Le];switch(Je[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Je[0]==="enter"?at++:at--,qe=void 0;break}case"lineEndingBlank":{Je[0]==="enter"&&(tt&&!qe&&!at&&!se&&(se=Le),qe=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:qe=void 0}if(!at&&Je[0]==="enter"&&Je[1].type==="listItemPrefix"||at===-1&&Je[0]==="exit"&&(Je[1].type==="listUnordered"||Je[1].type==="listOrdered")){if(tt){let Ft=Le;for(We=void 0;Ft--;){const it=pe[Ft];if(it[1].type==="lineEnding"||it[1].type==="lineEndingBlank"){if(it[0]==="exit")continue;We&&(pe[We][1].type="lineEndingBlank",Me=!0),it[1].type="lineEnding",We=Ft}else if(!(it[1].type==="linePrefix"||it[1].type==="blockQuotePrefix"||it[1].type==="blockQuotePrefixWhitespace"||it[1].type==="blockQuoteMarker"||it[1].type==="listItemIndent"))break}se&&(!We||se<We)&&(tt._spread=!0),tt.end=Object.assign({},We?pe[We][1].start:Je[1].end),pe.splice(We||Le,0,["exit",tt,Je[2]]),Le++,je++}if(Je[1].type==="listItemPrefix"){const Ft={type:"listItem",_spread:!1,start:Object.assign({},Je[1].start),end:void 0};tt=Ft,pe.splice(Le,0,["enter",Ft,Je[2]]),Le++,je++,se=void 0,qe=!0}}}return pe[Ce][1]._spread=Me,je}function s(pe,Ce){return je;function je(Le){c.call(this,pe(Le),Le),Ce&&Ce.call(this,Le)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(pe,Ce,je){this.stack[this.stack.length-1].children.push(pe),this.stack.push(pe),this.tokenStack.push([Ce,je||void 0]),pe.position={start:ji(Ce.start),end:void 0}}function d(pe){return Ce;function Ce(je){pe&&pe.call(this,je),f.call(this,je)}}function f(pe,Ce){const je=this.stack.pop(),Le=this.tokenStack.pop();if(Le)Le[0].type!==pe.type&&(Ce?Ce.call(this,pe,Le[0]):(Le[1]||Gy).call(this,pe,Le[0]));else throw new Error("Cannot close `"+pe.type+"` ("+cl({start:pe.start,end:pe.end})+"): it’s not open");je.position.end=ji(pe.end)}function p(){return vp(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function b(pe){if(this.data.expectingFirstListItemValue){const Ce=this.stack[this.stack.length-2];Ce.start=Number.parseInt(this.sliceSerialize(pe),10),this.data.expectingFirstListItemValue=void 0}}function g(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.lang=pe}function y(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.meta=pe}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=pe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=pe.replace(/(\r?\n|\r)$/g,"")}function M(pe){const Ce=this.resume(),je=this.stack[this.stack.length-1];je.label=Ce,je.identifier=xa(this.sliceSerialize(pe)).toLowerCase()}function _(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=pe}function L(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=pe}function A(pe){const Ce=this.stack[this.stack.length-1];if(!Ce.depth){const je=this.sliceSerialize(pe).length;Ce.depth=je}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function j(pe){const Ce=this.stack[this.stack.length-1];Ce.depth=this.sliceSerialize(pe).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function I(pe){const je=this.stack[this.stack.length-1].children;let Le=je[je.length-1];(!Le||Le.type!=="text")&&(Le=st(),Le.position={start:ji(pe.start),end:void 0},je.push(Le)),this.stack.push(Le)}function D(pe){const Ce=this.stack.pop();Ce.value+=this.sliceSerialize(pe),Ce.position.end=ji(pe.end)}function P(pe){const Ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const je=Ce.children[Ce.children.length-1];je.position.end=ji(pe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ce.type)&&(I.call(this,pe),D.call(this,pe))}function z(){this.data.atHardBreak=!0}function K(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=pe}function q(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=pe}function B(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=pe}function H(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=Ce,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function G(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=Ce,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function Q(pe){const Ce=this.sliceSerialize(pe),je=this.stack[this.stack.length-2];je.label=n6(Ce),je.identifier=xa(Ce).toLowerCase()}function re(){const pe=this.stack[this.stack.length-1],Ce=this.resume(),je=this.stack[this.stack.length-1];if(this.data.inReference=!0,je.type==="link"){const Le=pe.children;je.children=Le}else je.alt=Ce}function F(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=pe}function Y(){const pe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=pe}function W(){this.data.inReference=void 0}function U(){this.data.referenceType="collapsed"}function ae(pe){const Ce=this.resume(),je=this.stack[this.stack.length-1];je.label=Ce,je.identifier=xa(this.sliceSerialize(pe)).toLowerCase(),this.data.referenceType="full"}function J(pe){this.data.characterReferenceType=pe.type}function ne(pe){const Ce=this.sliceSerialize(pe),je=this.data.characterReferenceType;let Le;je?(Le=sT(Ce,je==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Le=Ep(Ce);const at=this.stack[this.stack.length-1];at.value+=Le}function me(pe){const Ce=this.stack.pop();Ce.position.end=ji(pe.end)}function Z(pe){D.call(this,pe);const Ce=this.stack[this.stack.length-1];Ce.url=this.sliceSerialize(pe)}function we(pe){D.call(this,pe);const Ce=this.stack[this.stack.length-1];Ce.url="mailto:"+this.sliceSerialize(pe)}function Fe(){return{type:"blockquote",children:[]}}function Se(){return{type:"code",lang:null,meta:null,value:""}}function ve(){return{type:"inlineCode",value:""}}function Oe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ie(){return{type:"emphasis",children:[]}}function $e(){return{type:"heading",depth:0,children:[]}}function Nt(){return{type:"break"}}function Ot(){return{type:"html",value:""}}function Te(){return{type:"image",title:null,url:"",alt:null}}function Ze(){return{type:"link",title:null,url:"",children:[]}}function rt(pe){return{type:"list",ordered:pe.type==="listOrdered",start:null,spread:pe._spread,children:[]}}function bt(pe){return{type:"listItem",spread:pe._spread,checked:null,children:[]}}function gt(){return{type:"paragraph",children:[]}}function lt(){return{type:"strong",children:[]}}function st(){return{type:"text",value:""}}function Ue(){return{type:"thematicBreak"}}}function ji(e){return{line:e.line,column:e.column,offset:e.offset}}function xT(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?xT(e,i):s6(e,i)}}function s6(e,t){let n;for(n in t)if(gT.call(t,n))switch(n){case"canContainEols":{const i=t[n];i&&e[n].push(...i);break}case"transforms":{const i=t[n];i&&e[n].push(...i);break}case"enter":case"exit":{const i=t[n];i&&Object.assign(e[n],i);break}}}function Gy(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+cl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+cl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+cl({start:t.start,end:t.end})+") is still open")}function o6(e){const t=this;t.parser=n;function n(i){return i6(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function l6(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 u6(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
523
|
-
`}]}function c6(e,t){const n=t.value?t.value+`
|
|
524
|
-
`:"",i={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(i.className=["language-"+o[0]]);let s={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function d6(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function f6(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function h6(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),o=qs(i.toLowerCase()),s=e.footnoteOrder.indexOf(i);let l,c=e.footnoteCounts.get(i);c===void 0?(c=0,e.footnoteOrder.push(i),l=e.footnoteOrder.length):l=s+1,c+=1,e.footnoteCounts.set(i,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function m6(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 p6(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function bT(e,t){const n=t.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const o=e.all(t),s=o[0];s&&s.type==="text"?s.value="["+s.value:o.unshift({type:"text",value:"["});const l=o[o.length-1];return l&&l.type==="text"?l.value+=i:o.push({type:"text",value:i}),o}function g6(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return bT(e,t);const o={src:qs(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(o.title=i.title);const s={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,s),e.applyData(t,s)}function x6(e,t){const n={src:qs(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 i={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,i),e.applyData(t,i)}function b6(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,i),e.applyData(t,i)}function y6(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return bT(e,t);const o={href:qs(i.url||"")};i.title!==null&&i.title!==void 0&&(o.title=i.title);const s={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function v6(e,t){const n={href:qs(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const i={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function E6(e,t,n){const i=e.all(t),o=n?T6(n):yT(t),s={},l=[];if(typeof t.checked=="boolean"){const p=i[0];let x;p&&p.type==="element"&&p.tagName==="p"?x=p:(x={type:"element",tagName:"p",properties:{},children:[]},i.unshift(x)),x.children.length>0&&x.children.unshift({type:"text",value:" "}),x.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let c=-1;for(;++c<i.length;){const p=i[c];(o||c!==0||p.type!=="element"||p.tagName!=="p")&&l.push({type:"text",value:`
|
|
525
|
-
`}),p.type==="element"&&p.tagName==="p"&&!o?l.push(...p.children):l.push(p)}const d=i[i.length-1];d&&(o||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
|
|
526
|
-
`});const f={type:"element",tagName:"li",properties:s,children:l};return e.patch(t,f),e.applyData(t,f)}function T6(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let i=-1;for(;!t&&++i<n.length;)t=yT(n[i])}return t}function yT(e){const t=e.spread;return t??e.children.length>1}function S6(e,t){const n={},i=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<i.length;){const l=i[o];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function k6(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function w6(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function A6(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function C6(e,t){const n=e.all(t),i=n.shift(),o=[];if(i){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(t.children[0],l),o.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=Ia(t.children[1]),d=vd(t.children[t.children.length-1]);c&&d&&(l.position={start:c,end:d}),o.push(l)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,s),e.applyData(t,s)}function N6(e,t,n){const i=n?n.children:void 0,s=(i?i.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,c=l?l.length:t.children.length;let d=-1;const f=[];for(;++d<c;){const x=t.children[d],b={},g=l?l[d]:void 0;g&&(b.align=g);let y={type:"element",tagName:s,properties:b,children:[]};x&&(y.children=e.all(x),e.patch(x,y),y=e.applyData(x,y)),f.push(y)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,p),e.applyData(t,p)}function _6(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Xy=9,Ky=32;function M6(e){const t=String(e),n=/\r?\n|\r/g;let i=n.exec(t),o=0;const s=[];for(;i;)s.push($y(t.slice(o,i.index),o>0,!0),i[0]),o=i.index+i[0].length,i=n.exec(t);return s.push($y(t.slice(o),o>0,!1)),s.join("")}function $y(e,t,n){let i=0,o=e.length;if(t){let s=e.codePointAt(i);for(;s===Xy||s===Ky;)i++,s=e.codePointAt(i)}if(n){let s=e.codePointAt(o-1);for(;s===Xy||s===Ky;)o--,s=e.codePointAt(o-1)}return o>i?e.slice(i,o):""}function R6(e,t){const n={type:"text",value:M6(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function D6(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const L6={blockquote:l6,break:u6,code:c6,delete:d6,emphasis:f6,footnoteReference:h6,heading:m6,html:p6,imageReference:g6,image:x6,inlineCode:b6,linkReference:y6,link:v6,listItem:E6,list:S6,paragraph:k6,root:w6,strong:A6,table:C6,tableCell:_6,tableRow:N6,text:R6,thematicBreak:D6,toml:pc,yaml:pc,definition:pc,footnoteDefinition:pc};function pc(){}const vT=-1,Sd=0,fl=1,Qc=2,Sp=3,kp=4,wp=5,Ap=6,ET=7,TT=8,ST=typeof self=="object"?self:globalThis,Qy=(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 ST[e](t)},O6=(e,t)=>{const n=(o,s)=>(e.set(s,o),o),i=o=>{if(e.has(o))return e.get(o);const[s,l]=t[o];switch(s){case Sd:case vT:return n(l,o);case fl:{const c=n([],o);for(const d of l)c.push(i(d));return c}case Qc:{const c=n({},o);for(const[d,f]of l)c[i(d)]=i(f);return c}case Sp:return n(new Date(l),o);case kp:{const{source:c,flags:d}=l;return n(new RegExp(c,d),o)}case wp:{const c=n(new Map,o);for(const[d,f]of l)c.set(i(d),i(f));return c}case Ap:{const c=n(new Set,o);for(const d of l)c.add(i(d));return c}case ET:{const{name:c,message:d}=l;return n(typeof ST[c]=="function"?Qy(c,d):new Error(d),o)}case TT:return n(BigInt(l),o);case"BigInt":return n(Object(BigInt(l)),o);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}}return n(Qy(s,l),o)};return i},Wy=e=>O6(new Map,e)(0),Sr="",{toString:I6}={},{keys:j6}=Object,Zo=e=>{const t=typeof e;if(t!=="object"||!e)return[Sd,t];const n=I6.call(e).slice(8,-1);switch(n){case"Array":return[fl,Sr];case"Object":return[Qc,Sr];case"Date":return[Sp,Sr];case"RegExp":return[kp,Sr];case"Map":return[wp,Sr];case"Set":return[Ap,Sr];case"DataView":return[fl,n]}return n.includes("Array")?[fl,n]:e instanceof Error?[ET,e.name||"Error"]:[Qc,n]},gc=([e,t])=>e===Sd&&(t==="function"||t==="symbol"),P6=(e,t,n,i)=>{const o=(l,c)=>{const d=i.push(l)-1;return n.set(c,d),d},s=l=>{if(n.has(l))return n.get(l);let[c,d]=Zo(l);switch(c){case Sd:{let p=l;switch(d){case"bigint":c=TT,p=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return o([vT],l)}return o([c,p],l)}case fl:{if(d){let b=l;return d==="DataView"?b=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(b=new Uint8Array(l)),o([d,[...b]],l)}const p=[],x=o([c,p],l);for(const b of l)p.push(s(b));return x}case Qc:{if(d)switch(d){case"BigInt":return o([d,l.toString()],l);case"Boolean":case"Number":case"String":return o([d,l.valueOf()],l)}if(t&&"toJSON"in l)return s(l.toJSON());const p=[],x=o([c,p],l);for(const b of j6(l))(e||!gc(Zo(l[b])))&&p.push([s(b),s(l[b])]);return x}case Sp:return o([c,isNaN(l.getTime())?Sr:l.toISOString()],l);case kp:{const{source:p,flags:x}=l;return o([c,{source:p,flags:x}],l)}case wp:{const p=[],x=o([c,p],l);for(const[b,g]of l)(e||!(gc(Zo(b))||gc(Zo(g))))&&p.push([s(b),s(g)]);return x}case Ap:{const p=[],x=o([c,p],l);for(const b of l)(e||!gc(Zo(b)))&&p.push(s(b));return x}}const{message:f}=l;return o([c,{name:d,message:f}],l)};return s},Zy=(e,{json:t,lossy:n}={})=>{const i=[];return P6(!(t||n),!!t,new Map,i)(e),i},Pr=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Wy(Zy(e,t)):structuredClone(e):(e,t)=>Wy(Zy(e,t));function B6(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 z6(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function U6(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||B6,i=e.options.footnoteBackLabel||z6,o=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let d=-1;for(;++d<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[d]);if(!f)continue;const p=e.all(f),x=String(f.identifier).toUpperCase(),b=qs(x.toLowerCase());let g=0;const y=[],E=e.footnoteCounts.get(x);for(;E!==void 0&&++g<=E;){y.length>0&&y.push({type:"text",value:" "});let M=typeof n=="string"?n:n(d,g);typeof M=="string"&&(M={type:"text",value:M}),y.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(d,g),className:["data-footnote-backref"]},children:Array.isArray(M)?M:[M]})}const T=p[p.length-1];if(T&&T.type==="element"&&T.tagName==="p"){const M=T.children[T.children.length-1];M&&M.type==="text"?M.value+=" ":T.children.push({type:"text",value:" "}),T.children.push(...y)}else p.push(...y);const w={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(p,!0)};e.patch(f,w),c.push(w)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Pr(l),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
527
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
|
528
|
-
`}]}}const kd=(function(e){if(e==null)return q6;if(typeof e=="function")return wd(e);if(typeof e=="object")return Array.isArray(e)?H6(e):F6(e);if(typeof e=="string")return V6(e);throw new Error("Expected function, string, or object as test")});function H6(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=kd(e[n]);return wd(i);function i(...o){let s=-1;for(;++s<t.length;)if(t[s].apply(this,o))return!0;return!1}}function F6(e){const t=e;return wd(n);function n(i){const o=i;let s;for(s in e)if(o[s]!==t[s])return!1;return!0}}function V6(e){return wd(t);function t(n){return n&&n.type===e}}function wd(e){return t;function t(n,i,o){return!!(Y6(n)&&e.call(this,n,typeof i=="number"?i:void 0,o||void 0))}}function q6(){return!0}function Y6(e){return e!==null&&typeof e=="object"&&"type"in e}const kT=[],G6=!0,T0=!1,X6="skip";function wT(e,t,n,i){let o;typeof t=="function"&&typeof n!="function"?(i=n,n=t):o=t;const s=kd(o),l=i?-1:1;c(e,void 0,[])();function c(d,f,p){const x=d&&typeof d=="object"?d:{};if(typeof x.type=="string"){const g=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(d.type+(g?"<"+g+">":""))+")"})}return b;function b(){let g=kT,y,E,T;if((!t||s(d,f,p[p.length-1]||void 0))&&(g=K6(n(d,p)),g[0]===T0))return g;if("children"in d&&d.children){const w=d;if(w.children&&g[0]!==X6)for(E=(i?w.children.length:-1)+l,T=p.concat(w);E>-1&&E<w.children.length;){const M=w.children[E];if(y=c(M,E,T)(),y[0]===T0)return y;E=typeof y[1]=="number"?y[1]:E+l}}return g}}}function K6(e){return Array.isArray(e)?e:typeof e=="number"?[G6,e]:e==null?kT:[e]}function Ad(e,t,n,i){let o,s,l;typeof t=="function"&&typeof n!="function"?(s=void 0,l=t,o=n):(s=t,l=n,o=i),wT(e,s,c,o);function c(d,f){const p=f[f.length-1],x=p?p.children.indexOf(d):void 0;return l(d,x,p)}}const S0={}.hasOwnProperty,$6={};function Q6(e,t){const n=t||$6,i=new Map,o=new Map,s=new Map,l={...L6,...n.handlers},c={all:f,applyData:Z6,definitionById:i,footnoteById:o,footnoteCounts:s,footnoteOrder:[],handlers:l,one:d,options:n,patch:W6,wrap:eM};return Ad(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const x=p.type==="definition"?i:o,b=String(p.identifier).toUpperCase();x.has(b)||x.set(b,p)}}),c;function d(p,x){const b=p.type,g=c.handlers[b];if(S0.call(c.handlers,b)&&g)return g(c,p,x);if(c.options.passThrough&&c.options.passThrough.includes(b)){if("children"in p){const{children:E,...T}=p,w=Pr(T);return w.children=c.all(p),w}return Pr(p)}return(c.options.unknownHandler||J6)(c,p,x)}function f(p){const x=[];if("children"in p){const b=p.children;let g=-1;for(;++g<b.length;){const y=c.one(b[g],p);if(y){if(g&&b[g-1].type==="break"&&(!Array.isArray(y)&&y.type==="text"&&(y.value=Jy(y.value)),!Array.isArray(y)&&y.type==="element")){const E=y.children[0];E&&E.type==="text"&&(E.value=Jy(E.value))}Array.isArray(y)?x.push(...y):x.push(y)}}}return x}}function W6(e,t){e.position&&(t.position=JE(e))}function Z6(e,t){let n=t;if(e&&e.data){const i=e.data.hName,o=e.data.hChildren,s=e.data.hProperties;if(typeof i=="string")if(n.type==="element")n.tagName=i;else{const l="children"in n?n.children:[n];n={type:"element",tagName:i,properties:{},children:l}}n.type==="element"&&s&&Object.assign(n.properties,Pr(s)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function J6(e,t){const n=t.data||{},i="value"in t&&!(S0.call(n,"hProperties")||S0.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function eM(e,t){const n=[];let i=-1;for(t&&n.push({type:"text",value:`
|
|
529
|
-
`});++i<e.length;)i&&n.push({type:"text",value:`
|
|
530
|
-
`}),n.push(e[i]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
531
|
-
`}),n}function Jy(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function ev(e,t){const n=Q6(e,t),i=n.one(e,void 0),o=U6(n),s=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return o&&s.children.push({type:"text",value:`
|
|
532
|
-
`},o),s}function tM(e,t){return e&&"run"in e?async function(n,i){const o=ev(n,{file:i,...t});await e.run(o,i)}:function(n,i){return ev(n,{file:i,...e||t})}}function tv(e){if(e)throw e}var bm,nv;function nM(){if(nv)return bm;nv=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},s=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),x=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!x)return!1;var b;for(b in f);return typeof b>"u"||e.call(f,b)},l=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},c=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(i)return i(f,p).value}else return;return f[p]};return bm=function d(){var f,p,x,b,g,y,E=arguments[0],T=1,w=arguments.length,M=!1;for(typeof E=="boolean"&&(M=E,E=arguments[1]||{},T=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});T<w;++T)if(f=arguments[T],f!=null)for(p in f)x=c(E,p),b=c(f,p),E!==b&&(M&&b&&(s(b)||(g=o(b)))?(g?(g=!1,y=x&&o(x)?x:[]):y=x&&s(x)?x:{},l(E,{name:p,newValue:d(M,y,b)})):typeof b<"u"&&l(E,{name:p,newValue:b}));return E},bm}var aM=nM();const ym=Ol(aM);function k0(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 iM(){const e=[],t={run:n,use:i};return t;function n(...o){let s=-1;const l=o.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...o);function c(d,...f){const p=e[++s];let x=-1;if(d){l(d);return}for(;++x<o.length;)(f[x]===null||f[x]===void 0)&&(f[x]=o[x]);o=f,p?rM(p,c)(...f):l(null,...f)}}function i(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function rM(e,t){let n;return i;function i(...l){const c=e.length>l.length;let d;c&&l.push(o);try{d=e.apply(this,l)}catch(f){const p=f;if(c&&n)throw p;return o(p)}c||(d&&d.then&&typeof d.then=="function"?d.then(s,o):d instanceof Error?o(d):s(d))}function o(l,...c){n||(n=!0,t(l,...c))}function s(l){o(null,l)}}const wa={basename:sM,dirname:oM,extname:lM,join:uM,sep:"/"};function sM(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Hl(e);let n=0,i=-1,o=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(s){n=o+1;break}}else i<0&&(s=!0,i=o+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let l=-1,c=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(s){n=o+1;break}}else l<0&&(s=!0,l=o+1),c>-1&&(e.codePointAt(o)===t.codePointAt(c--)?c<0&&(i=o):(c=-1,i=l));return n===i?i=l:i<0&&(i=e.length),e.slice(n,i)}function oM(e){if(Hl(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function lM(e){Hl(e);let t=e.length,n=-1,i=0,o=-1,s=0,l;for(;t--;){const c=e.codePointAt(t);if(c===47){if(l){i=t+1;break}continue}n<0&&(l=!0,n=t+1),c===46?o<0?o=t:s!==1&&(s=1):o>-1&&(s=-1)}return o<0||n<0||s===0||s===1&&o===n-1&&o===i+1?"":e.slice(o,n)}function uM(...e){let t=-1,n;for(;++t<e.length;)Hl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":cM(n)}function cM(e){Hl(e);const t=e.codePointAt(0)===47;let n=dM(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function dM(e,t){let n="",i=0,o=-1,s=0,l=-1,c,d;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(o===l-1||s===1))if(o!==l-1&&s===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",i=0):(n=n.slice(0,d),i=n.length-1-n.lastIndexOf("/")),o=l,s=0;continue}}else if(n.length>0){n="",i=0,o=l,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(o+1,l):n=e.slice(o+1,l),i=l-o-1;o=l,s=0}else c===46&&s>-1?s++:s=-1}return n}function Hl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const fM={cwd:hM};function hM(){return"/"}function w0(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function mM(e){if(typeof e=="string")e=new URL(e);else if(!w0(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 pM(e)}function pM(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const i=t.codePointAt(n+2);if(i===70||i===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const vm=["history","path","basename","stem","extname","dirname"];class AT{constructor(t){let n;t?w0(t)?n={path:t}:typeof t=="string"||gM(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":fM.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<vm.length;){const s=vm[i];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let o;for(o in n)vm.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?wa.basename(this.path):void 0}set basename(t){Tm(t,"basename"),Em(t,"basename"),this.path=wa.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?wa.dirname(this.path):void 0}set dirname(t){av(this.basename,"dirname"),this.path=wa.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?wa.extname(this.path):void 0}set extname(t){if(Em(t,"extname"),av(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=wa.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){w0(t)&&(t=mM(t)),Tm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?wa.basename(this.path,this.extname):void 0}set stem(t){Tm(t,"stem"),Em(t,"stem"),this.path=wa.join(this.dirname||"",t+(this.extname||""))}fail(t,n,i){const o=this.message(t,n,i);throw o.fatal=!0,o}info(t,n,i){const o=this.message(t,n,i);return o.fatal=void 0,o}message(t,n,i){const o=new bn(t,n,i);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Em(e,t){if(e&&e.includes(wa.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+wa.sep+"`")}function Tm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function av(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function gM(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const xM=(function(e){const i=this.constructor.prototype,o=i[e],s=function(){return o.apply(s,arguments)};return Object.setPrototypeOf(s,i),s}),bM={}.hasOwnProperty;class Cp extends xM{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=iM()}copy(){const t=new Cp;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(ym(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(wm("data",this.frozen),this.namespace[t]=n,this):bM.call(this.namespace,t)&&this.namespace[t]||void 0:t?(wm("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,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const o=n.call(t,...i);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=xc(t),i=this.parser||this.Parser;return Sm("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),Sm("process",this.parser||this.Parser),km("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(s,l){const c=xc(t),d=i.parse(c);i.run(d,c,function(p,x,b){if(p||!x||!b)return f(p);const g=x,y=i.stringify(g,b);EM(y)?b.value=y:b.result=y,f(p,b)});function f(p,x){p||!x?l(p):s?s(x):n(void 0,x)}}}processSync(t){let n=!1,i;return this.freeze(),Sm("processSync",this.parser||this.Parser),km("processSync",this.compiler||this.Compiler),this.process(t,o),rv("processSync","process",n),i;function o(s,l){n=!0,tv(s),i=l}}run(t,n,i){iv(t),this.freeze();const o=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?s(void 0,i):new Promise(s);function s(l,c){const d=xc(n);o.run(t,d,f);function f(p,x,b){const g=x||t;p?c(p):l?l(g):i(void 0,g,b)}}}runSync(t,n){let i=!1,o;return this.run(t,n,s),rv("runSync","run",i),o;function s(l,c){tv(l),o=c,i=!0}}stringify(t,n){this.freeze();const i=xc(n),o=this.compiler||this.Compiler;return km("stringify",o),iv(t),o(t,i)}use(t,...n){const i=this.attachers,o=this.namespace;if(wm("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...x]=f;d(p,x)}else l(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function l(f){if(!("plugins"in f)&&!("settings"in f))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");c(f.plugins),f.settings&&(o.settings=ym(!0,o.settings,f.settings))}function c(f){let p=-1;if(f!=null)if(Array.isArray(f))for(;++p<f.length;){const x=f[p];s(x)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,p){let x=-1,b=-1;for(;++x<i.length;)if(i[x][0]===f){b=x;break}if(b===-1)i.push([f,...p]);else if(p.length>0){let[g,...y]=p;const E=i[b][1];k0(E)&&k0(g)&&(g=ym(!0,E,g)),i[b]=[f,g,...y]}}}}const yM=new Cp().freeze();function Sm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function km(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function wm(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 iv(e){if(!k0(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function rv(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function xc(e){return vM(e)?e:new AT(e)}function vM(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function EM(e){return typeof e=="string"||TM(e)}function TM(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const SM="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",sv=[],ov={allowDangerousHtml:!0},kM=/^(https?|ircs?|mailto|xmpp)$/i,wM=[{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 CT(e){const t=AM(e),n=CM(e);return NM(t.runSync(t.parse(n),n),e)}function AM(e){const t=e.rehypePlugins||sv,n=e.remarkPlugins||sv,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...ov}:ov;return yM().use(o6).use(n).use(tM,i).use(t)}function CM(e){const t=e.children||"",n=new AT;return typeof t=="string"&&(n.value=t),n}function NM(e,t){const n=t.allowedElements,i=t.allowElement,o=t.components,s=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||_M;for(const p of wM)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+SM+p.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),Ad(e,f),q5(e,{Fragment:m.Fragment,components:o,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function f(p,x,b){if(p.type==="raw"&&b&&typeof x=="number")return l?b.children.splice(x,1):b.children[x]={type:"text",value:p.value},x;if(p.type==="element"){let g;for(g in pm)if(Object.hasOwn(pm,g)&&Object.hasOwn(p.properties,g)){const y=p.properties[g],E=pm[g];(E===null||E.includes(p.tagName))&&(p.properties[g]=d(String(y||""),g,p))}}if(p.type==="element"){let g=n?!n.includes(p.tagName):s?s.includes(p.tagName):!1;if(!g&&i&&typeof x=="number"&&(g=!i(p,x,b)),g&&b&&typeof x=="number")return c&&p.children?b.children.splice(x,1,...p.children):b.children.splice(x,1),x}}}function _M(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||i!==-1&&t>i||kM.test(e.slice(0,t))?e:""}function lv(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,o=n.indexOf(t);for(;o!==-1;)i++,o=n.indexOf(t,o+t.length);return i}function MM(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function RM(e,t,n){const o=kd((n||{}).ignore||[]),s=DM(t);let l=-1;for(;++l<s.length;)wT(e,"text",c);function c(f,p){let x=-1,b;for(;++x<p.length;){const g=p[x],y=b?b.children:void 0;if(o(g,y?y.indexOf(g):void 0,b))return;b=g}if(b)return d(f,p)}function d(f,p){const x=p[p.length-1],b=s[l][0],g=s[l][1];let y=0;const T=x.children.indexOf(f);let w=!1,M=[];b.lastIndex=0;let _=b.exec(f.value);for(;_;){const L=_.index,A={index:_.index,input:_.input,stack:[...p,f]};let R=g(..._,A);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?b.lastIndex=L+1:(y!==L&&M.push({type:"text",value:f.value.slice(y,L)}),Array.isArray(R)?M.push(...R):R&&M.push(R),y=L+_[0].length,w=!0),!b.global)break;_=b.exec(f.value)}return w?(y<f.value.length&&M.push({type:"text",value:f.value.slice(y)}),x.children.splice(T,1,...M)):M=[f],T+M.length}}function DM(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 i=-1;for(;++i<n.length;){const o=n[i];t.push([LM(o[0]),OM(o[1])])}return t}function LM(e){return typeof e=="string"?new RegExp(MM(e),"g"):e}function OM(e){return typeof e=="function"?e:function(){return e}}const Am="phrasing",Cm=["autolink","link","image","label"];function IM(){return{transforms:[FM],enter:{literalAutolink:PM,literalAutolinkEmail:Nm,literalAutolinkHttp:Nm,literalAutolinkWww:Nm},exit:{literalAutolink:HM,literalAutolinkEmail:UM,literalAutolinkHttp:BM,literalAutolinkWww:zM}}}function jM(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Am,notInConstruct:Cm},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Am,notInConstruct:Cm},{character:":",before:"[ps]",after:"\\/",inConstruct:Am,notInConstruct:Cm}]}}function PM(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Nm(e){this.config.enter.autolinkProtocol.call(this,e)}function BM(e){this.config.exit.autolinkProtocol.call(this,e)}function zM(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 UM(e){this.config.exit.autolinkEmail.call(this,e)}function HM(e){this.exit(e)}function FM(e){RM(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,VM],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),qM]],{ignore:["link","linkReference"]})}function VM(e,t,n,i,o){let s="";if(!NT(o)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!YM(n)))return!1;const l=GM(n+i);if(!l[0])return!1;const c={type:"link",title:null,url:s+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function qM(e,t,n,i){return!NT(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function YM(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 GM(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const o=lv(e,"(");let s=lv(e,")");for(;i!==-1&&o>s;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),s++;return[e,n]}function NT(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||jr(n)||Ed(n))&&(!t||n!==47)}_T.peek=tR;function XM(){this.buffer()}function KM(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function $M(){this.buffer()}function QM(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function WM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=xa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ZM(e){this.exit(e)}function JM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=xa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function eR(e){this.exit(e)}function tR(){return"["}function _T(e,t,n,i){const o=n.createTracker(i);let s=o.move("[^");const l=n.enter("footnoteReference"),c=n.enter("reference");return s+=o.move(n.safe(n.associationId(e),{after:"]",before:s})),c(),l(),s+=o.move("]"),s}function nR(){return{enter:{gfmFootnoteCallString:XM,gfmFootnoteCall:KM,gfmFootnoteDefinitionLabelString:$M,gfmFootnoteDefinition:QM},exit:{gfmFootnoteCallString:WM,gfmFootnoteCall:ZM,gfmFootnoteDefinitionLabelString:JM,gfmFootnoteDefinition:eR}}}function aR(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:_T},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,o,s,l){const c=s.createTracker(l);let d=c.move("[^");const f=s.enter("footnoteDefinition"),p=s.enter("label");return d+=c.move(s.safe(s.associationId(i),{before:d,after:"]"})),p(),d+=c.move("]:"),i.children&&i.children.length>0&&(c.shift(4),d+=c.move((t?`
|
|
533
|
-
`:" ")+s.indentLines(s.containerFlow(i,c.current()),t?MT:iR))),f(),d}}function iR(e,t,n){return t===0?e:MT(e,t,n)}function MT(e,t,n){return(n?"":" ")+e}const rR=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];RT.peek=cR;function sR(){return{canContainEols:["delete"],enter:{strikethrough:lR},exit:{strikethrough:uR}}}function oR(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:rR}],handlers:{delete:RT}}}function lR(e){this.enter({type:"delete",children:[]},e)}function uR(e){this.exit(e)}function RT(e,t,n,i){const o=n.createTracker(i),s=n.enter("strikethrough");let l=o.move("~~");return l+=n.containerPhrasing(e,{...o.current(),before:l,after:"~"}),l+=o.move("~~"),s(),l}function cR(){return"~"}function dR(e){return e.length}function fR(e,t){const n=t||{},i=(n.align||[]).concat(),o=n.stringLength||dR,s=[],l=[],c=[],d=[];let f=0,p=-1;for(;++p<e.length;){const E=[],T=[];let w=-1;for(e[p].length>f&&(f=e[p].length);++w<e[p].length;){const M=hR(e[p][w]);if(n.alignDelimiters!==!1){const _=o(M);T[w]=_,(d[w]===void 0||_>d[w])&&(d[w]=_)}E.push(M)}l[p]=E,c[p]=T}let x=-1;if(typeof i=="object"&&"length"in i)for(;++x<f;)s[x]=uv(i[x]);else{const E=uv(i);for(;++x<f;)s[x]=E}x=-1;const b=[],g=[];for(;++x<f;){const E=s[x];let T="",w="";E===99?(T=":",w=":"):E===108?T=":":E===114&&(w=":");let M=n.alignDelimiters===!1?1:Math.max(1,d[x]-T.length-w.length);const _=T+"-".repeat(M)+w;n.alignDelimiters!==!1&&(M=T.length+M+w.length,M>d[x]&&(d[x]=M),g[x]=M),b[x]=_}l.splice(1,0,b),c.splice(1,0,g),p=-1;const y=[];for(;++p<l.length;){const E=l[p],T=c[p];x=-1;const w=[];for(;++x<f;){const M=E[x]||"";let _="",L="";if(n.alignDelimiters!==!1){const A=d[x]-(T[x]||0),R=s[x];R===114?_=" ".repeat(A):R===99?A%2?(_=" ".repeat(A/2+.5),L=" ".repeat(A/2-.5)):(_=" ".repeat(A/2),L=_):L=" ".repeat(A)}n.delimiterStart!==!1&&!x&&w.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&M==="")&&(n.delimiterStart!==!1||x)&&w.push(" "),n.alignDelimiters!==!1&&w.push(_),w.push(M),n.alignDelimiters!==!1&&w.push(L),n.padding!==!1&&w.push(" "),(n.delimiterEnd!==!1||x!==f-1)&&w.push("|")}y.push(n.delimiterEnd===!1?w.join("").replace(/ +$/,""):w.join(""))}return y.join(`
|
|
534
|
-
`)}function hR(e){return e==null?"":String(e)}function uv(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 cv={}.hasOwnProperty;function DT(e,t){const n=t||{};function i(o,...s){let l=i.invalid;const c=i.handlers;if(o&&cv.call(o,e)){const d=String(o[e]);l=cv.call(c,d)?c[d]:i.unknown}if(l)return l.call(this,o,...s)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}function mR(e,t,n,i){const o=n.enter("blockquote"),s=n.createTracker(i);s.move("> "),s.shift(2);const l=n.indentLines(n.containerFlow(e,s.current()),pR);return o(),l}function pR(e,t,n){return">"+(n?"":" ")+e}function gR(e,t){return dv(e,t.inConstruct,!0)&&!dv(e,t.notInConstruct,!1)}function dv(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++i<t.length;)if(e.includes(t[i]))return!0;return!1}function fv(e,t,n,i){let o=-1;for(;++o<n.unsafe.length;)if(n.unsafe[o].character===`
|
|
535
|
-
`&&gR(n.stack,n.unsafe[o]))return/[ \t]/.test(i.before)?"":" ";return`\\
|
|
536
|
-
`}function xR(e,t){const n=String(e);let i=n.indexOf(t),o=i,s=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===o?++s>l&&(l=s):s=1,o=i+t.length,i=n.indexOf(t,o);return l}function bR(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 yR(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 vR(e,t,n,i){const o=yR(n),s=e.value||"",l=o==="`"?"GraveAccent":"Tilde";if(bR(e,n)){const x=n.enter("codeIndented"),b=n.indentLines(s,ER);return x(),b}const c=n.createTracker(i),d=o.repeat(Math.max(xR(s,o)+1,3)),f=n.enter("codeFenced");let p=c.move(d);if(e.lang){const x=n.enter(`codeFencedLang${l}`);p+=c.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...c.current()})),x()}if(e.lang&&e.meta){const x=n.enter(`codeFencedMeta${l}`);p+=c.move(" "),p+=c.move(n.safe(e.meta,{before:p,after:`
|
|
537
|
-
`,encode:["`"],...c.current()})),x()}return p+=c.move(`
|
|
538
|
-
`),s&&(p+=c.move(s+`
|
|
539
|
-
`)),p+=c.move(d),f(),p}function ER(e,t,n){return(n?"":" ")+e}function Np(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 TR(e,t,n,i){const o=Np(n),s=o==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=n.enter("label");const d=n.createTracker(i);let f=d.move("[");return f+=d.move(n.safe(n.associationId(e),{before:f,after:"]",...d.current()})),f+=d.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),f+=d.move("<"),f+=d.move(n.safe(e.url,{before:f,after:">",...d.current()})),f+=d.move(">")):(c=n.enter("destinationRaw"),f+=d.move(n.safe(e.url,{before:f,after:e.title?" ":`
|
|
540
|
-
`,...d.current()}))),c(),e.title&&(c=n.enter(`title${s}`),f+=d.move(" "+o),f+=d.move(n.safe(e.title,{before:f,after:o,...d.current()})),f+=d.move(o),c()),l(),f}function SR(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 Nl(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Wc(e,t,n){const i=Bs(e),o=Bs(t);return i===void 0?o===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}LT.peek=kR;function LT(e,t,n,i){const o=SR(n),s=n.enter("emphasis"),l=n.createTracker(i),c=l.move(o);let d=l.move(n.containerPhrasing(e,{after:o,before:c,...l.current()}));const f=d.charCodeAt(0),p=Wc(i.before.charCodeAt(i.before.length-1),f,o);p.inside&&(d=Nl(f)+d.slice(1));const x=d.charCodeAt(d.length-1),b=Wc(i.after.charCodeAt(0),x,o);b.inside&&(d=d.slice(0,-1)+Nl(x));const g=l.move(o);return s(),n.attentionEncodeSurroundingInfo={after:b.outside,before:p.outside},c+d+g}function kR(e,t,n){return n.options.emphasis||"*"}function wR(e,t){let n=!1;return Ad(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,T0}),!!((!e.depth||e.depth<3)&&vp(e)&&(t.options.setext||n))}function AR(e,t,n,i){const o=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(i);if(wR(e,n)){const p=n.enter("headingSetext"),x=n.enter("phrasing"),b=n.containerPhrasing(e,{...s.current(),before:`
|
|
541
|
-
`,after:`
|
|
542
|
-
`});return x(),p(),b+`
|
|
543
|
-
`+(o===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
|
|
544
|
-
`))+1))}const l="#".repeat(o),c=n.enter("headingAtx"),d=n.enter("phrasing");s.move(l+" ");let f=n.containerPhrasing(e,{before:"# ",after:`
|
|
545
|
-
`,...s.current()});return/^[\t ]/.test(f)&&(f=Nl(f.charCodeAt(0))+f.slice(1)),f=f?l+" "+f:l,n.options.closeAtx&&(f+=" "+l),d(),c(),f}OT.peek=CR;function OT(e){return e.value||""}function CR(){return"<"}IT.peek=NR;function IT(e,t,n,i){const o=Np(n),s=o==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const d=n.createTracker(i);let f=d.move("![");return f+=d.move(n.safe(e.alt,{before:f,after:"]",...d.current()})),f+=d.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),f+=d.move("<"),f+=d.move(n.safe(e.url,{before:f,after:">",...d.current()})),f+=d.move(">")):(c=n.enter("destinationRaw"),f+=d.move(n.safe(e.url,{before:f,after:e.title?" ":")",...d.current()}))),c(),e.title&&(c=n.enter(`title${s}`),f+=d.move(" "+o),f+=d.move(n.safe(e.title,{before:f,after:o,...d.current()})),f+=d.move(o),c()),f+=d.move(")"),l(),f}function NR(){return"!"}jT.peek=_R;function jT(e,t,n,i){const o=e.referenceType,s=n.enter("imageReference");let l=n.enter("label");const c=n.createTracker(i);let d=c.move("![");const f=n.safe(e.alt,{before:d,after:"]",...c.current()});d+=c.move(f+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const x=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return l(),n.stack=p,s(),o==="full"||!f||f!==x?d+=c.move(x+"]"):o==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function _R(){return"!"}PT.peek=MR;function PT(e,t,n){let i=e.value||"",o="`",s=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(i);)o+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++s<n.unsafe.length;){const l=n.unsafe[s],c=n.compilePattern(l);let d;if(l.atBreak)for(;d=c.exec(i);){let f=d.index;i.charCodeAt(f)===10&&i.charCodeAt(f-1)===13&&f--,i=i.slice(0,f)+" "+i.slice(d.index+1)}}return o+i+o}function MR(){return"`"}function BT(e,t){const n=vp(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))}zT.peek=RR;function zT(e,t,n,i){const o=Np(n),s=o==='"'?"Quote":"Apostrophe",l=n.createTracker(i);let c,d;if(BT(e,n)){const p=n.stack;n.stack=[],c=n.enter("autolink");let x=l.move("<");return x+=l.move(n.containerPhrasing(e,{before:x,after:">",...l.current()})),x+=l.move(">"),c(),n.stack=p,x}c=n.enter("link"),d=n.enter("label");let f=l.move("[");return f+=l.move(n.containerPhrasing(e,{before:f,after:"](",...l.current()})),f+=l.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),f+=l.move("<"),f+=l.move(n.safe(e.url,{before:f,after:">",...l.current()})),f+=l.move(">")):(d=n.enter("destinationRaw"),f+=l.move(n.safe(e.url,{before:f,after:e.title?" ":")",...l.current()}))),d(),e.title&&(d=n.enter(`title${s}`),f+=l.move(" "+o),f+=l.move(n.safe(e.title,{before:f,after:o,...l.current()})),f+=l.move(o),d()),f+=l.move(")"),c(),f}function RR(e,t,n){return BT(e,n)?"<":"["}UT.peek=DR;function UT(e,t,n,i){const o=e.referenceType,s=n.enter("linkReference");let l=n.enter("label");const c=n.createTracker(i);let d=c.move("[");const f=n.containerPhrasing(e,{before:d,after:"]",...c.current()});d+=c.move(f+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const x=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return l(),n.stack=p,s(),o==="full"||!f||f!==x?d+=c.move(x+"]"):o==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function DR(){return"["}function _p(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 LR(e){const t=_p(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 OR(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 HT(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 IR(e,t,n,i){const o=n.enter("list"),s=n.bulletCurrent;let l=e.ordered?OR(n):_p(n);const c=e.ordered?l==="."?")":".":LR(n);let d=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&p&&(!p.children||!p.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&&(d=!0),HT(n)===l&&p){let x=-1;for(;++x<e.children.length;){const b=e.children[x];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(l=c),n.bulletCurrent=l;const f=n.containerFlow(e,i);return n.bulletLastUsed=l,n.bulletCurrent=s,o(),f}function jR(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 PR(e,t,n,i){const o=jR(n);let s=n.bulletCurrent||_p(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let l=s.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const c=n.createTracker(i);c.move(s+" ".repeat(l-s.length)),c.shift(l);const d=n.enter("listItem"),f=n.indentLines(n.containerFlow(e,c.current()),p);return d(),f;function p(x,b,g){return b?(g?"":" ".repeat(l))+x:(g?s:s+" ".repeat(l-s.length))+x}}function BR(e,t,n,i){const o=n.enter("paragraph"),s=n.enter("phrasing"),l=n.containerPhrasing(e,i);return s(),o(),l}const zR=kd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function UR(e,t,n,i){return(e.children.some(function(l){return zR(l)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function HR(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}FT.peek=FR;function FT(e,t,n,i){const o=HR(n),s=n.enter("strong"),l=n.createTracker(i),c=l.move(o+o);let d=l.move(n.containerPhrasing(e,{after:o,before:c,...l.current()}));const f=d.charCodeAt(0),p=Wc(i.before.charCodeAt(i.before.length-1),f,o);p.inside&&(d=Nl(f)+d.slice(1));const x=d.charCodeAt(d.length-1),b=Wc(i.after.charCodeAt(0),x,o);b.inside&&(d=d.slice(0,-1)+Nl(x));const g=l.move(o+o);return s(),n.attentionEncodeSurroundingInfo={after:b.outside,before:p.outside},c+d+g}function FR(e,t,n){return n.options.strong||"*"}function VR(e,t,n,i){return n.safe(e.value,i)}function qR(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 YR(e,t,n){const i=(HT(n)+(n.options.ruleSpaces?" ":"")).repeat(qR(n));return n.options.ruleSpaces?i.slice(0,-1):i}const VT={blockquote:mR,break:fv,code:vR,definition:TR,emphasis:LT,hardBreak:fv,heading:AR,html:OT,image:IT,imageReference:jT,inlineCode:PT,link:zT,linkReference:UT,list:IR,listItem:PR,paragraph:BR,root:UR,strong:FT,text:VR,thematicBreak:YR};function GR(){return{enter:{table:XR,tableData:hv,tableHeader:hv,tableRow:$R},exit:{codeText:QR,table:KR,tableData:_m,tableHeader:_m,tableRow:_m}}}function XR(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 KR(e){this.exit(e),this.data.inTable=void 0}function $R(e){this.enter({type:"tableRow",children:[]},e)}function _m(e){this.exit(e)}function hv(e){this.enter({type:"tableCell",children:[]},e)}function QR(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,WR));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function WR(e,t){return t==="|"?t:e}function ZR(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,o=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
546
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:l,tableCell:d,tableRow:c}};function l(g,y,E,T){return f(p(g,E,T),g.align)}function c(g,y,E,T){const w=x(g,E,T),M=f([w]);return M.slice(0,M.indexOf(`
|
|
547
|
-
`))}function d(g,y,E,T){const w=E.enter("tableCell"),M=E.enter("phrasing"),_=E.containerPhrasing(g,{...T,before:s,after:s});return M(),w(),_}function f(g,y){return fR(g,{align:y,alignDelimiters:i,padding:n,stringLength:o})}function p(g,y,E){const T=g.children;let w=-1;const M=[],_=y.enter("table");for(;++w<T.length;)M[w]=x(T[w],y,E);return _(),M}function x(g,y,E){const T=g.children;let w=-1;const M=[],_=y.enter("tableRow");for(;++w<T.length;)M[w]=d(T[w],g,y,E);return _(),M}function b(g,y,E){let T=VT.inlineCode(g,y,E);return E.stack.includes("tableCell")&&(T=T.replace(/\|/g,"\\$&")),T}}function JR(){return{exit:{taskListCheckValueChecked:mv,taskListCheckValueUnchecked:mv,paragraph:tD}}}function eD(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:nD}}}function mv(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function tD(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 i=n.children[0];if(i&&i.type==="text"){const o=t.children;let s=-1,l;for(;++s<o.length;){const c=o[s];if(c.type==="paragraph"){l=c;break}}l===n&&(i.value=i.value.slice(1),i.value.length===0?n.children.shift():n.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,n.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function nD(e,t,n,i){const o=e.children[0],s=typeof e.checked=="boolean"&&o&&o.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",c=n.createTracker(i);s&&c.move(l);let d=VT.listItem(e,t,n,{...i,...c.current()});return s&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),d;function f(p){return p+l}}function aD(){return[IM(),nR(),sR(),GR(),JR()]}function iD(e){return{extensions:[jM(),aR(e),oR(),ZR(e),eD()]}}const rD={tokenize:dD,partial:!0},qT={tokenize:fD,partial:!0},YT={tokenize:hD,partial:!0},GT={tokenize:mD,partial:!0},sD={tokenize:pD,partial:!0},XT={name:"wwwAutolink",tokenize:uD,previous:$T},KT={name:"protocolAutolink",tokenize:cD,previous:QT},ui={name:"emailAutolink",tokenize:lD,previous:WT},ja={};function oD(){return{text:ja}}let br=48;for(;br<123;)ja[br]=ui,br++,br===58?br=65:br===91&&(br=97);ja[43]=ui;ja[45]=ui;ja[46]=ui;ja[95]=ui;ja[72]=[ui,KT];ja[104]=[ui,KT];ja[87]=[ui,XT];ja[119]=[ui,XT];function lD(e,t,n){const i=this;let o,s;return l;function l(x){return!A0(x)||!WT.call(i,i.previous)||Mp(i.events)?n(x):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(x))}function c(x){return A0(x)?(e.consume(x),c):x===64?(e.consume(x),d):n(x)}function d(x){return x===46?e.check(sD,p,f)(x):x===45||x===95||xn(x)?(s=!0,e.consume(x),d):p(x)}function f(x){return e.consume(x),o=!0,d}function p(x){return s&&o&&En(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(x)):n(x)}}function uD(e,t,n){const i=this;return o;function o(l){return l!==87&&l!==119||!$T.call(i,i.previous)||Mp(i.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(rD,e.attempt(qT,e.attempt(YT,s),n),n)(l))}function s(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function cD(e,t,n){const i=this;let o="",s=!1;return l;function l(x){return(x===72||x===104)&&QT.call(i,i.previous)&&!Mp(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(x),e.consume(x),c):n(x)}function c(x){if(En(x)&&o.length<5)return o+=String.fromCodePoint(x),e.consume(x),c;if(x===58){const b=o.toLowerCase();if(b==="http"||b==="https")return e.consume(x),d}return n(x)}function d(x){return x===47?(e.consume(x),s?f:(s=!0,d)):n(x)}function f(x){return x===null||$c(x)||Lt(x)||jr(x)||Ed(x)?n(x):e.attempt(qT,e.attempt(YT,p),n)(x)}function p(x){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(x)}}function dD(e,t,n){let i=0;return o;function o(l){return(l===87||l===119)&&i<3?(i++,e.consume(l),o):l===46&&i===3?(e.consume(l),s):n(l)}function s(l){return l===null?n(l):t(l)}}function fD(e,t,n){let i,o,s;return l;function l(f){return f===46||f===95?e.check(GT,d,c)(f):f===null||Lt(f)||jr(f)||f!==45&&Ed(f)?d(f):(s=!0,e.consume(f),l)}function c(f){return f===95?i=!0:(o=i,i=void 0),e.consume(f),l}function d(f){return o||i||!s?n(f):t(f)}}function hD(e,t){let n=0,i=0;return o;function o(l){return l===40?(n++,e.consume(l),o):l===41&&i<n?s(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(GT,t,s)(l):l===null||Lt(l)||jr(l)?t(l):(e.consume(l),o)}function s(l){return l===41&&i++,e.consume(l),o}}function mD(e,t,n){return i;function i(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),i):c===38?(e.consume(c),s):c===93?(e.consume(c),o):c===60||c===null||Lt(c)||jr(c)?t(c):n(c)}function o(c){return c===null||c===40||c===91||Lt(c)||jr(c)?t(c):i(c)}function s(c){return En(c)?l(c):n(c)}function l(c){return c===59?(e.consume(c),i):En(c)?(e.consume(c),l):n(c)}}function pD(e,t,n){return i;function i(s){return e.consume(s),o}function o(s){return xn(s)?n(s):t(s)}}function $T(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Lt(e)}function QT(e){return!En(e)}function WT(e){return!(e===47||A0(e))}function A0(e){return e===43||e===45||e===46||e===95||xn(e)}function Mp(e){let t=e.length,n=!1;for(;t--;){const i=e[t][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const gD={tokenize:kD,partial:!0};function xD(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:ED,continuation:{tokenize:TD},exit:SD}},text:{91:{name:"gfmFootnoteCall",tokenize:vD},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:bD,resolveTo:yD}}}}function bD(e,t,n){const i=this;let o=i.events.length;const s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let l;for(;o--;){const d=i.events[o][1];if(d.type==="labelImage"){l=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return c;function c(d){if(!l||!l._balanced)return n(d);const f=xa(i.sliceSerialize({start:l.end,end:i.now()}));return f.codePointAt(0)!==94||!s.includes(f.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function yD(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 i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},c=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",s,t],["enter",l,t],["exit",l,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...c),e}function vD(e,t,n){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s=0,l;return c;function c(x){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),d}function d(x){return x!==94?n(x):(e.enter("gfmFootnoteCallMarker"),e.consume(x),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(x){if(s>999||x===93&&!l||x===null||x===91||Lt(x))return n(x);if(x===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return o.includes(xa(i.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(x)}return Lt(x)||(l=!0),s++,e.consume(x),x===92?p:f}function p(x){return x===91||x===92||x===93?(e.consume(x),s++,f):f(x)}}function ED(e,t,n){const i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s,l=0,c;return d;function d(y){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(y){return y===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(y)}function p(y){if(l>999||y===93&&!c||y===null||y===91||Lt(y))return n(y);if(y===93){e.exit("chunkString");const E=e.exit("gfmFootnoteDefinitionLabelString");return s=xa(i.sliceSerialize(E)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return Lt(y)||(c=!0),l++,e.consume(y),y===92?x:p}function x(y){return y===91||y===92||y===93?(e.consume(y),l++,p):p(y)}function b(y){return y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),o.includes(s)||o.push(s),pt(e,g,"gfmFootnoteDefinitionWhitespace")):n(y)}function g(y){return t(y)}}function TD(e,t,n){return e.check(Ul,t,e.attempt(gD,t,n))}function SD(e){e.exit("gfmFootnoteDefinition")}function kD(e,t,n){const i=this;return pt(e,o,"gfmFootnoteDefinitionIndent",5);function o(s){const l=i.events[i.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(s):n(s)}}function wD(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:s,resolveAll:o};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function o(l,c){let d=-1;for(;++d<l.length;)if(l[d][0]==="enter"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._close){let f=d;for(;f--;)if(l[f][0]==="exit"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._open&&l[d][1].end.offset-l[d][1].start.offset===l[f][1].end.offset-l[f][1].start.offset){l[d][1].type="strikethroughSequence",l[f][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},l[f][1].start),end:Object.assign({},l[d][1].end)},x={type:"strikethroughText",start:Object.assign({},l[f][1].end),end:Object.assign({},l[d][1].start)},b=[["enter",p,c],["enter",l[f][1],c],["exit",l[f][1],c],["enter",x,c]],g=c.parser.constructs.insideSpan.null;g&&qn(b,b.length,0,Td(g,l.slice(f+1,d),c)),qn(b,b.length,0,[["exit",x,c],["enter",l[d][1],c],["exit",l[d][1],c],["exit",p,c]]),qn(l,f-1,d-f+3,b),d=f+b.length-2;break}}for(d=-1;++d<l.length;)l[d][1].type==="strikethroughSequenceTemporary"&&(l[d][1].type="data");return l}function s(l,c,d){const f=this.previous,p=this.events;let x=0;return b;function b(y){return f===126&&p[p.length-1][1].type!=="characterEscape"?d(y):(l.enter("strikethroughSequenceTemporary"),g(y))}function g(y){const E=Bs(f);if(y===126)return x>1?d(y):(l.consume(y),x++,g);if(x<2&&!n)return d(y);const T=l.exit("strikethroughSequenceTemporary"),w=Bs(y);return T._open=!w||w===2&&!!E,T._close=!E||E===2&&!!w,c(y)}}}class AD{constructor(){this.map=[]}add(t,n,i){CD(this,t,n,i)}consume(t){if(this.map.sort(function(s,l){return s[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let o=i.pop();for(;o;){for(const s of o)t.push(s);o=i.pop()}this.map.length=0}}function CD(e,t,n,i){let o=0;if(!(n===0&&i.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=n,e.map[o][2].push(...i);return}o+=1}e.map.push([t,n,i])}}function ND(e,t){let n=!1;const i=[];for(;t<e.length;){const o=e[t];if(n){if(o[0]==="enter")o[1].type==="tableContent"&&i.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=i.length-1;i[s]=i[s]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return i}function _D(){return{flow:{null:{name:"table",tokenize:MD,resolveAll:RD}}}}function MD(e,t,n){const i=this;let o=0,s=0,l;return c;function c(D){let P=i.events.length-1;for(;P>-1;){const q=i.events[P][1].type;if(q==="lineEnding"||q==="linePrefix")P--;else break}const z=P>-1?i.events[P][1].type:null,K=z==="tableHead"||z==="tableRow"?R:d;return K===R&&i.parser.lazy[i.now().line]?n(D):K(D)}function d(D){return e.enter("tableHead"),e.enter("tableRow"),f(D)}function f(D){return D===124||(l=!0,s+=1),p(D)}function p(D){return D===null?n(D):Ye(D)?s>1?(s=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),g):n(D):dt(D)?pt(e,p,"whitespace")(D):(s+=1,l&&(l=!1,o+=1),D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),l=!0,p):(e.enter("data"),x(D)))}function x(D){return D===null||D===124||Lt(D)?(e.exit("data"),p(D)):(e.consume(D),D===92?b:x)}function b(D){return D===92||D===124?(e.consume(D),x):x(D)}function g(D){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(D):(e.enter("tableDelimiterRow"),l=!1,dt(D)?pt(e,y,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):y(D))}function y(D){return D===45||D===58?T(D):D===124?(l=!0,e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),E):A(D)}function E(D){return dt(D)?pt(e,T,"whitespace")(D):T(D)}function T(D){return D===58?(s+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),w):D===45?(s+=1,w(D)):D===null||Ye(D)?L(D):A(D)}function w(D){return D===45?(e.enter("tableDelimiterFiller"),M(D)):A(D)}function M(D){return D===45?(e.consume(D),M):D===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),_):(e.exit("tableDelimiterFiller"),_(D))}function _(D){return dt(D)?pt(e,L,"whitespace")(D):L(D)}function L(D){return D===124?y(D):D===null||Ye(D)?!l||o!==s?A(D):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(D)):A(D)}function A(D){return n(D)}function R(D){return e.enter("tableRow"),j(D)}function j(D){return D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),j):D===null||Ye(D)?(e.exit("tableRow"),t(D)):dt(D)?pt(e,j,"whitespace")(D):(e.enter("data"),N(D))}function N(D){return D===null||D===124||Lt(D)?(e.exit("data"),j(D)):(e.consume(D),D===92?I:N)}function I(D){return D===92||D===124?(e.consume(D),N):N(D)}}function RD(e,t){let n=-1,i=!0,o=0,s=[0,0,0,0],l=[0,0,0,0],c=!1,d=0,f,p,x;const b=new AD;for(;++n<e.length;){const g=e[n],y=g[1];g[0]==="enter"?y.type==="tableHead"?(c=!1,d!==0&&(pv(b,t,d,f,p),p=void 0,d=0),f={type:"table",start:Object.assign({},y.start),end:Object.assign({},y.end)},b.add(n,0,[["enter",f,t]])):y.type==="tableRow"||y.type==="tableDelimiterRow"?(i=!0,x=void 0,s=[0,0,0,0],l=[0,n+1,0,0],c&&(c=!1,p={type:"tableBody",start:Object.assign({},y.start),end:Object.assign({},y.end)},b.add(n,0,[["enter",p,t]])),o=y.type==="tableDelimiterRow"?2:p?3:1):o&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")?(i=!1,l[2]===0&&(s[1]!==0&&(l[0]=l[1],x=bc(b,t,s,o,void 0,x),s=[0,0,0,0]),l[2]=n)):y.type==="tableCellDivider"&&(i?i=!1:(s[1]!==0&&(l[0]=l[1],x=bc(b,t,s,o,void 0,x)),s=l,l=[s[1],n,0,0])):y.type==="tableHead"?(c=!0,d=n):y.type==="tableRow"||y.type==="tableDelimiterRow"?(d=n,s[1]!==0?(l[0]=l[1],x=bc(b,t,s,o,n,x)):l[1]!==0&&(x=bc(b,t,l,o,n,x)),o=0):o&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")&&(l[3]=n)}for(d!==0&&pv(b,t,d,f,p),b.consume(t.events),n=-1;++n<t.events.length;){const g=t.events[n];g[0]==="enter"&&g[1].type==="table"&&(g[1]._align=ND(t.events,n))}return e}function bc(e,t,n,i,o,s){const l=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(s.end=Object.assign({},_s(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const d=_s(t.events,n[1]);if(s={type:l,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const f=_s(t.events,n[2]),p=_s(t.events,n[3]),x={type:c,start:Object.assign({},f),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",x,t]]),i!==2){const b=t.events[n[2]],g=t.events[n[3]];if(b[1].end=Object.assign({},g[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const y=n[2]+1,E=n[3]-n[2]-1;e.add(y,E,[])}}e.add(n[3]+1,0,[["exit",x,t]])}return o!==void 0&&(s.end=Object.assign({},_s(t.events,o)),e.add(o,0,[["exit",s,t]]),s=void 0),s}function pv(e,t,n,i,o){const s=[],l=_s(t.events,n);o&&(o.end=Object.assign({},l),s.push(["exit",o,t])),i.end=Object.assign({},l),s.push(["exit",i,t]),e.add(n+1,0,s)}function _s(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const DD={name:"tasklistCheck",tokenize:OD};function LD(){return{text:{91:DD}}}function OD(e,t,n){const i=this;return o;function o(d){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),s)}function s(d){return Lt(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),l):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),l):n(d)}function l(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(d)}function c(d){return Ye(d)?t(d):dt(d)?e.check({tokenize:ID},t,n)(d):n(d)}}function ID(e,t,n){return pt(e,i,"whitespace");function i(o){return o===null?n(o):t(o)}}function jD(e){return rT([oD(),xD(),wD(e),_D(),LD()])}const PD={};function ZT(e){const t=this,n=e||PD,i=t.data(),o=i.micromarkExtensions||(i.micromarkExtensions=[]),s=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),l=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);o.push(jD(n)),s.push(aD()),l.push(iD(n))}const gv=/[#.]/g;function BD(e,t){const n=e||"",i={};let o=0,s,l;for(;o<n.length;){gv.lastIndex=o;const c=gv.exec(n),d=n.slice(o,c?c.index:n.length);d&&(s?s==="#"?i.id=d:Array.isArray(i.className)?i.className.push(d):i.className=[d]:l=d,o+=d.length),c&&(s=c[0],o++)}return{type:"element",tagName:l||t||"div",properties:i,children:[]}}function JT(e,t,n){const i=n?FD(n):void 0;function o(s,l,...c){let d;if(s==null){d={type:"root",children:[]};const f=l;c.unshift(f)}else{d=BD(s,t);const f=d.tagName.toLowerCase(),p=i?i.get(f):void 0;if(d.tagName=p||f,zD(l))c.unshift(l);else for(const[x,b]of Object.entries(l))UD(e,d.properties,x,b)}for(const f of c)C0(d.children,f);return d.type==="element"&&d.tagName==="template"&&(d.content={type:"root",children:d.children},d.children=[]),d}return o}function zD(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 i of n){const o=t[i];if(o&&typeof o=="object"){if(!Array.isArray(o))return!0;const s=o;for(const l of s)if(typeof l!="number"&&typeof l!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function UD(e,t,n,i){const o=yd(e,n);let s;if(i!=null){if(typeof i=="number"){if(Number.isNaN(i))return;s=i}else typeof i=="boolean"?s=i:typeof i=="string"?o.spaceSeparated?s=_y(i):o.commaSeparated?s=ky(i):o.commaOrSpaceSeparated?s=_y(ky(i).join(" ")):s=xv(o,o.property,i):Array.isArray(i)?s=[...i]:s=o.property==="style"?HD(i):String(i);if(Array.isArray(s)){const l=[];for(const c of s)l.push(xv(o,o.property,c));s=l}o.property==="className"&&Array.isArray(t.className)&&(s=t.className.concat(s)),t[o.property]=s}}function C0(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)C0(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?C0(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function xv(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Al(n)===Al(t)))return!0}return n}function HD(e){const t=[];for(const[n,i]of Object.entries(e))t.push([n,i].join(": "));return t.join("; ")}function FD(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const VD=["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"],qD=JT(zl,"div"),YD=JT(Yi,"g",VD);function GD(e){const t=String(e),n=[];return{toOffset:o,toPoint:i};function i(s){if(typeof s=="number"&&s>-1&&s<=t.length){let l=0;for(;;){let c=n[l];if(c===void 0){const d=bv(t,n[l-1]);c=d===-1?t.length+1:d+1,n[l]=c}if(c>s)return{line:l+1,column:s-(l>0?n[l-1]:0)+1,offset:s};l++}}}function o(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length<s.line;){const c=n[n.length-1],d=bv(t,c),f=d===-1?t.length+1:d+1;if(c===f)break;n.push(f)}const l=(s.line>1?n[s.line-2]:0)+s.column-1;if(l<n[s.line-1])return l}}}function bv(e,t){const n=e.indexOf("\r",t),i=e.indexOf(`
|
|
548
|
-
`,t);return i===-1?n:n===-1||n+1===i?i:n<i?n:i}const wr={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/"},eS={}.hasOwnProperty,XD=Object.prototype;function KD(e,t){const n=t||{};return Rp({file:n.file||void 0,location:!1,schema:n.space==="svg"?Yi:zl,verbose:n.verbose||!1},e)}function Rp(e,t){let n;switch(t.nodeName){case"#comment":{const i=t;return n={type:"comment",value:i.data},Lc(e,i,n),n}case"#document":case"#document-fragment":{const i=t,o="mode"in i?i.mode==="quirks"||i.mode==="limited-quirks":!1;if(n={type:"root",children:tS(e,t.childNodes),data:{quirksMode:o}},e.file&&e.location){const s=String(e.file),l=GD(s),c=l.toPoint(0),d=l.toPoint(s.length);n.position={start:c,end:d}}return n}case"#documentType":{const i=t;return n={type:"doctype"},Lc(e,i,n),n}case"#text":{const i=t;return n={type:"text",value:i.value},Lc(e,i,n),n}default:return n=$D(e,t),n}}function tS(e,t){let n=-1;const i=[];for(;++n<t.length;){const o=Rp(e,t[n]);i.push(o)}return i}function $D(e,t){const n=e.schema;e.schema=t.namespaceURI===wr.svg?Yi:zl;let i=-1;const o={};for(;++i<t.attrs.length;){const c=t.attrs[i],d=(c.prefix?c.prefix+":":"")+c.name;eS.call(XD,d)||(o[d]=c.value)}const l=(e.schema.space==="svg"?YD:qD)(t.tagName,o,tS(e,t.childNodes));if(Lc(e,t,l),l.tagName==="template"){const c=t,d=c.sourceCodeLocation,f=d&&d.startTag&&Rs(d.startTag),p=d&&d.endTag&&Rs(d.endTag),x=Rp(e,c.content);f&&p&&e.file&&(x.position={start:f.end,end:p.start}),l.content=x}return e.schema=n,l}function Lc(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const i=QD(e,n,t.sourceCodeLocation);i&&(e.location=!0,n.position=i)}}function QD(e,t,n){const i=Rs(n);if(t.type==="element"){const o=t.children[t.children.length-1];if(i&&!n.endTag&&o&&o.position&&o.position.end&&(i.end=Object.assign({},o.position.end)),e.verbose){const s={};let l;if(n.attrs)for(l in n.attrs)eS.call(n.attrs,l)&&(s[yd(e.schema,l).property]=Rs(n.attrs[l]));n.startTag;const c=Rs(n.startTag),d=n.endTag?Rs(n.endTag):void 0,f={opening:c};d&&(f.closing=d),f.properties=s,t.data={position:f}}}return i}function Rs(e){const t=yv({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=yv({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function yv(e){return e.line&&e.column?e:void 0}const WD={},ZD={}.hasOwnProperty,nS=DT("type",{handlers:{root:e8,element:r8,text:a8,comment:i8,doctype:n8}});function JD(e,t){const i=(t||WD).space;return nS(e,i==="svg"?Yi:zl)}function e8(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Dp(e.children,n,t),Ys(e,n),n}function t8(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Dp(e.children,n,t),Ys(e,n),n}function n8(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Ys(e,t),t}function a8(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Ys(e,t),t}function i8(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Ys(e,t),t}function r8(e,t){const n=t;let i=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(i=Yi);const o=[];let s;if(e.properties){for(s in e.properties)if(s!=="children"&&ZD.call(e.properties,s)){const d=s8(i,s,e.properties[s]);d&&o.push(d)}}const l=i.space,c={nodeName:e.tagName,tagName:e.tagName,attrs:o,namespaceURI:wr[l],childNodes:[],parentNode:null};return c.childNodes=Dp(e.children,c,i),Ys(e,c),e.tagName==="template"&&e.content&&(c.content=t8(e.content,i)),c}function s8(e,t,n){const i=yd(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&i.boolean)return;Array.isArray(n)&&(n=i.commaSeparated?VE(n):WE(n));const o={name:i.attribute,value:n===!0?"":String(n)};if(i.space&&i.space!=="html"&&i.space!=="svg"){const s=o.name.indexOf(":");s<0?o.prefix="":(o.name=o.name.slice(s+1),o.prefix=i.attribute.slice(0,s)),o.namespace=wr[i.space]}return o}function Dp(e,t,n){let i=-1;const o=[];if(e)for(;++i<e.length;){const s=nS(e[i],n);s.parentNode=t,o.push(s)}return o}function Ys(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 o8=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],l8=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]),Bt="�";var X;(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"})(X||(X={}));const Rn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function aS(e){return e>=55296&&e<=57343}function u8(e){return e>=56320&&e<=57343}function c8(e,t){return(e-55296)*1024+9216+t}function iS(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function rS(e){return e>=64976&&e<=65007||l8.has(e)}var xe;(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"})(xe||(xe={}));const d8=65536;class f8{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=d8,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:i,col:o,offset:s}=this,l=o+n,c=s+n;return{code:t,startLine:i,endLine:i,startCol:l,endCol:l,startOffset:c,endOffset:c}}_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(u8(n))return this.pos++,this._addGap(),c8(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,X.EOF;return this._err(xe.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 i=0;i<t.length;i++)if((this.html.charCodeAt(this.pos+i)|32)!==t.charCodeAt(i))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,X.EOF;const i=this.html.charCodeAt(n);return i===X.CARRIAGE_RETURN?X.LINE_FEED:i}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,X.EOF;let t=this.html.charCodeAt(this.pos);return t===X.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,X.LINE_FEED):t===X.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,aS(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===X.LINE_FEED||t===X.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){iS(t)?this._err(xe.controlCharacterInInputStream):rS(t)&&this._err(xe.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var ot;(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"})(ot||(ot={}));function sS(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 h8=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))),m8=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 p8(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=m8.get(e))!==null&&t!==void 0?t:e}var ln;(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"})(ln||(ln={}));const g8=32;var Hi;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Hi||(Hi={}));function N0(e){return e>=ln.ZERO&&e<=ln.NINE}function x8(e){return e>=ln.UPPER_A&&e<=ln.UPPER_F||e>=ln.LOWER_A&&e<=ln.LOWER_F}function b8(e){return e>=ln.UPPER_A&&e<=ln.UPPER_Z||e>=ln.LOWER_A&&e<=ln.LOWER_Z||N0(e)}function y8(e){return e===ln.EQUALS||b8(e)}var on;(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"})(on||(on={}));var si;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(si||(si={}));class v8{constructor(t,n,i){this.decodeTree=t,this.emitCodePoint=n,this.errors=i,this.state=on.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=si.Strict}startEntity(t){this.decodeMode=t,this.state=on.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case on.EntityStart:return t.charCodeAt(n)===ln.NUM?(this.state=on.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=on.NamedEntity,this.stateNamedEntity(t,n));case on.NumericStart:return this.stateNumericStart(t,n);case on.NumericDecimal:return this.stateNumericDecimal(t,n);case on.NumericHex:return this.stateNumericHex(t,n);case on.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|g8)===ln.LOWER_X?(this.state=on.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=on.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,i,o){if(n!==i){const s=i-n;this.result=this.result*Math.pow(o,s)+Number.parseInt(t.substr(n,s),o),this.consumed+=s}}stateNumericHex(t,n){const i=n;for(;n<t.length;){const o=t.charCodeAt(n);if(N0(o)||x8(o))n+=1;else return this.addToNumericResult(t,i,n,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(t,i,n,16),-1}stateNumericDecimal(t,n){const i=n;for(;n<t.length;){const o=t.charCodeAt(n);if(N0(o))n+=1;else return this.addToNumericResult(t,i,n,10),this.emitNumericEntity(o,2)}return this.addToNumericResult(t,i,n,10),-1}emitNumericEntity(t,n){var i;if(this.consumed<=n)return(i=this.errors)===null||i===void 0||i.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===ln.SEMI)this.consumed+=1;else if(this.decodeMode===si.Strict)return 0;return this.emitCodePoint(p8(this.result),this.consumed),this.errors&&(t!==ln.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:i}=this;let o=i[this.treeIndex],s=(o&Hi.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const l=t.charCodeAt(n);if(this.treeIndex=E8(i,o,this.treeIndex+Math.max(1,s),l),this.treeIndex<0)return this.result===0||this.decodeMode===si.Attribute&&(s===0||y8(l))?0:this.emitNotTerminatedNamedEntity();if(o=i[this.treeIndex],s=(o&Hi.VALUE_LENGTH)>>14,s!==0){if(l===ln.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==si.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:i}=this,o=(i[n]&Hi.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,o,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,i){const{decodeTree:o}=this;return this.emitCodePoint(n===1?o[t]&~Hi.VALUE_LENGTH:o[t+1],i),n===3&&this.emitCodePoint(o[t+2],i),i}end(){var t;switch(this.state){case on.NamedEntity:return this.result!==0&&(this.decodeMode!==si.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case on.NumericDecimal:return this.emitNumericEntity(0,2);case on.NumericHex:return this.emitNumericEntity(0,3);case on.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case on.EntityStart:return 0}}}function E8(e,t,n,i){const o=(t&Hi.BRANCH_LENGTH)>>7,s=t&Hi.JUMP_TABLE;if(o===0)return s!==0&&i===s?n:-1;if(s){const d=i-s;return d<0||d>=o?-1:e[n+d]-1}let l=n,c=l+o-1;for(;l<=c;){const d=l+c>>>1,f=e[d];if(f<i)l=d+1;else if(f>i)c=d-1;else return e[d+o]}return-1}var Ae;(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/"})(Ae||(Ae={}));var Dr;(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"})(Dr||(Dr={}));var ia;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(ia||(ia={}));var ue;(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"})(ue||(ue={}));var k;(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"})(k||(k={}));const T8=new Map([[ue.A,k.A],[ue.ADDRESS,k.ADDRESS],[ue.ANNOTATION_XML,k.ANNOTATION_XML],[ue.APPLET,k.APPLET],[ue.AREA,k.AREA],[ue.ARTICLE,k.ARTICLE],[ue.ASIDE,k.ASIDE],[ue.B,k.B],[ue.BASE,k.BASE],[ue.BASEFONT,k.BASEFONT],[ue.BGSOUND,k.BGSOUND],[ue.BIG,k.BIG],[ue.BLOCKQUOTE,k.BLOCKQUOTE],[ue.BODY,k.BODY],[ue.BR,k.BR],[ue.BUTTON,k.BUTTON],[ue.CAPTION,k.CAPTION],[ue.CENTER,k.CENTER],[ue.CODE,k.CODE],[ue.COL,k.COL],[ue.COLGROUP,k.COLGROUP],[ue.DD,k.DD],[ue.DESC,k.DESC],[ue.DETAILS,k.DETAILS],[ue.DIALOG,k.DIALOG],[ue.DIR,k.DIR],[ue.DIV,k.DIV],[ue.DL,k.DL],[ue.DT,k.DT],[ue.EM,k.EM],[ue.EMBED,k.EMBED],[ue.FIELDSET,k.FIELDSET],[ue.FIGCAPTION,k.FIGCAPTION],[ue.FIGURE,k.FIGURE],[ue.FONT,k.FONT],[ue.FOOTER,k.FOOTER],[ue.FOREIGN_OBJECT,k.FOREIGN_OBJECT],[ue.FORM,k.FORM],[ue.FRAME,k.FRAME],[ue.FRAMESET,k.FRAMESET],[ue.H1,k.H1],[ue.H2,k.H2],[ue.H3,k.H3],[ue.H4,k.H4],[ue.H5,k.H5],[ue.H6,k.H6],[ue.HEAD,k.HEAD],[ue.HEADER,k.HEADER],[ue.HGROUP,k.HGROUP],[ue.HR,k.HR],[ue.HTML,k.HTML],[ue.I,k.I],[ue.IMG,k.IMG],[ue.IMAGE,k.IMAGE],[ue.INPUT,k.INPUT],[ue.IFRAME,k.IFRAME],[ue.KEYGEN,k.KEYGEN],[ue.LABEL,k.LABEL],[ue.LI,k.LI],[ue.LINK,k.LINK],[ue.LISTING,k.LISTING],[ue.MAIN,k.MAIN],[ue.MALIGNMARK,k.MALIGNMARK],[ue.MARQUEE,k.MARQUEE],[ue.MATH,k.MATH],[ue.MENU,k.MENU],[ue.META,k.META],[ue.MGLYPH,k.MGLYPH],[ue.MI,k.MI],[ue.MO,k.MO],[ue.MN,k.MN],[ue.MS,k.MS],[ue.MTEXT,k.MTEXT],[ue.NAV,k.NAV],[ue.NOBR,k.NOBR],[ue.NOFRAMES,k.NOFRAMES],[ue.NOEMBED,k.NOEMBED],[ue.NOSCRIPT,k.NOSCRIPT],[ue.OBJECT,k.OBJECT],[ue.OL,k.OL],[ue.OPTGROUP,k.OPTGROUP],[ue.OPTION,k.OPTION],[ue.P,k.P],[ue.PARAM,k.PARAM],[ue.PLAINTEXT,k.PLAINTEXT],[ue.PRE,k.PRE],[ue.RB,k.RB],[ue.RP,k.RP],[ue.RT,k.RT],[ue.RTC,k.RTC],[ue.RUBY,k.RUBY],[ue.S,k.S],[ue.SCRIPT,k.SCRIPT],[ue.SEARCH,k.SEARCH],[ue.SECTION,k.SECTION],[ue.SELECT,k.SELECT],[ue.SOURCE,k.SOURCE],[ue.SMALL,k.SMALL],[ue.SPAN,k.SPAN],[ue.STRIKE,k.STRIKE],[ue.STRONG,k.STRONG],[ue.STYLE,k.STYLE],[ue.SUB,k.SUB],[ue.SUMMARY,k.SUMMARY],[ue.SUP,k.SUP],[ue.TABLE,k.TABLE],[ue.TBODY,k.TBODY],[ue.TEMPLATE,k.TEMPLATE],[ue.TEXTAREA,k.TEXTAREA],[ue.TFOOT,k.TFOOT],[ue.TD,k.TD],[ue.TH,k.TH],[ue.THEAD,k.THEAD],[ue.TITLE,k.TITLE],[ue.TR,k.TR],[ue.TRACK,k.TRACK],[ue.TT,k.TT],[ue.U,k.U],[ue.UL,k.UL],[ue.SVG,k.SVG],[ue.VAR,k.VAR],[ue.WBR,k.WBR],[ue.XMP,k.XMP]]);function Gs(e){var t;return(t=T8.get(e))!==null&&t!==void 0?t:k.UNKNOWN}const Ne=k,S8={[Ae.HTML]:new Set([Ne.ADDRESS,Ne.APPLET,Ne.AREA,Ne.ARTICLE,Ne.ASIDE,Ne.BASE,Ne.BASEFONT,Ne.BGSOUND,Ne.BLOCKQUOTE,Ne.BODY,Ne.BR,Ne.BUTTON,Ne.CAPTION,Ne.CENTER,Ne.COL,Ne.COLGROUP,Ne.DD,Ne.DETAILS,Ne.DIR,Ne.DIV,Ne.DL,Ne.DT,Ne.EMBED,Ne.FIELDSET,Ne.FIGCAPTION,Ne.FIGURE,Ne.FOOTER,Ne.FORM,Ne.FRAME,Ne.FRAMESET,Ne.H1,Ne.H2,Ne.H3,Ne.H4,Ne.H5,Ne.H6,Ne.HEAD,Ne.HEADER,Ne.HGROUP,Ne.HR,Ne.HTML,Ne.IFRAME,Ne.IMG,Ne.INPUT,Ne.LI,Ne.LINK,Ne.LISTING,Ne.MAIN,Ne.MARQUEE,Ne.MENU,Ne.META,Ne.NAV,Ne.NOEMBED,Ne.NOFRAMES,Ne.NOSCRIPT,Ne.OBJECT,Ne.OL,Ne.P,Ne.PARAM,Ne.PLAINTEXT,Ne.PRE,Ne.SCRIPT,Ne.SECTION,Ne.SELECT,Ne.SOURCE,Ne.STYLE,Ne.SUMMARY,Ne.TABLE,Ne.TBODY,Ne.TD,Ne.TEMPLATE,Ne.TEXTAREA,Ne.TFOOT,Ne.TH,Ne.THEAD,Ne.TITLE,Ne.TR,Ne.TRACK,Ne.UL,Ne.WBR,Ne.XMP]),[Ae.MATHML]:new Set([Ne.MI,Ne.MO,Ne.MN,Ne.MS,Ne.MTEXT,Ne.ANNOTATION_XML]),[Ae.SVG]:new Set([Ne.TITLE,Ne.FOREIGN_OBJECT,Ne.DESC]),[Ae.XLINK]:new Set,[Ae.XML]:new Set,[Ae.XMLNS]:new Set},_0=new Set([Ne.H1,Ne.H2,Ne.H3,Ne.H4,Ne.H5,Ne.H6]);ue.STYLE,ue.SCRIPT,ue.XMP,ue.IFRAME,ue.NOEMBED,ue.NOFRAMES,ue.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 $t={DATA:$.DATA,RCDATA:$.RCDATA,RAWTEXT:$.RAWTEXT,SCRIPT_DATA:$.SCRIPT_DATA,PLAINTEXT:$.PLAINTEXT,CDATA_SECTION:$.CDATA_SECTION};function k8(e){return e>=X.DIGIT_0&&e<=X.DIGIT_9}function rl(e){return e>=X.LATIN_CAPITAL_A&&e<=X.LATIN_CAPITAL_Z}function w8(e){return e>=X.LATIN_SMALL_A&&e<=X.LATIN_SMALL_Z}function Pi(e){return w8(e)||rl(e)}function vv(e){return Pi(e)||k8(e)}function yc(e){return e+32}function oS(e){return e===X.SPACE||e===X.LINE_FEED||e===X.TABULATION||e===X.FORM_FEED}function Ev(e){return oS(e)||e===X.SOLIDUS||e===X.GREATER_THAN_SIGN}function A8(e){return e===X.NULL?xe.nullCharacterReference:e>1114111?xe.characterReferenceOutsideUnicodeRange:aS(e)?xe.surrogateCharacterReference:rS(e)?xe.noncharacterCharacterReference:iS(e)||e===X.CARRIAGE_RETURN?xe.controlCharacterReference:null}class C8{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 f8(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new v8(h8,(i,o)=>{this.preprocessor.pos=this.entityStartPos+o-1,this._flushCodePointConsumedAsCharacterReference(i)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(xe.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:i=>{this._err(xe.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+i)},validateNumericCharacterReference:i=>{const o=A8(i);o&&this._err(o,1)}}:void 0)}_err(t,n=0){var i,o;(o=(i=this.handler).onParseError)===null||o===void 0||o.call(i,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,i){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||i==null||i()}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:ot.START_TAG,tagName:"",tagID:k.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:ot.END_TAG,tagName:"",tagID:k.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:ot.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:ot.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 i=this.currentToken;if(sS(i,this.currentAttr.name)===null){if(i.attrs.push(this.currentAttr),i.location&&this.currentLocation){const o=(t=(n=i.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);o[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(xe.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=Gs(t.tagName),t.type===ot.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(xe.endTagWithAttributes),t.selfClosing&&this._err(xe.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 ot.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case ot.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case ot.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:ot.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=oS(t)?ot.WHITESPACE_CHARACTER:t===X.NULL?ot.NULL_CHARACTER:ot.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(ot.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=$.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?si.Attribute:si.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 X.LESS_THAN_SIGN:{this.state=$.TAG_OPEN;break}case X.AMPERSAND:{this._startCharacterReference();break}case X.NULL:{this._err(xe.unexpectedNullCharacter),this._emitCodePoint(t);break}case X.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case X.AMPERSAND:{this._startCharacterReference();break}case X.LESS_THAN_SIGN:{this.state=$.RCDATA_LESS_THAN_SIGN;break}case X.NULL:{this._err(xe.unexpectedNullCharacter),this._emitChars(Bt);break}case X.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case X.LESS_THAN_SIGN:{this.state=$.RAWTEXT_LESS_THAN_SIGN;break}case X.NULL:{this._err(xe.unexpectedNullCharacter),this._emitChars(Bt);break}case X.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case X.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_LESS_THAN_SIGN;break}case X.NULL:{this._err(xe.unexpectedNullCharacter),this._emitChars(Bt);break}case X.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case X.NULL:{this._err(xe.unexpectedNullCharacter),this._emitChars(Bt);break}case X.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Pi(t))this._createStartTagToken(),this.state=$.TAG_NAME,this._stateTagName(t);else switch(t){case X.EXCLAMATION_MARK:{this.state=$.MARKUP_DECLARATION_OPEN;break}case X.SOLIDUS:{this.state=$.END_TAG_OPEN;break}case X.QUESTION_MARK:{this._err(xe.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=$.BOGUS_COMMENT,this._stateBogusComment(t);break}case X.EOF:{this._err(xe.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(xe.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=$.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Pi(t))this._createEndTagToken(),this.state=$.TAG_NAME,this._stateTagName(t);else switch(t){case X.GREATER_THAN_SIGN:{this._err(xe.missingEndTagName),this.state=$.DATA;break}case X.EOF:{this._err(xe.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(xe.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=$.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:{this.state=$.BEFORE_ATTRIBUTE_NAME;break}case X.SOLIDUS:{this.state=$.SELF_CLOSING_START_TAG;break}case X.GREATER_THAN_SIGN:{this.state=$.DATA,this.emitCurrentTagToken();break}case X.NULL:{this._err(xe.unexpectedNullCharacter),n.tagName+=Bt;break}case X.EOF:{this._err(xe.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(rl(t)?yc(t):t)}}_stateRcdataLessThanSign(t){t===X.SOLIDUS?this.state=$.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=$.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){Pi(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 X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=$.BEFORE_ATTRIBUTE_NAME,!1;case X.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=$.SELF_CLOSING_START_TAG,!1;case X.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===X.SOLIDUS?this.state=$.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=$.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){Pi(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 X.SOLIDUS:{this.state=$.SCRIPT_DATA_END_TAG_OPEN;break}case X.EXCLAMATION_MARK:{this.state=$.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=$.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){Pi(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===X.HYPHEN_MINUS?(this.state=$.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=$.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===X.HYPHEN_MINUS?(this.state=$.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=$.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case X.HYPHEN_MINUS:{this.state=$.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case X.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case X.NULL:{this._err(xe.unexpectedNullCharacter),this._emitChars(Bt);break}case X.EOF:{this._err(xe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case X.HYPHEN_MINUS:{this.state=$.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case X.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case X.NULL:{this._err(xe.unexpectedNullCharacter),this.state=$.SCRIPT_DATA_ESCAPED,this._emitChars(Bt);break}case X.EOF:{this._err(xe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case X.HYPHEN_MINUS:{this._emitChars("-");break}case X.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case X.GREATER_THAN_SIGN:{this.state=$.SCRIPT_DATA,this._emitChars(">");break}case X.NULL:{this._err(xe.unexpectedNullCharacter),this.state=$.SCRIPT_DATA_ESCAPED,this._emitChars(Bt);break}case X.EOF:{this._err(xe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===X.SOLIDUS?this.state=$.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Pi(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){Pi(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(Rn.SCRIPT,!1)&&Ev(this.preprocessor.peek(Rn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Rn.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 X.HYPHEN_MINUS:{this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case X.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case X.NULL:{this._err(xe.unexpectedNullCharacter),this._emitChars(Bt);break}case X.EOF:{this._err(xe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case X.HYPHEN_MINUS:{this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case X.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case X.NULL:{this._err(xe.unexpectedNullCharacter),this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Bt);break}case X.EOF:{this._err(xe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case X.HYPHEN_MINUS:{this._emitChars("-");break}case X.LESS_THAN_SIGN:{this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case X.GREATER_THAN_SIGN:{this.state=$.SCRIPT_DATA,this._emitChars(">");break}case X.NULL:{this._err(xe.unexpectedNullCharacter),this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Bt);break}case X.EOF:{this._err(xe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===X.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(Rn.SCRIPT,!1)&&Ev(this.preprocessor.peek(Rn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Rn.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 X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:break;case X.SOLIDUS:case X.GREATER_THAN_SIGN:case X.EOF:{this.state=$.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case X.EQUALS_SIGN:{this._err(xe.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=$.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=$.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:case X.SOLIDUS:case X.GREATER_THAN_SIGN:case X.EOF:{this._leaveAttrName(),this.state=$.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case X.EQUALS_SIGN:{this._leaveAttrName(),this.state=$.BEFORE_ATTRIBUTE_VALUE;break}case X.QUOTATION_MARK:case X.APOSTROPHE:case X.LESS_THAN_SIGN:{this._err(xe.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case X.NULL:{this._err(xe.unexpectedNullCharacter),this.currentAttr.name+=Bt;break}default:this.currentAttr.name+=String.fromCodePoint(rl(t)?yc(t):t)}}_stateAfterAttributeName(t){switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:break;case X.SOLIDUS:{this.state=$.SELF_CLOSING_START_TAG;break}case X.EQUALS_SIGN:{this.state=$.BEFORE_ATTRIBUTE_VALUE;break}case X.GREATER_THAN_SIGN:{this.state=$.DATA,this.emitCurrentTagToken();break}case X.EOF:{this._err(xe.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=$.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:break;case X.QUOTATION_MARK:{this.state=$.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case X.APOSTROPHE:{this.state=$.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case X.GREATER_THAN_SIGN:{this._err(xe.missingAttributeValue),this.state=$.DATA,this.emitCurrentTagToken();break}default:this.state=$.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case X.QUOTATION_MARK:{this.state=$.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case X.AMPERSAND:{this._startCharacterReference();break}case X.NULL:{this._err(xe.unexpectedNullCharacter),this.currentAttr.value+=Bt;break}case X.EOF:{this._err(xe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case X.APOSTROPHE:{this.state=$.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case X.AMPERSAND:{this._startCharacterReference();break}case X.NULL:{this._err(xe.unexpectedNullCharacter),this.currentAttr.value+=Bt;break}case X.EOF:{this._err(xe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:{this._leaveAttrValue(),this.state=$.BEFORE_ATTRIBUTE_NAME;break}case X.AMPERSAND:{this._startCharacterReference();break}case X.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=$.DATA,this.emitCurrentTagToken();break}case X.NULL:{this._err(xe.unexpectedNullCharacter),this.currentAttr.value+=Bt;break}case X.QUOTATION_MARK:case X.APOSTROPHE:case X.LESS_THAN_SIGN:case X.EQUALS_SIGN:case X.GRAVE_ACCENT:{this._err(xe.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case X.EOF:{this._err(xe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:{this._leaveAttrValue(),this.state=$.BEFORE_ATTRIBUTE_NAME;break}case X.SOLIDUS:{this._leaveAttrValue(),this.state=$.SELF_CLOSING_START_TAG;break}case X.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=$.DATA,this.emitCurrentTagToken();break}case X.EOF:{this._err(xe.eofInTag),this._emitEOFToken();break}default:this._err(xe.missingWhitespaceBetweenAttributes),this.state=$.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case X.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=$.DATA,this.emitCurrentTagToken();break}case X.EOF:{this._err(xe.eofInTag),this._emitEOFToken();break}default:this._err(xe.unexpectedSolidusInTag),this.state=$.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case X.GREATER_THAN_SIGN:{this.state=$.DATA,this.emitCurrentComment(n);break}case X.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case X.NULL:{this._err(xe.unexpectedNullCharacter),n.data+=Bt;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Rn.DASH_DASH,!0)?(this._createCommentToken(Rn.DASH_DASH.length+1),this.state=$.COMMENT_START):this._consumeSequenceIfMatch(Rn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Rn.DOCTYPE.length+1),this.state=$.DOCTYPE):this._consumeSequenceIfMatch(Rn.CDATA_START,!0)?this.inForeignNode?this.state=$.CDATA_SECTION:(this._err(xe.cdataInHtmlContent),this._createCommentToken(Rn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=$.BOGUS_COMMENT):this._ensureHibernation()||(this._err(xe.incorrectlyOpenedComment),this._createCommentToken(2),this.state=$.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case X.HYPHEN_MINUS:{this.state=$.COMMENT_START_DASH;break}case X.GREATER_THAN_SIGN:{this._err(xe.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 X.HYPHEN_MINUS:{this.state=$.COMMENT_END;break}case X.GREATER_THAN_SIGN:{this._err(xe.abruptClosingOfEmptyComment),this.state=$.DATA,this.emitCurrentComment(n);break}case X.EOF:{this._err(xe.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 X.HYPHEN_MINUS:{this.state=$.COMMENT_END_DASH;break}case X.LESS_THAN_SIGN:{n.data+="<",this.state=$.COMMENT_LESS_THAN_SIGN;break}case X.NULL:{this._err(xe.unexpectedNullCharacter),n.data+=Bt;break}case X.EOF:{this._err(xe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case X.EXCLAMATION_MARK:{n.data+="!",this.state=$.COMMENT_LESS_THAN_SIGN_BANG;break}case X.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=$.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===X.HYPHEN_MINUS?this.state=$.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=$.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===X.HYPHEN_MINUS?this.state=$.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=$.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==X.GREATER_THAN_SIGN&&t!==X.EOF&&this._err(xe.nestedComment),this.state=$.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case X.HYPHEN_MINUS:{this.state=$.COMMENT_END;break}case X.EOF:{this._err(xe.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 X.GREATER_THAN_SIGN:{this.state=$.DATA,this.emitCurrentComment(n);break}case X.EXCLAMATION_MARK:{this.state=$.COMMENT_END_BANG;break}case X.HYPHEN_MINUS:{n.data+="-";break}case X.EOF:{this._err(xe.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 X.HYPHEN_MINUS:{n.data+="--!",this.state=$.COMMENT_END_DASH;break}case X.GREATER_THAN_SIGN:{this._err(xe.incorrectlyClosedComment),this.state=$.DATA,this.emitCurrentComment(n);break}case X.EOF:{this._err(xe.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=$.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:{this.state=$.BEFORE_DOCTYPE_NAME;break}case X.GREATER_THAN_SIGN:{this.state=$.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case X.EOF:{this._err(xe.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(xe.missingWhitespaceBeforeDoctypeName),this.state=$.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(rl(t))this._createDoctypeToken(String.fromCharCode(yc(t))),this.state=$.DOCTYPE_NAME;else switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:break;case X.NULL:{this._err(xe.unexpectedNullCharacter),this._createDoctypeToken(Bt),this.state=$.DOCTYPE_NAME;break}case X.GREATER_THAN_SIGN:{this._err(xe.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=$.DATA;break}case X.EOF:{this._err(xe.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 X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:{this.state=$.AFTER_DOCTYPE_NAME;break}case X.GREATER_THAN_SIGN:{this.state=$.DATA,this.emitCurrentDoctype(n);break}case X.NULL:{this._err(xe.unexpectedNullCharacter),n.name+=Bt;break}case X.EOF:{this._err(xe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(rl(t)?yc(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:break;case X.GREATER_THAN_SIGN:{this.state=$.DATA,this.emitCurrentDoctype(n);break}case X.EOF:{this._err(xe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Rn.PUBLIC,!1)?this.state=$.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Rn.SYSTEM,!1)?this.state=$.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(xe.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:{this.state=$.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case X.QUOTATION_MARK:{this._err(xe.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=$.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case X.APOSTROPHE:{this._err(xe.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=$.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case X.GREATER_THAN_SIGN:{this._err(xe.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=$.DATA,this.emitCurrentDoctype(n);break}case X.EOF:{this._err(xe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(xe.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:break;case X.QUOTATION_MARK:{n.publicId="",this.state=$.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case X.APOSTROPHE:{n.publicId="",this.state=$.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case X.GREATER_THAN_SIGN:{this._err(xe.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=$.DATA,this.emitCurrentDoctype(n);break}case X.EOF:{this._err(xe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(xe.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case X.QUOTATION_MARK:{this.state=$.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case X.NULL:{this._err(xe.unexpectedNullCharacter),n.publicId+=Bt;break}case X.GREATER_THAN_SIGN:{this._err(xe.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=$.DATA;break}case X.EOF:{this._err(xe.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 X.APOSTROPHE:{this.state=$.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case X.NULL:{this._err(xe.unexpectedNullCharacter),n.publicId+=Bt;break}case X.GREATER_THAN_SIGN:{this._err(xe.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=$.DATA;break}case X.EOF:{this._err(xe.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 X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:{this.state=$.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case X.GREATER_THAN_SIGN:{this.state=$.DATA,this.emitCurrentDoctype(n);break}case X.QUOTATION_MARK:{this._err(xe.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case X.APOSTROPHE:{this._err(xe.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case X.EOF:{this._err(xe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(xe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:break;case X.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=$.DATA;break}case X.QUOTATION_MARK:{n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case X.APOSTROPHE:{n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case X.EOF:{this._err(xe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(xe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:{this.state=$.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case X.QUOTATION_MARK:{this._err(xe.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case X.APOSTROPHE:{this._err(xe.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case X.GREATER_THAN_SIGN:{this._err(xe.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=$.DATA,this.emitCurrentDoctype(n);break}case X.EOF:{this._err(xe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(xe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:break;case X.QUOTATION_MARK:{n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case X.APOSTROPHE:{n.systemId="",this.state=$.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case X.GREATER_THAN_SIGN:{this._err(xe.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=$.DATA,this.emitCurrentDoctype(n);break}case X.EOF:{this._err(xe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(xe.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case X.QUOTATION_MARK:{this.state=$.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case X.NULL:{this._err(xe.unexpectedNullCharacter),n.systemId+=Bt;break}case X.GREATER_THAN_SIGN:{this._err(xe.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=$.DATA;break}case X.EOF:{this._err(xe.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 X.APOSTROPHE:{this.state=$.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case X.NULL:{this._err(xe.unexpectedNullCharacter),n.systemId+=Bt;break}case X.GREATER_THAN_SIGN:{this._err(xe.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=$.DATA;break}case X.EOF:{this._err(xe.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 X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:break;case X.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=$.DATA;break}case X.EOF:{this._err(xe.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(xe.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=$.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case X.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=$.DATA;break}case X.NULL:{this._err(xe.unexpectedNullCharacter);break}case X.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case X.RIGHT_SQUARE_BRACKET:{this.state=$.CDATA_SECTION_BRACKET;break}case X.EOF:{this._err(xe.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===X.RIGHT_SQUARE_BRACKET?this.state=$.CDATA_SECTION_END:(this._emitChars("]"),this.state=$.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case X.GREATER_THAN_SIGN:{this.state=$.DATA;break}case X.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(X.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&vv(this.preprocessor.peek(1))?$.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){vv(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===X.SEMICOLON&&this._err(xe.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const lS=new Set([k.DD,k.DT,k.LI,k.OPTGROUP,k.OPTION,k.P,k.RB,k.RP,k.RT,k.RTC]),Tv=new Set([...lS,k.CAPTION,k.COLGROUP,k.TBODY,k.TD,k.TFOOT,k.TH,k.THEAD,k.TR]),Zc=new Set([k.APPLET,k.CAPTION,k.HTML,k.MARQUEE,k.OBJECT,k.TABLE,k.TD,k.TEMPLATE,k.TH]),N8=new Set([...Zc,k.OL,k.UL]),_8=new Set([...Zc,k.BUTTON]),Sv=new Set([k.ANNOTATION_XML,k.MI,k.MN,k.MO,k.MS,k.MTEXT]),kv=new Set([k.DESC,k.FOREIGN_OBJECT,k.TITLE]),M8=new Set([k.TR,k.TEMPLATE,k.HTML]),R8=new Set([k.TBODY,k.TFOOT,k.THEAD,k.TEMPLATE,k.HTML]),D8=new Set([k.TABLE,k.TEMPLATE,k.HTML]),L8=new Set([k.TD,k.TH]);class O8{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,i){this.treeAdapter=n,this.handler=i,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=k.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===k.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Ae.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 i=this._indexOf(t);this.items[i]=n,i===this.stackTop&&(this.current=n)}insertAfter(t,n,i){const o=this._indexOf(t)+1;this.items.splice(o,0,n),this.tagIDs.splice(o,0,i),this.stackTop++,o===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,o===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])!==Ae.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 i=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(i,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(_0,Ae.HTML)}popUntilTableCellPopped(){this.popUntilPopped(L8,Ae.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let i=this.stackTop;i>=0;i--)if(t.has(this.tagIDs[i])&&this.treeAdapter.getNamespaceURI(this.items[i])===n)return i;return-1}clearBackTo(t,n){const i=this._indexOfTagNames(t,n);this.shortenToLength(i+1)}clearBackToTableContext(){this.clearBackTo(D8,Ae.HTML)}clearBackToTableBodyContext(){this.clearBackTo(R8,Ae.HTML)}clearBackToTableRowContext(){this.clearBackTo(M8,Ae.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]===k.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]===k.HTML}hasInDynamicScope(t,n){for(let i=this.stackTop;i>=0;i--){const o=this.tagIDs[i];switch(this.treeAdapter.getNamespaceURI(this.items[i])){case Ae.HTML:{if(o===t)return!0;if(n.has(o))return!1;break}case Ae.SVG:{if(kv.has(o))return!1;break}case Ae.MATHML:{if(Sv.has(o))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Zc)}hasInListItemScope(t){return this.hasInDynamicScope(t,N8)}hasInButtonScope(t){return this.hasInDynamicScope(t,_8)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case Ae.HTML:{if(_0.has(n))return!0;if(Zc.has(n))return!1;break}case Ae.SVG:{if(kv.has(n))return!1;break}case Ae.MATHML:{if(Sv.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Ae.HTML)switch(this.tagIDs[n]){case t:return!0;case k.TABLE:case k.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Ae.HTML)switch(this.tagIDs[t]){case k.TBODY:case k.THEAD:case k.TFOOT:return!0;case k.TABLE:case k.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Ae.HTML)switch(this.tagIDs[n]){case t:return!0;case k.OPTION:case k.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&lS.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Tv.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&Tv.has(this.currentTagId);)this.pop()}}const Mm=3;var Na;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Na||(Na={}));const wv={type:Na.Marker};class I8{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const i=[],o=n.length,s=this.treeAdapter.getTagName(t),l=this.treeAdapter.getNamespaceURI(t);for(let c=0;c<this.entries.length;c++){const d=this.entries[c];if(d.type===Na.Marker)break;const{element:f}=d;if(this.treeAdapter.getTagName(f)===s&&this.treeAdapter.getNamespaceURI(f)===l){const p=this.treeAdapter.getAttrList(f);p.length===o&&i.push({idx:c,attrs:p})}}return i}_ensureNoahArkCondition(t){if(this.entries.length<Mm)return;const n=this.treeAdapter.getAttrList(t),i=this._getNoahArkConditionCandidates(t,n);if(i.length<Mm)return;const o=new Map(n.map(l=>[l.name,l.value]));let s=0;for(let l=0;l<i.length;l++){const c=i[l];c.attrs.every(d=>o.get(d.name)===d.value)&&(s+=1,s>=Mm&&this.entries.splice(c.idx,1))}}insertMarker(){this.entries.unshift(wv)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Na.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const i=this.entries.indexOf(this.bookmark);this.entries.splice(i,0,{type:Na.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(wv);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(i=>i.type===Na.Marker||this.treeAdapter.getTagName(i.element)===t);return n&&n.type===Na.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Na.Element&&n.element===t)}}const Bi={createDocument(){return{nodeName:"#document",mode:ia.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 i=e.childNodes.indexOf(n);e.childNodes.splice(i,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,i){const o=e.childNodes.find(s=>s.nodeName==="#documentType");if(o)o.name=t,o.publicId=n,o.systemId=i;else{const s={nodeName:"#documentType",name:t,publicId:n,systemId:i,parentNode:null};Bi.appendChild(e,s)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(Bi.isTextNode(n)){n.value+=t;return}}Bi.appendChild(e,Bi.createTextNode(t))},insertTextBefore(e,t,n){const i=e.childNodes[e.childNodes.indexOf(n)-1];i&&Bi.isTextNode(i)?i.value+=t:Bi.insertBefore(e,Bi.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(i=>i.name));for(let i=0;i<t.length;i++)n.has(t[i].name)||e.attrs.push(t[i])},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}}},uS="html",j8="about:legacy-compat",P8="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",cS=["+//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//"],B8=[...cS,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],z8=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),dS=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],U8=[...dS,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Av(e,t){return t.some(n=>e.startsWith(n))}function H8(e){return e.name===uS&&e.publicId===null&&(e.systemId===null||e.systemId===j8)}function F8(e){if(e.name!==uS)return ia.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===P8)return ia.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),z8.has(n))return ia.QUIRKS;let i=t===null?B8:cS;if(Av(n,i))return ia.QUIRKS;if(i=t===null?dS:U8,Av(n,i))return ia.LIMITED_QUIRKS}return ia.NO_QUIRKS}const Cv={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},V8="definitionurl",q8="definitionURL",Y8=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])),G8=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Ae.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Ae.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Ae.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Ae.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Ae.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Ae.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Ae.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Ae.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Ae.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Ae.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Ae.XMLNS}]]),X8=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])),K8=new Set([k.B,k.BIG,k.BLOCKQUOTE,k.BODY,k.BR,k.CENTER,k.CODE,k.DD,k.DIV,k.DL,k.DT,k.EM,k.EMBED,k.H1,k.H2,k.H3,k.H4,k.H5,k.H6,k.HEAD,k.HR,k.I,k.IMG,k.LI,k.LISTING,k.MENU,k.META,k.NOBR,k.OL,k.P,k.PRE,k.RUBY,k.S,k.SMALL,k.SPAN,k.STRONG,k.STRIKE,k.SUB,k.SUP,k.TABLE,k.TT,k.U,k.UL,k.VAR]);function $8(e){const t=e.tagID;return t===k.FONT&&e.attrs.some(({name:i})=>i===Dr.COLOR||i===Dr.SIZE||i===Dr.FACE)||K8.has(t)}function fS(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===V8){e.attrs[t].name=q8;break}}function hS(e){for(let t=0;t<e.attrs.length;t++){const n=Y8.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function Lp(e){for(let t=0;t<e.attrs.length;t++){const n=G8.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 Q8(e){const t=X8.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Gs(e.tagName))}function W8(e,t){return t===Ae.MATHML&&(e===k.MI||e===k.MO||e===k.MN||e===k.MS||e===k.MTEXT)}function Z8(e,t,n){if(t===Ae.MATHML&&e===k.ANNOTATION_XML){for(let i=0;i<n.length;i++)if(n[i].name===Dr.ENCODING){const o=n[i].value.toLowerCase();return o===Cv.TEXT_HTML||o===Cv.APPLICATION_XML}}return t===Ae.SVG&&(e===k.FOREIGN_OBJECT||e===k.DESC||e===k.TITLE)}function J8(e,t,n,i){return(!i||i===Ae.HTML)&&Z8(e,t,n)||(!i||i===Ae.MATHML)&&W8(e,t)}const eL="hidden",tL=8,nL=3;var ee;(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"})(ee||(ee={}));const aL={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},mS=new Set([k.TABLE,k.TBODY,k.TFOOT,k.THEAD,k.TR]),Nv={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Bi,onParseError:null};class _v{constructor(t,n,i=null,o=null){this.fragmentContext=i,this.scriptHandler=o,this.currentToken=null,this.stopped=!1,this.insertionMode=ee.INITIAL,this.originalInsertionMode=ee.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={...Nv,...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 C8(this.options,this),this.activeFormattingElements=new I8(this.treeAdapter),this.fragmentContextID=i?Gs(this.treeAdapter.getTagName(i)):k.UNKNOWN,this._setContextModes(i??this.document,this.fragmentContextID),this.openElements=new O8(this.document,this.treeAdapter,this)}static parse(t,n){const i=new this(n);return i.tokenizer.write(t,!0),i.document}static getFragmentParser(t,n){const i={...Nv,...n};t??(t=i.treeAdapter.createElement(ue.TEMPLATE,Ae.HTML,[]));const o=i.treeAdapter.createElement("documentmock",Ae.HTML,[]),s=new this(i,o,t);return s.fragmentContextID===k.TEMPLATE&&s.tmplInsertionModeStack.unshift(ee.IN_TEMPLATE),s._initTokenizerForFragmentParsing(),s._insertFakeRootElement(),s._resetInsertionMode(),s._findFormInFragmentContext(),s}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,i){var o;if(!this.onParseError)return;const s=(o=t.location)!==null&&o!==void 0?o:aL,l={code:n,startLine:s.startLine,startCol:s.startCol,startOffset:s.startOffset,endLine:i?s.startLine:s.endLine,endCol:i?s.startCol:s.endCol,endOffset:i?s.startOffset:s.endOffset};this.onParseError(l)}onItemPush(t,n,i){var o,s;(s=(o=this.treeAdapter).onItemPush)===null||s===void 0||s.call(o,t),i&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var i,o;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(o=(i=this.treeAdapter).onItemPop)===null||o===void 0||o.call(i,t,this.openElements.current),n){let s,l;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,l=this.fragmentContextID):{current:s,currentTagId:l}=this.openElements,this._setContextModes(s,l)}}_setContextModes(t,n){const i=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===Ae.HTML;this.currentNotInHTML=!i,this.tokenizer.inForeignNode=!i&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Ae.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=ee.TEXT}switchToPlaintextParsing(){this.insertionMode=ee.TEXT,this.originalInsertionMode=ee.IN_BODY,this.tokenizer.state=$t.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)===ue.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Ae.HTML))switch(this.fragmentContextID){case k.TITLE:case k.TEXTAREA:{this.tokenizer.state=$t.RCDATA;break}case k.STYLE:case k.XMP:case k.IFRAME:case k.NOEMBED:case k.NOFRAMES:case k.NOSCRIPT:{this.tokenizer.state=$t.RAWTEXT;break}case k.SCRIPT:{this.tokenizer.state=$t.SCRIPT_DATA;break}case k.PLAINTEXT:{this.tokenizer.state=$t.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",i=t.publicId||"",o=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,i,o),t.location){const l=this.treeAdapter.getChildNodes(this.document).find(c=>this.treeAdapter.isDocumentTypeNode(c));l&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const i=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,i)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const i=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(i??this.document,t)}}_appendElement(t,n){const i=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(i,t.location)}_insertElement(t,n){const i=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(i,t.location),this.openElements.push(i,t.tagID)}_insertFakeElement(t,n){const i=this.treeAdapter.createElement(t,Ae.HTML,[]);this._attachElementToTree(i,null),this.openElements.push(i,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Ae.HTML,t.attrs),i=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,i),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(ue.HTML,Ae.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,k.HTML)}_appendCommentNode(t,n){const i=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,i),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,t.location)}_insertCharacters(t){let n,i;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:i}=this._findFosterParentingLocation(),i?this.treeAdapter.insertTextBefore(n,t.chars,i):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const o=this.treeAdapter.getChildNodes(n),s=i?o.lastIndexOf(i):o.length,l=o[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(l)){const{endLine:d,endCol:f,endOffset:p}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(l,{endLine:d,endCol:f,endOffset:p})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}_adoptNodes(t,n){for(let i=this.treeAdapter.getFirstChild(t);i;i=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(i),this.treeAdapter.appendChild(n,i)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const i=n.location,o=this.treeAdapter.getTagName(t),s=n.type===ot.END_TAG&&o===n.tagName?{endTag:{...i},endLine:i.endLine,endCol:i.endCol,endOffset:i.endOffset}:{endLine:i.startLine,endCol:i.startCol,endOffset:i.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,s)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,i;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,i=this.fragmentContextID):{current:n,currentTagId:i}=this.openElements,t.tagID===k.SVG&&this.treeAdapter.getTagName(n)===ue.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Ae.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===k.MGLYPH||t.tagID===k.MALIGNMARK)&&i!==void 0&&!this._isIntegrationPoint(i,n,Ae.HTML)}_processToken(t){switch(t.type){case ot.CHARACTER:{this.onCharacter(t);break}case ot.NULL_CHARACTER:{this.onNullCharacter(t);break}case ot.COMMENT:{this.onComment(t);break}case ot.DOCTYPE:{this.onDoctype(t);break}case ot.START_TAG:{this._processStartTag(t);break}case ot.END_TAG:{this.onEndTag(t);break}case ot.EOF:{this.onEof(t);break}case ot.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,i){const o=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return J8(t,o,s,i)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(o=>o.type===Na.Marker||this.openElements.contains(o.element)),i=n===-1?t-1:n-1;for(let o=i;o>=0;o--){const s=this.activeFormattingElements.entries[o];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=ee.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(k.P),this.openElements.popUntilTagNamePopped(k.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case k.TR:{this.insertionMode=ee.IN_ROW;return}case k.TBODY:case k.THEAD:case k.TFOOT:{this.insertionMode=ee.IN_TABLE_BODY;return}case k.CAPTION:{this.insertionMode=ee.IN_CAPTION;return}case k.COLGROUP:{this.insertionMode=ee.IN_COLUMN_GROUP;return}case k.TABLE:{this.insertionMode=ee.IN_TABLE;return}case k.BODY:{this.insertionMode=ee.IN_BODY;return}case k.FRAMESET:{this.insertionMode=ee.IN_FRAMESET;return}case k.SELECT:{this._resetInsertionModeForSelect(t);return}case k.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case k.HTML:{this.insertionMode=this.headElement?ee.AFTER_HEAD:ee.BEFORE_HEAD;return}case k.TD:case k.TH:{if(t>0){this.insertionMode=ee.IN_CELL;return}break}case k.HEAD:{if(t>0){this.insertionMode=ee.IN_HEAD;return}break}}this.insertionMode=ee.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const i=this.openElements.tagIDs[n];if(i===k.TEMPLATE)break;if(i===k.TABLE){this.insertionMode=ee.IN_SELECT_IN_TABLE;return}}this.insertionMode=ee.IN_SELECT}_isElementCausesFosterParenting(t){return mS.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 k.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Ae.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case k.TABLE:{const i=this.treeAdapter.getParentNode(n);return i?{parent:i,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 i=this.treeAdapter.getNamespaceURI(t);return S8[i].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){LO(this,t);return}switch(this.insertionMode){case ee.INITIAL:{Jo(this,t);break}case ee.BEFORE_HTML:{hl(this,t);break}case ee.BEFORE_HEAD:{ml(this,t);break}case ee.IN_HEAD:{pl(this,t);break}case ee.IN_HEAD_NO_SCRIPT:{gl(this,t);break}case ee.AFTER_HEAD:{xl(this,t);break}case ee.IN_BODY:case ee.IN_CAPTION:case ee.IN_CELL:case ee.IN_TEMPLATE:{gS(this,t);break}case ee.TEXT:case ee.IN_SELECT:case ee.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case ee.IN_TABLE:case ee.IN_TABLE_BODY:case ee.IN_ROW:{Rm(this,t);break}case ee.IN_TABLE_TEXT:{TS(this,t);break}case ee.IN_COLUMN_GROUP:{Jc(this,t);break}case ee.AFTER_BODY:{ed(this,t);break}case ee.AFTER_AFTER_BODY:{Oc(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){DO(this,t);return}switch(this.insertionMode){case ee.INITIAL:{Jo(this,t);break}case ee.BEFORE_HTML:{hl(this,t);break}case ee.BEFORE_HEAD:{ml(this,t);break}case ee.IN_HEAD:{pl(this,t);break}case ee.IN_HEAD_NO_SCRIPT:{gl(this,t);break}case ee.AFTER_HEAD:{xl(this,t);break}case ee.TEXT:{this._insertCharacters(t);break}case ee.IN_TABLE:case ee.IN_TABLE_BODY:case ee.IN_ROW:{Rm(this,t);break}case ee.IN_COLUMN_GROUP:{Jc(this,t);break}case ee.AFTER_BODY:{ed(this,t);break}case ee.AFTER_AFTER_BODY:{Oc(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){M0(this,t);return}switch(this.insertionMode){case ee.INITIAL:case ee.BEFORE_HTML:case ee.BEFORE_HEAD:case ee.IN_HEAD:case ee.IN_HEAD_NO_SCRIPT:case ee.AFTER_HEAD:case ee.IN_BODY:case ee.IN_TABLE:case ee.IN_CAPTION:case ee.IN_COLUMN_GROUP:case ee.IN_TABLE_BODY:case ee.IN_ROW:case ee.IN_CELL:case ee.IN_SELECT:case ee.IN_SELECT_IN_TABLE:case ee.IN_TEMPLATE:case ee.IN_FRAMESET:case ee.AFTER_FRAMESET:{M0(this,t);break}case ee.IN_TABLE_TEXT:{el(this,t);break}case ee.AFTER_BODY:{cL(this,t);break}case ee.AFTER_AFTER_BODY:case ee.AFTER_AFTER_FRAMESET:{dL(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case ee.INITIAL:{fL(this,t);break}case ee.BEFORE_HEAD:case ee.IN_HEAD:case ee.IN_HEAD_NO_SCRIPT:case ee.AFTER_HEAD:{this._err(t,xe.misplacedDoctype);break}case ee.IN_TABLE_TEXT:{el(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,xe.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?OO(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case ee.INITIAL:{Jo(this,t);break}case ee.BEFORE_HTML:{hL(this,t);break}case ee.BEFORE_HEAD:{pL(this,t);break}case ee.IN_HEAD:{ya(this,t);break}case ee.IN_HEAD_NO_SCRIPT:{bL(this,t);break}case ee.AFTER_HEAD:{vL(this,t);break}case ee.IN_BODY:{yn(this,t);break}case ee.IN_TABLE:{zs(this,t);break}case ee.IN_TABLE_TEXT:{el(this,t);break}case ee.IN_CAPTION:{gO(this,t);break}case ee.IN_COLUMN_GROUP:{jp(this,t);break}case ee.IN_TABLE_BODY:{_d(this,t);break}case ee.IN_ROW:{Md(this,t);break}case ee.IN_CELL:{yO(this,t);break}case ee.IN_SELECT:{wS(this,t);break}case ee.IN_SELECT_IN_TABLE:{EO(this,t);break}case ee.IN_TEMPLATE:{SO(this,t);break}case ee.AFTER_BODY:{wO(this,t);break}case ee.IN_FRAMESET:{AO(this,t);break}case ee.AFTER_FRAMESET:{NO(this,t);break}case ee.AFTER_AFTER_BODY:{MO(this,t);break}case ee.AFTER_AFTER_FRAMESET:{RO(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?IO(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case ee.INITIAL:{Jo(this,t);break}case ee.BEFORE_HTML:{mL(this,t);break}case ee.BEFORE_HEAD:{gL(this,t);break}case ee.IN_HEAD:{xL(this,t);break}case ee.IN_HEAD_NO_SCRIPT:{yL(this,t);break}case ee.AFTER_HEAD:{EL(this,t);break}case ee.IN_BODY:{Nd(this,t);break}case ee.TEXT:{sO(this,t);break}case ee.IN_TABLE:{_l(this,t);break}case ee.IN_TABLE_TEXT:{el(this,t);break}case ee.IN_CAPTION:{xO(this,t);break}case ee.IN_COLUMN_GROUP:{bO(this,t);break}case ee.IN_TABLE_BODY:{R0(this,t);break}case ee.IN_ROW:{kS(this,t);break}case ee.IN_CELL:{vO(this,t);break}case ee.IN_SELECT:{AS(this,t);break}case ee.IN_SELECT_IN_TABLE:{TO(this,t);break}case ee.IN_TEMPLATE:{kO(this,t);break}case ee.AFTER_BODY:{NS(this,t);break}case ee.IN_FRAMESET:{CO(this,t);break}case ee.AFTER_FRAMESET:{_O(this,t);break}case ee.AFTER_AFTER_BODY:{Oc(this,t);break}}}onEof(t){switch(this.insertionMode){case ee.INITIAL:{Jo(this,t);break}case ee.BEFORE_HTML:{hl(this,t);break}case ee.BEFORE_HEAD:{ml(this,t);break}case ee.IN_HEAD:{pl(this,t);break}case ee.IN_HEAD_NO_SCRIPT:{gl(this,t);break}case ee.AFTER_HEAD:{xl(this,t);break}case ee.IN_BODY:case ee.IN_TABLE:case ee.IN_CAPTION:case ee.IN_COLUMN_GROUP:case ee.IN_TABLE_BODY:case ee.IN_ROW:case ee.IN_CELL:case ee.IN_SELECT:case ee.IN_SELECT_IN_TABLE:{vS(this,t);break}case ee.TEXT:{oO(this,t);break}case ee.IN_TABLE_TEXT:{el(this,t);break}case ee.IN_TEMPLATE:{CS(this,t);break}case ee.AFTER_BODY:case ee.IN_FRAMESET:case ee.AFTER_FRAMESET:case ee.AFTER_AFTER_BODY:case ee.AFTER_AFTER_FRAMESET:{Ip(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===X.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 ee.IN_HEAD:case ee.IN_HEAD_NO_SCRIPT:case ee.AFTER_HEAD:case ee.TEXT:case ee.IN_COLUMN_GROUP:case ee.IN_SELECT:case ee.IN_SELECT_IN_TABLE:case ee.IN_FRAMESET:case ee.AFTER_FRAMESET:{this._insertCharacters(t);break}case ee.IN_BODY:case ee.IN_CAPTION:case ee.IN_CELL:case ee.IN_TEMPLATE:case ee.AFTER_BODY:case ee.AFTER_AFTER_BODY:case ee.AFTER_AFTER_FRAMESET:{pS(this,t);break}case ee.IN_TABLE:case ee.IN_TABLE_BODY:case ee.IN_ROW:{Rm(this,t);break}case ee.IN_TABLE_TEXT:{ES(this,t);break}}}}function iL(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):yS(e,t),n}function rL(e,t){let n=null,i=e.openElements.stackTop;for(;i>=0;i--){const o=e.openElements.items[i];if(o===t.element)break;e._isSpecialElement(o,e.openElements.tagIDs[i])&&(n=o)}return n||(e.openElements.shortenToLength(Math.max(i,0)),e.activeFormattingElements.removeEntry(t)),n}function sL(e,t,n){let i=t,o=e.openElements.getCommonAncestor(t);for(let s=0,l=o;l!==n;s++,l=o){o=e.openElements.getCommonAncestor(l);const c=e.activeFormattingElements.getElementEntry(l),d=c&&s>=nL;!c||d?(d&&e.activeFormattingElements.removeEntry(c),e.openElements.remove(l)):(l=oL(e,c),i===t&&(e.activeFormattingElements.bookmark=c),e.treeAdapter.detachNode(i),e.treeAdapter.appendChild(l,i),i=l)}return i}function oL(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),i=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,i),t.element=i,i}function lL(e,t,n){const i=e.treeAdapter.getTagName(t),o=Gs(i);if(e._isElementCausesFosterParenting(o))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);o===k.TEMPLATE&&s===Ae.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function uL(e,t,n){const i=e.treeAdapter.getNamespaceURI(n.element),{token:o}=n,s=e.treeAdapter.createElement(o.tagName,i,o.attrs);e._adoptNodes(t,s),e.treeAdapter.appendChild(t,s),e.activeFormattingElements.insertElementAfterBookmark(s,o),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,s,o.tagID)}function Op(e,t){for(let n=0;n<tL;n++){const i=iL(e,t);if(!i)break;const o=rL(e,i);if(!o)break;e.activeFormattingElements.bookmark=i;const s=sL(e,o,i.element),l=e.openElements.getCommonAncestor(i.element);e.treeAdapter.detachNode(s),l&&lL(e,l,s),uL(e,o,i)}}function M0(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function cL(e,t){e._appendCommentNode(t,e.openElements.items[0])}function dL(e,t){e._appendCommentNode(t,e.document)}function Ip(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let i=e.openElements.stackTop;i>=n;i--)e._setEndLocation(e.openElements.items[i],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const i=e.openElements.items[0],o=e.treeAdapter.getNodeSourceCodeLocation(i);if(o&&!o.endTag&&(e._setEndLocation(i,t),e.openElements.stackTop>=1)){const s=e.openElements.items[1],l=e.treeAdapter.getNodeSourceCodeLocation(s);l&&!l.endTag&&e._setEndLocation(s,t)}}}}function fL(e,t){e._setDocumentType(t);const n=t.forceQuirks?ia.QUIRKS:F8(t);H8(t)||e._err(t,xe.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=ee.BEFORE_HTML}function Jo(e,t){e._err(t,xe.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,ia.QUIRKS),e.insertionMode=ee.BEFORE_HTML,e._processToken(t)}function hL(e,t){t.tagID===k.HTML?(e._insertElement(t,Ae.HTML),e.insertionMode=ee.BEFORE_HEAD):hl(e,t)}function mL(e,t){const n=t.tagID;(n===k.HTML||n===k.HEAD||n===k.BODY||n===k.BR)&&hl(e,t)}function hl(e,t){e._insertFakeRootElement(),e.insertionMode=ee.BEFORE_HEAD,e._processToken(t)}function pL(e,t){switch(t.tagID){case k.HTML:{yn(e,t);break}case k.HEAD:{e._insertElement(t,Ae.HTML),e.headElement=e.openElements.current,e.insertionMode=ee.IN_HEAD;break}default:ml(e,t)}}function gL(e,t){const n=t.tagID;n===k.HEAD||n===k.BODY||n===k.HTML||n===k.BR?ml(e,t):e._err(t,xe.endTagWithoutMatchingOpenElement)}function ml(e,t){e._insertFakeElement(ue.HEAD,k.HEAD),e.headElement=e.openElements.current,e.insertionMode=ee.IN_HEAD,e._processToken(t)}function ya(e,t){switch(t.tagID){case k.HTML:{yn(e,t);break}case k.BASE:case k.BASEFONT:case k.BGSOUND:case k.LINK:case k.META:{e._appendElement(t,Ae.HTML),t.ackSelfClosing=!0;break}case k.TITLE:{e._switchToTextParsing(t,$t.RCDATA);break}case k.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,$t.RAWTEXT):(e._insertElement(t,Ae.HTML),e.insertionMode=ee.IN_HEAD_NO_SCRIPT);break}case k.NOFRAMES:case k.STYLE:{e._switchToTextParsing(t,$t.RAWTEXT);break}case k.SCRIPT:{e._switchToTextParsing(t,$t.SCRIPT_DATA);break}case k.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=ee.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(ee.IN_TEMPLATE);break}case k.HEAD:{e._err(t,xe.misplacedStartTagForHeadElement);break}default:pl(e,t)}}function xL(e,t){switch(t.tagID){case k.HEAD:{e.openElements.pop(),e.insertionMode=ee.AFTER_HEAD;break}case k.BODY:case k.BR:case k.HTML:{pl(e,t);break}case k.TEMPLATE:{zr(e,t);break}default:e._err(t,xe.endTagWithoutMatchingOpenElement)}}function zr(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==k.TEMPLATE&&e._err(t,xe.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(k.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,xe.endTagWithoutMatchingOpenElement)}function pl(e,t){e.openElements.pop(),e.insertionMode=ee.AFTER_HEAD,e._processToken(t)}function bL(e,t){switch(t.tagID){case k.HTML:{yn(e,t);break}case k.BASEFONT:case k.BGSOUND:case k.HEAD:case k.LINK:case k.META:case k.NOFRAMES:case k.STYLE:{ya(e,t);break}case k.NOSCRIPT:{e._err(t,xe.nestedNoscriptInHead);break}default:gl(e,t)}}function yL(e,t){switch(t.tagID){case k.NOSCRIPT:{e.openElements.pop(),e.insertionMode=ee.IN_HEAD;break}case k.BR:{gl(e,t);break}default:e._err(t,xe.endTagWithoutMatchingOpenElement)}}function gl(e,t){const n=t.type===ot.EOF?xe.openElementsLeftAfterEof:xe.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=ee.IN_HEAD,e._processToken(t)}function vL(e,t){switch(t.tagID){case k.HTML:{yn(e,t);break}case k.BODY:{e._insertElement(t,Ae.HTML),e.framesetOk=!1,e.insertionMode=ee.IN_BODY;break}case k.FRAMESET:{e._insertElement(t,Ae.HTML),e.insertionMode=ee.IN_FRAMESET;break}case k.BASE:case k.BASEFONT:case k.BGSOUND:case k.LINK:case k.META:case k.NOFRAMES:case k.SCRIPT:case k.STYLE:case k.TEMPLATE:case k.TITLE:{e._err(t,xe.abandonedHeadElementChild),e.openElements.push(e.headElement,k.HEAD),ya(e,t),e.openElements.remove(e.headElement);break}case k.HEAD:{e._err(t,xe.misplacedStartTagForHeadElement);break}default:xl(e,t)}}function EL(e,t){switch(t.tagID){case k.BODY:case k.HTML:case k.BR:{xl(e,t);break}case k.TEMPLATE:{zr(e,t);break}default:e._err(t,xe.endTagWithoutMatchingOpenElement)}}function xl(e,t){e._insertFakeElement(ue.BODY,k.BODY),e.insertionMode=ee.IN_BODY,Cd(e,t)}function Cd(e,t){switch(t.type){case ot.CHARACTER:{gS(e,t);break}case ot.WHITESPACE_CHARACTER:{pS(e,t);break}case ot.COMMENT:{M0(e,t);break}case ot.START_TAG:{yn(e,t);break}case ot.END_TAG:{Nd(e,t);break}case ot.EOF:{vS(e,t);break}}}function pS(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function gS(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function TL(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function SL(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function kL(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Ae.HTML),e.insertionMode=ee.IN_FRAMESET)}function wL(e,t){e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._insertElement(t,Ae.HTML)}function AL(e,t){e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&_0.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Ae.HTML)}function CL(e,t){e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._insertElement(t,Ae.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function NL(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._insertElement(t,Ae.HTML),n||(e.formElement=e.openElements.current))}function _L(e,t){e.framesetOk=!1;const n=t.tagID;for(let i=e.openElements.stackTop;i>=0;i--){const o=e.openElements.tagIDs[i];if(n===k.LI&&o===k.LI||(n===k.DD||n===k.DT)&&(o===k.DD||o===k.DT)){e.openElements.generateImpliedEndTagsWithExclusion(o),e.openElements.popUntilTagNamePopped(o);break}if(o!==k.ADDRESS&&o!==k.DIV&&o!==k.P&&e._isSpecialElement(e.openElements.items[i],o))break}e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._insertElement(t,Ae.HTML)}function ML(e,t){e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._insertElement(t,Ae.HTML),e.tokenizer.state=$t.PLAINTEXT}function RL(e,t){e.openElements.hasInScope(k.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(k.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Ae.HTML),e.framesetOk=!1}function DL(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(ue.A);n&&(Op(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Ae.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function LL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ae.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function OL(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(k.NOBR)&&(Op(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Ae.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function IL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ae.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function jL(e,t){e.treeAdapter.getDocumentMode(e.document)!==ia.QUIRKS&&e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._insertElement(t,Ae.HTML),e.framesetOk=!1,e.insertionMode=ee.IN_TABLE}function xS(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Ae.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function bS(e){const t=sS(e,Dr.TYPE);return t!=null&&t.toLowerCase()===eL}function PL(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Ae.HTML),bS(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function BL(e,t){e._appendElement(t,Ae.HTML),t.ackSelfClosing=!0}function zL(e,t){e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._appendElement(t,Ae.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function UL(e,t){t.tagName=ue.IMG,t.tagID=k.IMG,xS(e,t)}function HL(e,t){e._insertElement(t,Ae.HTML),e.skipNextNewLine=!0,e.tokenizer.state=$t.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=ee.TEXT}function FL(e,t){e.openElements.hasInButtonScope(k.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,$t.RAWTEXT)}function VL(e,t){e.framesetOk=!1,e._switchToTextParsing(t,$t.RAWTEXT)}function Mv(e,t){e._switchToTextParsing(t,$t.RAWTEXT)}function qL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ae.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===ee.IN_TABLE||e.insertionMode===ee.IN_CAPTION||e.insertionMode===ee.IN_TABLE_BODY||e.insertionMode===ee.IN_ROW||e.insertionMode===ee.IN_CELL?ee.IN_SELECT_IN_TABLE:ee.IN_SELECT}function YL(e,t){e.openElements.currentTagId===k.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Ae.HTML)}function GL(e,t){e.openElements.hasInScope(k.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Ae.HTML)}function XL(e,t){e.openElements.hasInScope(k.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(k.RTC),e._insertElement(t,Ae.HTML)}function KL(e,t){e._reconstructActiveFormattingElements(),fS(t),Lp(t),t.selfClosing?e._appendElement(t,Ae.MATHML):e._insertElement(t,Ae.MATHML),t.ackSelfClosing=!0}function $L(e,t){e._reconstructActiveFormattingElements(),hS(t),Lp(t),t.selfClosing?e._appendElement(t,Ae.SVG):e._insertElement(t,Ae.SVG),t.ackSelfClosing=!0}function Rv(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Ae.HTML)}function yn(e,t){switch(t.tagID){case k.I:case k.S:case k.B:case k.U:case k.EM:case k.TT:case k.BIG:case k.CODE:case k.FONT:case k.SMALL:case k.STRIKE:case k.STRONG:{LL(e,t);break}case k.A:{DL(e,t);break}case k.H1:case k.H2:case k.H3:case k.H4:case k.H5:case k.H6:{AL(e,t);break}case k.P:case k.DL:case k.OL:case k.UL:case k.DIV:case k.DIR:case k.NAV:case k.MAIN:case k.MENU:case k.ASIDE:case k.CENTER:case k.FIGURE:case k.FOOTER:case k.HEADER:case k.HGROUP:case k.DIALOG:case k.DETAILS:case k.ADDRESS:case k.ARTICLE:case k.SEARCH:case k.SECTION:case k.SUMMARY:case k.FIELDSET:case k.BLOCKQUOTE:case k.FIGCAPTION:{wL(e,t);break}case k.LI:case k.DD:case k.DT:{_L(e,t);break}case k.BR:case k.IMG:case k.WBR:case k.AREA:case k.EMBED:case k.KEYGEN:{xS(e,t);break}case k.HR:{zL(e,t);break}case k.RB:case k.RTC:{GL(e,t);break}case k.RT:case k.RP:{XL(e,t);break}case k.PRE:case k.LISTING:{CL(e,t);break}case k.XMP:{FL(e,t);break}case k.SVG:{$L(e,t);break}case k.HTML:{TL(e,t);break}case k.BASE:case k.LINK:case k.META:case k.STYLE:case k.TITLE:case k.SCRIPT:case k.BGSOUND:case k.BASEFONT:case k.TEMPLATE:{ya(e,t);break}case k.BODY:{SL(e,t);break}case k.FORM:{NL(e,t);break}case k.NOBR:{OL(e,t);break}case k.MATH:{KL(e,t);break}case k.TABLE:{jL(e,t);break}case k.INPUT:{PL(e,t);break}case k.PARAM:case k.TRACK:case k.SOURCE:{BL(e,t);break}case k.IMAGE:{UL(e,t);break}case k.BUTTON:{RL(e,t);break}case k.APPLET:case k.OBJECT:case k.MARQUEE:{IL(e,t);break}case k.IFRAME:{VL(e,t);break}case k.SELECT:{qL(e,t);break}case k.OPTION:case k.OPTGROUP:{YL(e,t);break}case k.NOEMBED:case k.NOFRAMES:{Mv(e,t);break}case k.FRAMESET:{kL(e,t);break}case k.TEXTAREA:{HL(e,t);break}case k.NOSCRIPT:{e.options.scriptingEnabled?Mv(e,t):Rv(e,t);break}case k.PLAINTEXT:{ML(e,t);break}case k.COL:case k.TH:case k.TD:case k.TR:case k.HEAD:case k.FRAME:case k.TBODY:case k.TFOOT:case k.THEAD:case k.CAPTION:case k.COLGROUP:break;default:Rv(e,t)}}function QL(e,t){if(e.openElements.hasInScope(k.BODY)&&(e.insertionMode=ee.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function WL(e,t){e.openElements.hasInScope(k.BODY)&&(e.insertionMode=ee.AFTER_BODY,NS(e,t))}function ZL(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function JL(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(k.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(k.FORM):n&&e.openElements.remove(n))}function eO(e){e.openElements.hasInButtonScope(k.P)||e._insertFakeElement(ue.P,k.P),e._closePElement()}function tO(e){e.openElements.hasInListItemScope(k.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(k.LI),e.openElements.popUntilTagNamePopped(k.LI))}function nO(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function aO(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function iO(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function rO(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(ue.BR,k.BR),e.openElements.pop(),e.framesetOk=!1}function yS(e,t){const n=t.tagName,i=t.tagID;for(let o=e.openElements.stackTop;o>0;o--){const s=e.openElements.items[o],l=e.openElements.tagIDs[o];if(i===l&&(i!==k.UNKNOWN||e.treeAdapter.getTagName(s)===n)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.stackTop>=o&&e.openElements.shortenToLength(o);break}if(e._isSpecialElement(s,l))break}}function Nd(e,t){switch(t.tagID){case k.A:case k.B:case k.I:case k.S:case k.U:case k.EM:case k.TT:case k.BIG:case k.CODE:case k.FONT:case k.NOBR:case k.SMALL:case k.STRIKE:case k.STRONG:{Op(e,t);break}case k.P:{eO(e);break}case k.DL:case k.UL:case k.OL:case k.DIR:case k.DIV:case k.NAV:case k.PRE:case k.MAIN:case k.MENU:case k.ASIDE:case k.BUTTON:case k.CENTER:case k.FIGURE:case k.FOOTER:case k.HEADER:case k.HGROUP:case k.DIALOG:case k.ADDRESS:case k.ARTICLE:case k.DETAILS:case k.SEARCH:case k.SECTION:case k.SUMMARY:case k.LISTING:case k.FIELDSET:case k.BLOCKQUOTE:case k.FIGCAPTION:{ZL(e,t);break}case k.LI:{tO(e);break}case k.DD:case k.DT:{nO(e,t);break}case k.H1:case k.H2:case k.H3:case k.H4:case k.H5:case k.H6:{aO(e);break}case k.BR:{rO(e);break}case k.BODY:{QL(e,t);break}case k.HTML:{WL(e,t);break}case k.FORM:{JL(e);break}case k.APPLET:case k.OBJECT:case k.MARQUEE:{iO(e,t);break}case k.TEMPLATE:{zr(e,t);break}default:yS(e,t)}}function vS(e,t){e.tmplInsertionModeStack.length>0?CS(e,t):Ip(e,t)}function sO(e,t){var n;t.tagID===k.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function oO(e,t){e._err(t,xe.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Rm(e,t){if(e.openElements.currentTagId!==void 0&&mS.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=ee.IN_TABLE_TEXT,t.type){case ot.CHARACTER:{TS(e,t);break}case ot.WHITESPACE_CHARACTER:{ES(e,t);break}}else Fl(e,t)}function lO(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Ae.HTML),e.insertionMode=ee.IN_CAPTION}function uO(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Ae.HTML),e.insertionMode=ee.IN_COLUMN_GROUP}function cO(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ue.COLGROUP,k.COLGROUP),e.insertionMode=ee.IN_COLUMN_GROUP,jp(e,t)}function dO(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Ae.HTML),e.insertionMode=ee.IN_TABLE_BODY}function fO(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ue.TBODY,k.TBODY),e.insertionMode=ee.IN_TABLE_BODY,_d(e,t)}function hO(e,t){e.openElements.hasInTableScope(k.TABLE)&&(e.openElements.popUntilTagNamePopped(k.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function mO(e,t){bS(t)?e._appendElement(t,Ae.HTML):Fl(e,t),t.ackSelfClosing=!0}function pO(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Ae.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function zs(e,t){switch(t.tagID){case k.TD:case k.TH:case k.TR:{fO(e,t);break}case k.STYLE:case k.SCRIPT:case k.TEMPLATE:{ya(e,t);break}case k.COL:{cO(e,t);break}case k.FORM:{pO(e,t);break}case k.TABLE:{hO(e,t);break}case k.TBODY:case k.TFOOT:case k.THEAD:{dO(e,t);break}case k.INPUT:{mO(e,t);break}case k.CAPTION:{lO(e,t);break}case k.COLGROUP:{uO(e,t);break}default:Fl(e,t)}}function _l(e,t){switch(t.tagID){case k.TABLE:{e.openElements.hasInTableScope(k.TABLE)&&(e.openElements.popUntilTagNamePopped(k.TABLE),e._resetInsertionMode());break}case k.TEMPLATE:{zr(e,t);break}case k.BODY:case k.CAPTION:case k.COL:case k.COLGROUP:case k.HTML:case k.TBODY:case k.TD:case k.TFOOT:case k.TH:case k.THEAD:case k.TR:break;default:Fl(e,t)}}function Fl(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Cd(e,t),e.fosterParentingEnabled=n}function ES(e,t){e.pendingCharacterTokens.push(t)}function TS(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function el(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)Fl(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const SS=new Set([k.CAPTION,k.COL,k.COLGROUP,k.TBODY,k.TD,k.TFOOT,k.TH,k.THEAD,k.TR]);function gO(e,t){const n=t.tagID;SS.has(n)?e.openElements.hasInTableScope(k.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(k.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=ee.IN_TABLE,zs(e,t)):yn(e,t)}function xO(e,t){const n=t.tagID;switch(n){case k.CAPTION:case k.TABLE:{e.openElements.hasInTableScope(k.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(k.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=ee.IN_TABLE,n===k.TABLE&&_l(e,t));break}case k.BODY:case k.COL:case k.COLGROUP:case k.HTML:case k.TBODY:case k.TD:case k.TFOOT:case k.TH:case k.THEAD:case k.TR:break;default:Nd(e,t)}}function jp(e,t){switch(t.tagID){case k.HTML:{yn(e,t);break}case k.COL:{e._appendElement(t,Ae.HTML),t.ackSelfClosing=!0;break}case k.TEMPLATE:{ya(e,t);break}default:Jc(e,t)}}function bO(e,t){switch(t.tagID){case k.COLGROUP:{e.openElements.currentTagId===k.COLGROUP&&(e.openElements.pop(),e.insertionMode=ee.IN_TABLE);break}case k.TEMPLATE:{zr(e,t);break}case k.COL:break;default:Jc(e,t)}}function Jc(e,t){e.openElements.currentTagId===k.COLGROUP&&(e.openElements.pop(),e.insertionMode=ee.IN_TABLE,e._processToken(t))}function _d(e,t){switch(t.tagID){case k.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,Ae.HTML),e.insertionMode=ee.IN_ROW;break}case k.TH:case k.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(ue.TR,k.TR),e.insertionMode=ee.IN_ROW,Md(e,t);break}case k.CAPTION:case k.COL:case k.COLGROUP:case k.TBODY:case k.TFOOT:case k.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=ee.IN_TABLE,zs(e,t));break}default:zs(e,t)}}function R0(e,t){const n=t.tagID;switch(t.tagID){case k.TBODY:case k.TFOOT:case k.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=ee.IN_TABLE);break}case k.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=ee.IN_TABLE,_l(e,t));break}case k.BODY:case k.CAPTION:case k.COL:case k.COLGROUP:case k.HTML:case k.TD:case k.TH:case k.TR:break;default:_l(e,t)}}function Md(e,t){switch(t.tagID){case k.TH:case k.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,Ae.HTML),e.insertionMode=ee.IN_CELL,e.activeFormattingElements.insertMarker();break}case k.CAPTION:case k.COL:case k.COLGROUP:case k.TBODY:case k.TFOOT:case k.THEAD:case k.TR:{e.openElements.hasInTableScope(k.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ee.IN_TABLE_BODY,_d(e,t));break}default:zs(e,t)}}function kS(e,t){switch(t.tagID){case k.TR:{e.openElements.hasInTableScope(k.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ee.IN_TABLE_BODY);break}case k.TABLE:{e.openElements.hasInTableScope(k.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ee.IN_TABLE_BODY,R0(e,t));break}case k.TBODY:case k.TFOOT:case k.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(k.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ee.IN_TABLE_BODY,R0(e,t));break}case k.BODY:case k.CAPTION:case k.COL:case k.COLGROUP:case k.HTML:case k.TD:case k.TH:break;default:_l(e,t)}}function yO(e,t){const n=t.tagID;SS.has(n)?(e.openElements.hasInTableScope(k.TD)||e.openElements.hasInTableScope(k.TH))&&(e._closeTableCell(),Md(e,t)):yn(e,t)}function vO(e,t){const n=t.tagID;switch(n){case k.TD:case k.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=ee.IN_ROW);break}case k.TABLE:case k.TBODY:case k.TFOOT:case k.THEAD:case k.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),kS(e,t));break}case k.BODY:case k.CAPTION:case k.COL:case k.COLGROUP:case k.HTML:break;default:Nd(e,t)}}function wS(e,t){switch(t.tagID){case k.HTML:{yn(e,t);break}case k.OPTION:{e.openElements.currentTagId===k.OPTION&&e.openElements.pop(),e._insertElement(t,Ae.HTML);break}case k.OPTGROUP:{e.openElements.currentTagId===k.OPTION&&e.openElements.pop(),e.openElements.currentTagId===k.OPTGROUP&&e.openElements.pop(),e._insertElement(t,Ae.HTML);break}case k.HR:{e.openElements.currentTagId===k.OPTION&&e.openElements.pop(),e.openElements.currentTagId===k.OPTGROUP&&e.openElements.pop(),e._appendElement(t,Ae.HTML),t.ackSelfClosing=!0;break}case k.INPUT:case k.KEYGEN:case k.TEXTAREA:case k.SELECT:{e.openElements.hasInSelectScope(k.SELECT)&&(e.openElements.popUntilTagNamePopped(k.SELECT),e._resetInsertionMode(),t.tagID!==k.SELECT&&e._processStartTag(t));break}case k.SCRIPT:case k.TEMPLATE:{ya(e,t);break}}}function AS(e,t){switch(t.tagID){case k.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===k.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===k.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===k.OPTGROUP&&e.openElements.pop();break}case k.OPTION:{e.openElements.currentTagId===k.OPTION&&e.openElements.pop();break}case k.SELECT:{e.openElements.hasInSelectScope(k.SELECT)&&(e.openElements.popUntilTagNamePopped(k.SELECT),e._resetInsertionMode());break}case k.TEMPLATE:{zr(e,t);break}}}function EO(e,t){const n=t.tagID;n===k.CAPTION||n===k.TABLE||n===k.TBODY||n===k.TFOOT||n===k.THEAD||n===k.TR||n===k.TD||n===k.TH?(e.openElements.popUntilTagNamePopped(k.SELECT),e._resetInsertionMode(),e._processStartTag(t)):wS(e,t)}function TO(e,t){const n=t.tagID;n===k.CAPTION||n===k.TABLE||n===k.TBODY||n===k.TFOOT||n===k.THEAD||n===k.TR||n===k.TD||n===k.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(k.SELECT),e._resetInsertionMode(),e.onEndTag(t)):AS(e,t)}function SO(e,t){switch(t.tagID){case k.BASE:case k.BASEFONT:case k.BGSOUND:case k.LINK:case k.META:case k.NOFRAMES:case k.SCRIPT:case k.STYLE:case k.TEMPLATE:case k.TITLE:{ya(e,t);break}case k.CAPTION:case k.COLGROUP:case k.TBODY:case k.TFOOT:case k.THEAD:{e.tmplInsertionModeStack[0]=ee.IN_TABLE,e.insertionMode=ee.IN_TABLE,zs(e,t);break}case k.COL:{e.tmplInsertionModeStack[0]=ee.IN_COLUMN_GROUP,e.insertionMode=ee.IN_COLUMN_GROUP,jp(e,t);break}case k.TR:{e.tmplInsertionModeStack[0]=ee.IN_TABLE_BODY,e.insertionMode=ee.IN_TABLE_BODY,_d(e,t);break}case k.TD:case k.TH:{e.tmplInsertionModeStack[0]=ee.IN_ROW,e.insertionMode=ee.IN_ROW,Md(e,t);break}default:e.tmplInsertionModeStack[0]=ee.IN_BODY,e.insertionMode=ee.IN_BODY,yn(e,t)}}function kO(e,t){t.tagID===k.TEMPLATE&&zr(e,t)}function CS(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(k.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Ip(e,t)}function wO(e,t){t.tagID===k.HTML?yn(e,t):ed(e,t)}function NS(e,t){var n;if(t.tagID===k.HTML){if(e.fragmentContext||(e.insertionMode=ee.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===k.HTML){e._setEndLocation(e.openElements.items[0],t);const i=e.openElements.items[1];i&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(i))===null||n===void 0)&&n.endTag)&&e._setEndLocation(i,t)}}else ed(e,t)}function ed(e,t){e.insertionMode=ee.IN_BODY,Cd(e,t)}function AO(e,t){switch(t.tagID){case k.HTML:{yn(e,t);break}case k.FRAMESET:{e._insertElement(t,Ae.HTML);break}case k.FRAME:{e._appendElement(t,Ae.HTML),t.ackSelfClosing=!0;break}case k.NOFRAMES:{ya(e,t);break}}}function CO(e,t){t.tagID===k.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==k.FRAMESET&&(e.insertionMode=ee.AFTER_FRAMESET))}function NO(e,t){switch(t.tagID){case k.HTML:{yn(e,t);break}case k.NOFRAMES:{ya(e,t);break}}}function _O(e,t){t.tagID===k.HTML&&(e.insertionMode=ee.AFTER_AFTER_FRAMESET)}function MO(e,t){t.tagID===k.HTML?yn(e,t):Oc(e,t)}function Oc(e,t){e.insertionMode=ee.IN_BODY,Cd(e,t)}function RO(e,t){switch(t.tagID){case k.HTML:{yn(e,t);break}case k.NOFRAMES:{ya(e,t);break}}}function DO(e,t){t.chars=Bt,e._insertCharacters(t)}function LO(e,t){e._insertCharacters(t),e.framesetOk=!1}function _S(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Ae.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function OO(e,t){if($8(t))_S(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),i=e.treeAdapter.getNamespaceURI(n);i===Ae.MATHML?fS(t):i===Ae.SVG&&(Q8(t),hS(t)),Lp(t),t.selfClosing?e._appendElement(t,i):e._insertElement(t,i),t.ackSelfClosing=!0}}function IO(e,t){if(t.tagID===k.P||t.tagID===k.BR){_S(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const i=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(i)===Ae.HTML){e._endTagOutsideForeignContent(t);break}const o=e.treeAdapter.getTagName(i);if(o.toLowerCase()===t.tagName){t.tagName=o,e.openElements.shortenToLength(n);break}}}ue.AREA,ue.BASE,ue.BASEFONT,ue.BGSOUND,ue.BR,ue.COL,ue.EMBED,ue.FRAME,ue.HR,ue.IMG,ue.INPUT,ue.KEYGEN,ue.LINK,ue.META,ue.PARAM,ue.SOURCE,ue.TRACK,ue.WBR;const jO=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,PO=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),Dv={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function MS(e,t){const n=XO(e),i=DT("type",{handlers:{root:BO,element:zO,text:UO,comment:DS,doctype:HO,raw:VO},unknown:qO}),o={parser:n?new _v(Dv):_v.getFragmentParser(void 0,Dv),handle(c){i(c,o)},stitches:!1,options:t||{}};i(e,o),Xs(o,Ia());const s=n?o.parser.document:o.parser.getFragment(),l=KD(s,{file:o.options.file});return o.stitches&&Ad(l,"comment",function(c,d,f){const p=c;if(p.value.stitch&&f&&d!==void 0){const x=f.children;return x[d]=p.value.stitch,d}}),l.type==="root"&&l.children.length===1&&l.children[0].type===e.type?l.children[0]:l}function RS(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function BO(e,t){RS(e.children,t)}function zO(e,t){YO(e,t),RS(e.children,t),GO(e,t)}function UO(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:ot.CHARACTER,chars:e.value,location:Vl(e)};Xs(t,Ia(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function HO(e,t){const n={type:ot.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Vl(e)};Xs(t,Ia(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function FO(e,t){t.stitches=!0;const n=KO(e);if("children"in e&&"children"in n){const i=MS({type:"root",children:e.children},t.options);n.children=i.children}DS({type:"comment",value:{stitch:n}},t)}function DS(e,t){const n=e.value,i={type:ot.COMMENT,data:n,location:Vl(e)};Xs(t,Ia(e)),t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken)}function VO(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,LS(t,Ia(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(jO,"<$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 qO(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))FO(n,t);else{let i="";throw PO.has(n.type)&&(i=". 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"+i)}}function Xs(e,t){LS(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=$t.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 LS(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 YO(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===$t.PLAINTEXT)return;Xs(t,Ia(e));const i=t.parser.openElements.current;let o="namespaceURI"in i?i.namespaceURI:wr.html;o===wr.html&&n==="svg"&&(o=wr.svg);const s=JD({...e,children:[]},{space:o===wr.svg?"svg":"html"}),l={type:ot.START_TAG,tagName:n,tagID:Gs(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:Vl(e)};t.parser.currentToken=l,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function GO(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&o8.includes(n)||t.parser.tokenizer.state===$t.PLAINTEXT)return;Xs(t,vd(e));const i={type:ot.END_TAG,tagName:n,tagID:Gs(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Vl(e)};t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===$t.RCDATA||t.parser.tokenizer.state===$t.RAWTEXT||t.parser.tokenizer.state===$t.SCRIPT_DATA)&&(t.parser.tokenizer.state=$t.DATA)}function XO(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Vl(e){const t=Ia(e)||{line:void 0,column:void 0,offset:void 0},n=vd(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 KO(e){return"children"in e?Pr({...e,children:[]}):Pr(e)}function OS(e){return function(t,n){return MS(t,{...e,file:n})}}const yr=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],bl={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...yr,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...yr],h2:[["className","sr-only"]],img:[...yr,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...yr,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...yr],table:[...yr],ul:[...yr,["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"]},Ui={}.hasOwnProperty;function $O(e,t){let n={type:"root",children:[]};const i={schema:t?{...bl,...t}:bl,stack:[]},o=IS(i,e);return o&&(Array.isArray(o)?o.length===1?n=o[0]:n.children=o:n=o),n}function IS(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return QO(e,n);case"doctype":return WO(e,n);case"element":return ZO(e,n);case"root":return JO(e,n);case"text":return eI(e,n)}}}function QO(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",i=n.indexOf("-->"),s={type:"comment",value:i<0?n:n.slice(0,i)};return ql(s,t),s}}function WO(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return ql(n,t),n}}function ZO(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const i=jS(e,t.children),o=tI(e,t.properties);e.stack.pop();let s=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(s=!0,e.schema.ancestors&&Ui.call(e.schema.ancestors,n))){const c=e.schema.ancestors[n];let d=-1;for(s=!1;++d<c.length;)e.stack.includes(c[d])&&(s=!0)}if(!s)return e.schema.strip&&!e.schema.strip.includes(n)?i:void 0;const l={type:"element",tagName:n,properties:o,children:i};return ql(l,t),l}function JO(e,t){const i={type:"root",children:jS(e,t.children)};return ql(i,t),i}function eI(e,t){const i={type:"text",value:typeof t.value=="string"?t.value:""};return ql(i,t),i}function jS(e,t){const n=[];if(Array.isArray(t)){const i=t;let o=-1;for(;++o<i.length;){const s=IS(e,i[o]);s&&(Array.isArray(s)?n.push(...s):n.push(s))}}return n}function tI(e,t){const n=e.stack[e.stack.length-1],i=e.schema.attributes,o=e.schema.required,s=i&&Ui.call(i,n)?i[n]:void 0,l=i&&Ui.call(i,"*")?i["*"]:void 0,c=t&&typeof t=="object"?t:{},d={};let f;for(f in c)if(Ui.call(c,f)){const p=c[f];let x=Lv(e,Ov(s,f),f,p);x==null&&(x=Lv(e,Ov(l,f),f,p)),x!=null&&(d[f]=x)}if(o&&Ui.call(o,n)){const p=o[n];for(f in p)Ui.call(p,f)&&!Ui.call(d,f)&&(d[f]=p[f])}return d}function Lv(e,t,n,i){return t?Array.isArray(i)?nI(e,t,n,i):PS(e,t,n,i):void 0}function nI(e,t,n,i){let o=-1;const s=[];for(;++o<i.length;){const l=PS(e,t,n,i[o]);(typeof l=="number"||typeof l=="string")&&s.push(l)}return s}function PS(e,t,n,i){if(!(typeof i!="boolean"&&typeof i!="number"&&typeof i!="string")&&aI(e,n,i)){if(typeof t=="object"&&t.length>1){let o=!1,s=0;for(;++s<t.length;){const l=t[s];if(l&&typeof l=="object"&&"flags"in l){if(l.test(String(i))){o=!0;break}}else if(l===i){o=!0;break}}if(!o)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+i:i}}function aI(e,t,n){const i=e.schema.protocols&&Ui.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!i||i.length===0)return!0;const o=String(n),s=o.indexOf(":"),l=o.indexOf("?"),c=o.indexOf("#"),d=o.indexOf("/");if(s<0||d>-1&&s>d||l>-1&&s>l||c>-1&&s>c)return!0;let f=-1;for(;++f<i.length;){const p=i[f];if(s===p.length&&o.slice(0,p.length)===p)return!0}return!1}function ql(e,t){const n=JE(t);t.data&&(e.data=Pr(t.data)),n&&(e.position=n)}function Ov(e,t){let n,i=-1;if(e)for(;++i<e.length;){const o=e[i],s=typeof o=="string"?o:o[0];if(s===t)return o;s==="data*"&&(n=o)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function BS(e){return function(t){return $O(t,e)}}var gE;const zS={...bl,protocols:{...bl.protocols,src:[...((gE=bl.protocols)==null?void 0:gE.src)??["http","https","mailto"],"data"]}};function iI({retry:e}){const t=Xe();return m.jsxs("div",{className:"text-body text-warning p-4 flex items-start gap-2",children:[m.jsx(li,{className:"w-4 h-4 shrink-0 mt-0.5"}),m.jsxs("span",{children:[t("error.renderFailed")," ",m.jsx("button",{className:"underline ml-1",onClick:e,children:t("error.retry")})]})]})}class rI extends C.Component{constructor(){super(...arguments);Kh(this,"state",{error:null});Kh(this,"retry",()=>this.setState({error:null}))}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,i){console.error("[ErrorBoundary caught]",n,i.componentStack)}render(){return this.state.error?this.props.fallback?this.props.fallback(this.state.error,this.retry):m.jsx(iI,{error:this.state.error,retry:this.retry}):this.props.children}}function sI({nodeId:e,onRated:t}){const n=Xe(),[i,o]=C.useState(!1),[s,l]=C.useState(!1),c=async d=>{if(!(i||s)){o(!0);try{await fe.recordReview(e,d),l(!0),t==null||t(),Mr(d>=4?"correct":"wrong")}catch{}finally{o(!1)}}};return s?m.jsx("div",{className:"text-center text-body text-brand py-2","data-testid":"self-rated",children:n("review.selfrated")}):m.jsxs("div",{className:"border-t border-[var(--border-faint)] pt-3 mt-3","data-testid":"self-rating",children:[m.jsx("div",{className:"text-caption font-bold text-ink-muted uppercase tracking-wider mb-2 text-center",children:n("review.selfrate.title")}),m.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[m.jsxs("button",{onClick:()=>c(1),disabled:i,"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:[m.jsx("span",{className:"text-body font-bold",children:n("review.selfrate.again")}),m.jsx("span",{className:"text-caption opacity-70",children:n("review.selfrate.again.hint")})]}),m.jsxs("button",{onClick:()=>c(4),disabled:i,"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:[m.jsx("span",{className:"text-body font-bold",children:n("review.selfrate.remembered")}),m.jsx("span",{className:"text-caption opacity-70",children:n("review.selfrate.remembered.hint")})]}),m.jsxs("button",{onClick:()=>c(5),disabled:i,"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:[m.jsx("span",{className:"text-body font-bold",children:n("review.selfrate.mastered")}),m.jsx("span",{className:"text-caption opacity-70",children:n("review.selfrate.mastered.hint")})]})]})]})}function td(e){const t=[];let n="";const i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode(s){const l=s.parentElement;if(!l)return NodeFilter.FILTER_REJECT;const c=l.tagName;return c==="SCRIPT"||c==="STYLE"||l.closest("mark.lookatstudy-underline")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});let o;for(;o=i.nextNode();){const s=o,l=s.textContent??"",c=n.length;n+=l,t.push({node:s,start:c,end:n.length})}return{text:n,nodes:t}}function US(e,t){const n=Iv(e.startContainer,e.startOffset,t,"start"),i=Iv(e.endContainer,e.endOffset,t,"end");return n==null||i==null||i<=n?null:{start:n,end:i}}function Iv(e,t,n,i){var o,s,l;if(e.nodeType===Node.TEXT_NODE){for(const c of n.nodes)if(c.node===e)return c.start+Math.min(t,((o=c.node.textContent)==null?void 0:o.length)??0);return i==="start"?((s=n.nodes[0])==null?void 0:s.start)??null:((l=n.nodes[n.nodes.length-1])==null?void 0:l.end)??null}if(e instanceof Element){const c=Array.from(e.childNodes);if(i==="end"){for(let f=t;f<c.length;f++){const p=HS(c[f],n);if(p!=null)return p}const d=n.nodes[n.nodes.length-1];return d?d.end:null}else{for(let f=t;f>=0;f--){const p=FS(c[f],n);if(p!=null)return p}const d=n.nodes[0];return d?d.start:null}}return null}function HS(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 i=HS(n,t);if(i!=null)return i}return null}function FS(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 i of e.childNodes){const o=FS(i,t);o!=null&&(n=o)}return n}return null}function oI(e,t,n){var c,d,f,p;if(n<=t)return null;let i=null,o=0,s=null,l=0;for(const x of e.nodes)if(!i&&t>=x.start&&t<x.end&&(i=x.node,o=t-x.start),!s&&n>x.start&&n<=x.end&&(s=x.node,l=n-x.start),i&&s)break;if(!i&&e.nodes.length>0){const x=e.nodes[e.nodes.length-1];i=x.node,o=((c=x.node.textContent)==null?void 0:c.length)??0}if(!s&&e.nodes.length>0){const x=e.nodes[e.nodes.length-1];s=x.node,l=((d=x.node.textContent)==null?void 0:d.length)??0}if(!i||!s)return null;try{const x=document.createRange();return x.setStart(i,Math.min(o,((f=i.textContent)==null?void 0:f.length)??0)),x.setEnd(s,Math.min(l,((p=s.textContent)==null?void 0:p.length)??0)),x}catch{return null}}function VS(e,t){e.querySelectorAll("mark.lookatstudy-underline").forEach(s=>{const l=s.parentNode;if(l){for(;s.firstChild;)l.insertBefore(s.firstChild,s);l.removeChild(s)}}),e.normalize();const n=new Map;if(t.length===0)return n;const i=td(e),o=[];for(const s of t){const l=lI(i.text,s.text,s.surrounding);l>=0&&o.push({noteId:s.noteId,start:l,end:l+s.text.length})}o.sort((s,l)=>l.start-s.start);for(const s of o){const l=oI(i,s.start,s.end);if(!l)continue;const c=uI(l,s.noteId);c&&n.set(s.noteId,c)}return n}function lI(e,t,n){if(!t)return-1;let i=e.indexOf(t);if(i<0){const o=t.replace(/\s+/g," ").trim();if(i=e.replace(/\s+/g," ").indexOf(o),i<0)return-1;const l=t.slice(0,Math.min(15,t.length));return e.indexOf(l)}if(n&&n.length>5){const o=e.indexOf(n.slice(0,20));if(o>=0){let s=i,l=Math.abs(i-o),c=i+1;for(;;){const d=e.indexOf(t,c);if(d<0)break;const f=Math.abs(d-o);f<l&&(s=d,l=f),c=d+1}return s}}return i}function uI(e,t){var i;const n="color: inherit; background: transparent; border-bottom: 2px solid rgb(34, 197, 94); padding-bottom: 1px;";if(e.startContainer===e.endContainer&&e.startContainer.nodeType===Node.TEXT_NODE)try{const o=document.createElement("mark");return o.className="lookatstudy-underline",o.dataset.noteId=t,o.style.cssText=n,e.surroundContents(o),o}catch{}try{const o=[],s=document.createTreeWalker(e.commonAncestorContainer,NodeFilter.SHOW_TEXT,{acceptNode(d){return e.intersectsNode(d)&&(d===e.startContainer||d===e.endContainer||e.intersectsNode(d))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}});let l;for(;l=s.nextNode();)o.push(l);if(o.length===0)return null;let c=null;for(const d of o){let f=d;if(d===e.startContainer&&e.startOffset>0&&(f=d.splitText(e.startOffset)),d===e.endContainer||f===e.endContainer){const x=f===e.endContainer?e.endOffset:e.endOffset-(d===e.startContainer?e.startOffset:0);x<f.textContent.length&&f.splitText(x)}if(!f.textContent)continue;const p=document.createElement("mark");p.className="lookatstudy-underline",p.dataset.noteId=t,p.style.cssText=n,(i=f.parentNode)==null||i.insertBefore(p,f),p.appendChild(f),c||(c=p)}return c}catch{return null}}function qS(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 YS(e,t,n){const o=e.top+e.height/2;return e.right+8+n<=t?{left:e.right+8,top:o,transform:"translate(0, -50%)"}:e.left-8-n>=0?{left:e.left-8,top:o,transform:"translate(-100%, -50%)"}:{left:e.left,top:e.bottom+8,transform:"translate(0, 0)"}}function Rd({title:e,onClose:t,children:n}){const i=Xe(),o=C.useRef(null);return Fs(o,!0),C.useEffect(()=>{const s=l=>{l.key==="Escape"&&t()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[t]),hp.createPortal(m.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:[m.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2.5 shrink-0",onClick:s=>s.stopPropagation(),children:[m.jsx("h3",{className:"text-body font-bold text-white truncate",children:e}),m.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[m.jsx("span",{className:"text-caption text-white/50 hidden sm:inline",children:i("artifact.viewer.hint")}),m.jsx("button",{onClick:t,"data-testid":"diagram-viewer-close","aria-label":i("action.close"),"data-tooltip":i("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:m.jsx(oa,{className:"w-5 h-5"})})]})]}),m.jsx("div",{className:"flex-1 min-h-0 px-2 pb-2",onClick:t,children:m.jsx("div",{ref:o,className:"h-full w-full",onClick:s=>s.stopPropagation(),children:n})})]}),document.body)}function cI(e,t,n,i,o=24){if(e<=0||t<=0||n<=0||i<=0)return 1;const s=Math.min((n-o*2)/e,(i-o*2)/t,1);return Math.max(.02,s)}function dI(e,t,n,i,o=24){const s=cI(e,t,n,i,o);return{scale:s,x:(n-e*s)/2,y:(i-t*s)/2}}function fI(e,t,n,i){return{scale:e.scale*t,x:n-(n-e.x)*t,y:i-(i-e.y)*t}}function sl(e,t,n,i,o,s=64){const l=t*e.scale,c=n*e.scale;let{x:d,y:f}=e;return l<=i?d=(i-l)/2:d=Math.min(Math.max(d,i-l-s),s),c<=o?f=(o-c)/2:f=Math.min(Math.max(f,o-c-s),s),{x:d,y:f,scale:e.scale}}function hI(e,t,n,i,o){const s=e.scale*t,l=Math.min(Math.max(s,o.min),o.max)/e.scale;return l===1?e:sl(fI(e,l,n,i),o.contentW,o.contentH,o.viewW,o.viewH)}const jv=.05,Pv=4,vc=1.25;function Yl({children:e,grid:t=!0,testid:n}){const i=Xe(),o=C.useRef(null),s=C.useRef(null),[l,c]=C.useState({x:0,y:0,scale:1}),[d,f]=C.useState(null),[p,x]=C.useState(!1),b=C.useRef("mouse"),g=C.useRef(!0),y=C.useRef({pointers:new Map,pinchBase:null,lastMid:null,panning:!1,moved:!1}),E=C.useRef(null),T=C.useCallback(()=>{const N=o.current,I=s.current;return{min:jv,max:Pv,contentW:(I==null?void 0:I.offsetWidth)??0,contentH:(I==null?void 0:I.offsetHeight)??0,viewW:(N==null?void 0:N.clientWidth)??0,viewH:(N==null?void 0:N.clientHeight)??0}},[]),w=C.useCallback(()=>{const N=T();!N.contentW||!N.viewW||(c(dI(N.contentW,N.contentH,N.viewW,N.viewH)),g.current=!0)},[T]);C.useEffect(()=>{const N=o.current,I=s.current;if(!N||!I)return;const D=()=>{f({w:I.offsetWidth,h:I.offsetHeight}),w()};D();const P=new ResizeObserver(D);return P.observe(I),P.observe(N),()=>P.disconnect()},[w]);const M=C.useCallback((N,I,D)=>{const P=T(),z=I??P.viewW/2,K=D??P.viewH/2;c(q=>hI(q,N,z,K,P)),g.current=!1},[T]),_=C.useCallback(N=>{var P,z;if((z=(P=N.target).closest)!=null&&z.call(P,"[data-testid=canvas-zoom-controls]"))return;const I=N.currentTarget;try{I.setPointerCapture(N.pointerId)}catch{}const D=y.current;if(b.current=N.pointerType,D.pointers.size===0&&x(!0),D.pointers.set(N.pointerId,{x:N.clientX,y:N.clientY}),D.pointers.size===2){const[K,q]=[...D.pointers.values()];D.pinchBase={dist:Math.hypot(K.x-q.x,K.y-q.y),factorAcc:1},D.lastMid={x:(K.x+q.x)/2,y:(K.y+q.y)/2},D.panning=!1}else D.pointers.size===1&&(D.panning=!0,D.moved=!1,D.lastMid={x:N.clientX,y:N.clientY})},[]),L=C.useCallback(N=>{const I=y.current;if(!I.pointers.has(N.pointerId))return;I.pointers.set(N.pointerId,{x:N.clientX,y:N.clientY});const D=o.current;if(!D)return;const P=D.getBoundingClientRect();if(I.pointers.size>=2&&I.pinchBase){const[z,K]=[...I.pointers.values()],q=Math.hypot(z.x-K.x,z.y-K.y),B={x:(z.x+K.x)/2,y:(z.y+K.y)/2};if(I.pinchBase.dist>0){const H=q/I.pinchBase.dist/I.pinchBase.factorAcc;I.pinchBase.factorAcc*=H,M(H,B.x-P.left,B.y-P.top)}if(I.lastMid){const H=B.x-I.lastMid.x,G=B.y-I.lastMid.y,Q=T();c(re=>sl({...re,x:re.x+H,y:re.y+G},Q.contentW,Q.contentH,Q.viewW,Q.viewH))}I.lastMid=B;return}if(I.panning&&I.lastMid){const z=N.clientX-I.lastMid.x,K=N.clientY-I.lastMid.y;Math.abs(z)+Math.abs(K)>2&&(I.moved=!0);const q=T();c(B=>sl({...B,x:B.x+z,y:B.y+K},q.contentW,q.contentH,q.viewW,q.viewH)),I.lastMid={x:N.clientX,y:N.clientY}}},[T,M]),A=C.useCallback(N=>{const I=y.current,D=I.pointers.size===1;if(I.pointers.delete(N.pointerId),I.pointers.size<2&&(I.pinchBase=null),I.pointers.size===0){if(I.panning=!1,I.lastMid=null,x(!1),D&&!I.moved&&N.pointerType!=="mouse"){const P=performance.now(),z=E.current;if(z&&P-z.t<320&&Math.hypot(N.clientX-z.x,N.clientY-z.y)<32){const K=T();g.current?(c(sl({x:(K.viewW-K.contentW)/2,y:Math.max(24,(K.viewH-K.contentH)/2),scale:1},K.contentW,K.contentH,K.viewW,K.viewH)),g.current=!1):w(),E.current=null}else E.current={t:P,x:N.clientX,y:N.clientY}}}else if(I.pointers.size===1){const P=[...I.pointers.values()][0];I.lastMid={x:P.x,y:P.y},I.panning=!0}},[T,w]),R=C.useCallback(N=>{var D;N.preventDefault();const I=(D=o.current)==null?void 0:D.getBoundingClientRect();I&&M(N.deltaY<0?vc:1/vc,N.clientX-I.left,N.clientY-I.top)},[M]),j=C.useCallback(()=>{if(b.current!=="mouse")return;const N=T();g.current?(c(sl({x:(N.viewW-N.contentW)/2,y:Math.max(24,(N.viewH-N.contentH)/2),scale:1},N.contentW,N.contentH,N.viewW,N.viewH)),g.current=!1):w()},[T,w]);return m.jsxs("div",{ref:o,"data-testid":n,"data-noswipe":"",className:`relative h-full w-full overflow-hidden select-none touch-none ${t?"canvas-grid":""}`,style:{touchAction:"none"},onPointerDown:_,onPointerMove:L,onPointerUp:A,onPointerCancel:A,onWheel:R,onDoubleClick:j,children:[m.jsx("div",{ref:s,className:`absolute top-0 left-0 canvas-stage-gesture ${p?"":"motion-safe:transition-transform motion-safe:duration-150 motion-safe:ease-out"}`,style:{transform:`translate(${l.x}px, ${l.y}px) scale(${l.scale})`,transformOrigin:"0 0"},children:e}),m.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:[m.jsx("button",{onClick:()=>M(1/vc),disabled:l.scale<=jv+1e-6,"aria-label":i("artifact.zoomOut"),"data-tooltip":i("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:m.jsx(RC,{className:"w-4 h-4"})}),m.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(l.scale*100),"%"]}),m.jsx("button",{onClick:()=>M(vc),disabled:l.scale>=Pv-1e-6,"aria-label":i("artifact.zoomIn"),"data-tooltip":i("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:m.jsx(md,{className:"w-4 h-4"})}),m.jsx("button",{onClick:w,"aria-label":i("artifact.canvas.fit"),"data-tooltip":i("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:m.jsx(jl,{className:"w-4 h-4"})})]}),m.jsx("span",{"data-testid":"canvas-natural-size",className:"hidden",children:d?`${d.w}x${d.h}`:""})]})}function pa(e,t=13){let n=0;for(const i of e)n+=/[\u2e80-\u9fff\uf900-\ufaff\uff00-\uffef\u3000-\u303f]/.test(i)?t:t*.58;return n}const As=118;function mI(e){if(pa(e)<=As)return[e];const t=[];for(let d=0;d<e.length;d++)/[\s/\-—·]/.test(e[d]??"")&&t.push(d);const n=e.length/2;let i=-1,o=1/0;for(const d of t){const f=Math.abs(d+1-n);f<o&&(o=f,i=d)}let s,l;if(i>=0)s=e.slice(0,i+1).trim(),l=e.slice(i+1).trim();else{let d=0,f=0;for(const p of e)if(d+=pa(p),f++,d>=pa(e)/2)break;s=e.slice(0,f),l=e.slice(f)}if(pa(s)<=As&&pa(l)<=As)return[s,l];const c=d=>{let f="";for(const p of d){if(pa(f+p+"…")>As)break;f+=p}return f+"…"};return[pa(s)>As?c(s):s,pa(l)>As?c(l):l]}function pI(e,t){const n=mI(e),i=t?14:13,o=Math.max(...n.map(d=>pa(d,i))),s=t?32:24,l=17,c=t?20:16;return{width:Math.min(t?196:170,Math.max(t?92:76,o+s)),height:c+n.length*l,lines:n,hub:t}}const gI=28,xI=52,Bv=34;function GS(e,t){var z,K,q;const n=e.map(B=>B.id),i=new Set(n),o=new Map;for(const B of e)o.set(B.id,new Set);const s=new Set,l=[];for(const B of t){if(!i.has(B.from)||!i.has(B.to)||B.from===B.to)continue;l.push(B);const H=[B.from,B.to].sort().join("→");s.has(H)||(s.add(H),o.get(B.from).add(B.to),o.get(B.to).add(B.from))}const c=B=>{var H;return((H=o.get(B))==null?void 0:H.size)??0};let d=((z=e[0])==null?void 0:z.id)??"";for(const B of e)c(B.id)>c(d)&&(d=B.id);const f=new Map(n.map((B,H)=>[B,H])),p=new Map,x=new Map;for(const B of e)x.set(B.id,[]);const b=new Map;if(d){b.set(d,0);const B=[d];for(;B.length;){const H=B.shift();for(const G of[...o.get(H)??[]].sort((Q,re)=>(f.get(Q)??0)-(f.get(re)??0)))b.has(G)||(b.set(G,(b.get(H)??0)+1),p.set(G,H),x.get(H).push(G),B.push(G))}}let g=0;for(const B of b.values())g=Math.max(g,B);const y=e.filter(B=>!b.has(B.id)).map(B=>B.id);for(const B of y)b.set(B,g+1),p.set(B,d),x.get(d).push(B);for(const B of b.values())g=Math.max(g,B);const E=new Map,T=B=>{const H=E.get(B);if(H!=null)return H;const G=x.get(B)??[],Q=G.length===0?1:G.reduce((re,F)=>re+T(F),0);return E.set(B,Q),Q};d&&T(d);const w=new Map,M=(B,H,G)=>{const Q=x.get(B)??[];if(Q.length===0)return;const re=Q.reduce((Y,W)=>Y+(E.get(W)??1),0);let F=H;for(const Y of Q){const W=(E.get(Y)??1)/re*G;w.set(Y,F+W/2),M(Y,F,W),F+=W}};d&&M(d,-Math.PI/2,Math.PI*2);const _=new Map;for(const B of e)_.set(B.id,pI(B.label,B.id===d||c(B.id)>=4));const L=new Map;for(const B of e){const H=b.get(B.id)??0;L.has(H)||L.set(H,[]),L.get(H).push(B.id)}const A=new Map;A.set(0,0);for(let B=1;B<=g;B++){const H=L.get(B)??[];if(H.length===0){A.set(B,A.get(B-1)??0);continue}const Q=H.reduce((J,ne)=>{var me;return J+(((me=_.get(ne))==null?void 0:me.width)??0)+Bv},0)/(Math.PI*2),re=H.map(J=>({id:J,a:w.get(J)??0})).sort((J,ne)=>J.a-ne.a);let F=0;if(re.length>1)for(let J=0;J<re.length;J++){const ne=re[J],me=re[(J+1)%re.length];let Z=me.a-ne.a;if(J===re.length-1&&(Z+=Math.PI*2),Z<=.01)continue;const we=((((K=_.get(ne.id))==null?void 0:K.width)??0)+(((q=_.get(me.id))==null?void 0:q.width)??0))/2+Bv;F=Math.max(F,we/(2*Math.sin(Math.min(Math.PI,Z)/2)))}const Y=A.get(B-1)??0,W=Math.max(...(L.get(B-1)??[]).map(J=>{var ne;return(((ne=_.get(J))==null?void 0:ne.height)??0)/2}),0),U=Math.max(...H.map(J=>{var ne;return(((ne=_.get(J))==null?void 0:ne.height)??0)/2})),ae=H.length===1?60:0;A.set(B,Math.max(Y+W+U+xI,Q,F+ae))}const R=new Map;for(const B of e){const H=b.get(B.id)??0,G=A.get(H)??0,Q=H===0?0:w.get(B.id)??0;R.set(B.id,{id:B.id,center:{x:G*Math.cos(Q),y:G*Math.sin(Q)},box:_.get(B.id),degree:c(B.id),depth:H})}let j=0;for(const B of R.values())j=Math.max(j,Math.abs(B.center.x)+B.box.width/2,Math.abs(B.center.y)+B.box.height/2);const N=Math.ceil(2*(j+gI)),I=N/2;for(const B of R.values())B.center={x:B.center.x+I,y:B.center.y+I};const D=[],P=[];for(const B of l){const H=R.get(B.from),G=R.get(B.to);if(!H||!G)continue;const Q=zv(H,G.center),re=zv(G,H.center),F={x:(Q.x+re.x)/2,y:(Q.y+re.y)/2},Y=re.x-Q.x,W=re.y-Q.y,U=Math.hypot(Y,W)||1,ae=Math.min(34,Math.max(10,U*.16)),J={x:F.x+W/U*ae,y:F.y-Y/U*ae};let ne={x:(Q.x+2*J.x+re.x)/4,y:(Q.y+2*J.y+re.y)/4};if(B.label){const me=pa(B.label,12)+14;for(const Z of P)if(Math.hypot(ne.x-Z.pt.x,ne.y-Z.pt.y)<(me+Z.w)/2+6){ne={x:ne.x+W/U*22,y:ne.y-Y/U*22};break}P.push({pt:ne,w:me})}D.push({edge:B,d:`M ${Q.x.toFixed(1)} ${Q.y.toFixed(1)} Q ${J.x.toFixed(1)} ${J.y.toFixed(1)} ${re.x.toFixed(1)} ${re.y.toFixed(1)}`,labelPt:ne})}return{nodes:R,edges:D,rootId:d,width:Math.ceil(N),height:Math.ceil(N)}}function zv(e,t){const n=t.x-e.center.x,i=t.y-e.center.y,o=e.box.width/2+3,s=e.box.height/2+3;if(n===0&&i===0)return{x:e.center.x,y:e.center.y-s};const l=n===0?1/0:o/Math.abs(n),c=i===0?1/0:s/Math.abs(i),d=Math.min(l,c);return{x:e.center.x+n*d,y:e.center.y+i*d}}function bI(e){return{width:pa(e,12)+16,height:19}}const Ec=.4,Dm=2.5,Tc=.2;function Uv({data:e}){const t=C.useMemo(()=>GS(e.nodes,e.edges),[e.nodes,e.edges]);return m.jsxs("svg",{width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,style:{display:"block"},"data-testid":"conceptmap-svg",children:[m.jsx("defs",{children:m.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:m.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",className:"fill-ink-faint"})})}),t.edges.map(({edge:n,d:i,labelPt:o},s)=>{const l=n.label?bI(n.label):null;return m.jsxs("g",{children:[m.jsx("path",{d:i,className:"fill-none stroke-ink-faint/70",strokeWidth:1.6,markerEnd:"url(#cm-arrow)"}),n.label&&l&&m.jsxs("g",{children:[m.jsx("rect",{x:o.x-l.width/2,y:o.y-l.height/2,width:l.width,height:l.height,rx:l.height/2,className:"fill-surface-0 stroke-[var(--border-faint)]",strokeWidth:1}),m.jsx("text",{x:o.x,y:o.y+3.5,textAnchor:"middle",className:"fill-ink-muted text-caption font-medium",children:n.label})]})]},`e-${s}`)}),[...t.nodes.values()].map(n=>{const i=n.center.x-n.box.width/2,o=n.center.y-n.box.height/2,s=n.box.hub?14:13;return m.jsxs("g",{children:[m.jsx("rect",{x:i,y:o,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((l,c)=>m.jsx("text",{x:n.center.x,y:n.center.y+(c-(n.box.lines.length-1)/2)*17+4.5,textAnchor:"middle",fontSize:s,className:n.box.hub?"fill-ink-strong font-bold":"fill-ink",children:l},c))]},n.id)})]})}function XS({data:e,variant:t="card"}){const n=e,i=Xe(),o=C.useMemo(()=>GS(n.nodes,n.edges),[n.nodes,n.edges]),[s,l]=C.useState(1),[c,d]=C.useState(!1),f=C.useRef(null);C.useEffect(()=>{const y=f.current;if(!y)return;const E=()=>{const w=(y.clientWidth-16)/o.width;w<1&&l(Math.max(Ec,+w.toFixed(2)))};E();const T=new ResizeObserver(E);return T.observe(y),()=>T.disconnect()},[o.width]);const p=C.useCallback(()=>l(y=>Math.min(Dm,+(y+Tc).toFixed(2))),[]),x=C.useCallback(()=>l(y=>Math.max(Ec,+(y-Tc).toFixed(2))),[]),b=C.useCallback(()=>l(1),[]),g=C.useCallback(y=>{if(!y.ctrlKey&&!y.metaKey)return;y.preventDefault();const E=y.deltaY>0?-Tc:Tc;l(T=>Math.min(Dm,Math.max(Ec,+(T+E).toFixed(2))))},[]);return t==="canvas"?m.jsx("div",{"data-testid":"conceptmap-canvas-content",children:m.jsx(Uv,{data:n})}):m.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-concept-map",children:[m.jsxs("div",{className:"flex items-center justify-between mb-3 gap-2",children:[m.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[m.jsx(dp,{className:"w-4 h-4 text-ink-muted shrink-0"}),m.jsx("h3",{className:"text-body font-bold text-ink truncate",children:n.title})]}),m.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[m.jsxs("div",{className:"flex items-center gap-1","data-testid":"conceptmap-zoom-controls",children:[m.jsx("button",{onClick:x,disabled:s<=Ec,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:i("artifact.zoomOut"),children:"−"}),m.jsxs("button",{onClick:b,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:i("artifact.zoomReset"),children:[Math.round(s*100),"%"]}),m.jsx("button",{onClick:p,disabled:s>=Dm,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:i("artifact.zoomIn"),children:"+"})]}),m.jsx("button",{onClick:()=>d(!0),"data-testid":"conceptmap-expand","aria-label":i("artifact.viewer.open"),"data-tooltip":i("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:m.jsx(jl,{className:"w-3.5 h-3.5"})})]})]}),m.jsx("div",{ref:f,onClick:()=>d(!0),onWheel:g,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:m.jsx("div",{style:{width:o.width*s,height:o.height*s,margin:"0 auto"},children:m.jsx("div",{style:{transform:`scale(${s})`,transformOrigin:"top left",width:o.width,height:o.height},children:m.jsx(Uv,{data:n})})})}),m.jsx("div",{className:"mt-1.5 flex items-center justify-between text-caption text-ink-muted",children:m.jsx("span",{children:i("artifact.conceptmap.stats",{nodes:n.nodes.length,edges:n.edges.length})})}),n.warnings&&n.warnings.length>0&&m.jsxs("div",{className:"mt-1 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[m.jsx(li,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),m.jsx("span",{children:n.warnings.join("; ")})]}),c&&m.jsx(Rd,{title:n.title,onClose:()=>d(!1),children:m.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:m.jsx(Yl,{testid:"conceptmap-modal-stage",children:m.jsx(XS,{data:e,variant:"canvas"})})})})]})}function yI(e,t){const{correct:n,total:i}=e,o=i>0&&n===i,s=i>0&&n<i,l=t!=null&&t>=JC,c=t!=null&&t>=eN;return s?[{id:"explain-wrong"},{id:"retry"}]:o&&l?[{id:"next-topic"},{id:"go-deeper"}]:o&&c?[{id:"mark-mastered",advancesMastery:!0},{id:"next-topic"},{id:"go-deeper"}]:[{id:"go-deeper"},{id:"retry"}]}const vI="ls-quiz-progress:";function EI(e){const t=e.questions.map(i=>`${i.prompt}|${(i.options??[]).join("/")}#${i.answer??""}`).join(`
|
|
549
|
-
`);let n=2166136261;for(let i=0;i<t.length;i++)n^=t.charCodeAt(i),n=Math.imul(n,16777619);return`${vI}${(n>>>0).toString(36)}`}function TI(e){var t,n;try{const i=localStorage.getItem(e);if(!i)return null;const o=JSON.parse(i);return typeof(o==null?void 0:o.current)=="number"&&o.current>=0&&typeof((t=o==null?void 0:o.score)==null?void 0:t.correct)=="number"&&typeof((n=o==null?void 0:o.score)==null?void 0:n.total)=="number"?o:null}catch{return null}}function SI(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}const kI={"explain-wrong":{icon:pC,labelKey:"quiz.action.explainWrong",message:"我刚才有题答错了,帮我讲讲为什么错、正确的思路是什么。"},retry:{icon:ul,labelKey:"quiz.action.retry",message:"再来一组类似的题巩固一下。"},"go-deeper":{icon:u0,labelKey:"quiz.action.goDeeper",message:"这组我答得不错,帮我深入讲讲背后的原理和容易混淆的地方。"},"mark-mastered":{icon:ga,labelKey:"quiz.action.markMastered",message:"这课我觉得掌握了,帮我确认一下——出个综合题检验,通过了就标记为掌握。"},"next-topic":{icon:o0,labelKey:"quiz.action.nextTopic",message:"进入下一个知识点。"}};function wI({data:e,onAnswered:t,quizMastery:n,onPickAction:i,onQuizCompleted:o}){const s=e,l=Xe(),c=C.useMemo(()=>EI(s),[s]),d=C.useMemo(()=>TI(c),[c]),[f,p]=C.useState((d==null?void 0:d.current)??0),[x,b]=C.useState(null),[g,y]=C.useState(!1),[E,T]=C.useState((d==null?void 0:d.score)??{correct:0,total:0}),w=C.useRef([]);C.useEffect(()=>{SI(c,{current:f,score:E})},[c,f,E]);const[M,_]=C.useState(!1);if(f>=s.questions.length){const N=!!i&&!o;if(o)return m.jsxs("div",{className:"surface-card p-4 text-center","data-testid":"artifact-quiz-done",children:[m.jsx("div",{className:"text-2xl mb-2",children:E.correct===E.total?"🎉":"📚"}),m.jsx("div",{className:"text-body font-bold text-ink",children:l("quiz.scoreSummary",{correct:E.correct,total:E.total})}),M?m.jsx("div",{className:"text-label text-ink-muted mt-1","data-testid":"quiz-hook-sent",children:l("quiz.hook.sent")}):m.jsx("button",{onClick:()=>{_(!0),o({title:s.title??"",correct:E.correct,total:E.total,detail:[...w.current]})},"data-testid":"quiz-hook-finish",className:"btn-3d-brand mt-3 px-5 py-2 text-body",children:l("quiz.hook.finish")})]});const I=N?yI(E,n??null):[];return m.jsxs("div",{className:"surface-card p-4 text-center","data-testid":"artifact-quiz-done",children:[m.jsx("div",{className:"text-2xl mb-2",children:E.correct===E.total?"🎉":"📚"}),m.jsx("div",{className:"text-body font-bold text-ink",children:l("quiz.scoreSummary",{correct:E.correct,total:E.total})}),m.jsx("div",{className:"text-label text-ink-muted mt-1",children:E.correct===E.total?l("quiz.allCorrectHint"):l("quiz.tryAgainHint")}),I.length>0&&m.jsxs("div",{className:"mt-3 space-y-2 text-left","data-testid":"quiz-next-actions",children:[m.jsx("div",{className:"text-label text-ink-muted",children:l("quiz.action.nextPrompt")}),I.map((D,P)=>{const z=kI[D.id],K=z.icon;return m.jsxs("button",{onClick:()=>i==null?void 0:i(z.message),"data-testid":`quiz-action-${D.id}`,className:`${P===0?"btn-3d-brand":"btn-3d-neutral"} w-full py-2 text-body flex items-center justify-center gap-1.5`,children:[m.jsx(K,{className:"w-4 h-4"}),l(z.labelKey)]},D.id)})]})]})}const L=s.questions[f],A=g&&x===L.answer,R=()=>{if(x===null)return;y(!0);const N=x===L.answer;T(I=>({correct:I.correct+(N?1:0),total:I.total+1})),t==null||t(L,x,N),w.current.push({prompt:L.prompt,chosen:L.options[x]??"?",answerText:L.options[L.answer]??"?",correct:N}),Mr(N?"correct":"wrong")},j=()=>{f===s.questions.length-1&&o&&!M&&(_(!0),o({title:s.title??"",correct:E.correct,total:E.total,detail:[...w.current]})),p(N=>N+1),b(null),y(!1)};return m.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-quiz",children:[m.jsxs("div",{className:"flex items-center justify-between mb-3",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(lp,{className:"w-4 h-4 text-brand"}),m.jsx("span",{className:"text-label font-bold text-brand",children:l("quiz.questionProgress",{cur:f+1,total:s.questions.length})})]}),m.jsx("span",{className:"text-label text-ink-muted",children:l("quiz.answeredCorrect",{n:E.correct})})]}),m.jsx("div",{className:"text-body text-ink font-medium mb-3 leading-relaxed",children:L.prompt}),m.jsx("div",{className:"space-y-2 mb-3",children:L.options.map((N,I)=>{const D=x===I,P=g&&I===L.answer,z=g&&D&&!P;return m.jsxs("button",{onClick:()=>!g&&b(I),disabled:g,"data-testid":`quiz-option-${I}`,className:`w-full text-left text-body p-2.5 rounded-lg border-2 font-medium transition-colors ${P?"border-brand bg-brand/10 text-brand animate-answer-correct":z?"border-warning bg-warning/10 text-warning animate-answer-wrong":D?"border-accent bg-accent/10 text-accent":"border-[var(--border)] text-ink-muted hover:border-[var(--border)]"} ${g?"cursor-default":"cursor-pointer"}`,children:[m.jsx("span",{className:"font-bold mr-2",children:String.fromCharCode(65+I)}),N,P&&m.jsx("span",{className:"float-right",children:m.jsx(Vn,{className:"w-4 h-4 inline-block"})}),z&&m.jsx("span",{className:"float-right",children:m.jsx(oa,{className:"w-4 h-4 inline-block"})})]},I)})}),g&&m.jsxs("div",{className:`rounded-lg p-3 mb-3 text-body leading-relaxed animate-artifact-render ${A?"bg-brand/10 border border-brand/30 text-brand":"bg-warning/10 border border-warning/30 text-warning"}`,"data-testid":"quiz-explanation",children:[m.jsxs("div",{className:"font-bold mb-1 flex items-center gap-1.5",children:[A?m.jsx(Vn,{className:"w-4 h-4"}):m.jsx(oa,{className:"w-4 h-4"}),m.jsx("span",{children:l(A?"quiz.correct":"quiz.wrong")})]}),m.jsx("div",{className:"text-ink-muted",children:L.explanation})]}),g?m.jsx("button",{onClick:j,"data-testid":"quiz-next",className:"btn-3d-brand w-full py-2 text-body",children:f+1<s.questions.length?l("exercise.next"):l("quiz.finish")}):m.jsx("button",{onClick:R,disabled:x===null,"data-testid":"quiz-submit",className:"btn-3d-brand w-full py-2 text-body disabled:opacity-40",children:l("exercise.submit")}),s.warnings&&s.warnings.length>0&&m.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[m.jsx(li,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),m.jsx("span",{children:s.warnings.join("; ")})]})]})}function KS({data:e,variant:t="card"}){const n=e,i=Xe(),[o,s]=C.useState(!1),l=m.jsxs("table",{className:"text-body",style:{width:"max-content",minWidth:"100%"},children:[m.jsx("thead",{children:m.jsx("tr",{className:"bg-surface-3/60",children:n.headers.map((c,d)=>m.jsx("th",{className:`px-3 py-2.5 text-left font-bold border-b border-[var(--border)] ${d===0?"text-ink-strong":"text-ink"}`,children:c},d))})}),m.jsx("tbody",{children:n.rows.map((c,d)=>m.jsx("tr",{className:d%2===0?"bg-surface-0/40":"",children:c.map((f,p)=>m.jsx("td",{className:`px-3 py-2.5 border-b border-[var(--border-faint)] align-top leading-relaxed ${p===0?"font-bold text-ink-strong whitespace-nowrap bg-surface-1/40":"text-ink-muted"}`,style:p===0?void 0:{maxWidth:260,overflowWrap:"anywhere"},children:f},p))},d))})]});return t==="canvas"?m.jsx("div",{className:"w-fit","data-testid":"comparetable-canvas-content",children:l}):m.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-compare-table",children:[m.jsxs("div",{className:"flex items-center justify-between gap-2 mb-3",children:[m.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[m.jsx(CE,{className:"w-4 h-4 text-ink-muted shrink-0"}),m.jsx("h3",{className:"text-body font-bold text-ink truncate",children:n.title})]}),m.jsx("button",{onClick:()=>s(!0),"data-testid":"comparetable-expand","aria-label":i("artifact.viewer.open"),"data-tooltip":i("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:m.jsx(jl,{className:"w-3.5 h-3.5"})})]}),m.jsx("div",{className:"overflow-x-auto rounded-lg border border-[var(--border-faint)]",onClick:()=>s(!0),style:{touchAction:"pan-x pan-y"},"data-noswipe":"",children:l}),n.warnings&&n.warnings.length>0&&m.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[m.jsx(li,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),m.jsx("span",{children:n.warnings.join("; ")})]}),o&&m.jsx(Rd,{title:n.title,onClose:()=>s(!1),children:m.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:m.jsx(Yl,{testid:"comparetable-modal-stage",children:m.jsx("div",{className:"p-2 surface-card",children:m.jsx(KS,{data:e,variant:"canvas"})})})})})]})}let Ic=null;function AI(){return Ic||(Ic=qc(()=>import("./mermaid.core-uJSxER2x.js").then(e=>e.bp),[],import.meta.url).then(e=>{const t=e.default;return t.initialize({startOnLoad:!1,theme:"base",securityLevel:"loose",themeVariables:CI(),flowchart:{useMaxWidth:!0,htmlLabels:!0,curve:"basis",nodeSpacing:42,rankSpacing:54,padding:10},sequence:{useMaxWidth:!0,boxMargin:8,noteMargin:8,messageMargin:32}}),t})),Ic}function CI(){const e=(n,i)=>{if(typeof document>"u")return i;const o=getComputedStyle(document.documentElement).getPropertyValue(n).trim();return o?`rgb(${o})`:i};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",()=>{Ic=null});async function NI(e,t){const n=await AI();try{await n.parse(t)}catch(o){throw new Error(`mermaid 语法校验失败: ${o instanceof Error?o.message:String(o)}`)}const{svg:i}=await n.render(e,t);if(i.includes('aria-roledescription="error"')||i.includes('class="error-text"')||i.includes("Syntax error"))throw new Error("mermaid 渲染失败(语法错误或节点 label 含未转义特殊字符)");return i}const Lm=.3,Om=3,Sc=.2;function $S({data:e,variant:t="card"}){const n=e,i=Xe(),o={flowchart:i("artifact.diagram.flowchart"),sequence:i("artifact.diagram.sequence"),state:i("artifact.diagram.state")},s=C.useId().replace(/[:]/g,"_"),[l,c]=C.useState({status:"loading"}),[d,f]=C.useState(0);C.useEffect(()=>{const R=()=>f(j=>j+1);return window.addEventListener("theme-changed",R),()=>window.removeEventListener("theme-changed",R)},[]);const[p,x]=C.useState(null),[b,g]=C.useState(1),[y,E]=C.useState(!1);C.useEffect(()=>{let R=!1;return c({status:"loading"}),x(null),NI(`mmd-${s}`,n.mermaid).then(j=>{R||c({status:"rendered",svg:j})}).catch(j=>{R||(console.error("[MermaidArtifact] render failed:",j),c({status:"error",message:j instanceof Error?j.message:String(j)}))}),()=>{R=!0}},[n.mermaid,s,d]);const T=`https://mermaid.live/edit#${encodeURIComponent(n.mermaid)}`,w=C.useCallback(()=>g(R=>Math.min(Om,+(R+Sc).toFixed(2))),[]),M=C.useCallback(()=>g(R=>Math.max(Lm,+(R-Sc).toFixed(2))),[]),_=C.useCallback(()=>g(1),[]),L=C.useCallback(R=>{if(!R.ctrlKey&&!R.metaKey)return;R.preventDefault();const j=R.deltaY>0?-Sc:Sc;g(N=>Math.min(Om,Math.max(Lm,+(N+j).toFixed(2))))},[]),A=l.status==="rendered"?m.jsx("div",{ref:R=>{var j;if(R&&!p){const N=R.querySelector("svg");if(N){const I=N.getBoundingClientRect(),D=(j=N.viewBox)==null?void 0:j.baseVal,P=D&&D.width?D.width:I.width,z=D&&D.height?D.height:I.height;P>0&&z>0&&x({width:P,height:z})}}},style:{width:(p==null?void 0:p.width)??void 0,height:(p==null?void 0:p.height)??void 0},dangerouslySetInnerHTML:{__html:l.svg},"data-testid":"mermaid-svg"}):null;return t==="canvas"?m.jsx("div",{"data-testid":"mermaid-canvas-content",children:A}):m.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-mermaid",children:[m.jsxs("div",{className:"flex items-center justify-between mb-3 gap-2",children:[m.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[m.jsx($C,{className:"w-4 h-4 text-ink-muted shrink-0"}),m.jsx("h3",{className:"text-body font-bold text-ink truncate",children:n.title}),m.jsx("span",{className:"text-caption font-bold px-1.5 py-0.5 rounded bg-accent/15 text-accent shrink-0",children:o[n.diagramType]??n.diagramType})]}),m.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[l.status==="rendered"&&m.jsxs("div",{className:"flex items-center gap-1","data-testid":"mermaid-zoom-controls",children:[m.jsx("button",{onClick:M,disabled:b<=Lm,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:i("artifact.zoomOut"),"data-testid":"mermaid-zoom-out",children:"−"}),m.jsxs("button",{onClick:_,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:i("artifact.zoomReset"),"data-testid":"mermaid-zoom-reset",children:[Math.round(b*100),"%"]}),m.jsx("button",{onClick:w,disabled:b>=Om,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:i("artifact.zoomIn"),"data-testid":"mermaid-zoom-in",children:"+"})]}),l.status==="rendered"&&m.jsx("button",{onClick:()=>E(!0),"data-testid":"mermaid-expand","aria-label":i("artifact.viewer.open"),"data-tooltip":i("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:m.jsx(jl,{className:"w-3.5 h-3.5"})})]}),m.jsx("button",{onClick:()=>window.open(T,"_blank"),className:"text-caption text-accent hover:underline font-bold shrink-0","data-testid":"mermaid-open-live",title:i("artifact.mermaid.openLive"),children:"mermaid.live ↗"})]}),m.jsxs("div",{onClick:()=>{l.status==="rendered"&&E(!0)},onWheel:L,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:[l.status==="loading"&&m.jsxs("div",{className:"flex items-center gap-2 text-body text-ink-muted my-8 justify-center","data-testid":"mermaid-loading",children:[m.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-accent rounded-full inline-block"}),m.jsx("span",{children:i("artifact.mermaid.rendering")})]}),l.status==="rendered"&&m.jsx("div",{style:{width:p?p.width*b:"auto",height:p?p.height*b:"auto",margin:"0 auto"},children:m.jsx("div",{style:{transform:`scale(${b})`,transformOrigin:"top left"},children:A})}),l.status==="error"&&m.jsxs("div",{className:"w-full text-center my-4","data-testid":"mermaid-fallback",children:[m.jsxs("div",{className:"text-body text-warning mb-2 flex items-center justify-center gap-1.5",children:[m.jsx(li,{className:"w-4 h-4 shrink-0"}),m.jsx("span",{children:i("artifact.mermaid.renderFailed")})]}),m.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}),m.jsx("div",{className:"text-caption text-ink-muted mt-2",children:i("artifact.mermaid.errorPrefix",{msg:l.message})})]})]}),l.status==="rendered"&&m.jsx("div",{className:"mt-1.5 text-caption text-ink-muted flex items-center gap-2",children:m.jsx("span",{children:i("artifact.mermaid.hint")})}),y&&l.status==="rendered"&&m.jsx(Rd,{title:n.title,onClose:()=>E(!1),children:m.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:m.jsx(Yl,{testid:"mermaid-modal-stage",children:m.jsx($S,{data:e,variant:"canvas"})})})}),n.warnings&&n.warnings.length>0&&m.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[m.jsx(li,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),m.jsx("span",{children:n.warnings.join("; ")})]})]})}function QS({data:e,variant:t="card"}){const n=e,i=Xe(),[o,s]=C.useState(null),[l,c]=C.useState(!1),d=C.useRef([]),f=C.useRef([]),p=n.code.split(`
|
|
550
|
-
`),x=E=>{if(o===null)return!1;const T=n.annotations[o];return T&&E>=T.lineStart&&E<=T.lineEnd},b=E=>{const T=o===E?null:E;if(s(T),T!==null){const w=n.annotations[T],M=(l?f:d).current[w.lineStart-1];M==null||M.scrollIntoView({behavior:"smooth",block:"center"})}},g=E=>m.jsx("div",{className:"bg-neutral-950 rounded-lg overflow-hidden border border-neutral-800 max-h-[420px] overflow-y-auto",children:m.jsx("pre",{className:"text-label font-mono leading-relaxed overflow-x-auto",children:m.jsx("code",{children:p.map((T,w)=>{const M=w+1;return m.jsxs("div",{ref:_=>{E.current[w]=_},className:`flex ${x(M)?"bg-brand/15":""}`,children:[m.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:M}),m.jsx("span",{className:"text-neutral-200 pl-3 whitespace-pre",children:T||" "})]},w)})})})}),y=m.jsxs("div",{className:"space-y-2",children:[m.jsx("div",{className:"text-caption font-bold text-ink-muted",children:i("artifact.codewalk.sectionLabel")}),n.annotations.map((E,T)=>m.jsxs("button",{onClick:()=>b(T),"data-testid":`annotation-${T}`,className:`w-full text-left p-2.5 rounded-lg border transition-colors ${o===T?"border-brand bg-brand/10":"border-[var(--border-faint)] hover:border-[var(--border)]"}`,children:[m.jsx("div",{className:"text-caption font-bold text-brand mb-0.5",children:E.lineEnd!==E.lineStart?i("artifact.codewalk.lineRange",{a:E.lineStart,b:E.lineEnd}):i("artifact.codewalk.lineSingle",{n:E.lineStart})}),m.jsx("div",{className:"text-body text-ink-muted leading-relaxed",children:E.note})]},T))]});return t==="canvas"?m.jsx("div",{className:"w-fit","data-testid":"codewalk-canvas-content",children:g(f)}):m.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-code-walkthrough",children:[m.jsxs("div",{className:"flex items-center justify-between gap-2 mb-3",children:[m.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[m.jsx(vE,{className:"w-4 h-4 text-ink-muted shrink-0"}),m.jsx("h3",{className:"text-body font-bold text-ink truncate",children:n.title}),m.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})]}),m.jsx("button",{onClick:()=>c(!0),"data-testid":"codewalk-expand","aria-label":i("artifact.viewer.open"),"data-tooltip":i("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:m.jsx(jl,{className:"w-3.5 h-3.5"})})]}),m.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:[m.jsx("div",{onClick:()=>{l||c(!0)},style:{touchAction:"pan-x pan-y"},"data-noswipe":"",children:g(d)}),y]}),n.warnings&&n.warnings.length>0&&m.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[m.jsx(li,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),m.jsx("span",{children:n.warnings.join("; ")})]}),l&&m.jsx(Rd,{title:n.title,onClose:()=>c(!1),children:m.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:m.jsx(Yl,{testid:"codewalk-modal-stage",children:m.jsx(QS,{data:e,variant:"canvas"})})})})]})}function _I({data:e,onPickAction:t}){const n=e,i=Xe(),[o,s]=C.useState(null),l=c=>{o||(s(c.id),t==null||t(`${i("guess.pickedPrefix")}${c.label}`))};return m.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-guess",children:[m.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[m.jsx(bC,{className:"w-4 h-4 text-accent"}),m.jsx("span",{className:"text-label font-bold text-accent",children:i("guess.header")})]}),m.jsx("div",{className:"text-body text-ink font-medium mb-3 leading-relaxed",children:n.prompt}),m.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 mb-2",children:n.options.map(c=>{const d=o===c.id,f=o!==null;return m.jsxs("button",{onClick:()=>l(c),disabled:f,"data-testid":`guess-option-${c.id}`,className:`text-body p-2.5 rounded-lg border-2 font-medium transition-colors text-left flex items-center justify-between gap-2 ${d?"border-accent bg-accent/10 text-accent":f?"border-[var(--border-faint)] text-ink-faint cursor-default":"border-[var(--border)] text-ink-muted hover:border-accent hover:text-accent cursor-pointer"}`,children:[m.jsx("span",{children:c.label}),d&&m.jsx(Vn,{className:"w-4 h-4 shrink-0"})]},c.id)})}),o&&m.jsx("div",{className:"text-label text-ink-muted mt-1","data-testid":"guess-picked-hint",children:i("guess.waitReveal")}),n.warnings&&n.warnings.length>0&&m.jsx("div",{className:"mt-2 text-caption text-warning","data-testid":"artifact-warnings",children:n.warnings.join("; ")})]})}function Pp({data:e,onQuizAnswered:t,quizMastery:n,onPickAction:i,onQuizCompleted:o,variant:s="card"}){const l=e;if(!l||!l.artifactType)return m.jsx(Hv,{data:e});switch(l.artifactType){case"concept_map":return m.jsx(XS,{data:e,variant:s});case"quiz":return m.jsx(wI,{data:e,onAnswered:t,quizMastery:n,onPickAction:i,onQuizCompleted:o});case"compare_table":return m.jsx(KS,{data:e,variant:s});case"diagram":return m.jsx($S,{data:e,variant:s});case"code_walkthrough":return m.jsx(QS,{data:e,variant:s});case"guess":return m.jsx(_I,{data:e,onPickAction:i});default:return m.jsx(Hv,{data:e})}}function Hv({data:e}){var n;const t=Xe();return m.jsxs("div",{className:"surface-card p-4 text-body text-ink-muted","data-testid":"artifact-unknown",children:[m.jsxs("div",{className:"font-bold mb-1 flex items-center gap-1.5",children:[m.jsx(AE,{className:"w-4 h-4"}),t("artifact.unknownHeader")]}),m.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)})]})}function WS(){const[e,t]=C.useState(null),[n,i]=C.useState(null),[o,s]=C.useState(null),[l,c]=C.useState(!1),d=C.useRef(null),f=C.useRef([]),p=C.useRef(!1),x=C.useRef([]),b=C.useRef(0),g=C.useRef(0),y=C.useRef(!1),E=C.useRef(null),T=()=>{if(!d.current){const R=window.AudioContext??window.webkitAudioContext;d.current=new R}return d.current.resume(),d.current},w=C.useCallback(()=>{y.current&&g.current>=b.current&&!p.current&&(E.current=null,t(null),i(null))},[]),M=C.useCallback(()=>{const R=d.current,j=f.current.shift();if(!R||!j){p.current=!1,w();return}p.current=!0;const N=R.createBufferSource();N.buffer=j,N.connect(R.destination),N.onended=()=>{g.current+=1,M()},x.current.push(N),N.start()},[w]),_=C.useCallback(()=>{for(const R of x.current)try{R.onended=null,R.stop()}catch{}x.current=[],f.current=[],p.current=!1,b.current=0,g.current=0,y.current=!1,E.current=null,t(null),i(null)},[]),L=C.useCallback(()=>{_(),window.api.ttsStop().catch(()=>{})},[_]),A=C.useCallback((R,j)=>{if(E.current===R){L();return}_(),s(null),E.current=R,b.current=0,g.current=0,y.current=!1,t(R),i({index:0,total:0}),T(),window.api.ttsSpeak(j,R).then(N=>{if(N.ok){N.firstUse&&c(!0);return}_(),N.reason!=="empty-text"&&s(N.reason)}).catch(()=>_())},[L,_]);return C.useEffect(()=>{const R=window.api.on("speech:ttsAudio",I=>{if(I.messageId!==E.current)return;const D=T();b.current+=1,i({index:I.sentenceIndex,total:I.sentenceTotal}),D.decodeAudioData(I.wavBytes).then(P=>{I.messageId===E.current&&(f.current.push(P),p.current||M())})}),j=window.api.on("speech:ttsDone",I=>{I.messageId===E.current&&(y.current=!0,w())}),N=window.api.on("speech:ttsError",()=>_());return()=>{R(),j(),N()}},[w,M,_]),C.useEffect(()=>_,[_]),{speakingMessageId:e,speakingSentence:n,failReason:o,clearFailReason:()=>s(null),onlineNotice:l,clearOnlineNotice:()=>c(!1),speak:A,stop:L}}const ZS=C.createContext(null);let MI=0;const RI={default:4e3,success:4e3,info:4e3,warning:5e3,error:6e3},DI={default:null,success:m.jsx(ga,{className:"w-4 h-4 text-brand shrink-0"}),error:m.jsx(l0,{className:"w-4 h-4 text-warning shrink-0"}),warning:m.jsx(li,{className:"w-4 h-4 text-review shrink-0"}),info:m.jsx(wC,{className:"w-4 h-4 text-accent shrink-0"})};function LI({children:e}){const[t,n]=C.useState([]),i=C.useCallback(l=>{n(c=>c.filter(d=>d.id!==l))},[]),o=C.useCallback(l=>{n(c=>c.map(d=>d.id===l?{...d,exiting:!0}:d))},[]),s=C.useCallback((l,c)=>{const d=++MI,f=(c==null?void 0:c.severity)??"default",p=(c==null?void 0:c.duration)??RI[f],x={id:d,message:l,action:c==null?void 0:c.action,duration:p,severity:f,exiting:!1};n(b=>[...b,x]),window.setTimeout(()=>o(d),p)},[o]);return m.jsxs(ZS.Provider,{value:{show:s},children:[e,m.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(l=>m.jsx(OI,{item:l,onAction:()=>{l.action.onClick(),o(l.id)},onDismiss:()=>o(l.id),onExitDone:()=>i(l.id)},l.id))})]})}function OI({item:e,onAction:t,onDismiss:n,onExitDone:i}){const o=Xe(),s=DI[e.severity];return m.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?i:void 0,children:[s,m.jsx("span",{className:"flex-1",children:e.message}),e.action&&m.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}),m.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":o("action.close"),children:m.jsx(oa,{className:"w-3.5 h-3.5"})})]})}function Bp(){const e=C.useContext(ZS);return e||{show:()=>{}}}const II={concept_map:dp,quiz:lp,compare_table:CE,diagram:EC,code_walkthrough:vE},jI=new Set(["concept_map","quiz","compare_table","diagram","code_walkthrough"]);function PI(e,t){return jI.has(t)?e(`artifact.type.${t}`):e("artifact.type.unknown")}function BI({selectedNode:e,items:t,loading:n,forceTab:i,canvasArtifact:o,isReviewing:s,onReviewDone:l,onUserTabChange:c,onRemove:d,onTogglePin:f,onRecordQuizResult:p,onSaveContentNote:x,onUpdateNoteComment:b,onJumpToSource:g,onQuoteToChat:y,locale:E}){var j;const T=Xe(),[w,M]=C.useState("content"),_=i??w,L=N=>{M(N),c==null||c()},A=e?t.filter(N=>N.nodeId===e.id):[],R=C.useRef(null);return C.useEffect(()=>{var N;(N=R.current)==null||N.scrollTo({top:0})},[e==null?void 0:e.id]),m.jsxs("div",{className:"h-full flex flex-col bg-surface-2","data-testid":"notebook-panel",children:[m.jsx("div",{className:"px-3 pt-3 pb-1 shrink-0","data-testid":"notebook-tabs",children:m.jsxs("div",{className:"flex p-1 rounded-lg gap-1 bg-ink/[0.08]",role:"tablist","aria-label":"Notebook",children:[m.jsx(Bm,{label:T("notebook.tab.explain"),icon:La,active:_==="content",onClick:()=>L("content"),testid:"tab-content"}),m.jsx(Bm,{label:T("notebook.tab.notes"),icon:DC,active:_==="notes",onClick:()=>L("notes"),testid:"tab-notes",badge:A.length>0?String(A.length):void 0}),m.jsx(Bm,{label:T("notebook.tab.board"),icon:tm,active:_==="board",onClick:()=>L("board"),testid:"tab-board"})]})}),m.jsx("div",{className:"flex-1 overflow-y-auto min-h-0 animate-tab-slide",ref:R,role:"tabpanel",children:_==="board"?m.jsx("div",{className:"h-full flex flex-col","data-testid":"board-tab-content",children:o?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"px-4 pt-3 pb-2 shrink-0 flex items-center gap-2 min-w-0",children:[m.jsx(tm,{className:"w-4 h-4 text-ink-muted shrink-0"}),m.jsx("span",{className:"text-label font-bold text-ink truncate",children:((j=o.output)==null?void 0:j.title)??o.toolName})]}),m.jsx("div",{className:"flex-1 min-h-0 px-2 pb-2",children:m.jsx("div",{className:"h-full rounded-xl overflow-hidden bg-surface-0/60 border border-[var(--border-faint)]",children:m.jsx(Yl,{testid:"board-canvas-stage",children:m.jsx(Pp,{data:o.output,variant:"canvas"})})})})]}):m.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center px-6",children:[m.jsx(tm,{className:"w-10 h-10 mb-3 text-ink-muted opacity-30"}),m.jsx("div",{className:"text-body text-ink-muted max-w-sm leading-relaxed",children:T("notebook.board.empty")})]})}):m.jsx(m.Fragment,{children:m.jsx("div",{className:"mx-auto w-full max-w-[960px] min-h-full flex flex-col",children:_==="content"?m.jsx(zI,{selectedNode:e,contentNotes:A.filter(N=>N.artifactType==="user_note"&&N.sourceAnchor),onQuoteToChat:y,onSaveContentNote:x,locale:E,isReviewing:s,onReviewDone:l}):m.jsx(UI,{items:A,loading:n,selectedNode:e,onRemove:d,onTogglePin:f,onRecordQuizResult:p,onUpdateNoteComment:b,onJumpToSource:g})})})},_)]})}function zI({selectedNode:e,contentNotes:t,onQuoteToChat:n,onSaveContentNote:i,locale:o,isReviewing:s,onReviewDone:l}){const c=Xe(),d=Bp(),f=WS();C.useEffect(()=>{if(f.failReason){const P=f.failReason==="engine-unavailable"?"chat.speech.engine_unavailable":f.failReason==="azure-key-missing"?"chat.speech.azure_key_missing":f.failReason==="azure-region-missing"?"chat.speech.azure_region_missing":f.failReason==="edge-failed"?"chat.speech.edge_failed":"chat.speech.model_missing";d.show(c(P),{severity:"warning"}),f.clearFailReason()}else f.onlineNotice&&(d.show(c("chat.speech.edge_disclosed"),{severity:"info"}),f.clearOnlineNotice())},[f.failReason,f.onlineNotice,d,c,f]);const p=C.useRef(f.stop);p.current=f.stop;const x=e?`content-${e.id}`:null;C.useEffect(()=>()=>{p.current()},[x]);const[b,g]=C.useState(null),[y,E]=C.useState(!1),[T,w]=C.useState(!1),[M,_]=C.useState([]),[L,A]=C.useState(null),R=C.useRef(null),j=C.useRef(null);C.useEffect(()=>{if(!e){g(null),w(!1);return}let P=!1;return E(!0),w(!1),fe.getNodeContent(e.id,o??void 0).then(z=>{P||g(z)}).catch(()=>{P||(g(null),w(!0))}).finally(()=>{P||E(!1)}),()=>{P=!0}},[e==null?void 0:e.id,o]),C.useEffect(()=>{if(!e){_([]);return}let P=!1;return fe.listAssetsByNode(e.id).then(z=>{P||_(z)}).catch(()=>{P||_([])}),()=>{P=!0}},[e==null?void 0:e.id]),C.useEffect(()=>{if(!b||!R.current)return;const P=[];for(const K of t)try{const q=JSON.parse(K.sourceAnchor);if(q.type==="content"){const B=JSON.parse(K.data).text??"";B&&P.push({noteId:K.id,text:B,surrounding:q.surroundingText})}}catch{}const z=setTimeout(()=>{j.current&&VS(j.current,P)},80);return()=>clearTimeout(z)},[b,t]),C.useEffect(()=>{const P=z=>{var B;const K=z.detail;if(!K)return;const q=(B=j.current)==null?void 0:B.querySelector(`mark[data-note-id="${K}"]`);q&&qS(q)};return window.addEventListener("lookatstudy-jump-to-note",P),()=>window.removeEventListener("lookatstudy-jump-to-note",P)},[]);const N=C.useCallback(()=>{var W;if(!n&&!i)return;const P=window.getSelection(),z=(P==null?void 0:P.toString().trim())??"";if(z.length<2||z.length>500){A(null);return}const K=P==null?void 0:P.getRangeAt(0);if(!K||!((W=R.current)!=null&&W.contains(K.commonAncestorContainer))){A(null);return}const q=K.getBoundingClientRect(),B=R.current.getBoundingClientRect(),H=j.current;let G=null;if(H&&H.contains(K.commonAncestorContainer)){const U=td(H);G=US(K,U)}const Q=H?td(H).text:z,re=G?G.start:Q.indexOf(z),F=re>=0?Q.slice(Math.max(0,re-30),re+z.length+30):z,Y=YS({left:q.left-B.left,top:q.top-B.top,right:q.right-B.left,bottom:q.bottom-B.top,width:q.width,height:q.height},B.width,n?150:100);A({x:Y.left,y:Y.top,transform:Y.transform,text:z,surrounding:F,offsets:G??void 0})},[n,i]);C.useEffect(()=>{let P=null,z=null;const K=()=>{P&&clearTimeout(P),P=setTimeout(()=>{var B;(((B=window.getSelection())==null?void 0:B.toString().trim().length)??0)>=2?(z&&(clearTimeout(z),z=null),N()):z||(z=setTimeout(()=>A(H=>H&&null),250))},250)};return document.addEventListener("selectionchange",K),()=>{document.removeEventListener("selectionchange",K),P&&clearTimeout(P),z&&clearTimeout(z)}},[N]);const I=C.useCallback(()=>{var z;if(!L||!n)return;const P=L.text.length>200?L.text.slice(0,200)+"…":L.text;n(c("notebook.quote.template",{text:P})),A(null),(z=window.getSelection())==null||z.removeAllRanges()},[L,n,c]),D=C.useCallback(()=>{var z,K,q;if(!L||!i||!e)return;const P=L.text.length>200?L.text.slice(0,200)+"…":L.text;i(P,{type:"content",surroundingText:L.surrounding,startOffset:(z=L.offsets)==null?void 0:z.start,endOffset:(K=L.offsets)==null?void 0:K.end}),A(null),(q=window.getSelection())==null||q.removeAllRanges()},[L,i,e]);return e?m.jsxs("div",{className:"p-5 relative","data-testid":"node-content",ref:R,onMouseUp:N,children:[m.jsx("div",{className:"text-caption font-bold text-brand uppercase tracking-wider mb-1",children:e.type==="section"?c("notebook.node_type.section"):e.type==="concept"?c("notebook.node_type.concept"):c("notebook.node_type.lesson")}),m.jsxs("div",{className:"flex items-start justify-between gap-3 mb-4",children:[m.jsx("h2",{className:"text-title font-extrabold text-ink-strong tracking-tight","data-testid":"node-content-title",children:e.title}),!y&&!T&&b&&m.jsx("button",{onClick:()=>f.speak(x??"content",b),"data-tooltip":f.speakingMessageId===x?c("chat.speech.stop"):c("chat.speech.read_aloud_node"),"aria-label":f.speakingMessageId===x?c("chat.speech.stop"):c("chat.speech.read_aloud_node"),"data-testid":f.speakingMessageId===x?"node-content-speak-active":"node-content-speak",className:`shrink-0 rounded-full p-2 transition-colors ${f.speakingMessageId===x?"text-brand bg-brand/10 animate-pulse":"text-ink-muted hover:text-ink-strong hover:bg-ink/[0.06]"}`,children:f.speakingMessageId===x?m.jsx(fp,{className:"w-4 h-4"}):m.jsx(_E,{className:"w-4 h-4"})})]}),y?m.jsxs("div",{className:"text-body text-ink-muted flex items-center gap-2",children:[m.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),c("notebook.content.loading")]}):T?m.jsxs("div",{className:"text-body text-warning",children:[c("notebook.content.load_failed"),m.jsx("button",{className:"underline ml-1",onClick:()=>{w(!1),E(!0),fe.getNodeContent(e.id,o??void 0).then(g).catch(()=>w(!0)).finally(()=>E(!1))},children:c("notebook.content.retry")})]}):b?m.jsx(rI,{fallback:(P,z)=>m.jsxs("div",{className:"prose prose-sm max-w-[80ch] leading-relaxed [&_pre]:max-w-full [&_pre]:overflow-x-auto",children:[m.jsx("div",{className:"text-body text-warning mb-2",children:c("notebook.content.render_failed")}),m.jsxs("pre",{className:"text-caption text-ink-muted whitespace-pre-wrap break-words bg-surface-1 p-3 rounded",children:[b.slice(0,500),b.length>500?`
|
|
551
|
-
`+c("notebook.content.truncated"):""]}),m.jsx("div",{className:"flex gap-2 mt-2",children:m.jsx("button",{className:"text-caption underline text-accent",onClick:z,children:c("notebook.content.retry_render")})})]}),children:m.jsx("div",{ref:j,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:m.jsx(CT,{remarkPlugins:[ZT],rehypePlugins:[OS,[BS,zS]],urlTransform:P=>P,components:{a({children:P,...z}){return m.jsx("a",{...z,target:"_blank",rel:"noopener noreferrer",children:P})},img({src:P,alt:z,...K}){return m.jsx(HI,{src:P,alt:z,assets:M,...K})},table({children:P}){return m.jsx("div",{className:"overflow-x-auto my-4",children:m.jsx("table",{children:P})})}},children:b})})},`${e.id}-${o??"orig"}`):m.jsx("div",{className:"text-body text-ink-muted",children:c("notebook.content.empty")}),M.length>0&&m.jsxs("div",{className:"mt-6 pt-4 border-t border-[var(--border-faint)]",children:[m.jsxs("div",{className:"text-label font-bold text-ink-muted mb-2 flex items-center gap-1",children:[m.jsx(kC,{className:"w-3.5 h-3.5"}),m.jsx("span",{children:c("notebook.images.heading",{n:M.length})})]}),m.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:M.map(P=>m.jsx(FI,{asset:P},P.id))})]}),L&&m.jsxs("div",{style:{left:L.x,top:L.y,transform:L.transform},className:"absolute z-20 flex items-center gap-0.5 msg-enter",children:[n&&m.jsxs("button",{onClick:I,"data-testid":"quote-to-chat-btn","aria-label":c("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:[m.jsx(wE,{className:"w-3 h-3"}),c("notebook.quote.ask")]}),m.jsxs("button",{onClick:D,"data-testid":"save-note-btn","aria-label":c("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:c("notebook.quote.save_note.title"),children:[m.jsx(kl,{className:"w-3.5 h-3.5"}),c("notebook.quote.add_note")]})]}),e.sourcePath&&m.jsx("div",{className:"mt-6 pt-3 border-t border-[var(--border-faint)] text-label text-ink-muted",children:c("notebook.source.label",{path:e.sourcePath})}),m.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:[m.jsx(Yc,{className:"w-3.5 h-3.5 shrink-0 mt-0.5 text-accent"}),m.jsx("span",{children:c("notebook.quote.hint")})]}),s&&e&&m.jsx(sI,{nodeId:e.id,onRated:l})]}):m.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center px-6",children:[m.jsx("div",{className:"text-4xl mb-3 opacity-30",children:"📖"}),m.jsx("div",{className:"text-body text-ink-muted max-w-xs",children:c("notebook.empty.select_node")})]})}function UI({items:e,loading:t,selectedNode:n,onRemove:i,onTogglePin:o,onRecordQuizResult:s,onUpdateNoteComment:l,onJumpToSource:c}){const d=Xe();if(!n)return m.jsx(Fv,{message:d("notebook.empty.notes.title"),icon:"📓"});if(t)return m.jsxs("div",{className:"flex-1 flex items-center justify-center gap-2 text-body text-ink-muted",children:[m.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),d("notebook.empty.notes.title")]});const f=e.filter(E=>["concept_map","compare_table","diagram","code_walkthrough"].includes(E.artifactType)),p=e.filter(E=>E.artifactType==="user_note"),x=e.filter(E=>E.artifactType==="quiz"),b=e.length,g=x.filter(E=>E.lastResult==="correct").length,y=x.filter(E=>E.lastResult==="wrong").length;return b===0?m.jsx(Fv,{message:d("notebook.empty.no_notes_message"),icon:"🧩"}):m.jsxs("div",{className:"p-4 space-y-3","data-testid":"notes-list",children:[m.jsx(Im,{title:d("notebook.zone.understand"),icon:m.jsx(dp,{className:"w-4 h-4"}),subtitle:d("notebook.zone.understand.subtitle"),count:f.length,testid:"zone-understand",defaultOpen:!1,children:f.length===0?m.jsx(jm,{hint:d("notebook.zone.understand.empty_hint")}):f.map(E=>m.jsx(Pm,{item:E,onRemove:i,onTogglePin:o,onRecordQuizResult:s,onUpdateNoteComment:l,onJumpToSource:c},E.id))}),m.jsx(Im,{title:d("notebook.zone.note"),icon:m.jsx(kl,{className:"w-4 h-4"}),subtitle:d("notebook.zone.note.subtitle"),count:p.length,testid:"zone-note",defaultOpen:!1,children:p.length===0?m.jsx(jm,{hint:d("notebook.zone.note.empty_hint")}):p.map(E=>m.jsx(Pm,{item:E,onRemove:i,onTogglePin:o,onRecordQuizResult:s,onUpdateNoteComment:l,onJumpToSource:c},E.id))}),m.jsx(Im,{title:d("notebook.zone.practice"),icon:m.jsx(lp,{className:"w-4 h-4"}),subtitle:x.length>0?d("notebook.zone.practice.subtitle_stats",{total:x.length,correct:g,wrong:y}):d("notebook.zone.practice.subtitle_empty"),count:x.length,testid:"zone-practice",defaultOpen:!1,children:x.length===0?m.jsx(jm,{hint:d("notebook.zone.practice.empty_hint")}):x.map(E=>m.jsx(Pm,{item:E,onRemove:i,onTogglePin:o,onRecordQuizResult:s,onUpdateNoteComment:l,onJumpToSource:c},E.id))})]})}function Im({title:e,icon:t,subtitle:n,count:i,testid:o,defaultOpen:s=!0,children:l}){const[c,d]=C.useState(s),f=C.useRef(!0),p=C.useRef(i);return C.useEffect(()=>{if(f.current){f.current=!1,p.current=i;return}i>p.current&&d(!0),p.current=i},[i]),m.jsxs("section",{className:"rounded-xl bg-surface-1 overflow-hidden","data-testid":o,children:[m.jsxs("button",{onClick:()=>d(x=>!x),"aria-expanded":c,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":`${o}-toggle`,children:[m.jsx(op,{className:`w-4 h-4 text-ink-muted transition-transform duration-200 ease-out-back ${c?"":"-rotate-90"}`}),m.jsx("span",{className:"text-body text-ink-strong flex items-center",children:t}),m.jsx("span",{className:"text-body font-bold text-ink",children:e}),m.jsx("span",{className:"text-caption font-bold px-1.5 py-0.5 rounded-full bg-brand/15 text-brand",children:i}),m.jsx("span",{className:"text-label text-ink-muted ml-auto truncate",children:n})]}),m.jsx("div",{className:"grid transition-all duration-200 ease-out-expo",style:{gridTemplateRows:c?"1fr":"0fr"},children:m.jsx("div",{className:"overflow-hidden",children:m.jsx("div",{className:"p-3 space-y-3",children:l})})})]})}function jm({hint:e}){return m.jsx("div",{className:"text-center py-3 text-body text-ink-muted",children:e})}function Pm({item:e,onRemove:t,onTogglePin:n,onRecordQuizResult:i,onUpdateNoteComment:o,onJumpToSource:s}){const l=Xe(),[c,d]=C.useState(!1),[f,p]=C.useState(e.notes??""),x=C.useCallback((_,L,A)=>{e.nodeId&&fe.recordQuizAnswer(e.nodeId,A).catch(()=>{}),i(e.id,A)},[e.nodeId,e.id,i]),b=e.artifactType==="user_note";let g="",y=null;if(b){try{g=JSON.parse(e.data).text??""}catch{g=e.title??""}try{e.sourceAnchor&&(y=JSON.parse(e.sourceAnchor))}catch{y=null}}let E=null;if(!b)try{E=JSON.parse(e.data)}catch{E=null}const T=new Date(e.createdAt),w=`${T.getMonth()+1}/${T.getDate()} ${T.getHours().toString().padStart(2,"0")}:${T.getMinutes().toString().padStart(2,"0")}`;if(b){const _=e.notes&&e.notes.trim().length>0?e.notes:null,L=()=>{p(_??""),d(!0)},A=()=>{p(_??""),d(!1)},R=()=>{o==null||o(e.id,f),d(!1)};return m.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:m.jsxs("div",{className:"flex items-start gap-2",children:[m.jsx(PC,{className:"w-4 h-4 text-accent shrink-0 mt-0.5"}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsx("div",{className:"text-body text-ink leading-relaxed whitespace-pre-wrap",children:g}),o&&c?m.jsxs("div",{className:"mt-2 space-y-1.5","data-testid":`note-comment-edit-${e.id.slice(0,8)}`,children:[m.jsx("textarea",{value:f,onChange:j=>p(j.target.value),rows:2,placeholder:l(_?"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)}`}),m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsxs("button",{onClick:R,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:[m.jsx(Vn,{className:"w-3 h-3"})," ",l("notebook.action.save")]}),m.jsxs("button",{onClick:A,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:[m.jsx(oa,{className:"w-3 h-3"})," ",l("notebook.action.cancel")]})]})]}):_?m.jsxs("div",{className:"mt-2 px-2.5 py-1.5 rounded-lg bg-ink/5",children:[m.jsx("div",{className:"text-label text-ink-muted italic leading-relaxed whitespace-pre-wrap",children:_}),o&&m.jsxs("button",{onClick:L,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:l("notebook.note.edit_comment"),children:[m.jsx(kl,{className:"w-2.5 h-2.5"})," ",l("notebook.note.edit_comment")]})]}):o?m.jsxs("button",{onClick:L,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:l("notebook.note.add_comment"),children:[m.jsx(kl,{className:"w-2.5 h-2.5"})," ",l("notebook.note.add_comment")]}):null,y&&s&&m.jsx("button",{onClick:()=>s(y,g,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:y.type==="content"?m.jsxs(m.Fragment,{children:[m.jsx(La,{className:"w-3 h-3"}),l("notebook.source.jump_content")]}):m.jsxs(m.Fragment,{children:[m.jsx(wE,{className:"w-3 h-3"}),l("notebook.source.jump_chat")]})}),m.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[m.jsx("span",{className:"text-caption text-ink-muted",children:w}),m.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:l("notebook.note.delete"),children:m.jsx(c0,{className:"w-3 h-3"})})]})]})]})})}const M=II[e.artifactType]??AE;return m.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:[m.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[m.jsx("span",{className:"text-body inline-flex items-center text-ink-strong",children:m.jsx(M,{className:"w-4 h-4"})}),m.jsx("span",{className:"text-label font-bold text-ink-muted flex-1 truncate",children:e.title??PI(l,e.artifactType)}),e.artifactType==="quiz"&&e.lastResult&&m.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"?l("notebook.quiz.last_correct"):l("notebook.quiz.last_wrong")}),e.pinned?m.jsxs("span",{className:"text-caption text-brand font-bold flex items-center gap-0.5",children:[m.jsx(fy,{className:"w-2.5 h-2.5"}),l("notebook.note.pinned")]}):null,m.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?l("notebook.note.unpin"):l("notebook.note.pin"),children:m.jsx(fy,{className:"w-3 h-3"})}),m.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:l("notebook.note.delete"),children:m.jsx(c0,{className:"w-3 h-3"})})]}),m.jsx("div",{className:"text-label",children:E?m.jsx(Pp,{data:E,onQuizAnswered:x}):m.jsx("div",{className:"text-ink-muted",children:l("notebook.artifact.broken")})}),m.jsx("div",{className:"text-caption text-ink-muted mt-2",children:w})]})}function Fv({message:e,icon:t}){return m.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center px-6","data-testid":"empty-notebook",children:[m.jsx("div",{className:"text-4xl mb-3 opacity-30",children:t}),m.jsx("div",{className:"text-body text-ink-muted max-w-xs leading-relaxed",children:e})]})}function Bm({label:e,icon:t,active:n,onClick:i,testid:o,badge:s}){return m.jsxs("button",{onClick:i,"data-testid":o,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:[m.jsx(t,{className:"w-3 h-3"}),m.jsx("span",{children:e}),s&&m.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:s})]})}function HI({src:e,alt:t,assets:n,...i}){const[o,s]=C.useState(null),l=e??"",c=C.useMemo(()=>{if(!l||l.startsWith("http")||l.startsWith("data:"))return null;const f=l.split("/").pop()??l;return n.find(p=>{var x;return(x=p.sourcePath)==null?void 0:x.endsWith(f)})??n.find(p=>p.filename===f)??null},[l,n]);if(C.useEffect(()=>{if(!c){s(null);return}let f=!1;return fe.getAssetDataUrl(c.id).then(p=>{f||s(p)}),()=>{f=!0}},[c]),!l)return null;const d=o??l;return m.jsx("img",{src:d,alt:t??"","data-asset-id":c==null?void 0:c.id,className:"rounded-lg max-w-full h-auto my-3",loading:"lazy",...i})}function FI({asset:e}){const t=Xe(),[n,i]=C.useState(null),[o,s]=C.useState(!1);return C.useEffect(()=>{let l=!1;return fe.getAssetDataUrl(e.id).then(c=>{l||i(c)}),()=>{l=!0}},[e.id]),m.jsxs(m.Fragment,{children:[m.jsx("button",{onClick:()=>s(!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?m.jsx("img",{src:n,alt:e.altText??e.filename,"data-asset-id":e.id,className:"w-full h-24 object-cover",loading:"lazy"}):m.jsx("div",{className:"w-full h-24 flex items-center justify-center text-ink-faint text-caption",children:t("notebook.asset.loading")})}),o&&n&&m.jsxs("div",{className:"fixed inset-0 z-50 bg-black/80 flex items-center justify-center p-8 cursor-pointer",onClick:()=>s(!1),children:[m.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"}),m.jsx("button",{className:"absolute top-4 right-4 text-white/70 hover:text-white","aria-label":t("action.close"),onClick:l=>{l.stopPropagation(),s(!1)},children:m.jsx(oa,{className:"w-6 h-6"})})]})]})}function VI(e){const[t,n]=C.useState([]),[i,o]=C.useState(!0),s=C.useCallback(async()=>{if(!e){n([]),o(!1);return}try{const y=await fe.canvasList(e);n(y)}catch{n([])}finally{o(!1)}},[e]);C.useEffect(()=>{s()},[s]);const l=C.useCallback(async y=>{if(!e)return null;try{const E=await fe.canvasSave({...y,courseId:e});return n(T=>T.some(w=>w.id===E.id)?T:[E,...T]),E}catch{return null}},[e]),c=C.useCallback(async y=>{if(!e)return null;try{const E=await fe.canvasSaveUserNote({...y,courseId:e});return n(T=>[E,...T]),E}catch{return null}},[e]),d=C.useCallback(async(y,E)=>{try{const T=await fe.canvasRecordQuizResult(y,E);return T&&n(w=>w.map(M=>M.id===y?T:M)),T}catch{return null}},[]),f=C.useCallback(async(y,E)=>{try{const T=await fe.canvasUpdateUserNoteComment(y,E);return T&&n(w=>w.map(M=>M.id===y?T:M)),T}catch{return null}},[]),p=C.useCallback(async y=>{try{await fe.canvasDelete(y),n(E=>E.filter(T=>T.id!==y))}catch{}},[]),x=C.useCallback(async y=>{try{const E=await fe.canvasTogglePin(y);E&&n(T=>T.map(M=>M.id===y?E:M).sort((M,_)=>_.pinned!==M.pinned?_.pinned-M.pinned:_.createdAt.localeCompare(M.createdAt)))}catch{}},[]),b=C.useCallback(y=>y===null?t:t.filter(E=>E.nodeId===y),[t]),g=C.useCallback((y,E)=>{const T=y===null?t:t.filter(w=>w.nodeId===y);return E==="note"?T.filter(w=>w.artifactType==="user_note"):E==="practice"?T.filter(w=>w.artifactType==="quiz"):T.filter(w=>["concept_map","compare_table","diagram","code_walkthrough"].includes(w.artifactType))},[t]);return{items:t,loading:i,reload:s,save:l,saveUserNote:c,recordQuizResult:d,updateUserNoteComment:f,remove:p,togglePin:x,byNode:b,byZone:g}}const Vv={small:16,medium:17,large:18},qv="lookatstudy-font-size",qI="medium";function YI(){const[e,t]=C.useState(()=>{if(typeof localStorage<"u"){const i=localStorage.getItem(qv);if(i&&i in Vv)return i}return qI});C.useEffect(()=>{document.documentElement.style.fontSize=`${Vv[e]}px`,localStorage.setItem(qv,e)},[e]);const n=C.useCallback(i=>{t(o=>{const s=["small","medium","large"],l=s.indexOf(o),c=i==="up"?Math.min(l+1,s.length-1):Math.max(l-1,0);return s[c]})},[]);return{size:e,bump:n}}const zm=new Map;function GI({ref_:e,onOpen:t}){const n=Xe(),[i,o]=C.useState(e.previewUrl??(e.file?zm.get(e.file)??null:null));return C.useEffect(()=>{if(i||!e.file)return;let s=!1;return(async()=>{const l=zm.get(e.file);if(l){s||o(l);return}const c=await fe.getAttachmentDataUrl(e.file);c&&!s&&(zm.set(e.file,c),o(c))})(),()=>{s=!0}},[e.file,i]),i?m.jsx("button",{type:"button",onClick:()=>t(i),"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:m.jsx("img",{src:i,alt:e.name,className:"w-full h-full object-cover"})}):m.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 XI({src:e,name:t,onClose:n}){return C.useEffect(()=>{const i=o=>{o.key==="Escape"&&n()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[n]),m.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:[m.jsx("img",{src:e,alt:t,className:"max-w-full max-h-full object-contain rounded-lg shadow-elevated"}),m.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:m.jsx(oa,{className:"w-4 h-4"})})]})}function KI({parts:e}){const t=Xe(),[n,i]=C.useState(null),o=e.filter(c=>c.type==="attachment").map(c=>c.attachment);if(o.length===0)return null;const s=o.filter(c=>c.kind==="image"),l=o.filter(c=>c.kind==="text");return m.jsxs("div",{className:"flex flex-col gap-1.5 mb-1","data-testid":"message-attachments",children:[s.length>0&&m.jsx("div",{className:"flex gap-1.5 flex-wrap",children:s.map((c,d)=>m.jsx(GI,{ref_:c,onOpen:f=>i({src:f,name:c.name})},c.file??c.previewUrl??`${c.name}:${d}`))}),l.length>0&&m.jsx("div",{className:"flex gap-1.5 flex-wrap",children:l.map((c,d)=>m.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:[m.jsx(Il,{className:"w-3 h-3 shrink-0"}),m.jsx("span",{className:"truncate max-w-[12rem]",children:c.name})]},`${c.name}:${d}`))}),n&&m.jsx(XI,{src:n.src,name:n.name,onClose:()=>i(null)})]})}function $I({messages:e,streaming:t,onApplyProposal:n,onRejectProposal:i,summary:o,onStartLearning:s,agentReady:l=!0,onGotoSettings:c,hasNode:d=!0,selectedNodeId:f,threadId:p,onSaveChatNote:x,chatNotes:b,onPickQuizAction:g,onQuizCompleted:y,cardMode:E=!1}){const T=Xe(),w=Bp(),M=WS();C.useEffect(()=>{if(M.failReason){const G=M.failReason==="engine-unavailable"?"chat.speech.engine_unavailable":M.failReason==="azure-key-missing"?"chat.speech.azure_key_missing":M.failReason==="azure-region-missing"?"chat.speech.azure_region_missing":M.failReason==="edge-failed"?"chat.speech.edge_failed":M.failReason==="custom-provider-missing"?"chat.speech.custom_provider_missing":"chat.speech.model_missing";w.show(T(G),{severity:"warning"}),M.clearFailReason()}},[M.failReason,w,T,M]),C.useEffect(()=>{M.onlineNotice&&(w.show(T("chat.speech.edge_disclosed"),{severity:"info"}),M.clearOnlineNotice())},[M.onlineNotice,w,T,M]);const _=C.useCallback((G,Q,re)=>{f&&fe.recordQuizAnswer(f,re,G.kc).catch(()=>{})},[f]),[L,A]=C.useState(null);C.useEffect(()=>{if(!f){A(null);return}let G=!1;const Q=()=>fe.getProgress(f).then(F=>{G||A((F==null?void 0:F.mastery)??null)}).catch(()=>{});Q();const re=fe.on("state:changed",F=>{F==="mastery"&&Q()});return()=>{G=!0,re()}},[f]);const R=C.useRef(null),j=C.useRef(!0),[N,I]=C.useState(!1);C.useEffect(()=>{const G=Q=>{const re=Q.detail;if(!(re!=null&&re.msgId))return;const F=document.querySelector(`[data-msg-id="${re.msgId}"]`);F&&(F.scrollIntoView({behavior:"smooth",block:"center"}),F.classList.add("ring-2","ring-accent","rounded-lg"),setTimeout(()=>F.classList.remove("ring-2","ring-accent","rounded-lg"),2500))};return window.addEventListener("lookatstudy-highlight-message",G),()=>window.removeEventListener("lookatstudy-highlight-message",G)},[]),C.useEffect(()=>{if(t||!R.current||!b||b.length===0)return;const G=setTimeout(()=>{if(!R.current)return;const Q=new Map;for(const re of b)try{const F=JSON.parse(re.sourceAnchor);if(F.type==="chat"&&F.msgId){const Y=JSON.parse(re.data).text??"";if(Y){const W=Q.get(F.msgId)??[];W.push({noteId:re.id,text:Y}),Q.set(F.msgId,W)}}}catch{}for(const[re,F]of Q){const Y=R.current.querySelector(`[data-msg-id="${re}"]`);Y&&VS(Y,F)}},150);return()=>clearTimeout(G)},[e,b,t]),C.useEffect(()=>{const G=Q=>{var Y;const re=Q.detail;if(!re)return;const F=(Y=R.current)==null?void 0:Y.querySelector(`mark[data-note-id="${re}"]`);F&&qS(F)};return window.addEventListener("lookatstudy-jump-to-chat-note",G),()=>window.removeEventListener("lookatstudy-jump-to-chat-note",G)},[]);const[D,P]=C.useState(null),z=C.useCallback(()=>{if(!x||!p)return;const G=window.getSelection(),Q=(G==null?void 0:G.toString().trim())??"";if(Q.length<2||Q.length>500){P(null);return}const re=G==null?void 0:G.getRangeAt(0);if(!re){P(null);return}const F=R.current;if(!(F!=null&&F.contains(re.commonAncestorContainer))){P(null);return}let Y=re.commonAncestorContainer,W=null;for(;Y&&Y!==F;){if(Y instanceof HTMLElement&&Y.dataset.msgId){W=Y;break}Y=Y.parentNode}if(!W){P(null);return}const U=W.dataset.msgId,ae=td(W),J=US(re,ae),ne=re.getBoundingClientRect(),me=F.getBoundingClientRect(),Z=YS({left:ne.left-me.left,top:ne.top-me.top,right:ne.right-me.left,bottom:ne.bottom-me.top,width:ne.width,height:ne.height},me.width,110);P({x:Z.left,y:Z.top,transform:Z.transform,text:Q,msgId:U,startOffset:J==null?void 0:J.start,endOffset:J==null?void 0:J.end})},[x,p]);C.useEffect(()=>{let G=null,Q=null;const re=()=>{G&&clearTimeout(G),G=setTimeout(()=>{var Y;(((Y=window.getSelection())==null?void 0:Y.toString().trim().length)??0)>=2?(Q&&(clearTimeout(Q),Q=null),z()):Q||(Q=setTimeout(()=>P(W=>W&&null),250))},250)};return document.addEventListener("selectionchange",re),()=>{document.removeEventListener("selectionchange",re),G&&clearTimeout(G),Q&&clearTimeout(Q)}},[z]);const K=C.useCallback(()=>{var Q;if(!D||!x)return;const G=D.text.length>200?D.text.slice(0,200)+"…":D.text;x(G,D.msgId,D.startOffset,D.endOffset),P(null),(Q=window.getSelection())==null||Q.removeAllRanges()},[D,x]),q=C.useCallback(()=>{const G=R.current;if(!G)return;const Q=G.scrollHeight-G.scrollTop-G.clientHeight<80;j.current=Q,I(re=>re===!Q?re:!Q)},[]);C.useEffect(()=>{if(!j.current)return;const G=R.current;G&&(G.scrollTop=G.scrollHeight)},[e,t]);const B=e.length>0&&e[e.length-1].role==="user";C.useEffect(()=>{if(!B)return;j.current=!0,I(!1);const G=R.current;G&&(G.scrollTop=G.scrollHeight)},[B]);const H=C.useCallback(()=>{const G=R.current;G&&(G.scrollTop=G.scrollHeight,j.current=!0,I(!1))},[]);return m.jsxs("div",{className:"relative flex-1 min-h-0",children:[m.jsxs("div",{ref:R,onScroll:q,onMouseUp:z,className:`h-full overflow-y-auto px-3 py-4 space-y-2 relative ${E?"":"px-5 py-6 space-y-6"}`,"data-testid":"chat-stream",children:[e.length===0&&m.jsx("div",{className:"mt-10 mx-auto max-w-md","data-testid":"chat-empty-state",children:d?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"text-center mb-4",children:[m.jsx("div",{className:"text-4xl mb-2 opacity-30",children:"📖"}),m.jsx("div",{className:"text-body font-bold text-ink-muted mb-1",children:T("chat.empty.greeting")}),m.jsx("div",{className:"text-ink-muted text-label",children:T("chat.empty.overview")})]}),o?m.jsxs("div",{className:"surface-card p-4 mb-4",children:[m.jsx("div",{className:"text-caption font-bold text-brand uppercase tracking-wider mb-2",children:T("chat.empty.summary.title")}),m.jsx("div",{className:"text-body text-ink-muted leading-relaxed whitespace-pre-wrap",children:o})]}):m.jsx("div",{className:"surface-card p-4 mb-4 text-center",children:m.jsx("div",{className:"text-body text-ink-muted",children:T("chat.empty.summary.none")})}),l?m.jsx(m.Fragment,{children:s&&m.jsxs("button",{onClick:s,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:[m.jsx(BC,{className:"w-4 h-4"}),m.jsx("span",{children:T("chat.empty.start")})]})}):m.jsxs("div",{className:"surface-card p-4 mb-2","data-testid":"keyless-card",children:[m.jsx("div",{className:"text-body font-bold text-ink-muted mb-1",children:T("chat.empty.keyless.title")}),m.jsx("div",{className:"text-label text-ink-muted mb-3",children:T("chat.empty.keyless.desc")}),m.jsxs("button",{onClick:c,className:"btn-3d-brand w-full py-2 text-body font-bold flex items-center justify-center gap-2",children:[m.jsx(Gc,{className:"w-4 h-4"}),m.jsx("span",{children:T("chat.empty.keyless.btn")})]})]})]}):m.jsxs("div",{className:"text-center mt-16","data-testid":"no-node-selected",children:[m.jsx("div",{className:"text-5xl mb-3 opacity-25",children:"🗺️"}),m.jsx("div",{className:"text-body font-bold text-ink-muted mb-1",children:T("chat.empty.no_node.title")}),m.jsx("div",{className:"text-body text-ink-muted max-w-xs mx-auto",children:T("chat.empty.no_node.desc")})]})}),e.map(G=>m.jsx("div",{className:E?"":"contents",children:m.jsx("div",{className:E&&G.role==="assistant"?"surface-card p-4 rounded-2xl shadow-card":void 0,children:m.jsx(QI,{msg:G,onApplyProposal:n,onRejectProposal:i,onQuizAnswered:_,quizMastery:L,onPickAction:g,onQuizCompleted:y,speakingMessageId:M.speakingMessageId,speakingSentence:M.speakingSentence,onSpeak:M.speak})})},G.id)),t&&m.jsxs("div",{className:"flex items-center gap-1.5 text-body text-brand",children:[m.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),m.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),m.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"})]})]}),N&&e.length>0&&m.jsxs("button",{onClick:H,"data-testid":"scroll-to-bottom","aria-label":T("chat.scroll.bottom"),title:T("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:[m.jsx(op,{className:"w-5 h-5"}),t&&m.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"})]}),D&&m.jsxs("button",{onClick:K,"data-testid":"save-chat-note-btn",style:{left:D.x,top:D.y,transform:D.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:T("chat.note.add.title"),children:[m.jsx(kl,{className:"w-3 h-3"})," ",T("chat.note.add")]})]})}function Yv(e){const t=[];for(const n of e)if(n.role==="assistant")for(let i=0;i<n.parts.length;i++){const o=n.parts[i];o.type==="tool-call"&&o.state==="output-available"&&o.output&&typeof o.output=="object"&&"artifactType"in o.output&&t.push({id:`${n.id}-${i}`,toolName:o.toolName,output:o.output})}return t}function QI({msg:e,onApplyProposal:t,onRejectProposal:n,onQuizAnswered:i,quizMastery:o,onPickAction:s,onQuizCompleted:l,speakingMessageId:c,speakingSentence:d,onSpeak:f}){const p=Xe();if(e.role==="user")return m.jsx("div",{className:"msg-enter flex justify-end","data-testid":"msg-user","data-msg-id":e.id,children:m.jsxs("div",{className:"max-w-[85%] bg-ink/[0.04] rounded-2xl rounded-br-md px-4 py-2.5",children:[m.jsx(KI,{parts:e.parts}),m.jsx("div",{className:"font-medium text-ink-strong whitespace-pre-wrap select-text text-body",children:e.displayText??e.parts.map((g,y)=>g.type==="text"?m.jsx("span",{children:g.text},y):null)})]})});const x=e.parts.map(g=>g.type==="text"?g.text:"").join("").trim(),b=c===e.id;return m.jsxs("div",{className:"msg-enter","data-testid":"msg-assistant","data-msg-id":e.id,children:[m.jsx("div",{className:"min-w-0 space-y-2.5",children:e.parts.map((g,y)=>m.jsx(WI,{part:g,msgId:e.id,toolCallIdx:y,onApplyProposal:t,onRejectProposal:n,onQuizAnswered:i,quizMastery:o,onPickAction:s,onQuizCompleted:l},y))}),f&&x&&m.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[m.jsx("button",{onClick:()=>f(e.id,x),"data-testid":b?"speech-stop-btn":"speech-speak-btn","aria-label":p(b?"chat.speech.stop":"chat.speech.speak"),title:p(b?"chat.speech.stop":"chat.speech.speak"),className:`w-7 h-7 rounded-lg flex items-center justify-center transition ${b?"bg-brand/15 text-brand":"text-ink-muted hover:bg-ink/[0.06] hover:text-ink"}`,children:b?m.jsx(fp,{className:"w-3.5 h-3.5"}):m.jsx(_E,{className:"w-4 h-4"})}),b&&d&&d.total>0&&m.jsx("span",{className:"text-caption text-ink-muted",children:p("chat.speech.progress").replace("{n}",String(d.index+1)).replace("{total}",String(d.total))})]})]})}function WI({part:e,msgId:t,toolCallIdx:n,onApplyProposal:i,onRejectProposal:o,onQuizAnswered:s,quizMastery:l,onPickAction:c,onQuizCompleted:d}){if(e.type==="text")return m.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:m.jsx(CT,{remarkPlugins:[ZT],rehypePlugins:[OS,[BS,zS]],urlTransform:g=>g,components:ej,children:e.text})});if(e.type==="reasoning")return m.jsx(ZI,{text:e.text});if(e.type!=="tool-call")return null;const{toolName:f,state:p,output:x,error:b}=e;return m.jsx(JI,{toolName:f,state:p,output:x,error:b,msgId:t,toolCallIdx:n,onApplyProposal:i,onRejectProposal:o,onQuizAnswered:s,quizMastery:l,onPickAction:c,onQuizCompleted:d})}function ZI({text:e}){const t=Xe(),[n,i]=C.useState(!1);return m.jsxs("div",{className:"rounded-lg bg-surface-1/60 border border-[var(--border-faint)]","data-testid":"part-reasoning",children:[m.jsxs("button",{onClick:()=>i(o=>!o),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:[m.jsxs("span",{children:[n?"▾":"▸"," ",t("chat.reasoning.label")]}),m.jsx("span",{className:"text-ink-muted font-normal",children:t("chat.reasoning.chars",{n:e.length})})]}),n&&m.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 JI({toolName:e,state:t,output:n,error:i,msgId:o,toolCallIdx:s,onApplyProposal:l,onRejectProposal:c,onQuizAnswered:d,quizMastery:f,onPickAction:p,onQuizCompleted:x}){const b=Xe(),y=(e==="record_answer"||e==="mark_mastered")&&t==="output-available"&&typeof n=="object"&&n!==null?n:null;if(y!=null&&y.proposalId){const w=y.status;return w==="applied"?m.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:[m.jsx(ga,{className:"w-4 h-4 text-gold shrink-0"}),m.jsx("span",{className:"text-body font-bold text-ink",children:b("chat.proposal.applied")})]}):w==="rejected"?m.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:[m.jsx(gC,{className:"w-4 h-4 text-ink-muted shrink-0"}),m.jsx("span",{className:"text-body text-ink-muted",children:b("chat.proposal.rejected")})]}):m.jsxs("div",{className:"proposal-card relative rounded-xl border border-brand/30 bg-brand/5 overflow-hidden","data-testid":"part-proposal",children:[m.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-1 bg-brand"}),m.jsxs("div",{className:"pl-4 pr-3 py-3",children:[m.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[m.jsx("span",{className:"flex items-center justify-center w-7 h-7 rounded-lg bg-brand/15 text-brand shrink-0",children:m.jsx(kE,{className:"w-4 h-4"})}),m.jsx("span",{className:"text-lead font-bold text-ink",children:b("chat.proposal.mastered.title")})]}),y.message&&m.jsx("div",{className:"text-body text-ink mb-2 leading-relaxed",children:y.message}),m.jsx("div",{className:"text-caption text-ink-muted mb-3",children:b("chat.proposal.mastered.hint")}),m.jsxs("div",{className:"flex gap-2",children:[m.jsxs("button",{onClick:()=>l==null?void 0:l(y.proposalId,o,s),"data-testid":"proposal-apply",className:"btn-3d-brand px-4 py-1.5 text-body",children:[m.jsx(Vn,{className:"w-3.5 h-3.5 inline"}),b("chat.proposal.confirm")]}),m.jsx("button",{onClick:()=>c==null?void 0:c(y.proposalId,o,s),"data-testid":"proposal-reject",className:"btn-3d-neutral px-4 py-1.5 text-body",children:b("chat.proposal.later")})]})]})]})}if(t==="output-available"&&n&&typeof n=="object"&&"artifactType"in n){const w=n.artifactType;return m.jsx("div",{className:"my-1 max-w-full","data-testid":`inline-artifact-${w}`,"data-tool":e,children:m.jsx(Pp,{data:n,onQuizAnswered:d,quizMastery:f,onPickAction:p,onQuizCompleted:x})})}const T=nj(e,b);return m.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"?m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),m.jsxs("span",{className:"text-ink-muted",children:[T,"…"]})]}):t==="output-error"?m.jsxs(m.Fragment,{children:[m.jsx(Ir,{className:"w-3.5 h-3.5 text-warning shrink-0"}),m.jsxs("span",{className:"text-warning",children:[T,": ",i]})]}):m.jsxs(m.Fragment,{children:[m.jsx(Pl,{className:"w-3.5 h-3.5 text-ink-faint shrink-0"}),m.jsx("span",{className:"text-ink-muted",children:T})]})})}const ej={pre({children:e,...t}){return m.jsx(tj,{...t,children:e})},a({children:e,...t}){return m.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",children:e})},table({children:e}){return m.jsx("div",{className:"overflow-x-auto my-4",children:m.jsx("table",{children:e})})}};function tj({children:e,...t}){const n=Xe(),[i,o]=C.useState(!1),s=Array.isArray(e)?e[0]:e,l=(s==null?void 0:s.props)??{},c=/language-(\w+)/.exec(l.className??""),d=(c==null?void 0:c[1])??"",f=()=>{var b;const p=l.children,x=typeof p=="string"?p:Array.isArray(p)?p.join(""):"";(b=navigator.clipboard)==null||b.writeText(x).then(()=>{o(!0),setTimeout(()=>o(!1),1500)})};return m.jsxs("div",{className:"relative group my-3","data-testid":"md-codeblock",children:[m.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:[m.jsx("span",{className:"text-caption font-mono text-ink-faint uppercase tracking-wider",children:d||"code"}),m.jsx("button",{onClick:f,"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:i?m.jsxs(m.Fragment,{children:[m.jsx(Vn,{className:"w-3 h-3 inline"}),n("chat.copied")]}):m.jsxs(m.Fragment,{children:[m.jsx(xC,{className:"w-3 h-3 inline"}),n("chat.copy")]})})]}),m.jsx("pre",{...t,className:"!mt-0 !rounded-t-none !border-t-0",children:e})]})}function nj(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 yl={maxPerMessage:4,maxImageBytes:5*1024*1024,maxTextBytes:256*1024},aj=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 Gv(e){const t=e.lastIndexOf(".");return t<=0||t===e.length-1?"":e.slice(t+1).toLowerCase()}function ij(e,t,n){return t&&t.startsWith("image/")||["png","jpg","jpeg","webp","gif","bmp"].includes(Gv(e))?n>yl.maxImageBytes?{ok:!1,reason:"tooLargeImage"}:{ok:!0,kind:"image"}:aj.has(Gv(e))?n>yl.maxTextBytes?{ok:!1,reason:"tooLargeText"}:{ok:!0,kind:"text"}:{ok:!1,reason:"unsupported"}}function rj(e,t){const n=e.length,i=n*2,o=new ArrayBuffer(44+i),s=new DataView(o),l=(d,f)=>{for(let p=0;p<f.length;p++)s.setUint8(d+p,f.charCodeAt(p))};l(0,"RIFF"),s.setUint32(4,36+i,!0),l(8,"WAVE"),l(12,"fmt "),s.setUint32(16,16,!0),s.setUint16(20,1,!0),s.setUint16(22,1,!0),s.setUint32(24,t,!0),s.setUint32(28,t*2,!0),s.setUint16(32,2,!0),s.setUint16(34,16,!0),l(36,"data"),s.setUint32(40,i,!0);let c=44;for(let d=0;d<n;d++){const f=e[d]<=-1?-1:e[d]>=1?1:e[d];s.setInt16(c,Math.round(f*32767),!0),c+=2}return o}function sj(e,t){const n=Math.floor(e.length/t),i=new Float32Array(n);for(let o=0;o<n;o++){const s=o*t,l=Math.floor(s),c=s-l,d=e[l]??0,f=e[l+1]??d;i[o]=d+(f-d)*c}return i}function oj(e,t,n={}){if(e.length===0||e.length!==t.length)return e;const i=n.threshold??.012;let o=0;for(;o<e.length-1&&t[o]<i;)o+=1;let s=e.length;for(;s>o+1&&t[s-1]<i;)s-=1;return e.slice(o,s)}function lj(e={}){const t=e.rmsThreshold??.015,n=e.minSpeechMs??300,i=e.silenceMs??1200,o=e.maxMs??6e4,s=e.autoStop!==!1;let l=null,c=0,d=null,f=null,p=!1;return{feed(x,b){l==null&&(l=b);const g=f==null?0:Math.max(0,b-f);if(f=b,x>=t)c+=g,c>=n&&(p=!0,d=b);else if(s&&p&&d!=null&&b-d>=i)return"auto-stop";return s&&b-l>=o?"auto-stop":"listening"},hadSpeech(){return p}}}const Um=16e3;function uj(e,t={}){const[n,i]=C.useState(!1),[o,s]=C.useState(!1),[l,c]=C.useState(0),[d,f]=C.useState(null),[p,x]=C.useState(null),b=C.useRef(null),g=C.useRef(null),y=C.useRef(null),E=C.useRef([]),T=C.useRef([]),w=C.useRef(!1),M=C.useRef(null),_=C.useRef(0),L=C.useRef(e);L.current=e;const A=C.useRef(t);A.current=t;const R=C.useRef(!1),j=C.useRef(!1),N=C.useCallback(()=>{var K,q,B;w.current=!1,(K=y.current)==null||K.disconnect(),y.current=null,(q=g.current)==null||q.getTracks().forEach(H=>H.stop()),g.current=null,(B=b.current)==null||B.close().catch(()=>{}),b.current=null,E.current=[],T.current=[],M.current=null,c(0)},[]),I=C.useCallback(()=>{var W;const K=E.current,q=T.current,B=((W=M.current)==null?void 0:W.hadSpeech())??!1;E.current=[],T.current=[];let H=0;for(const U of K)H+=U.length;if(N(),i(!1),H===0)return;if(!B){x("no-speech");return}const G=oj(K,q);let Q=0;for(const U of G)Q+=U.length;const re=new Float32Array(Q);let F=0;for(const U of G)re.set(U,F),F+=U.length;const Y=rj(re,Um);s(!0),x(null),window.api.asrTranscribe(Y,A.current.locale).then(U=>{U.ok?L.current(U.text):x(U.reason)}).catch(()=>x("asr-failed")).finally(()=>s(!1))},[N]),D=C.useCallback(()=>{w.current&&I()},[I]),P=C.useCallback(()=>{w.current||R.current||(f(null),R.current=!0,(async()=>{var K;try{if(((K=navigator.mediaDevices)==null?void 0:K.getUserMedia)==null){f("mic-unavailable");return}const q=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0}}),B=window.AudioContext??window.webkitAudioContext;let H;try{H=new B({sampleRate:Um})}catch{H=new B}b.current=H,g.current=q,w.current=!0,M.current=lj({autoStop:A.current.autoStop!==!1});const G=H.createMediaStreamSource(q),Q=H.createScriptProcessor(4096,1,1);y.current=Q;const re=H.sampleRate/Um;Q.onaudioprocess=Y=>{var me;if(!w.current)return;const W=Y.inputBuffer.getChannelData(0),U=re===1?new Float32Array(W):sj(W,re);E.current.push(U);let ae=0;for(let Z=0;Z<U.length;Z++)ae+=U[Z]*U[Z];const J=Math.sqrt(ae/U.length);T.current.push(J),_.current=_.current*.7+J*.3,c(Math.min(1,_.current*8)),((me=M.current)==null?void 0:me.feed(J,performance.now()))==="auto-stop"&&w.current&&I()},G.connect(Q);const F=H.createGain();F.gain.value=0,Q.connect(F),F.connect(H.destination),i(!0),j.current&&(j.current=!1,I())}catch(q){N(),i(!1),f(q instanceof Error?q.message:String(q))}finally{R.current=!1}})())},[N,I]),z=C.useCallback(()=>{w.current?D():R.current&&(j.current=!0)},[D]);return C.useEffect(()=>()=>{w.current&&N()},[N]),{listening:n,transcribing:o,level:l,startError:d,transcribeError:p,clearTranscribeError:()=>x(null),beginHold:P,endHold:z}}function cj({onGotoSettings:e}){var E;const t=Xe(),[n,i]=C.useState(!1),[o,s]=C.useState(null),[l,c]=C.useState(""),[d,f]=C.useState(""),p=C.useRef(null),x=C.useCallback(async()=>{var T,w;try{const[M,_,L,A]=await Promise.all([fe.getProviderPresets(),fe.listCustomProviders(),fe.getSetting("active_provider"),fe.getSetting("active_model")]),R=L??"glm",j=await Promise.all(M.map(async K=>await fe.getSetting(K.apiKeySetting)!=null)),N=new Set;M.forEach((K,q)=>{(j[q]||K.id===R)&&N.add(K.id)});const I=[],D=(K,q,B)=>{for(const H of B)I.push({providerId:K,providerLabel:q,modelId:H.id,modelLabel:H.label,vision:(H.capabilities??[]).includes("vision"),contextWindow:H.contextWindow})};for(const K of M)N.has(K.id)&&D(K.id,K.label,K.models);const P=_.filter(K=>K.kind==="llm");for(const K of P)D(K.id,K.label,K.models);const z=A??"";if(z&&!I.some(K=>K.providerId===R&&K.modelId===z)){const K=((T=M.find(q=>q.id===R))==null?void 0:T.label)??((w=P.find(q=>q.id===R))==null?void 0:w.label)??R;I.unshift({providerId:R,providerLabel:K,modelId:z,modelLabel:z,vision:!0,contextWindow:null})}s(I),c(R),f(z)}catch{s([])}},[]);C.useEffect(()=>{x();const T=()=>void x();return window.addEventListener("llm-config-changed",T),()=>window.removeEventListener("llm-config-changed",T)},[x]),C.useEffect(()=>{if(!n)return;const T=M=>{var _;M.target instanceof Node&&((_=p.current)==null?void 0:_.contains(M.target))!==!0&&i(!1)},w=M=>{M.key==="Escape"&&i(!1)};return document.addEventListener("pointerdown",T),document.addEventListener("keydown",w),()=>{document.removeEventListener("pointerdown",T),document.removeEventListener("keydown",w)}},[n]);const b=async T=>{if(i(!1),!(T.providerId===l&&T.modelId===d))try{await fe.setSetting("active_provider",T.providerId),await fe.setSetting("active_model",T.modelId),c(T.providerId),f(T.modelId),window.dispatchEvent(new Event("llm-config-changed"))}catch{}},g=((E=o==null?void 0:o.find(T=>T.providerId===l&&T.modelId===d))==null?void 0:E.modelLabel)??d??t("model.picker.label"),y=[];for(const T of o??[]){const w=y[y.length-1];w&&w.label===T.providerLabel?w.rows.push(T):y.push({label:T.providerLabel,rows:[T]})}return m.jsxs("div",{ref:p,className:"relative","data-testid":"composer-model",children:[m.jsxs("button",{type:"button",onClick:()=>i(!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:[m.jsx("span",{className:"truncate",children:g}),m.jsx(yE,{className:`w-3 h-3 shrink-0 transition-transform ${n?"":"rotate-180"}`})]}),n&&m.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:[y.length===0&&m.jsx("div",{className:"px-3 py-2 text-caption text-ink-faint",children:t("model.picker.noneConfigured")}),y.map(T=>m.jsxs("div",{role:"group","aria-label":T.label,children:[m.jsx("div",{className:"px-3 pt-1.5 pb-0.5 text-caption font-bold text-ink-faint",children:T.label}),T.rows.map(w=>{const M=w.providerId===l&&w.modelId===d;return m.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":M,onClick:()=>void b(w),className:`w-full flex items-center gap-1.5 px-3 py-1.5 text-left transition-colors ${M?"text-brand":"text-ink-strong hover:bg-ink/[0.06]"}`,children:[m.jsx(Vn,{className:`w-3.5 h-3.5 shrink-0 ${M?"opacity-100":"opacity-0"}`}),m.jsx("span",{className:"flex-1 truncate text-label",children:w.modelLabel}),w.vision&&m.jsx(yC,{className:"w-3 h-3 shrink-0 text-ink-faint","aria-label":t("model.picker.vision")})]},`${w.providerId}:${w.modelId}`)})]},T.label)),m.jsx("div",{className:"border-t border-[var(--border)] mt-1 pt-1",children:m.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{i(!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:[m.jsx(FC,{className:"w-3.5 h-3.5"}),t("model.picker.manage")]})})]})]})}const D0=5.5,Xv=2*Math.PI*D0,Cs=["system","node","learner","history","draft"],Kv={system:"bg-accent",node:"bg-brand",learner:"bg-gold",history:"bg-ink/50",draft:"bg-exam"};function dj({info:e,historyTokens:t,draftTokens:n}){const i=Xe(),[o,s]=C.useState(!1),l=C.useRef(null);if(C.useEffect(()=>{!(e!=null&&e.contextWindow)&&o&&s(!1)},[e==null?void 0:e.contextWindow,o]),C.useEffect(()=>{if(!o)return;const b=y=>{var E;y.target instanceof Node&&((E=l.current)==null?void 0:E.contains(y.target))!==!0&&s(!1)},g=y=>{y.key==="Escape"&&s(!1)};return document.addEventListener("pointerdown",b),document.addEventListener("keydown",g),()=>{document.removeEventListener("pointerdown",b),document.removeEventListener("keydown",g)}},[o]),!e)return null;const c={system:e.systemTokens,node:e.nodeTokens,learner:e.learnerTokens,history:t,draft:n},d=Cs.reduce((b,g)=>b+c[g],0),f=WC(d,e.contextWindow),p=f!==null&&f>=85,x=ZC(Cs.map(b=>c[b]),f??0);return m.jsxs("span",{ref:l,className:"relative inline-flex items-center","data-testid":"composer-context",children:[m.jsxs("button",{type:"button",onClick:()=>s(!o),disabled:e.contextWindow===null,"aria-label":i("context.aria",{p:f!==null?`${f}%`:Ss(d)}),"aria-haspopup":"dialog","aria-expanded":o,"data-testid":"composer-context-trigger","data-tooltip":e.contextWindow===null?`${i("context.label")} ~${Ss(d)} · ${i("context.unknownWindow")}`:i("context.aria",{p:`${f}%`}),className:`flex items-center gap-1 px-1.5 py-0.5 rounded-full text-caption font-medium transition-colors ${p?"text-warning":"text-ink-muted"} hover:bg-ink/[0.06] disabled:hover:bg-transparent`,children:[m.jsxs("svg",{viewBox:"0 0 14 14",width:"14",height:"14","aria-hidden":!0,className:"shrink-0",children:[m.jsx("circle",{cx:"7",cy:"7",r:D0,fill:"none",strokeWidth:"2",className:"stroke-ink/20"}),m.jsx("circle",{cx:"7",cy:"7",r:D0,fill:"none",strokeWidth:"2",stroke:"currentColor",strokeLinecap:"round",strokeDasharray:`${Xv*(f??100)/100} ${Xv}`,transform:"rotate(-90 7 7)"})]}),f!==null?m.jsxs("span",{children:[f,"%"]}):m.jsxs("span",{children:["~",Ss(d)]})]}),o&&e.contextWindow!==null&&m.jsxs("div",{role:"dialog","aria-label":i("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:[m.jsxs("div",{className:"flex items-baseline justify-between mb-2",children:[m.jsx("span",{className:"text-label font-bold text-ink-strong",children:i("context.label")}),m.jsxs("span",{className:`text-caption ${p?"text-warning":"text-ink-muted"}`,children:[i("context.approx")," ",Ss(d)," / ",Ss(e.contextWindow)]})]}),m.jsx("div",{className:"flex h-2 rounded-full overflow-hidden bg-ink/10 mb-2",role:"img","aria-label":`${f}%`,children:Cs.map(b=>x[Cs.indexOf(b)]>0?m.jsx("div",{className:Kv[b],style:{width:`${x[Cs.indexOf(b)]}%`}},b):null)}),m.jsx("dl",{className:"space-y-1",children:Cs.map(b=>m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsxs("dt",{className:"flex items-center gap-1.5 text-caption text-ink-muted",children:[m.jsx("span",{className:`w-2 h-2 rounded-sm ${Kv[b]}`,"aria-hidden":!0}),i(`context.${b}`)]}),m.jsxs("dd",{className:"text-caption text-ink-strong tabular-nums",children:["~",Ss(c[b])]})]},b))})]})]})}const L0={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 fj(e,t,n){if(e==="openai"||e in L0)return e;const i=(t??"").toLowerCase(),o=(n??"").toLowerCase();return i.includes("bigmodel.cn")||i.includes("z.ai")||o.startsWith("glm")?"glm":i.includes("dashscope")||o.startsWith("qwen")?"qwen":i.includes("siliconflow")?"siliconcloud":e}function hj(e,t,n){return t==="anthropic"||t==="google"||e==="openai"||e in L0?!0:fj(e,n==null?void 0:n.baseUrl,n==null?void 0:n.model)in L0}const Hm=[{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 mj(){const e=Xe(),[t,n]=C.useState(!1),[i,o]=C.useState(""),[s,l]=C.useState(!0),c=C.useRef(null),d=C.useRef(null),[f,p]=C.useState("right"),[x,b]=C.useState(0),g=C.useRef(0),[y,E]=C.useState(0);C.useLayoutEffect(()=>{if(!t){E(0),g.current=0,b(0);return}const _=d.current;if(!_)return;const L=_.getBoundingClientRect(),A=L.left-g.current,R=L.right-g.current,j=window.innerWidth;if(y===0){if(A<8&&R<=j-8){p("left"),E(1);return}if(R>j-8&&A>=8){p("right"),E(1);return}E(1)}const N=Math.min(0,j-8-R)+Math.max(0,8-A);N!==g.current&&(g.current=N,b(N))},[t,y]);const T=C.useCallback(async()=>{var _;try{const[L,A,R,j,N]=await Promise.all([fe.getSetting("active_provider"),fe.getSetting("reasoning_effort"),fe.getProviderPresets(),fe.listCustomProviders(),fe.getSetting("active_model")]),I=L??"glm",D=j.find(K=>K.id===I),P=((_=R.find(K=>K.id===I))==null?void 0:_.protocol)??(D==null?void 0:D.protocol)??"openai-compatible";l(hj(I,P,{baseUrl:D==null?void 0:D.baseUrl,model:N??(D==null?void 0:D.defaultModel)}));const z=A??"";o(z==="fast"||z==="deep"?z:"")}catch{l(!1)}},[]);C.useEffect(()=>{T();const _=()=>void T();return window.addEventListener("llm-config-changed",_),()=>window.removeEventListener("llm-config-changed",_)},[T]),C.useEffect(()=>{if(!t)return;const _=A=>{var R;A.target instanceof Node&&((R=c.current)==null?void 0:R.contains(A.target))!==!0&&n(!1)},L=A=>{A.key==="Escape"&&n(!1)};return document.addEventListener("pointerdown",_),document.addEventListener("keydown",L),()=>{document.removeEventListener("pointerdown",_),document.removeEventListener("keydown",L)}},[t]);const w=async _=>{if(n(!1),_!==i){o(_);try{await fe.setSetting("reasoning_effort",_)}catch{o(i)}}},M=Hm.find(_=>_.value===i)??Hm[0];return m.jsxs("div",{ref:c,className:"relative","data-testid":"composer-effort",children:[m.jsxs("button",{type:"button",onClick:()=>!!s&&n(!t),disabled:!s,"aria-haspopup":"menu","aria-expanded":t,"data-testid":"composer-effort-trigger","data-tooltip":e(s?"effort.label":"effort.unsupported"),className:`flex items-center gap-1 px-1.5 py-0.5 rounded-full text-caption font-medium transition-colors ${i?"text-accent":"text-ink-muted"} ${s?"hover:text-ink-strong hover:bg-ink/[0.06]":"opacity-40 cursor-not-allowed"}`,children:[m.jsx(fC,{className:"w-3 h-3 shrink-0"}),m.jsx("span",{className:"truncate",children:e(M.labelKey)}),m.jsx(yE,{className:`w-3 h-3 shrink-0 transition-transform ${t?"":"rotate-180"}`})]}),t&&m.jsx("div",{ref:d,role:"menu","aria-label":e("effort.label"),"data-testid":"composer-effort-menu",style:{transform:x?`translateX(${x}px)`:void 0},className:`absolute bottom-full ${f==="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:Hm.map(_=>{const L=_.value===i;return m.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":L,onClick:()=>void w(_.value),className:`w-full flex items-start gap-1.5 px-3 py-1.5 text-left transition-colors ${L?"text-brand":"text-ink-strong hover:bg-ink/[0.06]"}`,children:[m.jsx(Vn,{className:`w-3.5 h-3.5 shrink-0 mt-0.5 ${L?"opacity-100":"opacity-0"}`}),m.jsxs("span",{className:"flex-1",children:[m.jsx("span",{className:"block text-label font-bold",children:e(_.labelKey)}),m.jsx("span",{className:"block text-caption text-ink-faint",children:e(_.descKey)})]})]},_.value||"auto")})})]})}function pj(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 gj({view:e,level:t,text:n,onTextChange:i,onSend:o,onRerecord:s,errorMessage:l,sendDisabled:c}){const d=Xe(),[f,p]=C.useState(0),x=C.useRef(performance.now());return C.useEffect(()=>{x.current=performance.now(),p(0)},[e]),C.useEffect(()=>{if(e!=="recording")return;const b=window.setInterval(()=>p(performance.now()-x.current),250);return()=>window.clearInterval(b)},[e]),m.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"&&m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx("span",{className:"w-11 h-11 shrink-0 rounded-full bg-warning/15 text-warning flex items-center justify-center",children:m.jsx(ll,{className:"w-5 h-5 animate-pulse"})}),m.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center justify-between text-label text-ink-muted",children:[m.jsx("span",{children:d("chat.speech.recording_hint")}),m.jsx("span",{className:"tabular-nums",children:pj(f)})]}),m.jsx("span",{className:"block h-2 rounded-full bg-ink/[0.08] overflow-hidden","data-testid":"voice-level",children:m.jsx("span",{className:"block h-full bg-warning transition-[width] duration-100",style:{width:`${Math.round(Math.min(1,t)*100)}%`}})})]})]}),e==="transcribing"&&m.jsxs("div",{className:"flex items-center justify-center gap-2 py-2 text-body text-ink-muted",children:[m.jsx(NC,{className:"w-4 h-4 animate-spin"}),m.jsx("span",{children:d("chat.speech.transcribing")})]}),e==="review"&&m.jsxs(m.Fragment,{children:[m.jsx("textarea",{value:n,onChange:b=>i(b.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]"}),m.jsxs("div",{className:"flex items-center justify-end gap-2",children:[m.jsx("button",{type:"button",onClick:s,"data-testid":"voice-rerecord",className:"btn-3d-neutral px-4 py-1.5 text-body",children:d("chat.speech.rerecord")}),m.jsxs("button",{type:"button",onClick:o,disabled:c,"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:[m.jsx(HC,{className:"w-3.5 h-3.5"}),d("chat.send")]})]})]}),e==="error"&&m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"text-body text-warning py-1",children:l??d("chat.speech.asr_failed")}),m.jsx("div",{className:"flex items-center justify-end",children:m.jsxs("button",{type:"button",onClick:s,"data-testid":"voice-rerecord",className:"btn-3d-neutral px-4 py-1.5 text-body flex items-center gap-1.5",children:[m.jsx(ul,{className:"w-3.5 h-3.5"}),d("chat.speech.retry")]})})]})]})}const xj={direct:"soul.direct",guide:"soul.guide",practice:"soul.practice"},bj={direct:La,guide:EE,practice:SC},yj={direct:"soul.direct.desc",guide:"soul.guide.desc",practice:"soul.practice.desc"},vj=["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 $v=0;function Ej({nodeId:e,agentReady:t,streaming:n,souls:i,activeSoul:o,starterPrompts:s,onPickSoul:l,onSend:c,onStop:d,onLogFriction:f,onGotoSettings:p,insertText:x,historyTokens:b}){const g=Xe(),y=OE(),[E,T]=C.useState(""),[w,M]=C.useState([]),[_,L]=C.useState(null),[A,R]=C.useState(null),[j,N]=C.useState(!1),I=C.useRef(null),D=C.useRef(0),[P,z]=C.useState(!0);C.useEffect(()=>{fe.getSetting("asr_auto_stop").then(Te=>z(Te!=="0"))},[]);const[K,q]=C.useState(!1),[B,H]=C.useState(""),[G,Q]=C.useState(!1),[re,F]=C.useState(null),Y=uj(Te=>{H(Te),Q(!0)},{locale:y,autoStop:P}),W=Y.startError??Y.transcribeError;C.useEffect(()=>{if(!W)return;F(g(W==="no-speech"?"chat.speech.no_speech":W==="model-missing"?"chat.speech.asr_model_missing":W==="engine-unavailable"?"chat.speech.engine_unavailable":W==="custom-provider-missing"?"chat.speech.custom_provider_missing":W==="groq-key-missing"?"chat.speech.groq_key_missing":W==="azure-key-missing"?"chat.speech.azure_stt_key_missing":W==="azure-region-missing"?"chat.speech.azure_stt_region_missing":W==="mic-unavailable"?"chat.speech.asr_start_fail":"chat.speech.asr_failed")),Y.clearTranscribeError()},[W,Y,g]);const U=re?"error":Y.listening?"recording":Y.transcribing?"transcribing":G?"review":"idle",ae=C.useCallback(()=>{H(""),Q(!1),F(null)},[]),J=C.useCallback(()=>{q(!1),ae()},[ae]),ne=()=>{const Te=B.trim();!Te||n||!e||(c(Te),J())};C.useEffect(()=>{x&&T(Te=>Te.trim()?`${Te}
|
|
552
|
-
|
|
553
|
-
${x}`:x)},[x]),C.useEffect(()=>{if(!e){R(null);return}let Te=!1;(async()=>{try{const rt=await fe.getContextUsage(e,y);Te||R(rt)}catch{Te||R(null)}})();const Ze=()=>{fe.getContextUsage(e,y).then(rt=>{Te||R(rt)}).catch(()=>{})};return window.addEventListener("llm-config-changed",Ze),()=>{Te=!0,window.removeEventListener("llm-config-changed",Ze)}},[e,y]),C.useEffect(()=>{if(!_)return;const Te=setTimeout(()=>L(null),3e3);return()=>clearTimeout(Te)},[_]);const me=C.useRef(new Set);C.useEffect(()=>()=>{for(const Te of me.current)URL.revokeObjectURL(Te)},[]);const Z=C.useCallback(Te=>{M(Ze=>{const rt=Ze.find(bt=>bt.id===Te);return rt!=null&&rt.previewUrl&&(URL.revokeObjectURL(rt.previewUrl),me.current.delete(rt.previewUrl)),Ze.filter(bt=>bt.id!==Te)})},[]),we=C.useCallback(async Te=>{if(Te.length===0)return;const Ze=yl.maxPerMessage-w.length;if(Ze<=0){L(g("chat.attach.tooMany",{n:yl.maxPerMessage}));return}const rt=Te.length>Ze?Te.slice(0,Ze):Te;Te.length>Ze&&L(g("chat.attach.tooMany",{n:yl.maxPerMessage}));const bt=[],gt=[];for(const lt of rt){const st=ij(lt.name,lt.type,lt.size);if(!st.ok){L(st.reason==="unsupported"?g("chat.attach.unsupported",{name:lt.name}):st.reason==="tooLargeImage"?g("chat.attach.tooLargeImage",{name:lt.name}):g("chat.attach.tooLargeText",{name:lt.name}));continue}if(st.kind==="image"){if((A==null?void 0:A.visionCapable)===!1){L(g("chat.attach.visionUnsupported"));continue}const Ue=await new Promise(Ce=>{const je=new FileReader;je.onload=()=>{const Le=je.result;Ce(typeof Le=="string"?Le.slice(Le.indexOf(",")+1):null)},je.onerror=()=>Ce(null),je.readAsDataURL(lt)});if(Ue===null)continue;const pe=URL.createObjectURL(lt);gt.push(pe),bt.push({id:++$v,kind:"image",name:lt.name,mime:lt.type||"image/png",size:lt.size,previewUrl:pe,base64:Ue})}else try{const Ue=await lt.text();bt.push({id:++$v,kind:"text",name:lt.name,mime:lt.type||"text/plain",size:lt.size,text:Ue})}catch{}}if(bt.length>0){for(const lt of gt)me.current.add(lt);M(lt=>[...lt,...bt])}else for(const lt of gt)URL.revokeObjectURL(lt)},[w.length,A==null?void 0:A.visionCapable,g]),Fe=Te=>{const Ze=Te.trim();if(n||!e||!Ze&&w.length===0)return;const rt=Ze||mp("chat.attach.imageOnlyText"),bt=w.map(gt=>({kind:gt.kind,name:gt.name,mime:gt.mime,size:gt.size,data:gt.kind==="image"?gt.base64??"":gt.text??"",...gt.kind==="image"&>.previewUrl?{previewUrl:gt.previewUrl}:{}}));c(rt,void 0,bt.length>0?bt:void 0),T(""),M([])},Se=()=>Fe(E),ve=Te=>{n||(c(Te.message,Te.label),Te.frictionCategory&&(f==null||f(Te.frictionCategory,null)))},Oe=Te=>{const Ze=Array.from(Te.clipboardData.files??[]);Ze.length>0&&(Te.preventDefault(),we(Ze))},Ie=Te=>{Te.dataTransfer.types.includes("Files")&&(Te.preventDefault(),D.current+=1,N(!0))},$e=Te=>{Te.dataTransfer.types.includes("Files")&&(D.current=Math.max(0,D.current-1),D.current===0&&N(!1))},Nt=Te=>{Te.dataTransfer.types.includes("Files")&&(Te.preventDefault(),D.current=0,N(!1),we(Array.from(Te.dataTransfer.files??[])))},Ot=C.useMemo(()=>ME(E),[E]);return t?m.jsxs("div",{className:"px-5 pb-4 pt-1 shrink-0","data-testid":"composer",children:[!K&&s.length>0&&e&&m.jsx("div",{className:"flex items-center gap-1.5 overflow-x-auto pb-2","data-testid":"starter-prompts",children:s.map((Te,Ze)=>m.jsx("button",{onClick:()=>ve(Te),disabled:n,"data-testid":`starter-prompt-${Ze}`,"data-tooltip":Te.hint??Te.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:Te.label},Ze))}),m.jsx("div",{className:`relative rounded-2xl transition-colors px-3 pt-2 pb-1.5 ${j?"bg-accent/10 ring-1 ring-accent":"bg-ink/[0.05] focus-within:bg-ink/[0.07]"}`,onDragEnter:Ie,onDragOver:Te=>{Te.dataTransfer.types.includes("Files")&&Te.preventDefault()},onDragLeave:$e,onDrop:Nt,"data-testid":"composer-card",children:K?m.jsxs(m.Fragment,{children:[U!=="idle"&&m.jsx(gj,{view:U,level:Y.level,text:B,onTextChange:H,onSend:ne,onRerecord:ae,errorMessage:re,sendDisabled:n||!e||!B.trim()}),m.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[m.jsxs("span",{className:"flex items-center gap-1.5 text-label text-ink-muted font-medium",children:[m.jsx(ll,{className:"w-3.5 h-3.5 text-accent"}),g("chat.speech.dictation")]}),m.jsxs("button",{type:"button",onClick:J,"data-tooltip":g("chat.speech.back_to_keyboard"),"aria-label":g("chat.speech.back_to_keyboard"),"data-testid":"voice-keyboard-toggle",className:"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:[m.jsx(AC,{className:"w-3.5 h-3.5"}),m.jsx("span",{children:g("chat.speech.keyboard")})]})]}),m.jsxs("button",{type:"button",onPointerDown:Te=>{Te.preventDefault(),Y.beginHold()},onPointerUp:Y.endHold,onPointerLeave:Y.endHold,onPointerCancel:Y.endHold,onContextMenu:Te=>Te.preventDefault(),disabled:!e||U!=="idle","data-testid":Y.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 ${Y.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:[m.jsx(ll,{className:"w-5 h-5"}),Y.listening?g("chat.speech.release_to_stop"):g("chat.speech.hold_to_talk")]})]}):m.jsxs(m.Fragment,{children:[i.length>0&&m.jsxs("div",{className:"flex items-center gap-1 overflow-x-auto mb-1","data-testid":"soul-picker",children:[m.jsx("span",{className:"text-body text-ink-faint shrink-0",children:g("chat.soul.label")}),i.map(Te=>{const Ze=o===Te.name,rt=bj[Te.name]??EE,bt=g(yj[Te.name]??"soul.direct.desc");return m.jsxs("button",{onClick:()=>l(Te.name),"data-testid":`soul-pill-${Te.name}`,"data-tooltip":bt,className:`shrink-0 flex items-center gap-1 px-2 py-0.5 rounded-full text-body font-medium transition-colors ${Ze?"bg-brand/15 text-brand":"text-ink-muted hover:text-ink-strong hover:bg-ink/5"}`,children:[m.jsx(rt,{className:"w-3.5 h-3.5"}),m.jsx("span",{children:g(xj[Te.name]??"soul.direct")})]},Te.id)})]}),w.length>0&&m.jsxs("div",{className:"flex gap-1.5 flex-wrap mb-1.5","data-testid":"composer-attachments",children:[(A==null?void 0:A.visionBridgeModel)&&w.some(Te=>Te.kind==="image")&&m.jsxs("div",{className:"w-full flex items-center gap-1 text-caption text-ink-muted","data-testid":"vision-bridge-chip",children:[m.jsx(UC,{className:"w-3.5 h-3.5 shrink-0"}),m.jsx("span",{children:g("chat.attach.bridgeChip",{model:A.visionBridgeModel})})]}),w.map(Te=>Te.kind==="image"?m.jsxs("div",{className:"relative w-16 h-16 shrink-0",children:[m.jsx("img",{src:Te.previewUrl,alt:Te.name,className:"w-16 h-16 object-cover rounded-lg border border-[var(--border)]"}),m.jsx("button",{type:"button",onClick:()=>Z(Te.id),"aria-label":g("chat.attach.remove",{name:Te.name}),className:"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:m.jsx(oa,{className:"w-3 h-3"})})]},Te.id):m.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:[m.jsx(Il,{className:"w-3 h-3 shrink-0 text-ink-faint"}),m.jsx("span",{className:"truncate max-w-[10rem]",children:Te.name}),m.jsx("button",{type:"button",onClick:()=>Z(Te.id),"aria-label":g("chat.attach.remove",{name:Te.name}),className:"w-4 h-4 rounded-full hover:bg-ink/20 flex items-center justify-center text-ink-muted hover:text-warning transition-colors",children:m.jsx(oa,{className:"w-2.5 h-2.5"})})]},Te.id))]}),_&&m.jsx("div",{className:"text-caption text-warning pb-1",role:"status","data-testid":"composer-notice",children:_}),m.jsxs("div",{className:"flex gap-2 items-end",children:[m.jsx("textarea",{value:E,onChange:Te=>T(Te.target.value),onKeyDown:Te=>{Te.key==="Enter"&&!Te.shiftKey&&(Te.preventDefault(),Se())},onPaste:Oe,placeholder:g(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?m.jsx("button",{onClick:d,"data-testid":"chat-stop",className:"btn-icon-3d-warning shrink-0 w-9 h-9",title:g("chat.stop"),"aria-label":g("chat.stop"),children:m.jsx(fp,{className:"w-3.5 h-3.5 fill-current"})}):m.jsx("button",{onClick:Se,disabled:n||!E.trim()&&w.length===0||!e,"data-testid":"chat-send",className:"btn-icon-3d-brand shrink-0 w-9 h-9",title:g("chat.send"),"aria-label":g("chat.send"),children:m.jsx(cC,{className:"w-4 h-4"})})]}),m.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-0.5 gap-y-1 mt-0.5",children:[m.jsx("button",{type:"button",onClick:()=>{ae(),q(!0)},disabled:!e,"data-tooltip":g("chat.speech.dictation"),"aria-label":g("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:m.jsx(ll,{className:"w-3.5 h-3.5"})}),m.jsx("button",{type:"button",onClick:()=>{var Te;return(Te=I.current)==null?void 0:Te.click()},"data-tooltip":g("chat.attach.add"),"aria-label":g("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:m.jsx(IC,{className:"w-3 h-3"})}),m.jsx("input",{ref:I,type:"file",multiple:!0,accept:vj,className:"hidden",onChange:Te=>{we(Array.from(Te.target.files??[])),Te.target.value=""}}),m.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-0.5",children:[m.jsx(mj,{}),m.jsx(dj,{info:A,historyTokens:b,draftTokens:Ot}),m.jsx(cj,{onGotoSettings:p})]})]})]})})]}):m.jsx("div",{className:"px-5 pb-4 shrink-0","data-testid":"composer-nokey",children:m.jsxs("div",{className:"flex items-center justify-center gap-3 py-3 text-body text-ink-muted",children:[m.jsx("span",{children:g("chat.no_key.short")}),m.jsx("button",{onClick:p,className:"text-brand hover:underline font-bold",children:g("chat.no_key.cta")})]})})}function Fm(e){return e.length>=200||e.includes("```")?90:60}function Tj(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 Sj(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 Qv(e,t){const n=Array.from({length:e},(i,o)=>o);for(let i=e-1;i>0;i--){const o=Math.floor(t()*(i+1)),s=n[i];n[i]=n[o],n[o]=s}return n}function kj(e,t){const n=Sj(Tj(t)),i=Qv(e.length,n),o={};for(const s of e)o[s.id]=Qv(Math.max(1,s.optionCount),n);return{questionOrder:i,optionPerms:o}}function wj(e,t){const n=e[t];return String(n??t)}function Aj({stars:e}){return m.jsx("div",{className:"flex gap-1","aria-label":`${e} stars`,children:[1,2,3].map(t=>m.jsx(GC,{className:`w-7 h-7 ${t<=e?"text-gold fill-gold":"text-ink/20"}`},t))})}function Cj({examNode:e,locale:t,onExamCompleted:n,onSessionChange:i,paused:o}){const s=Xe(),[l,c]=C.useState("loading"),[d,f]=C.useState(null),[p,x]=C.useState([]),[b,g]=C.useState(null),[y,E]=C.useState(0),[T,w]=C.useState(null),[M,_]=C.useState(null),[L,A]=C.useState(""),[R,j]=C.useState(0),[N,I]=C.useState(null),D=C.useRef({}),P=C.useRef(null),z=C.useRef(null),K=C.useRef(null),q=b?p[b.questionOrder[y]]??null:null,B=q&&b?b.optionPerms[q.id]??[]:[],H=(q==null?void 0:q.options)??[],G=B.length===H.length?B:H.map((U,ae)=>ae);C.useEffect(()=>{let U=!1;return c("loading"),A(""),_(null),f(null),(async()=>{try{const ae=await fe.examGetStatus(e.id);if(U)return;f(ae),x(ae.exercises),ae.status==="generating"?c("generating"):ae.status==="failed"?(A(ae.error??s("exam.errorEmpty")),c("failed")):ae.status==="ready"?ae.latestAttempt&&ae.latestAttempt.finishedAt?(_({correctCount:ae.latestAttempt.correctCount,totalCount:ae.latestAttempt.totalCount,stars:ae.latestAttempt.stars,bestStars:ae.bestStars,terminated:ae.latestAttempt.terminated,perQuestion:ae.latestAttempt.perQuestion??[]}),c("result")):c("ready"):(c("generating"),fe.examPrepare(e.id,t??null).catch(()=>{}))}catch(ae){U||(A(ae instanceof Error?ae.message:String(ae)),c("failed"))}})(),()=>{U=!0}},[e.id]),C.useEffect(()=>fe.on("exam:status",ae=>{ae.nodeId===e.id&&(ae.status==="ready"?fe.examGetStatus(e.id).then(J=>{f(J),x(J.exercises),c(ne=>ne==="generating"?J.latestAttempt?"result":"ready":ne)}).catch(()=>{}):ae.status==="failed"?(A(ae.error??s("exam.errorEmpty")),c("failed")):(f(J=>J&&{...J,...ae}),c(J=>J==="loading"?"generating":J)))}),[e.id]);const Q=C.useCallback(async()=>{var U;try{const ae=await fe.examStartAttempt(e.id),J=kj(ae.exercises.map(ne=>{var me;return{id:ne.id,optionCount:((me=ne.options)==null?void 0:me.length)??0}}),ae.attemptId);x(ae.exercises),P.current=ae.attemptId,g(J),D.current={},E(0),w(null),_(null),z.current=null,c("answering"),j(Fm(((U=ae.exercises[J.questionOrder[0]])==null?void 0:U.prompt)??""))}catch(ae){A(ae instanceof Error?ae.message:String(ae)),c("failed")}},[e.id]),re=C.useCallback(()=>{I(null),_(null),c("generating"),f(U=>U&&{...U,status:"generating",done:0,total:0}),fe.examRegenerate(e.id,t??null).then(U=>{U.status==="failed"&&(A(U.error??s("exam.errorEmpty")),c("failed"))}).catch(U=>{A(U instanceof Error?U.message:String(U)),c("failed")})},[e.id,t,s]),F=m.jsxs(m.Fragment,{children:[m.jsxs("button",{className:"btn-3d-neutral px-4 py-1.5 text-body","data-testid":"exam-regen-btn",onClick:U=>I(U.currentTarget.getBoundingClientRect()),children:[m.jsx(ul,{className:"w-3.5 h-3.5 inline"}),s("exam.regenerate")]}),N&&m.jsx(pd,{anchorRect:N,message:s("exam.regenerate.confirmMsg"),confirmLabel:s("exam.regenerate"),onConfirm:re,onCancel:()=>I(null)})]});C.useEffect(()=>{var U;l!=="answering"||!q||z.current!==q.id&&(j(Fm(q.prompt)),w(null),(U=K.current)==null||U.scrollTo({top:0}))},[y,l]),C.useEffect(()=>{if(l!=="answering"||o)return;const U=setInterval(()=>{j(ae=>ae>0?ae-1:0)},1e3);return()=>clearInterval(U)},[l,o]);const Y=C.useCallback(U=>{const ae=q;if(!ae||l!=="answering"||z.current===ae.id)return;z.current=ae.id;const J=U===null?"":wj(G,U),ne={...D.current,[ae.id]:J};D.current=ne,P.current&&fe.examRecordAnswer(e.id,P.current,ae.id,J).catch(()=>{}),y+1<p.length?E(y+1):(c("submitting"),(async()=>{try{const me=await fe.examSubmitAttempt(e.id,P.current,ne);_({correctCount:me.correctCount,totalCount:me.totalCount,stars:me.stars,bestStars:me.bestStars,terminated:me.terminated,perQuestion:me.perQuestion}),c("result"),n==null||n(),me.stars>=1&&Mr("exam-pass")}catch(me){A(me instanceof Error?me.message:String(me)),c("failed")}})())},[q,l,G,y,p.length,e.id,n]),W=C.useCallback(()=>{T!==null&&Y(T)},[T,Y]);if(C.useEffect(()=>{l!=="answering"||R>0||o||Y(T)},[R,l,o]),C.useEffect(()=>{const U=async()=>{if(P.current)try{await fe.examSubmitAttempt(e.id,P.current,D.current,{terminated:!0}),n==null||n()}catch{}},ae=l==="answering"||l==="submitting";return i==null||i(ae?{active:!0,terminate:U}:{active:!1,terminate:null}),()=>i==null?void 0:i({active:!1,terminate:null})},[l,e.id,n,i]),l==="loading")return m.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6","data-testid":"exam-loading",children:[m.jsx(Is,{className:"w-12 h-12 text-accent mb-4 opacity-60"}),m.jsxs("div",{className:"flex gap-1",children:[m.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),m.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"}),m.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-brand rounded-full inline-block"})]})]});if(l==="generating"){const U=(d==null?void 0:d.done)??0,ae=(d==null?void 0:d.total)??0,J=ae>0?Math.round(U/ae*100):0;return m.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6","data-testid":"exam-generating",children:[m.jsx(Is,{className:"w-12 h-12 text-accent mb-4 opacity-60"}),m.jsx("div",{className:"text-title font-bold text-ink mb-2",children:s("exam.generating.title")}),m.jsx("div",{className:"text-body text-ink-muted mb-4",children:s("exam.generating.stage")}),m.jsx("div",{className:"w-56 h-2.5 rounded-full bg-ink/10 overflow-hidden mb-2",role:"progressbar","aria-valuenow":J,"aria-valuemin":0,"aria-valuemax":100,children:m.jsx("div",{className:"h-full rounded-full bg-brand transition-all duration-500",style:{width:`${Math.max(4,J)}%`}})}),m.jsx("div",{className:"text-label text-ink-muted tabular-nums mb-6",children:ae>0?s("exam.generating.kcProgress",{done:U,total:ae}):s("exam.generating.preparing")}),m.jsx("div",{className:"text-caption text-ink-muted max-w-xs text-center",children:s("exam.generating.canLeave")})]})}if(l==="failed")return m.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6 text-center","data-testid":"exam-error",children:[m.jsx(l0,{className:"w-10 h-10 text-warning mb-3"}),m.jsx("div",{className:"text-body font-bold text-ink mb-1",children:s("exam.errorTitle")}),m.jsx("div",{className:"text-body text-ink-muted mb-4 max-w-xs break-words",children:L||s("exam.errorEmpty")}),m.jsxs("button",{className:"btn-3d-brand px-4 py-1.5 text-body",onClick:()=>{c("generating"),fe.examPrepare(e.id,t??null).catch(()=>{})},children:[m.jsx(ul,{className:"w-3.5 h-3.5 inline"}),s("exam.failed.retry")]})]});if(l==="ready"&&d){const U=d.exercises.reduce((J,ne)=>J+Fm(ne.prompt),0),ae=Math.max(1,Math.round(U/60));return m.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-6","data-testid":"exam-ready",children:[m.jsx("div",{className:"w-14 h-14 rounded-full bg-brand/15 flex items-center justify-center mb-4",children:m.jsx(Is,{className:"w-7 h-7 text-brand"})}),m.jsx("div",{className:"text-hero font-extrabold text-ink mb-1",children:s("exam.ready.title")}),m.jsx("div",{className:"text-body text-ink-muted mb-3 text-center",children:e.title}),m.jsx("div",{className:"text-label text-ink-muted mb-8",children:s("exam.ready.meta",{q:d.questionCount,kc:d.kcCount,min:ae})}),m.jsxs("div",{className:"flex flex-col items-center gap-3",children:[m.jsxs("button",{className:"btn-3d-brand px-6 py-2 text-lead",onClick:Q,"data-testid":"exam-start-btn",children:[s("exam.start"),m.jsx(o0,{className:"w-4 h-4 inline ml-1"})]}),F]})]})}if(l==="answering"||l==="submitting"){if(!q)return null;const U=R<=10;return m.jsxs("div",{className:"flex-1 flex flex-col min-h-0","data-testid":"exam-answering",children:[m.jsxs("div",{className:"px-6 pt-6 w-full max-w-2xl mx-auto shrink-0",children:[m.jsxs("div",{className:"flex items-center justify-between mb-3",children:[m.jsx("div",{className:"text-label text-ink-muted tabular-nums",children:s("exam.q.progress",{i:y+1,n:p.length})}),m.jsxs("div",{className:`flex items-center gap-1 text-label font-bold tabular-nums transition-colors ${U?"text-warning":"text-ink"}`,"data-testid":"exam-timer",children:[m.jsx(XC,{className:"w-3.5 h-3.5"}),Math.floor(R/60),":",String(R%60).padStart(2,"0")]})]}),m.jsx("div",{className:"w-full h-1.5 rounded-full bg-ink/10 overflow-hidden mb-6",children:m.jsx("div",{className:"h-full bg-accent transition-all duration-300",style:{width:`${y/p.length*100}%`}})})]}),m.jsxs("div",{ref:K,className:"flex-1 min-h-0 overflow-y-auto px-6 pb-6 w-full max-w-2xl mx-auto",children:[q.kcTitle&&m.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:[m.jsx(Yc,{className:"w-3 h-3"}),q.kcTitle]}),m.jsx("div",{className:"text-lead text-ink leading-relaxed mb-6 whitespace-pre-wrap break-words",children:q.prompt}),m.jsx("div",{className:"flex flex-col gap-2.5",children:G.map((ae,J)=>m.jsx("button",{onClick:()=>w(J),"data-testid":`exam-option-${J}`,className:`text-left px-4 py-3 rounded-xl border transition-all duration-150 ${T===J?"border-accent bg-accent/15 text-ink":"border-ink/10 bg-ink/5 text-ink hover:border-ink/25"}`,children:m.jsx("span",{className:"text-body break-words",children:H[ae]})},ae))}),m.jsx("div",{className:"mt-6 flex justify-end",children:l==="submitting"?m.jsx("div",{className:"text-body text-ink-muted",children:s("exam.submitting")}):m.jsxs("button",{className:"btn-3d-brand px-5 py-2 text-body disabled:opacity-40 disabled:cursor-not-allowed",disabled:T===null,onClick:W,"data-testid":"exam-next-btn",children:[y+1<p.length?s("exam.q.next"):s("exam.q.submit"),m.jsx(o0,{className:"w-3.5 h-3.5 inline ml-1"})]})})]})]})}if(l==="result"&&M){const U=M.totalCount>0?Math.round(M.correctCount/M.totalCount*100):0,ae=new Map;for(const ne of M.perQuestion){const me=ne.kcTitle??"";if(!me)continue;const Z=ae.get(me)??{correct:0,total:0};Z.total++,ne.correct&&Z.correct++,ae.set(me,Z)}const J=new Map(p.map(ne=>[ne.id,ne]));return m.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-8 max-w-2xl w-full mx-auto","data-testid":"exam-result",children:[m.jsxs("div",{className:"flex flex-col items-center mb-6",children:[m.jsx(Aj,{stars:M.stars}),m.jsx("div",{className:"text-hero font-extrabold text-ink mt-3",children:s("exam.result.score",{correct:M.correctCount,total:M.totalCount})}),m.jsx("div",{className:"text-body text-ink-muted mt-1",children:s("exam.result.accuracy",{pct:U})}),m.jsxs("div",{className:"flex items-center gap-3 text-label text-ink-muted mt-2",children:[m.jsx("span",{children:s("exam.result.best",{stars:M.bestStars})}),d&&d.attemptCount>1&&m.jsx("span",{children:s("exam.result.attempts",{n:d.attemptCount})})]})]}),M.terminated&&m.jsxs("div",{className:"rounded-xl border border-warning/40 bg-warning/10 px-4 py-3 mb-6 flex items-center gap-2",children:[m.jsx(l0,{className:"w-4 h-4 text-warning shrink-0"}),m.jsx("span",{className:"text-body text-ink",children:s("exam.terminated.banner")})]}),ae.size>0&&m.jsxs("div",{className:"mb-8",children:[m.jsx("div",{className:"text-title font-bold text-ink mb-3",children:s("exam.result.kcBreakdown")}),m.jsx("div",{className:"flex flex-col gap-2",children:[...ae.entries()].map(([ne,me])=>{const we=(me.total>0?me.correct/me.total:0)<.6;return m.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 rounded-xl bg-ink/5","data-testid":"exam-kc-row",children:[m.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[m.jsx(Yc,{className:"w-3.5 h-3.5 text-accent shrink-0"}),m.jsx("span",{className:"text-body text-ink truncate",children:ne})]}),m.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[we&&m.jsx("span",{className:"text-caption text-warning",children:s("exam.result.weakKc")}),m.jsxs("span",{className:"text-label text-ink-muted tabular-nums",children:[me.correct,"/",me.total]})]})]},ne)})})]}),m.jsxs("div",{className:"mb-8",children:[m.jsx("div",{className:"text-title font-bold text-ink mb-3",children:s("exam.result.review")}),m.jsx("div",{className:"flex flex-col gap-2",children:M.perQuestion.map((ne,me)=>{const Z=J.get(ne.exerciseId),we=ne.options??(Z==null?void 0:Z.options)??null,Fe=ne.prompt??(Z==null?void 0:Z.prompt)??`#${me+1}`,Se=ve=>we&&ve!==""&&we[Number(ve)]!==void 0?we[Number(ve)]:ve;return m.jsx("div",{className:"px-4 py-3 rounded-xl bg-ink/5","data-testid":"exam-review-row",children:m.jsxs("div",{className:"flex items-start gap-2",children:[ne.correct?m.jsx(Vn,{className:"w-4 h-4 text-brand shrink-0 mt-0.5"}):m.jsx(oa,{className:`w-4 h-4 shrink-0 mt-0.5 ${ne.answered?"text-warning":"text-ink-muted"}`}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("div",{className:"text-body text-ink mb-1",children:Fe}),m.jsx("div",{className:"text-caption text-ink-muted",children:ne.answered?ne.correct?m.jsx("span",{className:"text-brand",children:s("exam.result.correctLabel")}):m.jsxs(m.Fragment,{children:[s("exam.result.yourAnswer"),":",Se(ne.userAnswer),m.jsx("span",{className:"mx-1",children:"·"}),s("exam.result.correctAnswer"),":",Se(ne.correctAnswer)]}):s("exam.result.unanswered")}),ne.explanation&&m.jsx("div",{className:"text-caption text-ink-muted mt-1 leading-relaxed",children:ne.explanation})]})]})},ne.exerciseId)})})]}),m.jsxs("div",{className:"flex justify-center items-center gap-3 pb-4",children:[m.jsxs("button",{className:"btn-3d-brand px-5 py-2 text-body",onClick:Q,"data-testid":"exam-retry-btn",children:[m.jsx(ul,{className:"w-3.5 h-3.5 inline"}),s("exam.retryExam")]}),F]})]})}return null}const Nj=[{id:"explain_simple",icon:Yc,labelKey:"command.explain_simple",group:"command.group.node",requiresNode:!0},{id:"quiz_3",icon:Il,labelKey:"command.quiz_3",group:"command.group.node",requiresNode:!0},{id:"concept_map",icon:up,labelKey:"command.concept_map",group:"command.group.node",requiresNode:!0},{id:"compare_prev",icon:hC,labelKey:"command.compare_prev",group:"command.group.node",requiresNode:!0},{id:"socratic",icon:kE,labelKey:"command.socratic",group:"command.group.mode"},{id:"exam_mode",icon:Is,labelKey:"command.exam_mode",group:"command.group.mode"}],_j=["command.group.node","command.group.mode","command.group.nav"];function Mj({onClose:e,onPick:t,hasNode:n}){const i=Xe(),[o,s]=C.useState(""),[l,c]=C.useState(0),d=C.useRef(null),f=C.useRef(null);C.useEffect(()=>{var g;(g=d.current)==null||g.focus()},[]),Fs(f,!0);const x=Nj.filter(g=>i(g.labelKey).toLowerCase().includes(o.toLowerCase())).filter(g=>!g.requiresNode||n),b=g=>{g.key==="ArrowDown"?(g.preventDefault(),c(y=>Math.min(y+1,x.length-1))):g.key==="ArrowUp"?(g.preventDefault(),c(y=>Math.max(y-1,0))):g.key==="Enter"&&x[l]&&(g.preventDefault(),t(x[l].id))};return m.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[15vh] px-4","data-testid":"command-palette",children:[m.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:e}),m.jsxs("div",{ref:f,role:"dialog","aria-modal":"true","aria-label":i("command.footer.hint"),className:"relative w-full max-w-lg bg-surface-0 rounded-xl shadow-elevated overflow-hidden",children:[m.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-[var(--border-faint)]",children:[m.jsx(cp,{className:"w-4 h-4 text-ink-faint"}),m.jsx("input",{ref:d,value:o,onChange:g=>{s(g.target.value),c(0)},onKeyDown:b,placeholder:i("command.placeholder"),className:"flex-1 bg-transparent text-body text-ink-strong placeholder:text-ink-faint focus:outline-none","data-testid":"command-input"}),m.jsx("kbd",{className:"text-caption text-ink-faint px-1.5 py-0.5 rounded border border-[var(--border-faint)]",children:"ESC"})]}),m.jsx("div",{className:"max-h-80 overflow-y-auto py-2","data-testid":"command-list",children:x.length===0?m.jsx("div",{className:"px-4 py-6 text-center text-body text-ink-faint",children:i(n?"command.empty.node":"command.empty.nonode")}):_j.map(g=>{const y=x.filter(E=>E.group===g);return y.length===0?null:m.jsxs("div",{children:[m.jsx("div",{className:"px-4 pt-2 pb-1 text-caption font-bold text-ink-faint uppercase tracking-wider",children:i(g)}),y.map(E=>{const T=x.indexOf(E),w=E.icon;return m.jsxs("button",{onClick:()=>t(E.id),onMouseEnter:()=>c(T),"data-testid":`command-${E.id}`,className:`w-full flex items-center gap-3 px-4 py-2 text-left transition-colors ${T===l?"bg-brand/10 text-brand":"text-ink-muted hover:bg-surface-1 hover:bg-surface-3/50"}`,children:[m.jsx(w,{className:"w-4 h-4 shrink-0","aria-hidden":"true"}),m.jsx("span",{className:"text-body font-medium flex-1",children:i(E.labelKey)})]},E.id)})]},g)})}),m.jsxs("div",{className:"px-4 py-2 border-t border-[var(--border-faint)] flex items-center justify-between text-caption text-ink-faint",children:[m.jsx("span",{children:i("command.footer.hint")}),m.jsx("span",{children:i("command.footer.keys")})]})]})]})}const tl="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 nd({kind:e,showProtocol:t=!0,testPrefix:n="custom",titleKey:i="settings.custom.form_title",modelPhKey:o="settings.custom.model_ph",testOverride:s,onSaved:l,onCancel:c}){const d=Xe(),[f,p]=C.useState(""),[x,b]=C.useState("openai-compatible"),[g,y]=C.useState(""),[E,T]=C.useState(""),[w,M]=C.useState(""),[_,L]=C.useState(!1),[A,R]=C.useState(null),j=async()=>{if(!(!g.trim()||!w.trim()||_)){L(!0),R(null);try{const I=s?await s({baseUrl:g.trim(),apiKey:E.trim(),model:w.trim()}):await fe.testCustomProvider({label:f||d("settings.custom.test_label"),protocol:x,baseUrl:g.trim(),apiKey:E.trim()||void 0,defaultModel:w.trim()});R({ok:I.ok,detail:I.detail})}catch(I){R({ok:!1,detail:I instanceof Error?I.message:String(I)})}finally{L(!1)}}},N=async()=>{if(!(!f.trim()||!g.trim()||!w.trim()))try{const I=await fe.createCustomProvider({label:f.trim(),kind:e,protocol:t?x:"openai-compatible",baseUrl:g.trim(),apiKey:E.trim()||void 0,defaultModel:w.trim()});l(I)}catch{}};return m.jsxs("div",{className:"space-y-2.5","data-testid":`${n}-provider-form`,children:[m.jsx("div",{className:"text-label font-bold text-ink-strong",children:d(i)}),m.jsxs("div",{className:"flex gap-2",children:[m.jsx("input",{type:"text",value:f,onChange:I=>p(I.target.value),placeholder:d("settings.custom.label_ph"),"data-testid":`${n}-label`,className:`${tl} flex-1 px-2.5 py-1.5`}),t&&m.jsxs("select",{value:x,onChange:I=>b(I.target.value),"data-testid":`${n}-protocol`,className:`${tl} px-2 py-1.5`,children:[m.jsx("option",{value:"openai-compatible",children:d("settings.proto.openai")}),m.jsx("option",{value:"anthropic",children:"Anthropic"}),m.jsx("option",{value:"google",children:"Google"})]})]}),m.jsx("input",{type:"text",value:g,onChange:I=>y(I.target.value),placeholder:d("settings.custom.baseurl_ph"),"data-testid":`${n}-baseurl`,className:`${tl} w-full px-2.5 py-1.5 font-mono`}),m.jsxs("div",{className:"flex gap-2",children:[m.jsx("input",{type:"text",value:w,onChange:I=>M(I.target.value),placeholder:d(o),"data-testid":`${n}-model`,className:`${tl} flex-1 px-2.5 py-1.5 font-mono`}),m.jsx("input",{type:"password",value:E,onChange:I=>T(I.target.value),placeholder:d("settings.custom.apikey_ph"),"data-testid":`${n}-apikey`,className:`${tl} flex-1 px-2.5 py-1.5`})]}),A&&m.jsxs("div",{className:`text-label rounded p-2 inline-flex items-start gap-1.5 ${A.ok?"bg-brand/10 text-brand":"bg-warning/10 text-warning"}`,children:[A.ok?m.jsx(ga,{className:"w-4 h-4 mt-px shrink-0","aria-hidden":"true"}):m.jsx(Ir,{className:"w-4 h-4 mt-px shrink-0","aria-hidden":"true"}),m.jsx("span",{className:"break-words",children:A.detail})]}),m.jsxs("div",{className:"flex gap-2",children:[m.jsx("button",{onClick:()=>void j(),disabled:!g.trim()||!w.trim()||_,"data-testid":`${n}-test`,className:"btn-3d-neutral px-3 py-1.5 text-label disabled:opacity-40",children:d(_?"settings.testing":"settings.test")}),m.jsx("button",{onClick:()=>void N(),disabled:!f.trim()||!g.trim()||!w.trim(),"data-testid":`${n}-save`,className:"btn-3d-brand px-3 py-1.5 text-label disabled:opacity-40",children:d("settings.custom.save")}),c&&m.jsx("button",{onClick:c,className:"text-label text-ink-muted hover:text-ink-strong px-3 py-1.5 transition-colors",children:d("action.cancel")})]})]})}const JS="lookatstudy-theme",Wv="auto",ek="(prefers-color-scheme: dark)";function Vm(){return typeof window>"u"||window.matchMedia(ek).matches?"dark":"light"}function Rj(){if(typeof localStorage>"u")return Wv;const e=localStorage.getItem(JS);return e==="auto"||e==="light"||e==="dark"?e:Wv}function qm(e){const t=document.documentElement;t.classList.remove("dark","light"),t.classList.add(e),window.dispatchEvent(new CustomEvent("theme-changed",{detail:{resolved:e}}))}function Dj(){const[e,t]=C.useState(()=>Rj()),[n,i]=C.useState(()=>e==="auto"?Vm():e),o=C.useCallback(s=>{t(s),localStorage.setItem(JS,s);const l=s==="auto"?Vm():s;i(l),qm(l)},[]);return C.useEffect(()=>{if(e!=="auto")return;const s=window.matchMedia(ek),l=c=>{const d=c.matches?"dark":"light";i(d),qm(d)};return s.addEventListener("change",l),()=>s.removeEventListener("change",l)},[e]),C.useEffect(()=>{const s=e==="auto"?Vm():e;i(s),qm(s)},[e]),{mode:e,resolved:n,setMode:o}}const oi="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",Ma="bg-surface-3 text-ink-muted hover:bg-surface-3 hover:bg-surface-3 hover:text-ink-strong",Ra="bg-brand text-white shadow-sm";function zt(e){return e?"px-4 py-3.5 border-t border-[var(--border-faint)]":"px-4 py-3.5"}function Lj(){const e=Xe(),[t,n]=C.useState([]),[i,o]=C.useState([]),[s,l]=C.useState("glm"),[c,d]=C.useState(""),[f,p]=C.useState(""),[x,b]=C.useState(null),[g,y]=C.useState(!1),[E,T]=C.useState(null),[w,M]=C.useState(!1),[_,L]=C.useState(!1),[A,R]=C.useState([]),[j,N]=C.useState(!1),[I,D]=C.useState(null),[P,z]=C.useState(null),[K,q]=C.useState(""),[B,H]=C.useState(!1),G=Dj(),Q=async()=>{N(!0),D(null);try{const Z=await fe.discoverModels();Z.ok&&Z.models?R(Z.models):D(Z.error||e("settings.discover_failed"))}catch(Z){D(Z instanceof Error?Z.message:String(Z))}finally{N(!1)}},re=C.useCallback(async()=>{try{const[Z,we,Fe,Se]=await Promise.all([fe.getProviderPresets(),fe.listCustomProviders(),fe.getSetting("active_provider"),fe.getSetting("active_model")]);n(Z),o(we);const ve=Fe??"glm";if(l(ve),ve.startsWith("custom-")){const Oe=we.find(Ie=>Ie.id===ve);b(Oe!=null&&Oe.hasApiKey?e("settings.key.configured"):null)}else{const Oe=Z.find(Ie=>Ie.id===ve);if(Oe){const Ie=await fe.getSetting(Oe.apiKeySetting);b(Ie?`${Ie.slice(0,4)}…${Ie.slice(-4)}`:null)}}if(ve.startsWith("custom-")){const Oe=we.find(Ie=>Ie.id===ve);d(Se??(Oe==null?void 0:Oe.defaultModel)??"")}else{const Oe=Z.find(Ie=>Ie.id===ve);d(Se??(Oe==null?void 0:Oe.defaultModel)??"")}}catch(Z){console.error("[SettingsView] load() failed:",Z)}},[e]);C.useEffect(()=>{re()},[re]);const F=async Z=>{l(Z),T(null),p("");const we=t.find(Fe=>Fe.id===Z);if(we){const Fe=await fe.getSetting(we.apiKeySetting);b(Fe?`${Fe.slice(0,4)}…${Fe.slice(-4)}`:null),d(c||we.defaultModel)}},Y=async()=>{M(!1);try{if(await fe.setSetting("active_provider",s),await fe.setSetting("active_model",c),f.trim()){const Z=t.find(we=>we.id===s);Z&&(await fe.setSetting(Z.apiKeySetting,f.trim()),b(`${f.trim().slice(0,4)}…${f.trim().slice(-4)}`),p(""))}M(!0),setTimeout(()=>M(!1),2e3),window.dispatchEvent(new Event("llm-config-changed"))}catch{}},W=async()=>{y(!0),T(null);try{const Z=await fe.testLlmConnection();T(Z)}catch(Z){T({ok:!1,detail:Z instanceof Error?Z.message:String(Z),errorKind:"unknown"})}finally{y(!1)}},U=async Z=>{await fe.setSetting("active_provider",Z.id),await fe.setSetting("active_model",Z.defaultModel),l(Z.id),d(Z.defaultModel),L(!1),await re(),window.dispatchEvent(new Event("llm-config-changed"))},ae=async Z=>{try{await fe.deleteCustomProvider(Z),s===Z&&(await fe.setSetting("active_provider","glm"),l("glm")),await re()}catch{}},J=s.startsWith("custom-")?i.find(Z=>Z.id===s):null;C.useEffect(()=>{if(!J)return;const Z=J.models.find(we=>we.id===c);q(Z!=null&&Z.contextWindow?String(Z.contextWindow):"")},[J,c]);const ne=async()=>{var ve,Oe;if(!J)return;const Z=K.trim().replace(/[,\s_]/g,""),we=/^(\d+)([km]?)$/i.exec(Z);if(Z!==""&&!we)return;const Fe=((ve=we==null?void 0:we[2])==null?void 0:ve.toLowerCase())==="k"?1e3:((Oe=we==null?void 0:we[2])==null?void 0:Oe.toLowerCase())==="m"?1e6:1,Se=Z===""||!we?null:Math.max(1,Math.round(parseInt(we[1],10)*Fe));H(!0);try{const Ie=J.models.map($e=>$e.id===c?{...$e,contextWindow:Se}:$e);await fe.updateCustomProvider(J.id,{models:Ie}),await re(),window.dispatchEvent(new Event("llm-config-changed"))}catch{}finally{H(!1)}},me=s.startsWith("custom-")?null:t.find(Z=>Z.id===s);return m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"px-5 pt-5 space-y-6",children:[m.jsxs("section",{children:[m.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.ai")}),m.jsxs("div",{className:"surface-card overflow-hidden",children:[m.jsxs("div",{className:zt(!1),children:[m.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.row.provider")}),m.jsxs("div",{className:"flex flex-wrap gap-1.5","data-testid":"provider-grid",children:[t.map(Z=>m.jsx("button",{onClick:()=>F(Z.id),"data-testid":`provider-card-${Z.id}`,"aria-pressed":s===Z.id,className:`px-3 py-1.5 rounded-lg text-label font-medium whitespace-nowrap transition-colors ${s===Z.id?Ra:Ma}`,children:Z.label},Z.id)),i.filter(Z=>Z.kind==="llm").map(Z=>m.jsxs("button",{onClick:()=>F(Z.id),"data-testid":`provider-card-${Z.id}`,"aria-pressed":s===Z.id,className:`px-3 py-1.5 rounded-lg text-label font-medium whitespace-nowrap transition-colors inline-flex items-center gap-1 ${s===Z.id?Ra:Ma}`,children:[m.jsx(Pl,{className:"w-3.5 h-3.5","aria-hidden":"true"}),Z.label]},Z.id)),m.jsxs("button",{onClick:()=>L(Z=>!Z),"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:[m.jsx(md,{className:"w-3.5 h-3.5","aria-hidden":"true"}),e("settings.add_custom")]})]})]}),_&&m.jsx("div",{className:"px-4 py-3.5 bg-surface-1 border-t border-[var(--border-faint)]",children:m.jsx(nd,{kind:"llm",testPrefix:"custom",onSaved:Z=>void U(Z),onCancel:()=>L(!1)})}),i.length>0&&s.startsWith("custom-")&&m.jsx("div",{className:zt(!0),children:m.jsx("button",{onClick:Z=>{const we=Z.currentTarget.getBoundingClientRect(),Fe=i.find(Se=>Se.id===s);Fe&&z({id:Fe.id,label:Fe.label,rect:we})},className:"text-label text-warning hover:underline",children:e("settings.delete_custom")})}),me&&m.jsxs(m.Fragment,{children:[me.baseUrl&&m.jsxs("div",{className:zt(!0),children:[m.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:"Base URL"}),m.jsx("code",{className:"text-label text-ink-faint font-mono break-all",children:me.baseUrl})]}),m.jsxs("div",{className:zt(!0),children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.model")}),m.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[m.jsxs("select",{value:c,onChange:Z=>d(Z.target.value),"data-testid":"model-select",className:`${oi} flex-1 px-2.5 py-1.5`,children:[me.models.map(Z=>m.jsx("option",{value:Z.id,children:Z.id},Z.id)),s==="openrouter"&&A.map(Z=>m.jsx("option",{value:Z.id,children:Z.id},Z.id))]}),s==="openrouter"&&m.jsxs("button",{onClick:Q,disabled:j,"data-testid":"discover-models-btn",className:"text-label text-accent hover:underline disabled:opacity-40 whitespace-nowrap inline-flex items-center gap-1",children:[m.jsx(zC,{className:`w-3.5 h-3.5 ${j?"animate-spin":""}`,"aria-hidden":"true"}),e(j?"settings.discovering":"settings.refresh")]})]})]}),I&&m.jsx("div",{className:"text-label text-warning mt-1.5 ml-[68px]",children:I})]}),m.jsx("div",{className:zt(!0),children:m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.apikey")}),m.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[x&&m.jsxs("span",{className:"text-label text-brand shrink-0 inline-flex items-center gap-1",children:[m.jsx(ga,{className:"w-3.5 h-3.5","aria-hidden":"true"}),x]}),m.jsx("input",{type:"password",value:f,onChange:Z=>p(Z.target.value),placeholder:e(x?"settings.key.overwrite_ph":"settings.key.paste_ph"),"data-testid":"settings-key-input",className:`${oi} flex-1 px-2.5 py-1.5`}),m.jsx("a",{href:me.keyUrl,target:"_blank",rel:"noopener noreferrer",className:"text-label text-brand hover:underline whitespace-nowrap",children:e("settings.key.get")})]})]})}),m.jsx("div",{className:zt(!0),children:m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx("button",{onClick:W,disabled:g,"data-testid":"test-connection-btn",className:"btn-3d-neutral px-3 py-1.5 text-label disabled:opacity-40",children:e(g?"settings.testing":"settings.test")}),E&&m.jsxs("span",{className:`text-label inline-flex items-center gap-1 ${E.ok?"text-brand":"text-warning"}`,children:[E.ok?m.jsx(ga,{className:"w-4 h-4","aria-hidden":"true"}):m.jsx(Ir,{className:"w-4 h-4","aria-hidden":"true"}),E.detail]})]})})]}),J&&!me&&m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:zt(!0),children:[m.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:"Base URL"}),m.jsx("code",{className:"text-label text-ink-faint font-mono break-all",children:J.baseUrl})]}),m.jsx("div",{className:zt(!0),children:m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.model")}),J.models.length>1?m.jsx("select",{value:c,onChange:Z=>d(Z.target.value),"data-testid":"model-select-custom",className:`${oi} flex-1 px-2.5 py-1.5`,children:J.models.map(Z=>m.jsx("option",{value:Z.id,children:Z.id},Z.id))}):m.jsx("input",{type:"text",value:c,onChange:Z=>d(Z.target.value),placeholder:e("settings.custom.model_ph"),"data-testid":"model-input-custom",className:`${oi} flex-1 px-2.5 py-1.5 font-mono`})]})}),m.jsxs("div",{className:zt(!0),children:[m.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:e("settings.custom.windowLabel")}),m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("input",{type:"text",inputMode:"numeric",value:K,onChange:Z=>q(Z.target.value),placeholder:e("settings.custom.windowPh"),"data-testid":"context-window-input",className:`${oi} flex-1 px-2.5 py-1.5 font-mono tabular-nums`}),m.jsx("button",{onClick:ne,disabled:B,"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")})]}),m.jsx("div",{className:"text-caption text-ink-faint mt-1",children:e("settings.custom.windowHint")})]}),m.jsx("div",{className:zt(!0),children:m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx("button",{onClick:W,disabled:g,"data-testid":"test-connection-btn",className:"btn-3d-neutral px-3 py-1.5 text-label disabled:opacity-40",children:e(g?"settings.testing":"settings.test")}),E&&m.jsxs("span",{className:`text-label inline-flex items-center gap-1 ${E.ok?"text-brand":"text-warning"}`,children:[E.ok?m.jsx(ga,{className:"w-4 h-4","aria-hidden":"true"}):m.jsx(Ir,{className:"w-4 h-4","aria-hidden":"true"}),E.detail]})]})})]})]})]}),m.jsxs("section",{children:[m.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.vision")}),m.jsx("div",{className:"surface-card overflow-hidden",children:m.jsx(Ij,{activeProvider:s,activeModel:c,presets:t,customProviders:i})})]}),m.jsxs("section",{children:[m.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.speech")}),m.jsx("div",{className:"surface-card overflow-hidden",children:m.jsx(zj,{})})]}),m.jsxs("section",{children:[m.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.memory")}),m.jsx("div",{className:"surface-card overflow-hidden",children:m.jsx(jj,{})})]}),m.jsxs("section",{children:[m.jsx("h3",{className:"text-label font-bold text-ink-muted mb-2 px-1",children:e("settings.group.appearance")}),m.jsxs("div",{className:"surface-card overflow-hidden",children:[m.jsxs("div",{className:zt(!1),children:[m.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.row.theme")}),m.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:Z,label:we})=>m.jsx("button",{onClick:()=>G.setMode(Z),"data-testid":`theme-${Z}`,"aria-pressed":G.mode===Z,className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${G.mode===Z?Ra:Ma}`,children:we},Z))}),m.jsx("p",{className:"text-label text-ink-muted mt-2",children:G.mode==="auto"?e("settings.theme.following",{mode:e(`settings.theme.${G.resolved}`)}):null})]}),m.jsxs("div",{className:zt(!0),children:[m.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.row.interface_lang")}),m.jsx("div",{className:"flex gap-2",children:["zh-CN","en"].map(Z=>m.jsx("button",{onClick:()=>tN(Z),"data-testid":`lang-${Z}`,"aria-pressed":js()===Z,className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${js()===Z?Ra:Ma}`,children:Z==="zh-CN"?"中文":"English"},Z))})]}),m.jsxs("div",{className:zt(!0),children:[m.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.row.import_lang")}),m.jsx(Oj,{})]})]})]})]}),m.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:[m.jsx("span",{className:"text-label text-ink-muted",children:e("settings.footer.hint")}),m.jsxs("button",{onClick:Y,"data-testid":"settings-save",className:"btn-3d-brand px-5 py-2 text-body inline-flex items-center gap-1.5",children:[w&&m.jsx(Vn,{className:"w-4 h-4","aria-hidden":"true"}),e(w?"settings.saved_text":"settings.footer.save")]})]}),P&&m.jsx(pd,{anchorRect:P.rect,message:e("settings.delete_custom_confirm",{name:P.label}),danger:!0,confirmLabel:e("action.delete"),testid:"custom-provider-delete-confirm",onConfirm:()=>{ae(P.id),z(null)},onCancel:()=>z(null)})]})}function Oj(){const[e,t]=C.useState("en"),[n,i]=C.useState(!1);C.useEffect(()=>{fe.getSetting("pref_lang").then(l=>{l&&t(l),i(!0)})},[]);const o=async l=>{t(l),await fe.setSetting("pref_lang",l)},s=[{code:"en",label:"English"},{code:"zh-CN",label:"简体中文"},{code:"zh-TW",label:"繁體中文"}];return n?m.jsx("div",{className:"flex gap-2","data-testid":"pref-lang-options",children:s.map(l=>m.jsx("button",{onClick:()=>o(l.code),"data-testid":`pref-lang-${l.code}`,"aria-pressed":e===l.code,className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${e===l.code?Ra:Ma}`,children:l.label},l.code))}):null}function Ij({activeProvider:e,activeModel:t,presets:n,customProviders:i}){const o=Xe(),[s,l]=C.useState(!1),[c,d]=C.useState(!1),[f,p]=C.useState(""),[x,b]=C.useState(!1),[g,y]=C.useState(!1),[E,T]=C.useState(null);C.useEffect(()=>{Promise.all([fe.getSetting("flag_multimodal_import"),fe.getSetting("vision_provider_override"),fe.getSetting("vision_model_override")]).then(([N,I])=>{l(N==="true"),p(I??""),d(!0)})},[]);const w=async()=>{const N=!s;l(N),await fe.setSetting("flag_multimodal_import",String(N))},M=async N=>{await fe.setSetting("vision_provider_override",N.id),await fe.setSetting("vision_model_override",N.defaultModel),p(N.id),b(!1)},_=async()=>{await fe.setSetting("vision_provider_override",""),await fe.setSetting("vision_model_override",""),p(""),b(!1)},L=async()=>{if(!g){y(!0),T(null);try{const N=await fe.testLlmConnection({vision:!0});T({ok:N.ok,detail:N.detail})}catch(N){T({ok:!1,detail:N instanceof Error?N.message:String(N)})}finally{y(!1)}}},A=i.filter(N=>N.kind==="vision"),R=f.startsWith("custom-")?i.find(N=>N.id===f):null,j=f&&!f.startsWith("custom-")?n.find(N=>N.id===f):null;return c?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"px-4 py-3.5 flex items-center gap-3",children:[m.jsx(zp,{checked:s,onChange:w,label:o("settings.multimodal.toggle"),testid:"multimodal-toggle"}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsx("div",{className:"text-body font-medium text-ink-strong",children:o("settings.multimodal.toggle")}),m.jsx("div",{className:"text-label text-ink-muted",children:o("settings.multimodal.toggle.desc")})]})]}),m.jsxs("div",{className:"px-4 py-3.5 border-t border-[var(--border-faint)] space-y-3",children:[m.jsxs("div",{className:"text-label text-ink-muted bg-ink/5 rounded-lg p-3",children:[m.jsx("div",{className:"font-medium mb-1",children:o("settings.multimodal.current_model",{model:t||o("settings.multimodal.not_selected")})}),m.jsx("div",{children:e.startsWith("custom-")?o("settings.multimodal.hint_custom"):o("settings.multimodal.hint_preset")})]}),m.jsxs("div",{className:"bg-ink/5 rounded-lg p-3",children:[m.jsx("div",{className:"text-label font-medium text-ink-muted mb-2",children:o("settings.multimodal.override_title")}),m.jsx("div",{className:"text-caption text-ink-muted mb-2",children:o("settings.multimodal.override_bridge_hint")}),m.jsxs("div",{className:"space-y-3 mt-1",children:[R&&m.jsxs("div",{className:"space-y-2",children:[m.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-label",children:[m.jsx(Pl,{className:"w-3.5 h-3.5 text-ink-faint shrink-0","aria-hidden":"true"}),m.jsx("span",{className:"font-medium text-ink-strong",children:R.label}),m.jsx("code",{className:"text-ink-faint font-mono break-all",children:R.defaultModel}),m.jsx("span",{className:"text-ink-faint truncate",children:R.baseUrl})]}),m.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[m.jsx("button",{onClick:()=>void L(),disabled:g,"data-testid":"vision-override-test",className:"btn-3d-neutral px-4 py-1.5 text-label disabled:opacity-50",children:o(g?"settings.testing":"settings.multimodal.test_override")}),m.jsx("button",{onClick:()=>b(N=>!N),className:"text-label text-accent hover:underline",children:o("settings.multimodal.replace_custom")}),m.jsx("button",{onClick:()=>void _(),className:"text-label text-ink-muted hover:text-ink-strong",children:o("settings.multimodal.stop_override")}),E&&m.jsxs("span",{className:`text-label inline-flex items-center gap-1 ${E.ok?"text-brand":"text-warning"}`,children:[E.ok?m.jsx(ga,{className:"w-4 h-4","aria-hidden":"true"}):m.jsx(Ir,{className:"w-4 h-4","aria-hidden":"true"}),E.detail]})]})]}),j&&m.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-label",children:[m.jsx("span",{className:"text-ink-muted",children:o("settings.multimodal.legacy_preset",{label:j.label})}),m.jsx("button",{onClick:()=>void _(),className:"text-label text-ink-muted hover:text-ink-strong underline",children:o("settings.multimodal.stop_override")})]}),!R&&!j&&m.jsxs(m.Fragment,{children:[A.map(N=>m.jsxs("button",{onClick:()=>void M(N),className:"w-full text-left px-3 py-2 rounded-lg bg-surface-1 hover:bg-surface-3 transition-colors","data-testid":`vision-pick-${N.id}`,children:[m.jsx("span",{className:"text-label font-medium text-ink-strong",children:N.label}),m.jsx("span",{className:"text-label text-ink-faint font-mono break-all ml-2",children:N.defaultModel})]},N.id)),(x||A.length===0)&&m.jsx(nd,{kind:"vision",testPrefix:"vision-custom",titleKey:"settings.custom.form_title_vision",modelPhKey:"settings.custom.model_ph_vision",onSaved:N=>void M(N),onCancel:()=>b(!1)}),A.length>0&&m.jsx("button",{onClick:()=>b(N=>!N),className:"text-label text-accent hover:underline",children:o(x?"action.cancel":"settings.custom.new")})]})]})]})]})]}):null}function jj(){const e=Xe(),[t,n]=C.useState(!1),[i,o]=C.useState(!1);C.useEffect(()=>{fe.getSetting("flag_memory_system").then(l=>{n(l==="true"),o(!0)})},[]);const s=async()=>{const l=!t;n(l),await fe.setSetting("flag_memory_system",String(l))};return i?m.jsxs("div",{className:"px-4 py-3.5 flex items-center gap-3",children:[m.jsx(zp,{checked:t,onChange:s,label:e("settings.memory.toggle"),testid:"memory-toggle"}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsx("div",{className:"text-body font-medium text-ink-strong",children:e("settings.memory.toggle")}),m.jsx("div",{className:"text-label text-ink-muted",children:e("settings.memory.toggle.desc")})]})]}):null}function zp({checked:e,onChange:t,label:n,testid:i}){return m.jsx("button",{type:"button",role:"switch","aria-checked":e,"aria-label":n,onClick:t,"data-testid":i,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:m.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 Pj=[{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(女)"}],Bj=[{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 zj(){const e=Xe(),[t,n]=C.useState([]),[i,o]=C.useState(null),[s,l]=C.useState(null),[c,d]=C.useState(null),[f,p]=C.useState(null),[x,b]=C.useState("edge"),[g,y]=C.useState("zh-CN-XiaoxiaoNeural"),[E,T]=C.useState("48"),[w,M]=C.useState("1.0"),[_,L]=C.useState(""),[A,R]=C.useState("local"),[j,N]=C.useState("asr-whisper-turbo"),[I,D]=C.useState(!0),[P,z]=C.useState([]),[K,q]=C.useState(!1),[B,H]=C.useState(!1),[G,Q]=C.useState(!1),[re,F]=C.useState(!1),[Y,W]=C.useState(!1),[U,ae]=C.useState(null),[J,ne]=C.useState(!1),[me,Z]=C.useState(null),[we,Fe]=C.useState(null),Se=C.useCallback(()=>{fe.listCustomProviders().then(se=>z(se.filter(qe=>qe.kind==="tts"||qe.kind==="asr"))).catch(()=>{})},[]);C.useEffect(()=>{Promise.all([fe.getSetting("tts_engine"),fe.getSetting("tts_voice_edge"),fe.getSetting("tts_sid_local"),fe.getSetting("tts_speed"),fe.getSetting("tts_custom_voice"),fe.getSetting("asr_engine"),fe.getSetting("asr_local_model"),fe.getSetting("asr_auto_stop")]).then(([se,qe,Je,Ft,it,Ur,pn,ci])=>{se&&b(se),qe&&y(qe),Je&&T(Je),Ft&&M(Ft),it&&L(it),Ur&&R(Ur),(pn==="asr-whisper-turbo"||pn==="asr-whisper-small")&&N(pn),D(ci!=="0")}),Se()},[Se]);const ve=C.useCallback(()=>{window.api.getSpeechModelStatus().then(se=>n(se)).catch(()=>{})},[]);C.useEffect(()=>(ve(),window.api.on("speech:modelProgress",qe=>{d({id:qe.id,pct:Math.floor(qe.progress*100),label:qe.currentFile?qe.currentFile.split("/").pop()??"":""})})),[ve]);const Oe=se=>{l(null),o(se),d({id:se,pct:0,label:""}),window.api.ensureSpeechModel(se).then(()=>{o(null),d(null),ve()}).catch(qe=>{o(null),d(null),l(qe instanceof Error?qe.message:String(qe)),ve()})},Ie=se=>{o(se),p(null),window.api.deleteSpeechModel(se).then(ve).catch(qe=>l(qe instanceof Error?qe.message:String(qe))).finally(()=>o(null))},$e=se=>e(se==="tts-kokoro"?"settings.speech.model.tts":se==="asr-whisper-turbo"?"settings.speech.model.asr_turbo":"settings.speech.model.asr_small"),Nt=se=>e(se==="asr-whisper-turbo"?"settings.speech.model.turbo_short":"settings.speech.model.small_short"),Ot=se=>se.startsWith("asr-whisper")?e("settings.speech.license_mit"):e("settings.speech.license"),Te=se=>e(se==="ready"?"settings.speech.state.ready":se==="error"?"settings.speech.state.error":"settings.speech.state.absent"),Ze=se=>{var qe;return((qe=t.find(Je=>Je.id===se))==null?void 0:qe.state)??"absent"},rt=se=>{b(se),ae(null),fe.setSetting("tts_engine",se)},bt=se=>{R(se),Z(null),fe.setSetting("asr_engine",se)},gt=P.filter(se=>se.kind==="tts"),lt=P.filter(se=>se.kind==="asr"),st=x.startsWith("custom-")?gt.find(se=>se.id===x)??null:null,Ue=A.startsWith("custom-")?lt.find(se=>se.id===A)??null:null,pe=x==="azure",Ce=A==="groq",je=A==="azure",Le=async()=>{if(!(!st||Y)){W(!0),ae(null);try{ae(await fe.testCustomTts({providerId:st.id}))}catch(se){ae({ok:!1,detail:se instanceof Error?se.message:String(se)})}finally{W(!1)}}},at=async()=>{if(!(!Ue||J)){ne(!0),Z(null);try{Z(await fe.testCustomAsr({providerId:Ue.id}))}catch(se){Z({ok:!1,detail:se instanceof Error?se.message:String(se)})}finally{ne(!1)}}},Me=async(se,qe)=>{Fe(null);try{await fe.deleteCustomProvider(se),qe==="tts"&&x===se&&rt("edge"),qe==="asr"&&A===se&&bt("local"),Se()}catch{}},tt=se=>{const qe=t.find(Ft=>Ft.id===se),Je=(qe==null?void 0:qe.state)??"absent";return m.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("div",{className:"text-label font-medium text-ink-strong truncate",children:$e(se)}),m.jsxs("div",{className:"text-caption text-ink-muted",children:[Te(Je)," · ",Ot(se)]}),i===se&&(c==null?void 0:c.id)===se&&m.jsx("div",{className:"mt-1.5 h-1.5 rounded-full bg-ink/[0.08] overflow-hidden","data-testid":`speech-dl-bar-${se}`,children:m.jsx("div",{className:"h-full bg-brand transition-all",style:{width:`${c.pct}%`}})}),i===se&&(c==null?void 0:c.id)===se&&m.jsxs("div",{className:"text-caption text-ink-faint mt-0.5","data-testid":`speech-dl-pct-${se}`,children:[c.pct,"%",c.label?` · ${c.label}`:""]})]}),Je==="ready"?f===se?m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx("span",{className:"text-caption text-warning",children:e("settings.speech.confirm_del")}),m.jsx("button",{onClick:()=>Ie(se),className:"text-label text-warning hover:underline","data-testid":`speech-del-confirm-${se}`,children:e("settings.speech.delete")}),m.jsx("button",{onClick:()=>p(null),className:"text-label text-ink-muted hover:text-ink-strong",children:e("action.cancel")})]}):m.jsx("button",{onClick:()=>p(se),disabled:i===se,className:"text-label text-ink-muted hover:text-warning disabled:opacity-40","data-testid":`speech-del-${se}`,children:e("settings.speech.delete")}):m.jsx("button",{onClick:()=>Oe(se),disabled:i!=null||Je==="downloading",className:"btn-3d-brand px-3 py-1 text-label disabled:opacity-40","data-testid":`speech-dl-${se}`,children:e(i===se||Je==="downloading"?"settings.speech.downloading":"settings.speech.download")})]},se)},We=(se,qe,Je,Ft,it)=>m.jsxs("div",{className:"space-y-2",children:[m.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-label",children:[m.jsx(Pl,{className:"w-3.5 h-3.5 text-ink-faint shrink-0","aria-hidden":"true"}),m.jsx("span",{className:"font-medium text-ink-strong",children:se.label}),m.jsx("code",{className:"text-ink-faint font-mono break-all",children:se.defaultModel}),m.jsx("span",{className:"text-ink-faint truncate",children:se.baseUrl}),se.hasApiKey&&m.jsxs("span",{className:"text-brand shrink-0 inline-flex items-center gap-0.5",children:[m.jsx(ga,{className:"w-3.5 h-3.5","aria-hidden":"true"}),e("settings.speech.key_saved")]})]}),m.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[m.jsx("button",{onClick:()=>void it(),disabled:Je,className:"btn-3d-neutral px-3 py-1 text-label disabled:opacity-40","data-testid":`${qe}-custom-test`,children:e(Je?"settings.testing":"settings.test")}),we===se.id?m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-caption text-warning",children:e("settings.speech.confirm_del_custom")}),m.jsx("button",{onClick:()=>void Me(se.id,qe),className:"text-label text-warning hover:underline","data-testid":`${qe}-custom-del-confirm`,children:e("settings.speech.delete")}),m.jsx("button",{onClick:()=>Fe(null),className:"text-label text-ink-muted hover:text-ink-strong",children:e("action.cancel")})]}):m.jsx("button",{onClick:()=>Fe(se.id),className:"text-label text-ink-muted hover:text-warning","data-testid":`${qe}-custom-del`,children:e("settings.speech.delete")}),Ft&&m.jsxs("span",{className:`text-label inline-flex items-center gap-1 ${Ft.ok?"text-brand":"text-warning"}`,children:[Ft.ok?m.jsx(ga,{className:"w-4 h-4","aria-hidden":"true"}):m.jsx(Ir,{className:"w-4 h-4","aria-hidden":"true"}),Ft.detail]})]})]});return m.jsxs("div",{"data-testid":"settings-speech",children:[m.jsxs("div",{className:zt(!1),children:[m.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.speech.tts_title")}),m.jsxs("div",{className:"flex gap-2 flex-wrap",children:[m.jsx("button",{onClick:()=>{rt("edge"),q(!1),Q(!1)},"data-testid":"tts-engine-edge","aria-pressed":x==="edge",className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${x==="edge"?Ra:Ma}`,children:e("settings.speech.engine.edge")}),m.jsxs("button",{onClick:()=>{rt("local"),q(!1),Q(!1)},"data-testid":"tts-engine-local","aria-pressed":x==="local",className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${x==="local"?Ra:Ma}`,children:[e("settings.speech.engine.local"),Ze("tts-kokoro")!=="ready"?` · ${e("settings.speech.state.absent")}`:""]}),m.jsx("button",{onClick:()=>{q(se=>!se),K||Q(!1)},"data-testid":"tts-engine-custom","aria-pressed":x.startsWith("custom-")||K,className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${x.startsWith("custom-")||K?Ra:Ma}`,children:e("settings.speech.engine.custom")}),pe&&m.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")]})]}),x==="edge"&&m.jsx("p",{className:"text-label text-ink-muted mt-2",children:e("settings.speech.engine.edge_note")})]}),x==="edge"&&m.jsxs("div",{className:zt(!1),children:[m.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:e("settings.speech.voice")}),m.jsx("select",{value:g,onChange:se=>{y(se.target.value),fe.setSetting("tts_voice_edge",se.target.value)},"data-testid":"tts-voice-select",className:`${oi} w-full min-w-0 px-2.5 py-1.5`,children:Pj.map(se=>m.jsx("option",{value:se.id,children:se.label},se.id))})]}),x==="local"&&m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:zt(!1),children:[m.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:e("settings.speech.voice")}),m.jsx("select",{value:E,onChange:se=>{T(se.target.value),fe.setSetting("tts_sid_local",se.target.value)},"data-testid":"tts-sid-select",className:`${oi} w-full min-w-0 px-2.5 py-1.5`,children:Bj.map(se=>m.jsx("option",{value:se.sid,children:se.label},se.sid))})]}),m.jsx("div",{className:zt(!1),children:tt("tts-kokoro")})]}),K&&m.jsx("div",{className:zt(!1),children:m.jsxs("div",{className:"space-y-3",children:[st&&We(st,"tts",Y,U,Le),st&&m.jsxs("div",{children:[m.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:e("settings.speech.voice")}),m.jsx("input",{type:"text",value:_,onChange:se=>L(se.target.value),onBlur:()=>void fe.setSetting("tts_custom_voice",_.trim()),placeholder:e("settings.speech.custom_voice_ph"),"data-testid":"tts-custom-voice",className:`${oi} w-full min-w-0 px-2.5 py-1.5 font-mono`})]}),!st&>.map(se=>m.jsxs("button",{onClick:()=>rt(se.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-${se.id}`,children:[m.jsx("span",{className:"text-label font-medium text-ink-strong",children:se.label}),m.jsx("span",{className:"text-label text-ink-faint font-mono break-all ml-2",children:se.defaultModel})]},se.id)),(G||!st&>.length===0)&&m.jsx(nd,{kind:"tts",showProtocol:!1,testPrefix:"tts-custom",titleKey:"settings.custom.form_title_tts",modelPhKey:"settings.custom.model_ph_tts",testOverride:se=>fe.testCustomTts({baseUrl:se.baseUrl,apiKey:se.apiKey||void 0,model:se.model}),onSaved:se=>{rt(se.id),Q(!1),Se()},onCancel:()=>Q(!1)}),(st||gt.length>0)&&m.jsx("button",{onClick:()=>Q(se=>!se),className:"text-label text-accent hover:underline",children:e(G?"action.cancel":"settings.custom.new")})]})}),m.jsx("div",{className:zt(!0),children:m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-label font-medium text-ink-strong shrink-0 w-14",children:e("settings.speech.speed")}),m.jsx("input",{type:"range",min:"0.5",max:"2",step:"0.05",value:w,onChange:se=>M(se.target.value),onPointerUp:()=>void fe.setSetting("tts_speed",w),onKeyUp:()=>void fe.setSetting("tts_speed",w),"data-testid":"tts-speed-range",className:"flex-1 min-w-0 accent-[var(--brand)]"}),m.jsxs("span",{className:"text-label text-ink-muted tabular-nums w-10 text-right","data-testid":"tts-speed-value",children:[Number(w).toFixed(2),"x"]})]})}),m.jsxs("div",{className:zt(!0),children:[m.jsx("div",{className:"text-label font-medium text-ink-strong mb-2",children:e("settings.speech.asr_title")}),m.jsxs("div",{className:"flex gap-2 flex-wrap",children:[m.jsx("button",{onClick:()=>{bt("local"),H(!1),F(!1)},"data-testid":"asr-engine-local","aria-pressed":A==="local",className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${A==="local"?Ra:Ma}`,children:e("settings.speech.asr_engine.local")}),m.jsx("button",{onClick:()=>{H(se=>!se),B||F(!1)},"data-testid":"asr-engine-custom","aria-pressed":A.startsWith("custom-")||B,className:`px-4 py-2 rounded-xl text-body font-bold transition-all ${A.startsWith("custom-")||B?Ra:Ma}`,children:e("settings.speech.engine.custom")}),Ce&&m.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")]}),je&&m.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")]})]}),A==="local"?m.jsx("p",{className:"text-label text-ink-muted mt-2",children:e("settings.speech.asr_engine.local_note")}):A.startsWith("custom-")&&m.jsx("p",{className:"text-label text-ink-muted mt-2",children:e("settings.speech.asr_engine.custom_note")})]}),A==="local"&&m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:zt(!1),children:[m.jsx("div",{className:"text-label font-medium text-ink-strong mb-1.5",children:e("settings.model")}),m.jsx("select",{value:j,onChange:se=>{N(se.target.value),fe.setSetting("asr_local_model",se.target.value)},"data-testid":"asr-model-select",className:`${oi} w-full min-w-0 px-2.5 py-1.5`,children:["asr-whisper-turbo","asr-whisper-small"].map(se=>m.jsxs("option",{value:se,children:[Nt(se)," · ",Te(Ze(se))]},se))})]}),m.jsx("div",{className:zt(!1),children:tt(j)})]}),B&&m.jsx("div",{className:zt(!1),children:m.jsxs("div",{className:"space-y-3",children:[Ue&&We(Ue,"asr",J,me,at),!Ue&<.map(se=>m.jsxs("button",{onClick:()=>bt(se.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-${se.id}`,children:[m.jsx("span",{className:"text-label font-medium text-ink-strong",children:se.label}),m.jsx("span",{className:"text-label text-ink-faint font-mono break-all ml-2",children:se.defaultModel})]},se.id)),(re||!Ue&<.length===0)&&m.jsx(nd,{kind:"asr",showProtocol:!1,testPrefix:"asr-custom",titleKey:"settings.custom.form_title_asr",modelPhKey:"settings.custom.model_ph_asr",testOverride:se=>fe.testCustomAsr({baseUrl:se.baseUrl,apiKey:se.apiKey||void 0,model:se.model}),onSaved:se=>{bt(se.id),F(!1),Se()},onCancel:()=>F(!1)}),(Ue||lt.length>0)&&m.jsx("button",{onClick:()=>F(se=>!se),className:"text-label text-accent hover:underline",children:e(re?"action.cancel":"settings.custom.new")})]})}),m.jsxs("div",{className:zt(!0),children:[m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx(zp,{checked:I,onChange:()=>{const se=!I;D(se),fe.setSetting("asr_auto_stop",se?"1":"0")},label:e("settings.speech.asr_auto_stop"),testid:"asr-auto-stop-toggle"}),m.jsx("div",{className:"text-body font-medium text-ink-strong",children:e("settings.speech.asr_auto_stop")})]}),m.jsx("p",{className:"text-label text-ink-muted mt-2",children:e("settings.speech.asr_ux_note")})]}),s&&m.jsx("div",{className:"px-4 py-3 text-label text-warning break-all",role:"alert",children:s==="engine-unavailable"?e("chat.speech.engine_unavailable"):s})]})}function Uj(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 i=e.length-1;i>=0;i--){const o=e[i];if(o.type==="tool-call"&&o.toolName===t.toolName&&o.state==="input-available"){n=i;break}}return n<0?e:e.map((i,o)=>o===n?{...i,state:"output-available",output:t.output}:i)}if(t.type==="tool-error"){let n=-1;for(let i=e.length-1;i>=0;i--){const o=e[i];if(o.type==="tool-call"&&o.toolName===t.toolName&&o.state==="input-available"){n=i;break}}return n<0?e:e.map((i,o)=>o===n?{...i,state:"output-error",error:t.error}:i)}return e}let Hj=0;const kc=()=>`msg-v2-${++Hj}`;function Fj(e){if(!e)return null;try{const t=JSON.parse(e);return!Array.isArray(t)||t.length===0?null:t.every(i=>typeof i=="object"&&i!==null&&typeof i.type=="string")?t:null}catch{return null}}function Vj(e,t){const[n,i]=C.useState([]),[o,s]=C.useState(!1),l=C.useRef(null);C.useEffect(()=>{if(!e){i([]),s(!1),l.current=null;return}let b=!1;return(async()=>{try{const g=await fe.threadGetMessages(e);if(b)return;i(g.map(y=>{const E=Fj(y.partsJson);return{id:y.id,role:y.role,parts:E??[{type:"text",text:y.content}],...y.displayText?{displayText:y.displayText}:{}}}))}catch{b||i([])}})(),()=>{b=!0}},[e]),C.useEffect(()=>fe.on("chat:part",g=>{const E=l.current;i(T=>{let w=E,M=T;if(!(w&&T.some(A=>A.id===w))){const A=T[T.length-1];A&&A.role==="assistant"?w=A.id:(w=kc(),M=[...T,{id:w,role:"assistant",parts:[]}])}const L=w;return M.map(A=>A.id===L?{...A,parts:Uj(A.parts,g)}:A)})}),[]),C.useEffect(()=>fe.on("chat:done",(g,y)=>{s(!1),l.current=null,y&&(y.userMessageId||y.assistantMessageId)&&i(E=>{let T=-1,w=-1;for(let M=E.length-1;M>=0&&(E[M].role==="user"&&T===-1&&(T=M),E[M].role==="assistant"&&w===-1&&(w=M),!(T!==-1&&w!==-1));M--);return E.map((M,_)=>_===T&&y.userMessageId?{...M,id:y.userMessageId}:_===w&&y.assistantMessageId?{...M,id:y.assistantMessageId}:M)})}),[]),C.useEffect(()=>fe.on("chat:error",g=>{s(!1),l.current=null,i(y=>[...y,{id:kc(),role:"assistant",parts:[{type:"text",text:`⚠️ ${g}`}]}])}),[]);const c=C.useCallback(async(b,g,y,E)=>{const T=g??e;if(!T||o||!b.trim())return;const w=b.trim(),M={id:kc(),role:"user",parts:[...(E??[]).map(_=>({type:"attachment",attachment:{kind:_.kind,name:_.name,mime:_.mime,size:_.size,..._.previewUrl?{previewUrl:_.previewUrl}:{}}})),{type:"text",text:w}],...y?{displayText:y}:{}};i(_=>[..._,M]),s(!0),l.current=null;try{await fe.agentChatThread(T,w,y,t??null,E)}catch(_){s(!1),i(L=>[...L,{id:kc(),role:"assistant",parts:[{type:"text",text:`⚠️ ${_ instanceof Error?_.message:String(_)}`}]}])}},[e,o,t]),d=C.useCallback(async()=>{if(!(!e||!o)){try{await fe.abortAgentChatThread(e)}catch{}s(!1),l.current=null}},[e,o]),f=C.useCallback(()=>{i([])},[]);C.useEffect(()=>{const b=g=>{const y=g.detail;if(typeof y!="string")return;const T={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"}}[y];T&&c(T.msg,void 0,mp(T.labelKey))};return window.addEventListener("lookatstudy-command",b),()=>window.removeEventListener("lookatstudy-command",b)},[c]);const p=C.useCallback((b,g,y)=>{i(E=>E.map(T=>{if(T.id!==b)return T;const w=[...T.parts],M=w[g];return M&&M.type==="tool-call"&&(w[g]={...M,output:{...typeof M.output=="object"&&M.output?M.output:{},status:y?"applied":"rejected"}}),{...T,parts:w}}))},[]),x=C.useCallback(b=>{i(b)},[]);return{messages:n,streaming:o,send:c,stop:d,clear:f,markProposalStatus:p,setMessagesForNode:x}}const wc=(e,t=60)=>e.length>t?e.slice(0,t)+"…":e;function qj(e,t){return t("quiz.hook.label",{correct:e.correct,total:e.total})}function Yj(e,t){const n=e.detail.map((o,s)=>o.correct?t("quiz.hook.lineOk",{n:s+1,prompt:wc(o.prompt)}):t("quiz.hook.lineWrong",{n:s+1,prompt:wc(o.prompt),chosen:wc(o.chosen,30),answer:wc(o.answerText,30)})),i=e.title?`《${e.title}》`:"";return t("quiz.hook.message",{title:i,correct:e.correct,total:e.total})+(n.length?`
|
|
554
|
-
`+n.join(`
|
|
555
|
-
`):"")}function Gj(e,t){const[n,i]=C.useState([]),[o,s]=C.useState(null),l=C.useCallback(async()=>{if(!e||!t){i([]),s(null);return}try{const E=(await fe.threadList(e,"active")).filter(T=>T.focusNodeId===t);i(E),E.length>0?s(E[0].id):s(null)}catch{i([]),s(null)}},[e,t]);C.useEffect(()=>{l()},[l]);const c=C.useCallback(async y=>{if(!e||!t)return null;try{const E=await fe.threadCreate({...y,courseId:e,focusNodeId:t});return i(T=>[E,...T]),s(E.id),E}catch{return null}},[e,t]),d=C.useCallback(async(y,E)=>{try{const T=await fe.threadUpdate(y,E);return T&&(T.status==="archived"?(i(w=>w.filter(M=>M.id!==y)),s(w=>{var _;return w!==y?w:((_=n.filter(L=>L.id!==y)[0])==null?void 0:_.id)??null})):i(w=>w.map(M=>M.id===y?T:M))),T}catch{return null}},[n]),f=C.useCallback(async y=>{try{await fe.threadDelete(y),i(E=>E.filter(T=>T.id!==y)),s(E=>{var w;return E!==y?E:((w=n.filter(M=>M.id!==y)[0])==null?void 0:w.id)??null})}catch{}},[n]),p=C.useCallback(y=>{const E=n.find(T=>T.id===y)??null;return E?(i(T=>T.filter(w=>w.id!==y)),s(T=>{var M;return T!==y?T:((M=n.filter(_=>_.id!==y)[0])==null?void 0:M.id)??null}),E):null},[n]),x=C.useCallback(y=>{i(E=>[y,...E.filter(T=>T.id!==y.id)]),s(y.id)},[]),b=C.useCallback(async(y,E)=>{if(!e||!t)return null;if(o)return o;const T=await c({title:(E??y).trim()});return(T==null?void 0:T.id)??null},[e,t,o,c]),g=n.find(y=>y.id===o)??null;return{threads:n,activeId:o,activeThread:g,setActiveId:s,reload:l,create:c,update:d,remove:f,removeWithUndo:p,restore:x,ensureThreadForSend:b}}function Xj({threads:e,activeThread:t,focusNodeTitle:n,onPickThread:i,onCreate:o,onRename:s,onArchive:l,onDelete:c}){const d=Xe(),[f,p]=C.useState(null),[x,b]=C.useState(null),[g,y]=C.useState(null),[E,T]=C.useState(""),[w,M]=C.useState(null),_=C.useRef(null);C.useEffect(()=>{const j=N=>{_.current&&!_.current.contains(N.target)&&(p(null),b(null))};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[]);const L=(j,N)=>{j.stopPropagation();const I=j.currentTarget.getBoundingClientRect(),D=Math.max(8,I.right-128),P=I.bottom+4;b({top:P,left:D}),p(f===N?null:N)},A=j=>{y(j.id),T(j.title??""),p(null),b(null)},R=()=>{g&&E.trim()&&s(g,E.trim()),y(null)};return e.length===0?m.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:[m.jsx("span",{className:"w-1 h-1 rounded-full bg-brand shrink-0"}),m.jsx("span",{className:"text-ink-muted truncate flex-1",children:n??d("thread.empty.no_node")}),m.jsx("span",{className:"text-caption text-ink-muted shrink-0",children:d("thread.empty.hint")})]}):m.jsxs("div",{className:"shrink-0 bg-surface-1","data-testid":"thread-switcher",children:[m.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(j=>{const N=j.id===(t==null?void 0:t.id),I=g===j.id;return m.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 ${N?"text-ink-strong":"text-ink-muted hover:text-ink-strong"}`,onClick:()=>!I&&i(j.id),"data-testid":`thread-tab-${j.id.slice(0,8)}`,children:[m.jsx("span",{className:`w-1 h-1 rounded-full shrink-0 transition-opacity ${N?"bg-brand opacity-100":"bg-[var(--border)] opacity-0 group-hover:opacity-60"}`}),I?m.jsx("input",{value:E,onChange:D=>T(D.target.value),onKeyDown:D=>{D.key==="Enter"&&R(),D.key==="Escape"&&y(null)},onBlur:R,onClick:D=>D.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"}):m.jsx("span",{className:`text-label max-w-[120px] truncate ${N?"font-semibold":"font-normal"}`,"data-tooltip":j.title||d("toast.threadDefault"),children:j.title||d("toast.threadDefault")}),!I&&m.jsx("button",{onClick:D=>L(D,j.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-${j.id.slice(0,8)}`,title:d("thread.actions.label"),"aria-label":d("thread.actions.label"),children:m.jsx(Gc,{className:"w-3 h-3"})})]},j.id)}),m.jsx("button",{onClick:o,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:d("thread.new.label"),"aria-label":d("thread.new.label"),children:m.jsx(md,{className:"w-3.5 h-3.5"})})]}),f&&x&&(()=>{const j=e.find(N=>N.id===f);return j?m.jsxs("div",{ref:_,style:{position:"fixed",top:x.top,left:x.left},className:"z-50 w-32 bg-surface-0 rounded-lg shadow-pop py-1 border border-[var(--border-faint)]","data-testid":`thread-menu-${j.id.slice(0,8)}`,onClick:N=>N.stopPropagation(),children:[m.jsxs("button",{onClick:()=>A(j),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:[m.jsx(YC,{className:"w-3 h-3"}),d("thread.menu.rename")]}),m.jsxs("button",{onClick:()=>{l(j.id),p(null),b(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:[m.jsx(uC,{className:"w-3 h-3"}),d("thread.menu.archive")]}),m.jsxs("button",{onClick:N=>{const I=N.currentTarget.getBoundingClientRect();M({id:j.id,title:j.title??d("toast.threadDefault"),rect:I}),p(null),b(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:[m.jsx(c0,{className:"w-3 h-3"}),d("action.delete")]})]}):null})(),w&&m.jsx(pd,{anchorRect:w.rect,message:d("thread.delete.confirm",{name:w.title}),danger:!0,confirmLabel:d("action.delete"),testid:"thread-delete-confirm",onConfirm:()=>{c(w.id),M(null)},onCancel:()=>M(null)})]})}const Kj=1240,$j=920;function Qj(e){return e>=Kj?1:e>=$j?2:3}function Wj(e){return e==="rail"?"rail":"notebook"}function Zj(e,t,n){if(Math.abs(t)<60||Math.abs(t)<Math.abs(n)*1.6)return null;const i=["rail","chat","notebook"],o=i.indexOf(e)+(t<0?1:-1);return o>=0&&o<i.length?i[o]:null}function Jj(e){return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}function e9(){return Qj(typeof window>"u"?t9:window.innerWidth)}const t9=99999;function n9(){return C.useSyncExternalStore(Jj,e9,()=>1)}const Up=C.createContext({});function Hp(e){const t=C.useRef(null);return t.current===null&&(t.current=e()),t.current}const a9=typeof window<"u",ad=a9?C.useLayoutEffect:C.useEffect,Dd=C.createContext(null);function Fp(e,t){e.indexOf(t)===-1&&e.push(t)}function id(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Oa=(e,t,n)=>n>t?t:n<e?e:n;let Ld=()=>{};const Vi={},tk=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),nk=e=>typeof e=="object"&&e!==null,ak=e=>/^0[^.\s]+$/u.test(e);function ik(e){let t;return()=>(t===void 0&&(t=e()),t)}const sa=e=>e,Gl=(...e)=>e.reduce((t,n)=>i=>n(t(i))),Ml=(e,t,n)=>{const i=t-e;return i?(n-e)/i:1};class Vp{constructor(){this.subscriptions=[]}add(t){return Fp(this.subscriptions,t),()=>id(this.subscriptions,t)}notify(t,n,i){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,i);else for(let s=0;s<o;s++){const l=this.subscriptions[s];l&&l(t,n,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Yn=e=>e*1e3,ra=e=>e/1e3,rk=(e,t)=>t?e*(1e3/t):0,sk=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,i9=1e-7,r9=12;function s9(e,t,n,i,o){let s,l,c=0;do l=t+(n-t)/2,s=sk(l,i,o)-e,s>0?n=l:t=l;while(Math.abs(s)>i9&&++c<r9);return l}function Xl(e,t,n,i){if(e===t&&n===i)return sa;const o=s=>s9(s,0,1,e,n);return s=>s===0||s===1?s:sk(o(s),t,i)}const ok=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,lk=e=>t=>1-e(1-t),uk=Xl(.33,1.53,.69,.99),qp=lk(uk),ck=ok(qp),dk=e=>e>=1?1:(e*=2)<1?.5*qp(e):.5*(2-Math.pow(2,-10*(e-1))),Yp=e=>1-Math.sin(Math.acos(e)),fk=lk(Yp),hk=ok(Yp),o9=Xl(.42,0,1,1),l9=Xl(0,0,.58,1),mk=Xl(.42,0,.58,1),u9=e=>Array.isArray(e)&&typeof e[0]!="number",pk=e=>Array.isArray(e)&&typeof e[0]=="number",c9={linear:sa,easeIn:o9,easeInOut:mk,easeOut:l9,circIn:Yp,circInOut:hk,circOut:fk,backIn:qp,backInOut:ck,backOut:uk,anticipate:dk},d9=e=>typeof e=="string",Zv=e=>{if(pk(e)){Ld(e.length===4);const[t,n,i,o]=e;return Xl(t,n,i,o)}else if(d9(e))return c9[e];return e},Ac=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function f9(e){let t=new Set,n=new Set,i=!1,o=!1;const s=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function c(f){s.has(f)&&(d.schedule(f),e()),f(l)}const d={schedule:(f,p=!1,x=!1)=>{const g=x&&i?t:n;return p&&s.add(f),g.add(f),f},cancel:f=>{n.delete(f),s.delete(f)},process:f=>{if(l=f,i){o=!0;return}i=!0;const p=t;t=n,n=p,t.forEach(c),t.clear(),i=!1,o&&(o=!1,d.process(f))}};return d}const h9=40;function gk(e,t){let n=!1,i=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,l=Ac.reduce((_,L)=>(_[L]=f9(s),_),{}),{setup:c,read:d,resolveKeyframes:f,preUpdate:p,update:x,preRender:b,render:g,postRender:y}=l,E=()=>{const _=Vi.useManualTiming,L=_?o.timestamp:performance.now();n=!1,_||(o.delta=i?1e3/60:Math.max(Math.min(L-o.timestamp,h9),1)),o.timestamp=L,o.isProcessing=!0,c.process(o),d.process(o),f.process(o),p.process(o),x.process(o),b.process(o),g.process(o),y.process(o),o.isProcessing=!1,n&&t&&(i=!1,e(E))},T=()=>{n=!0,i=!0,o.isProcessing||e(E)};return{schedule:Ac.reduce((_,L)=>{const A=l[L];return _[L]=(R,j=!1,N=!1)=>(n||T(),A.schedule(R,j,N)),_},{}),cancel:_=>{for(let L=0;L<Ac.length;L++)l[Ac[L]].cancel(_)},state:o,steps:l}}const{schedule:Dt,cancel:qi,state:hn,steps:Ym}=gk(typeof requestAnimationFrame<"u"?requestAnimationFrame:sa,!0);let jc;function m9(){jc=void 0}const Tn={now:()=>(jc===void 0&&Tn.set(hn.isProcessing||Vi.useManualTiming?hn.timestamp:performance.now()),jc),set:e=>{jc=e,queueMicrotask(m9)}},xk=e=>t=>typeof t=="string"&&t.startsWith(e),bk=xk("--"),p9=xk("var(--"),Gp=e=>p9(e)?g9.test(e.split("/*")[0].trim()):!1,g9=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Jv(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Ks={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Rl={...Ks,transform:e=>Oa(0,1,e)},Cc={...Ks,default:1},vl=e=>Math.round(e*1e5)/1e5,Xp=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function x9(e){return e==null}const b9=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Kp=(e,t)=>n=>!!(typeof n=="string"&&b9.test(n)&&n.startsWith(e)||t&&!x9(n)&&Object.prototype.hasOwnProperty.call(n,t)),yk=(e,t,n)=>i=>{if(typeof i!="string")return i;const[o,s,l,c]=i.match(Xp);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(l),alpha:c!==void 0?parseFloat(c):1}},y9=e=>Oa(0,255,e),Gm={...Ks,transform:e=>Math.round(y9(e))},Ar={test:Kp("rgb","red"),parse:yk("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+Gm.transform(e)+", "+Gm.transform(t)+", "+Gm.transform(n)+", "+vl(Rl.transform(i))+")"};function v9(e){let t="",n="",i="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,i+=i,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:o?parseInt(o,16)/255:1}}const O0={test:Kp("#"),parse:v9,transform:Ar.transform},Kl=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ii=Kl("deg"),Da=Kl("%"),Be=Kl("px"),E9=Kl("vh"),T9=Kl("vw"),e2={...Da,parse:e=>Da.parse(e)/100,transform:e=>Da.transform(e*100)},Ds={test:Kp("hsl","hue"),parse:yk("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+Da.transform(vl(t))+", "+Da.transform(vl(n))+", "+vl(Rl.transform(i))+")"},tn={test:e=>Ar.test(e)||O0.test(e)||Ds.test(e),parse:e=>Ar.test(e)?Ar.parse(e):Ds.test(e)?Ds.parse(e):O0.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ar.transform(e):Ds.transform(e),getAnimatableNone:e=>{const t=tn.parse(e);return t.alpha=0,tn.transform(t)}},S9=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function k9(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Xp))==null?void 0:t.length)||0)+(((n=e.match(S9))==null?void 0:n.length)||0)>0}const vk="number",Ek="color",w9="var",A9="var(",t2="${}",C9=/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 Us(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},o=[];let s=0;const c=t.replace(C9,d=>(tn.test(d)?(i.color.push(s),o.push(Ek),n.push(tn.parse(d))):d.startsWith(A9)?(i.var.push(s),o.push(w9),n.push(d)):(i.number.push(s),o.push(vk),n.push(parseFloat(d))),++s,t2)).split(t2);return{values:n,split:c,indexes:i,types:o}}function N9(e){return Us(e).values}function Tk({split:e,types:t}){const n=e.length;return i=>{let o="";for(let s=0;s<n;s++)if(o+=e[s],i[s]!==void 0){const l=t[s];l===vk?o+=vl(i[s]):l===Ek?o+=tn.transform(i[s]):o+=i[s]}return o}}function _9(e){return Tk(Us(e))}const M9=e=>typeof e=="number"?0:tn.test(e)?tn.getAnimatableNone(e):e,R9=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:M9(e);function D9(e){const t=Us(e);return Tk(t)(t.values.map((i,o)=>R9(i,t.split[o])))}const ba={test:k9,parse:N9,createTransformer:_9,getAnimatableNone:D9};function Xm(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 L9({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let o=0,s=0,l=0;if(!t)o=s=l=n;else{const c=n<.5?n*(1+t):n+t-n*t,d=2*n-c;o=Xm(d,c,e+1/3),s=Xm(d,c,e),l=Xm(d,c,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(l*255),alpha:i}}function rd(e,t){return n=>n>0?t:e}const Rt=(e,t,n)=>e+(t-e)*n,Km=(e,t,n)=>{const i=e*e,o=n*(t*t-i)+i;return o<0?0:Math.sqrt(o)},O9=[O0,Ar,Ds],I9=e=>O9.find(t=>t.test(e));function n2(e){const t=I9(e);if(!t)return!1;let n=t.parse(e);return t===Ds&&(n=L9(n)),n}const a2=(e,t)=>{const n=n2(e),i=n2(t);if(!n||!i)return rd(e,t);const o={...n};return s=>(o.red=Km(n.red,i.red,s),o.green=Km(n.green,i.green,s),o.blue=Km(n.blue,i.blue,s),o.alpha=Rt(n.alpha,i.alpha,s),Ar.transform(o))},I0=new Set(["none","hidden"]);function j9(e,t){return I0.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function P9(e,t){return n=>Rt(e,t,n)}function $p(e){return typeof e=="number"?P9:typeof e=="string"?Gp(e)?rd:tn.test(e)?a2:U9:Array.isArray(e)?Sk:typeof e=="object"?tn.test(e)?a2:B9:rd}function Sk(e,t){const n=[...e],i=n.length,o=e.map((s,l)=>$p(s)(s,t[l]));return s=>{for(let l=0;l<i;l++)n[l]=o[l](s);return n}}function B9(e,t){const n={...e,...t},i={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(i[o]=$p(e[o])(e[o],t[o]));return o=>{for(const s in i)n[s]=i[s](o);return n}}function z9(e,t){const n=[],i={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const s=t.types[o],l=e.indexes[s][i[s]],c=e.values[l]??0;n[o]=c,i[s]++}return n}const U9=(e,t)=>{const n=ba.createTransformer(t),i=Us(e),o=Us(t);return i.indexes.var.length===o.indexes.var.length&&i.indexes.color.length===o.indexes.color.length&&i.indexes.number.length>=o.indexes.number.length?I0.has(e)&&!o.values.length||I0.has(t)&&!i.values.length?j9(e,t):Gl(Sk(z9(i,o),o.values),n):rd(e,t)};function kk(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Rt(e,t,n):$p(e)(e,t)}const H9=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Dt.update(t,n),stop:()=>qi(t),now:()=>hn.isProcessing?hn.timestamp:Tn.now()}},wk=(e,t,n=10)=>{let i="";const o=Math.max(Math.round(t/n),2);for(let s=0;s<o;s++)i+=Math.round(e(s/(o-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},sd=2e4;function Qp(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t<sd;)t+=n,i=e.next(t);return t>=sd?1/0:t}function F9(e,t=100,n){const i=n({...e,keyframes:[0,t]}),o=Math.min(Qp(i),sd);return{type:"keyframes",ease:s=>i.next(o*s).value/t,duration:ra(o)}}const Yt={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 j0(e,t){return e*Math.sqrt(1-t*t)}const V9=12;function q9(e,t,n){let i=n;for(let o=1;o<V9;o++)i=i-e(i)/t(i);return i}const $m=.001;function Y9({duration:e=Yt.duration,bounce:t=Yt.bounce,velocity:n=Yt.velocity,mass:i=Yt.mass}){let o,s,l=1-t;l=Oa(Yt.minDamping,Yt.maxDamping,l),e=Oa(Yt.minDuration,Yt.maxDuration,ra(e)),l<1?(o=f=>{const p=f*l,x=p*e,b=p-n,g=j0(f,l),y=Math.exp(-x);return $m-b/g*y},s=f=>{const x=f*l*e,b=x*n+n,g=Math.pow(l,2)*Math.pow(f,2)*e,y=Math.exp(-x),E=j0(Math.pow(f,2),l);return(-o(f)+$m>0?-1:1)*((b-g)*y)/E}):(o=f=>{const p=Math.exp(-f*e),x=(f-n)*e+1;return-$m+p*x},s=f=>{const p=Math.exp(-f*e),x=(n-f)*(e*e);return p*x});const c=5/e,d=q9(o,s,c);if(e=Yn(e),isNaN(d))return{stiffness:Yt.stiffness,damping:Yt.damping,duration:e};{const f=Math.pow(d,2)*i;return{stiffness:f,damping:l*2*Math.sqrt(i*f),duration:e}}}const G9=["duration","bounce"],X9=["stiffness","damping","mass"];function i2(e,t){return t.some(n=>e[n]!==void 0)}function K9(e){let t={velocity:Yt.velocity,stiffness:Yt.stiffness,damping:Yt.damping,mass:Yt.mass,isResolvedFromDuration:!1,...e};if(!i2(e,X9)&&i2(e,G9))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,i=2*Math.PI/(n*1.2),o=i*i,s=2*Oa(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Yt.mass,stiffness:o,damping:s}}else{const n=Y9({...e,velocity:0});t={...t,...n,mass:Yt.mass},t.isResolvedFromDuration=!0}return t}function od(e=Yt.visualDuration,t=Yt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:i,restDelta:o}=n;const s=n.keyframes[0],l=n.keyframes[n.keyframes.length-1],c={done:!1,value:s},{stiffness:d,damping:f,mass:p,duration:x,velocity:b,isResolvedFromDuration:g}=K9({...n,velocity:-ra(n.velocity||0)}),y=b||0,E=f/(2*Math.sqrt(d*p)),T=l-s,w=ra(Math.sqrt(d/p)),M=Math.abs(T)<5;i||(i=M?Yt.restSpeed.granular:Yt.restSpeed.default),o||(o=M?Yt.restDelta.granular:Yt.restDelta.default);let _,L,A,R,j,N;if(E<1)A=j0(w,E),R=(y+E*w*T)/A,_=D=>{const P=Math.exp(-E*w*D);return l-P*(R*Math.sin(A*D)+T*Math.cos(A*D))},j=E*w*R+T*A,N=E*w*T-R*A,L=D=>Math.exp(-E*w*D)*(j*Math.sin(A*D)+N*Math.cos(A*D));else if(E===1){_=P=>l-Math.exp(-w*P)*(T+(y+w*T)*P);const D=y+w*T;L=P=>Math.exp(-w*P)*(w*D*P-y)}else{const D=w*Math.sqrt(E*E-1);_=q=>{const B=Math.exp(-E*w*q),H=Math.min(D*q,300);return l-B*((y+E*w*T)*Math.sinh(H)+D*T*Math.cosh(H))/D};const P=(y+E*w*T)/D,z=E*w*P-T*D,K=E*w*T-P*D;L=q=>{const B=Math.exp(-E*w*q),H=Math.min(D*q,300);return B*(z*Math.sinh(H)+K*Math.cosh(H))}}const I={calculatedDuration:g&&x||null,velocity:D=>Yn(L(D)),next:D=>{if(!g&&E<1){const z=Math.exp(-E*w*D),K=Math.sin(A*D),q=Math.cos(A*D),B=l-z*(R*K+T*q),H=Yn(z*(j*K+N*q));return c.done=Math.abs(H)<=i&&Math.abs(l-B)<=o,c.value=c.done?l:B,c}const P=_(D);if(g)c.done=D>=x;else{const z=Yn(L(D));c.done=Math.abs(z)<=i&&Math.abs(l-P)<=o}return c.value=c.done?l:P,c},toString:()=>{const D=Math.min(Qp(I),sd),P=wk(z=>I.next(D*z).value,D,30);return D+"ms "+P},toTransition:()=>{}};return I}od.applyToOptions=e=>{const t=F9(e,100,od);return e.ease=t.ease,e.duration=Yn(t.duration),e.type="keyframes",e};const $9=5;function Ak(e,t,n){const i=Math.max(t-$9,0);return rk(n-e(i),t-i)}function P0({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:l,min:c,max:d,restDelta:f=.5,restSpeed:p}){const x=e[0],b={done:!1,value:x},g=N=>c!==void 0&&N<c||d!==void 0&&N>d,y=N=>c===void 0?d:d===void 0||Math.abs(c-N)<Math.abs(d-N)?c:d;let E=n*t;const T=x+E,w=l===void 0?T:l(T);w!==T&&(E=w-x);const M=N=>-E*Math.exp(-N/i),_=N=>w+M(N),L=N=>{const I=M(N),D=_(N);b.done=Math.abs(I)<=f,b.value=b.done?w:D};let A,R;const j=N=>{g(b.value)&&(A=N,R=od({keyframes:[b.value,y(b.value)],velocity:Ak(_,N,b.value),damping:o,stiffness:s,restDelta:f,restSpeed:p}))};return j(0),{calculatedDuration:null,next:N=>{let I=!1;return!R&&A===void 0&&(I=!0,L(N),j(N)),A!==void 0&&N>=A?R.next(N-A):(!I&&L(N),b)}}}function Q9(e,t,n){const i=[],o=n||Vi.mix||kk,s=e.length-1;for(let l=0;l<s;l++){let c=o(e[l],e[l+1]);if(t){const d=Array.isArray(t)?t[l]||sa:t;c=Gl(d,c)}i.push(c)}return i}function W9(e,t,{clamp:n=!0,ease:i,mixer:o}={}){const s=e.length;if(Ld(s===t.length),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const c=Q9(t,i,o),d=c.length,f=p=>{if(l&&p<e[0])return t[0];let x=0;if(d>1)for(;x<e.length-2&&!(p<e[x+1]);x++);const b=Ml(e[x],e[x+1],p);return c[x](b)};return n?p=>f(Oa(e[0],e[s-1],p)):f}function Z9(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const o=Ml(0,t,i);e.push(Rt(n,1,o))}}function J9(e){const t=[0];return Z9(t,e.length-1),t}function eP(e,t){return e.map(n=>n*t)}function tP(e,t){return e.map(()=>t||mk).splice(0,e.length-1)}function El({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const o=u9(i)?i.map(Zv):Zv(i),s={done:!1,value:t[0]},l=eP(n&&n.length===t.length?n:J9(t),e),c=W9(l,t,{ease:Array.isArray(o)?o:tP(t,o)});return{calculatedDuration:e,next:d=>(s.value=c(d),s.done=d>=e,s)}}const nP=e=>e!==null;function Od(e,{repeat:t,repeatType:n="loop"},i,o=1){const s=e.filter(nP),c=o<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!c||i===void 0?s[c]:i}const aP={decay:P0,inertia:P0,tween:El,keyframes:El,spring:od};function Ck(e){typeof e.type=="string"&&(e.type=aP[e.type])}class Wp{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 iP=e=>e/100;class ld extends Wp{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 i,o;const{motionValue:n}=this.options;n&&n.updatedAt!==Tn.now()&&this.tick(Tn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(o=(i=this.options).onStop)==null||o.call(i))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Ck(t);const{type:n=El,repeat:i=0,repeatDelay:o=0,repeatType:s,velocity:l=0}=t;let{keyframes:c}=t;const d=n||El;d!==El&&typeof c[0]!="number"&&(this.mixKeyframes=Gl(iP,kk(c[0],c[1])),c=[0,100]);const f=d({...t,keyframes:c});s==="mirror"&&(this.mirroredGenerator=d({...t,keyframes:[...c].reverse(),velocity:-l})),f.calculatedDuration===null&&(f.calculatedDuration=Qp(f));const{calculatedDuration:p}=f;this.calculatedDuration=p,this.resolvedDuration=p+o,this.totalDuration=this.resolvedDuration*(i+1)-o,this.generator=f}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:i,totalDuration:o,mixKeyframes:s,mirroredGenerator:l,resolvedDuration:c,calculatedDuration:d}=this;if(this.startTime===null)return i.next(0);const{delay:f=0,keyframes:p,repeat:x,repeatType:b,repeatDelay:g,type:y,onUpdate:E,finalKeyframe:T}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const w=this.currentTime-f*(this.playbackSpeed>=0?1:-1),M=this.playbackSpeed>=0?w<0:w>o;this.currentTime=Math.max(w,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let _=this.currentTime,L=i;if(x){const N=Math.min(this.currentTime,o)/c;let I=Math.floor(N),D=N%1;!D&&N>=1&&(D=1),D===1&&I--,I=Math.min(I,x+1),!!(I%2)&&(b==="reverse"?(D=1-D,g&&(D-=g/c)):b==="mirror"&&(L=l)),_=Oa(0,1,D)*c}let A;M?(this.delayState.value=p[0],A=this.delayState):A=L.next(_),s&&!M&&(A.value=s(A.value));let{done:R}=A;!M&&d!==null&&(R=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const j=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&R);return j&&y!==P0&&(A.value=Od(p,this.options,T,this.speed)),E&&E(A.value),j&&this.finish(),A}then(t,n){return this.finished.then(t,n)}get duration(){return ra(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ra(t)}get time(){return ra(this.currentTime)}set time(t){t=Yn(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 Ak(i=>this.generator.next(i).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(Tn.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=ra(this.currentTime))}play(){var o,s;if(this.isStopped)return;const{driver:t=H9,startTime:n}=this.options;this.driver||(this.driver=t(l=>this.tick(l))),(s=(o=this.options).onPlay)==null||s.call(o);const i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=n??i),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(Tn.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 rP(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Cr=e=>e*180/Math.PI,B0=e=>{const t=Cr(Math.atan2(e[1],e[0]));return z0(t)},sP={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:B0,rotateZ:B0,skewX:e=>Cr(Math.atan(e[1])),skewY:e=>Cr(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},z0=e=>(e=e%360,e<0&&(e+=360),e),r2=B0,s2=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),o2=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),oP={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:s2,scaleY:o2,scale:e=>(s2(e)+o2(e))/2,rotateX:e=>z0(Cr(Math.atan2(e[6],e[5]))),rotateY:e=>z0(Cr(Math.atan2(-e[2],e[0]))),rotateZ:r2,rotate:r2,skewX:e=>Cr(Math.atan(e[4])),skewY:e=>Cr(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function U0(e){return e.includes("scale")?1:0}function H0(e,t){if(!e||e==="none")return U0(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,o;if(n)i=oP,o=n;else{const c=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=sP,o=c}if(!o)return U0(t);const s=i[t],l=o[1].split(",").map(uP);return typeof s=="function"?s(l):l[s]}const lP=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return H0(n,t)};function uP(e){return parseFloat(e.trim())}const $s=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Qs=new Set([...$s,"pathRotation"]),l2=e=>e===Ks||e===Be,cP=new Set(["x","y","z"]),dP=$s.filter(e=>!cP.has(e));function fP(e){const t=[];return dP.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}const Fi={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:i})=>{const o=e.max-e.min;return i==="border-box"?o:o-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:i})=>{const o=e.max-e.min;return i==="border-box"?o:o-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})=>H0(t,"x"),y:(e,{transform:t})=>H0(t,"y")};Fi.translateX=Fi.x;Fi.translateY=Fi.y;const Lr=new Set;let F0=!1,V0=!1,q0=!1;function Nk(){if(V0){const e=Array.from(Lr).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),n=new Map;t.forEach(i=>{const o=fP(i);o.length&&(n.set(i,o),i.render())}),e.forEach(i=>i.measureInitialState()),t.forEach(i=>{i.render();const o=n.get(i);o&&o.forEach(([s,l])=>{var c;(c=i.getValue(s))==null||c.set(l)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}V0=!1,F0=!1,Lr.forEach(e=>e.complete(q0)),Lr.clear()}function _k(){Lr.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(V0=!0)})}function hP(){q0=!0,_k(),Nk(),q0=!1}class Zp{constructor(t,n,i,o,s,l=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=i,this.motionValue=o,this.element=s,this.isAsync=l}scheduleResolve(){this.state="scheduled",this.isAsync?(Lr.add(this),F0||(F0=!0,Dt.read(_k),Dt.resolveKeyframes(Nk))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:i,motionValue:o}=this;if(t[0]===null){const s=o==null?void 0:o.get(),l=t[t.length-1];if(s!==void 0)t[0]=s;else if(i&&n){const c=i.readValue(n,l);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=l),o&&s===void 0&&o.set(t[0])}rP(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Lr.delete(this)}cancel(){this.state==="scheduled"&&(Lr.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const mP=e=>e.startsWith("--");function Mk(e,t,n){mP(t)?e.style.setProperty(t,n):e.style[t]=n}const pP={};function Rk(e,t){const n=ik(e);return()=>pP[t]??n()}const gP=Rk(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Dk=Rk(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ol=([e,t,n,i])=>`cubic-bezier(${e}, ${t}, ${n}, ${i})`,u2={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ol([0,.65,.55,1]),circOut:ol([.55,0,1,.45]),backIn:ol([.31,.01,.66,-.59]),backOut:ol([.33,1.53,.69,.99])};function Lk(e,t){if(e)return typeof e=="function"?Dk()?wk(e,t):"ease-out":pk(e)?ol(e):Array.isArray(e)?e.map(n=>Lk(n,t)||u2.easeOut):u2[e]}function xP(e,t,n,{delay:i=0,duration:o=300,repeat:s=0,repeatType:l="loop",ease:c="easeOut",times:d}={},f=void 0){const p={[t]:n};d&&(p.offset=d);const x=Lk(c,o);Array.isArray(x)&&(p.easing=x);const b={delay:i,duration:o,easing:Array.isArray(x)?"linear":x,fill:"both",iterations:s+1,direction:l==="reverse"?"alternate":"normal"};return f&&(b.pseudoElement=f),e.animate(p,b)}function Ok(e){return typeof e=="function"&&"applyToOptions"in e}function bP({type:e,...t}){return Ok(e)&&Dk()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Ik extends Wp{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:i,keyframes:o,pseudoElement:s,allowFlatten:l=!1,finalKeyframe:c,onComplete:d}=t;this.isPseudoElement=!!s,this.allowFlatten=l,this.options=t,Ld(typeof t.type!="string");const f=bP(t);this.animation=xP(n,i,o,f,s),f.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const p=Od(o,this.options,c,this.speed);this.updateMotionValue&&this.updateMotionValue(p),Mk(n,i,p),this.animation.cancel()}d==null||d(),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,i,o;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((o=(i=this.animation).commitStyles)==null||o.call(i))}get duration(){var n,i;const t=((i=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:i.call(n).duration)||0;return ra(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ra(t)}get time(){return ra(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Yn(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:i,observe:o}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&gP()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),i&&(this.animation.rangeEnd=i),sa):o(this)}}const jk={anticipate:dk,backInOut:ck,circInOut:hk};function yP(e){return e in jk}function vP(e){typeof e.ease=="string"&&yP(e.ease)&&(e.ease=jk[e.ease])}const Qm=10;class EP extends Ik{constructor(t){vP(t),Ck(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:i,onComplete:o,element:s,...l}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const c=new ld({...l,autoplay:!1}),d=Math.max(Qm,Tn.now()-this.startTime),f=Oa(0,Qm,d-Qm),p=c.sample(d).value,{name:x}=this.options;s&&x&&Mk(s,x,p),n.setWithVelocity(c.sample(Math.max(0,d-f)).value,p,f),c.stop()}}const c2=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ba.test(e)||e==="0")&&!e.startsWith("url("));function TP(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 SP(e,t,n,i){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],l=c2(o,t),c=c2(s,t);return!l||!c?!1:TP(e)||(n==="spring"||Ok(n))&&i}function Y0(e){e.duration=0,e.type="keyframes"}const Pk=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),kP=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function wP(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&kP.test(e[t]))return!0;return!1}const AP=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),CP=ik(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function NP(e){var x;const{motionValue:t,name:n,repeatDelay:i,repeatType:o,damping:s,type:l,keyframes:c}=e,d=(x=t==null?void 0:t.owner)==null?void 0:x.current;if(!(d instanceof HTMLElement)&&!(d instanceof SVGElement))return!1;const{onUpdate:f,transformTemplate:p}=t.owner.getProps();return CP()&&n&&(Pk.has(n)||AP.has(n)&&wP(c))&&(n!=="transform"||!p)&&!f&&!i&&o!=="mirror"&&s!==0&&l!=="inertia"}const _P=40;class MP extends Wp{constructor({autoplay:t=!0,delay:n=0,type:i="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:l="loop",keyframes:c,name:d,motionValue:f,element:p,...x}){var y;super(),this.stop=()=>{var E,T;this._animation&&(this._animation.stop(),(E=this.stopTimeline)==null||E.call(this)),(T=this.keyframeResolver)==null||T.cancel()},this.createdAt=Tn.now();const b={autoplay:t,delay:n,type:i,repeat:o,repeatDelay:s,repeatType:l,name:d,motionValue:f,element:p,...x},g=(p==null?void 0:p.KeyframeResolver)||Zp;this.keyframeResolver=new g(c,(E,T,w)=>this.onKeyframesResolved(E,T,b,!w),d,f,p),(y=this.keyframeResolver)==null||y.scheduleResolve()}onKeyframesResolved(t,n,i,o){var w,M;this.keyframeResolver=void 0;const{name:s,type:l,velocity:c,delay:d,isHandoff:f,onUpdate:p}=i;this.resolvedAt=Tn.now();let x=!0;SP(t,s,l,c)||(x=!1,(Vi.instantAnimations||!d)&&(p==null||p(Od(t,i,n))),t[0]=t[t.length-1],Y0(i),i.repeat=0);const g={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>_P?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:t},y=x&&!f&&NP(g),E=(M=(w=g.motionValue)==null?void 0:w.owner)==null?void 0:M.current;let T;if(y)try{T=new EP({...g,element:E})}catch{T=new ld(g)}else T=new ld(g);T.finished.then(()=>{this.notifyFinished()}).catch(sa),this.pendingTimeline&&(this.stopTimeline=T.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=T}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(),hP()),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 Bk(e,t,n,i=0,o=1){const s=Array.from(e).sort((f,p)=>f.sortNodePosition(p)).indexOf(t),l=e.size,c=(l-1)*i;return typeof n=="function"?n(s,l):o===1?s*i:c-s*i}const d2=30,RP=e=>!isNaN(parseFloat(e));class DP{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{var s;const o=Tn.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const l of this.dependents)l.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Tn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=RP(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 Vp);const i=this.events[t].add(n);return t==="change"?()=>{i(),Dt.read(()=>{this.events.change.getSize()||this.stop()})}:i}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,i){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}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=Tn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>d2)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,d2);return rk(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 Hs(e,t){return new DP(e,t)}function zk(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...i}=e;return{...t,...i}}return e}function Jp(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?zk(n,e):n}const LP={type:"spring",stiffness:500,damping:25,restSpeed:10},OP=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),IP={type:"keyframes",duration:.8},jP={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},PP=(e,{keyframes:t})=>t.length>2?IP:Qs.has(e)?e.startsWith("scale")?OP(t[1]):LP:jP,BP=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function zP(e){for(const t in e)if(!BP.has(t))return!0;return!1}const eg=(e,t,n,i={},o,s)=>l=>{const c=Jp(i,e)||{},d=c.delay||i.delay||0;let{elapsed:f=0}=i;f=f-Yn(d);const p={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...c,delay:-f,onUpdate:b=>{t.set(b),c.onUpdate&&c.onUpdate(b)},onComplete:()=>{l(),c.onComplete&&c.onComplete()},name:e,motionValue:t,element:s?void 0:o};zP(c)||Object.assign(p,PP(e,p)),p.duration&&(p.duration=Yn(p.duration)),p.repeatDelay&&(p.repeatDelay=Yn(p.repeatDelay)),p.from!==void 0&&(p.keyframes[0]=p.from);let x=!1;if((p.type===!1||p.duration===0&&!p.repeatDelay)&&(Y0(p),p.delay===0&&(x=!0)),(Vi.instantAnimations||Vi.skipAnimations||o!=null&&o.shouldSkipAnimations||c.skipAnimations)&&(x=!0,Y0(p),p.delay=0),p.allowFlatten=!c.type&&!c.ease,x&&!s&&t.get()!==void 0){const b=Od(p.keyframes,c);if(b!==void 0){Dt.update(()=>{p.onUpdate(b),p.onComplete()});return}}return c.isSync?new ld(p):new MP(p)},UP=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function HP(e){const t=UP.exec(e);if(!t)return[,];const[,n,i,o]=t;return[`--${n??i}`,o]}function Uk(e,t,n=1){const[i,o]=HP(e);if(!i)return;const s=window.getComputedStyle(t).getPropertyValue(i);if(s){const l=s.trim();return tk(l)?parseFloat(l):l}return Gp(o)?Uk(o,t,n+1):o}function f2(e){const t=[{},{}];return e==null||e.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function tg(e,t,n,i){if(typeof t=="function"){const[o,s]=f2(i);t=t(n!==void 0?n:e.custom,o,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,s]=f2(i);t=t(n!==void 0?n:e.custom,o,s)}return t}function Or(e,t,n){const i=e.getProps();return tg(i,t,n!==void 0?n:i.custom,e)}const Hk=new Set(["width","height","top","left","right","bottom",...$s]),G0=e=>Array.isArray(e);function FP(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Hs(n))}function VP(e){return G0(e)?e[e.length-1]||0:e}function qP(e,t){const n=Or(e,t);let{transitionEnd:i={},transition:o={},...s}=n||{};s={...s,...i};for(const l in s){const c=VP(s[l]);FP(e,l,c)}}const mn=e=>!!(e&&e.getVelocity);function YP(e){return!!(mn(e)&&e.add)}function X0(e,t){const n=e.getValue("willChange");if(YP(n))return n.add(t);if(!n&&Vi.WillChange){const i=new Vi.WillChange("auto");e.addValue("willChange",i),i.add(t)}}function ng(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const GP="framerAppearId",Fk="data-"+ng(GP);function Vk(e){return e.props[Fk]}function XP({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function qk(e,t,{delay:n=0,transitionOverride:i,type:o}={}){let{transition:s,transitionEnd:l,...c}=t;const d=e.getDefaultTransition();s=s?zk(s,d):d;const f=s==null?void 0:s.reduceMotion,p=s==null?void 0:s.skipAnimations;i&&(s=i);const x=[],b=o&&e.animationState&&e.animationState.getState()[o],g=s==null?void 0:s.path;g&&g.animateVisualElement(e,c,s,n,x);for(const y in c){const E=e.getValue(y,e.latestValues[y]??null),T=c[y];if(T===void 0||b&&XP(b,y))continue;const w={delay:n,...Jp(s||{},y)};p&&(w.skipAnimations=!0);const M=E.get();if(M!==void 0&&!E.isAnimating()&&!Array.isArray(T)&&T===M&&!w.velocity){Dt.update(()=>E.set(T));continue}let _=!1;if(window.MotionHandoffAnimation){const R=Vk(e);if(R){const j=window.MotionHandoffAnimation(R,y,Dt);j!==null&&(w.startTime=j,_=!0)}}X0(e,y);const L=f??e.shouldReduceMotion;E.start(eg(y,E,T,L&&Hk.has(y)?{type:!1}:w,e,_));const A=E.animation;A&&x.push(A)}if(l){const y=()=>Dt.update(()=>{l&&qP(e,l)});x.length?Promise.all(x).then(y):y()}return x}function K0(e,t,n={}){var d;const i=Or(e,t,n.type==="exit"?(d=e.presenceContext)==null?void 0:d.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const s=i?()=>Promise.all(qk(e,i,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(f=0)=>{const{delayChildren:p=0,staggerChildren:x,staggerDirection:b}=o;return KP(e,t,f,p,x,b,n)}:()=>Promise.resolve(),{when:c}=o;if(c){const[f,p]=c==="beforeChildren"?[s,l]:[l,s];return f().then(()=>p())}else return Promise.all([s(),l(n.delay)])}function KP(e,t,n=0,i=0,o=0,s=1,l){const c=[];for(const d of e.variantChildren)d.notify("AnimationStart",t),c.push(K0(d,t,{...l,delay:n+(typeof i=="function"?0:i)+Bk(e.variantChildren,d,i,o,s)}).then(()=>d.notify("AnimationComplete",t)));return Promise.all(c)}function $P(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const o=t.map(s=>K0(e,s,n));i=Promise.all(o)}else if(typeof t=="string")i=K0(e,t,n);else{const o=typeof t=="function"?Or(e,t,n.custom):t;i=Promise.all(qk(e,o,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}const QP={test:e=>e==="auto",parse:e=>e},Yk=e=>t=>t.test(e),Gk=[Ks,Be,Da,ii,T9,E9,QP],h2=e=>Gk.find(Yk(e));function WP(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||ak(e):!0}const ZP=new Set(["brightness","contrast","saturate","opacity"]);function JP(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(Xp)||[];if(!i)return e;const o=n.replace(i,"");let s=ZP.has(t)?1:0;return i!==n&&(s*=100),t+"("+s+o+")"}const e7=/\b([a-z-]*)\(.*?\)/gu,$0={...ba,getAnimatableNone:e=>{const t=e.match(e7);return t?t.map(JP).join(" "):e}},Q0={...ba,getAnimatableNone:e=>{const t=ba.parse(e);return ba.createTransformer(e)(t.map(i=>typeof i=="number"?0:typeof i=="object"?{...i,alpha:1}:i))}},m2={...Ks,transform:Math.round},t7={rotate:ii,pathRotation:ii,rotateX:ii,rotateY:ii,rotateZ:ii,scale:Cc,scaleX:Cc,scaleY:Cc,scaleZ:Cc,skew:ii,skewX:ii,skewY:ii,distance:Be,translateX:Be,translateY:Be,translateZ:Be,x:Be,y:Be,z:Be,perspective:Be,transformPerspective:Be,opacity:Rl,originX:e2,originY:e2,originZ:Be},ud={borderWidth:Be,borderTopWidth:Be,borderRightWidth:Be,borderBottomWidth:Be,borderLeftWidth:Be,borderRadius:Be,borderTopLeftRadius:Be,borderTopRightRadius:Be,borderBottomRightRadius:Be,borderBottomLeftRadius:Be,width:Be,maxWidth:Be,height:Be,maxHeight:Be,top:Be,right:Be,bottom:Be,left:Be,inset:Be,insetBlock:Be,insetBlockStart:Be,insetBlockEnd:Be,insetInline:Be,insetInlineStart:Be,insetInlineEnd:Be,padding:Be,paddingTop:Be,paddingRight:Be,paddingBottom:Be,paddingLeft:Be,paddingBlock:Be,paddingBlockStart:Be,paddingBlockEnd:Be,paddingInline:Be,paddingInlineStart:Be,paddingInlineEnd:Be,margin:Be,marginTop:Be,marginRight:Be,marginBottom:Be,marginLeft:Be,marginBlock:Be,marginBlockStart:Be,marginBlockEnd:Be,marginInline:Be,marginInlineStart:Be,marginInlineEnd:Be,fontSize:Be,backgroundPositionX:Be,backgroundPositionY:Be,...t7,zIndex:m2,fillOpacity:Rl,strokeOpacity:Rl,numOctaves:m2},n7={...ud,color:tn,backgroundColor:tn,outlineColor:tn,fill:tn,stroke:tn,borderColor:tn,borderTopColor:tn,borderRightColor:tn,borderBottomColor:tn,borderLeftColor:tn,filter:$0,WebkitFilter:$0,mask:Q0,WebkitMask:Q0},Xk=e=>n7[e],a7=new Set([$0,Q0]);function Kk(e,t){let n=Xk(e);return a7.has(n)||(n=ba),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const i7=new Set(["auto","none","0"]);function r7(e,t,n){let i=0,o;for(;i<e.length&&!o;){const s=e[i];typeof s=="string"&&!i7.has(s)&&Us(s).values.length&&(o=e[i]),i++}if(o&&n)for(const s of t)e[s]=Kk(n,o)}class s7 extends Zp{constructor(t,n,i,o,s){super(t,n,i,o,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:i}=this;if(!n||!n.current)return;super.readKeyframes();for(let p=0;p<t.length;p++){let x=t[p];if(typeof x=="string"&&(x=x.trim(),Gp(x))){const b=Uk(x,n.current);b!==void 0&&(t[p]=b),p===t.length-1&&(this.finalKeyframe=x)}}if(this.resolveNoneKeyframes(),!Hk.has(i)||t.length!==2)return;const[o,s]=t,l=h2(o),c=h2(s),d=Jv(o),f=Jv(s);if(d!==f&&Fi[i]){this.needsMeasurement=!0;return}if(l!==c)if(l2(l)&&l2(c))for(let p=0;p<t.length;p++){const x=t[p];typeof x=="string"&&(t[p]=parseFloat(x))}else Fi[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,i=[];for(let o=0;o<t.length;o++)(t[o]===null||WP(t[o]))&&i.push(o);i.length&&r7(t,i,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:i}=this;if(!t||!t.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Fi[i](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(i,o).jump(o,!1)}measureEndState(){var c;const{element:t,name:n,unresolvedKeyframes:i}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const s=i.length-1,l=i[s];i[s]=Fi[n](t.measureViewportBox(),window.getComputedStyle(t.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),(c=this.removedTransforms)!=null&&c.length&&this.removedTransforms.forEach(([d,f])=>{t.getValue(d).set(f)}),this.resolveNoneKeyframes()}}const ag=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function $k(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let i=document;const o=(n==null?void 0:n[e])??i.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e).filter(i=>i!=null)}const W0=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Pc(e){return nk(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:ig}=gk(queueMicrotask,!1),ma={x:!1,y:!1};function Qk(){return ma.x||ma.y}function o7(e){return e==="x"||e==="y"?ma[e]?null:(ma[e]=!0,()=>{ma[e]=!1}):ma.x||ma.y?null:(ma.x=ma.y=!0,()=>{ma.x=ma.y=!1})}function Wk(e,t){const n=$k(e),i=new AbortController,o={passive:!0,...t,signal:i.signal};return[n,o,()=>i.abort()]}function l7(e){return!(e.pointerType==="touch"||Qk())}function u7(e,t,n={}){const[i,o,s]=Wk(e,n);return i.forEach(l=>{let c=!1,d=!1,f;const p=()=>{l.removeEventListener("pointerleave",y)},x=T=>{f&&(f(T),f=void 0),p()},b=T=>{c=!1,window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",b),d&&(d=!1,x(T))},g=()=>{c=!0,window.addEventListener("pointerup",b,o),window.addEventListener("pointercancel",b,o)},y=T=>{if(T.pointerType!=="touch"){if(c){d=!0;return}x(T)}},E=T=>{if(!l7(T))return;d=!1;const w=t(l,T);typeof w=="function"&&(f=w,l.addEventListener("pointerleave",y,o))};l.addEventListener("pointerenter",E,o),l.addEventListener("pointerdown",g,o)}),s}const Zk=(e,t)=>t?e===t?!0:Zk(e,t.parentElement):!1,rg=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,c7=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function d7(e){return c7.has(e.tagName)||e.isContentEditable===!0}const f7=new Set(["INPUT","SELECT","TEXTAREA"]);function h7(e){return f7.has(e.tagName)||e.isContentEditable===!0}const Bc=new WeakSet;function p2(e){return t=>{t.key==="Enter"&&e(t)}}function Wm(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const m7=(e,t)=>{const n=e.currentTarget;if(!n)return;const i=p2(()=>{if(Bc.has(n))return;Wm(n,"down");const o=p2(()=>{Wm(n,"up")}),s=()=>Wm(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",i,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),t)};function g2(e){return rg(e)&&!Qk()}const x2=new WeakSet;function p7(e,t,n={}){const[i,o,s]=Wk(e,n),l=c=>{const d=c.currentTarget;if(!g2(c)||x2.has(c))return;Bc.add(d),n.stopPropagation&&x2.add(c);const f=t(d,c),p={...o,capture:!0},x=(y,E)=>{window.removeEventListener("pointerup",b,p),window.removeEventListener("pointercancel",g,p),Bc.has(d)&&Bc.delete(d),g2(y)&&typeof f=="function"&&f(y,{success:E})},b=y=>{x(y,d===window||d===document||n.useGlobalTarget||Zk(d,y.target))},g=y=>{x(y,!1)};window.addEventListener("pointerup",b,p),window.addEventListener("pointercancel",g,p)};return i.forEach(c=>{(n.useGlobalTarget?window:c).addEventListener("pointerdown",l,o),Pc(c)&&(c.addEventListener("focus",f=>m7(f,o)),!d7(c)&&!c.hasAttribute("tabindex")&&(c.tabIndex=0))}),s}function sg(e){return nk(e)&&"ownerSVGElement"in e}const zc=new WeakMap;let zi;const Jk=(e,t,n)=>(i,o)=>o&&o[0]?o[0][e+"Size"]:sg(i)&&"getBBox"in i?i.getBBox()[t]:i[n],g7=Jk("inline","width","offsetWidth"),x7=Jk("block","height","offsetHeight");function b7({target:e,borderBoxSize:t}){var n;(n=zc.get(e))==null||n.forEach(i=>{i(e,{get width(){return g7(e,t)},get height(){return x7(e,t)}})})}function y7(e){e.forEach(b7)}function v7(){typeof ResizeObserver>"u"||(zi=new ResizeObserver(y7))}function E7(e,t){zi||v7();const n=$k(e);return n.forEach(i=>{let o=zc.get(i);o||(o=new Set,zc.set(i,o)),o.add(t),zi==null||zi.observe(i)}),()=>{n.forEach(i=>{const o=zc.get(i);o==null||o.delete(t),o!=null&&o.size||zi==null||zi.unobserve(i)})}}const Uc=new Set;let Ls;function T7(){Ls=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Uc.forEach(t=>t(e))},window.addEventListener("resize",Ls)}function S7(e){return Uc.add(e),Ls||T7(),()=>{Uc.delete(e),!Uc.size&&typeof Ls=="function"&&(window.removeEventListener("resize",Ls),Ls=void 0)}}function b2(e,t){return typeof e=="function"?S7(e):E7(e,t)}function k7(e){return sg(e)&&e.tagName==="svg"}const w7=[...Gk,tn,ba],A7=e=>w7.find(Yk(e)),y2=()=>({translate:0,scale:1,origin:0,originPoint:0}),Os=()=>({x:y2(),y:y2()}),v2=()=>({min:0,max:0}),rn=()=>({x:v2(),y:v2()}),C7=new WeakMap;function Id(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Dl(e){return typeof e=="string"||Array.isArray(e)}const og=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],lg=["initial",...og];function jd(e){return Id(e.animate)||lg.some(t=>Dl(e[t]))}function ew(e){return!!(jd(e)||e.variants)}function N7(e,t,n){for(const i in t){const o=t[i],s=n[i];if(mn(o))e.addValue(i,o);else if(mn(s))e.addValue(i,Hs(o,{owner:e}));else if(s!==o)if(e.hasValue(i)){const l=e.getValue(i);l.liveStyle===!0?l.jump(o):l.hasAnimated||l.set(o)}else{const l=e.getStaticValue(i);e.addValue(i,Hs(l!==void 0?l:o,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const Z0={current:null},tw={current:!1},_7=typeof window<"u";function M7(){if(tw.current=!0,!!_7)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Z0.current=e.matches;e.addEventListener("change",t),t()}else Z0.current=!1}const E2=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let cd={};function nw(e){cd=e}function R7(){return cd}class D7{scrapeMotionValuesFromProps(t,n,i){return{}}constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:o,skipAnimations:s,blockInitialAnimation:l,visualState:c},d={}){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=Zp,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 g=Tn.now();this.renderScheduledAt<g&&(this.renderScheduledAt=g,Dt.render(this.render,!1,!0))};const{latestValues:f,renderState:p}=c;this.latestValues=f,this.baseTarget={...f},this.initialValues=n.initial?{...f}:{},this.renderState=p,this.parent=t,this.props=n,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.skipAnimationsConfig=s,this.options=d,this.blockInitialAnimation=!!l,this.isControllingVariants=jd(n),this.isVariantNode=ew(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:x,...b}=this.scrapeMotionValuesFromProps(n,{},this);for(const g in b){const y=b[g];f[g]!==void 0&&mn(y)&&y.set(f[g])}}mount(t){var n,i;if(this.hasBeenMounted)for(const o in this.initialValues)(n=this.values.get(o))==null||n.jump(this.initialValues[o]),this.latestValues[o]=this.initialValues[o];this.current=t,C7.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((o,s)=>this.bindToMotionValue(s,o)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(tw.current||M7(),this.shouldReduceMotion=Z0.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(i=this.parent)==null||i.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),qi(this.notifyUpdate),qi(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 i=this.features[n];i&&(i.unmount(),i.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&&Pk.has(t)&&this.current instanceof HTMLElement){const{factory:l,keyframes:c,times:d,ease:f,duration:p}=n.accelerate,x=new Ik({element:this.current,name:t,keyframes:c,times:d,ease:f,duration:Yn(p)}),b=l(x);this.valueSubscriptions.set(t,()=>{b(),x.cancel()});return}const i=Qs.has(t);i&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&Dt.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;typeof window<"u"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),s&&s()})}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 cd){const n=cd[t];if(!n)continue;const{isEnabled:i,Feature:o}=n;if(!this.features[t]&&o&&i(this.props)&&(this.features[t]=new o(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):rn()}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 i=0;i<E2.length;i++){const o=E2[i];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s="on"+o,l=t[s];l&&(this.propEventSubscriptions[o]=this.on(o,l))}this.prevMotionValues=N7(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 i=this.values.get(t);n!==i&&(i&&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 i=this.values.get(t);return i===void 0&&n!==void 0&&(i=Hs(n===null?void 0:n,{owner:this}),this.addValue(t,i)),i}readValue(t,n){let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(tk(i)||ak(i))?i=parseFloat(i):!A7(i)&&ba.test(n)&&(i=Kk(t,n)),this.setBaseTarget(t,mn(i)?i.get():i)),mn(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const l=tg(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);l&&(i=l[t])}if(n&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!mn(o)?o:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Vp),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){ig.render(this.render)}}class aw extends D7{constructor(){super(...arguments),this.KeyframeResolver=s7}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const i=t.style;return i?i[n]:void 0}removeValueFromRenderState(t,{vars:n,style:i}){delete n[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;mn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Xi{constructor(t){this.isMounted=!1,this.node=t}update(){}}function iw({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function L7({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function O7(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function Zm(e){return e===void 0||e===1}function J0({scale:e,scaleX:t,scaleY:n}){return!Zm(e)||!Zm(t)||!Zm(n)}function kr(e){return J0(e)||rw(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function rw(e){return T2(e.x)||T2(e.y)}function T2(e){return e&&e!=="0%"}function dd(e,t,n){const i=e-n,o=t*i;return n+o}function S2(e,t,n,i,o){return o!==void 0&&(e=dd(e,o,i)),dd(e,n,i)+t}function ep(e,t=0,n=1,i,o){e.min=S2(e.min,t,n,i,o),e.max=S2(e.max,t,n,i,o)}function sw(e,{x:t,y:n}){ep(e.x,t.translate,t.scale,t.originPoint),ep(e.y,n.translate,n.scale,n.originPoint)}const k2=.999999999999,w2=1.0000000000001;function I7(e,t,n,i=!1){var c;const o=n.length;if(!o)return;t.x=t.y=1;let s,l;for(let d=0;d<o;d++){s=n[d],l=s.projectionDelta;const{visualElement:f}=s.options;f&&f.props.style&&f.props.style.display==="contents"||(i&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(_a(e.x,-s.scroll.offset.x),_a(e.y,-s.scroll.offset.y)),l&&(t.x*=l.x.scale,t.y*=l.y.scale,sw(e,l)),i&&kr(s.latestValues)&&Hc(e,s.latestValues,(c=s.layout)==null?void 0:c.layoutBox))}t.x<w2&&t.x>k2&&(t.x=1),t.y<w2&&t.y>k2&&(t.y=1)}function _a(e,t){e.min+=t,e.max+=t}function A2(e,t,n,i,o=.5){const s=Rt(e.min,e.max,o);ep(e,t,n,s,i)}function C2(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Hc(e,t,n){const i=n??e;A2(e.x,C2(t.x,i.x),t.scaleX,t.scale,t.originX),A2(e.y,C2(t.y,i.y),t.scaleY,t.scale,t.originY)}function ow(e,t){return iw(O7(e.getBoundingClientRect(),t))}function j7(e,t,n){const i=ow(e,n),{scroll:o}=t;return o&&(_a(i.x,o.offset.x),_a(i.y,o.offset.y)),i}const P7={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},B7=$s.length;function z7(e,t,n){let i="",o=!0;for(let l=0;l<B7;l++){const c=$s[l],d=e[c];if(d===void 0)continue;let f=!0;if(typeof d=="number")f=d===(c.startsWith("scale")?1:0);else{const p=parseFloat(d);f=c.startsWith("scale")?p===1:p===0}if(!f||n){const p=W0(d,ud[c]);if(!f){o=!1;const x=P7[c]||c;i+=`${x}(${p}) `}n&&(t[c]=p)}}const s=e.pathRotation;return s&&(o=!1,i+=`rotate(${W0(s,ud.pathRotation)}) `),i=i.trim(),n?i=n(t,o?"":i):o&&(i="none"),i}function ug(e,t,n){const{style:i,vars:o,transformOrigin:s}=e;let l=!1,c=!1;for(const d in t){const f=t[d];if(Qs.has(d)){l=!0;continue}else if(bk(d)){o[d]=f;continue}else{const p=W0(f,ud[d]);d.startsWith("origin")?(c=!0,s[d]=p):i[d]=p}}if(t.transform||(l||n?i.transform=z7(t,e.transform,n):i.transform&&(i.transform="none")),c){const{originX:d="50%",originY:f="50%",originZ:p=0}=s;i.transformOrigin=`${d} ${f} ${p}`}}function lw(e,{style:t,vars:n},i,o){const s=e.style;let l;for(l in t)s[l]=t[l];o==null||o.applyProjectionStyles(s,i);for(l in n)s.setProperty(l,n[l])}function N2(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const nl={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Be.test(e))e=parseFloat(e);else return e;const n=N2(e,t.target.x),i=N2(e,t.target.y);return`${n}% ${i}%`}},U7={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,o=ba.parse(e);if(o.length>5)return i;const s=ba.createTransformer(e),l=typeof o[0]!="number"?1:0,c=n.x.scale*t.x,d=n.y.scale*t.y;o[0+l]/=c,o[1+l]/=d;const f=Rt(c,d,.5);return typeof o[2+l]=="number"&&(o[2+l]/=f),typeof o[3+l]=="number"&&(o[3+l]/=f),s(o)}},tp={borderRadius:{...nl,applyTo:[...ag]},borderTopLeftRadius:nl,borderTopRightRadius:nl,borderBottomLeftRadius:nl,borderBottomRightRadius:nl,boxShadow:U7};function uw(e,{layout:t,layoutId:n}){return Qs.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!tp[e]||e==="opacity")}function cg(e,t,n){var l;const i=e.style,o=t==null?void 0:t.style,s={};if(!i)return s;for(const c in i)(mn(i[c])||o&&mn(o[c])||uw(c,e)||((l=n==null?void 0:n.getValue(c))==null?void 0:l.liveStyle)!==void 0)&&(s[c]=i[c]);return s}function H7(e){return window.getComputedStyle(e)}class F7 extends aw{constructor(){super(...arguments),this.type="html",this.renderInstance=lw}mount(t){Ld(!!t.style),super.mount(t)}readValueFromInstance(t,n){var i;if(Qs.has(n))return(i=this.projection)!=null&&i.isProjecting?U0(n):lP(t,n);{const o=H7(t),s=(bk(n)?o.getPropertyValue(n):o[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return ow(t,n)}build(t,n,i){ug(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return cg(t,n,i)}}const V7={offset:"stroke-dashoffset",array:"stroke-dasharray"},q7={offset:"strokeDashoffset",array:"strokeDasharray"};function Y7(e,t,n=1,i=0,o=!0){e.pathLength=1;const s=o?V7:q7;e[s.offset]=`${-i}`,e[s.array]=`${t} ${n}`}const cw=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function dw(e,{attrX:t,attrY:n,attrScale:i,pathLength:o,pathSpacing:s=1,pathOffset:l=0,...c},d,f,p){if(ug(e,c,f),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:x,style:b}=e;for(const g of cw)x[g]!==void 0&&(b[g]=x[g],delete x[g]);(b.transform||x.transformOrigin)&&(b.transformOrigin=x.transformOrigin??"50% 50%",delete x.transformOrigin),b.transform&&(b.transformBox=(p==null?void 0:p.transformBox)??"fill-box",delete x.transformBox),t!==void 0&&(x.x=t),n!==void 0&&(x.y=n),i!==void 0&&(x.scale=i),o!==void 0&&Y7(x,o,s,l,!1)}const fw=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"]),hw=e=>typeof e=="string"&&e.toLowerCase()==="svg";function G7(e,t,n,i){lw(e,t,void 0,i);for(const o in t.attrs)e.setAttribute(fw.has(o)?o:ng(o),t.attrs[o])}function mw(e,t,n){const i=cg(e,t,n);for(const o in e)if(mn(e[o])||mn(t[o])){const s=$s.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;i[s]=e[o]}return i}class X7 extends aw{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=rn}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Qs.has(n)){const i=Xk(n);return i&&i.default||0}if(cw.includes(n)){const o=getComputedStyle(t)[n];if(typeof o=="string"&&o)return o.trim()}return n=fw.has(n)?n:ng(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return mw(t,n,i)}build(t,n,i){dw(t,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,n,i,o){G7(t,n,i,o)}mount(t){this.isSVGTag=hw(t.tagName),super.mount(t)}}const K7=lg.length;function pw(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?pw(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<K7;n++){const i=lg[n],o=e.props[i];(Dl(o)||o===!1)&&(t[i]=o)}return t}function gw(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}const $7=[...og].reverse(),Q7=og.length;function W7(e){return t=>Promise.all(t.map(({animation:n,options:i})=>$P(e,n,i)))}function Z7(e){let t=W7(e),n=_2(),i=!0,o=!1;const s=f=>(p,x)=>{var g;const b=Or(e,x,f==="exit"?(g=e.presenceContext)==null?void 0:g.custom:void 0);if(b){const{transition:y,transitionEnd:E,...T}=b;p={...p,...T,...E}}return p};function l(f){t=f(e)}function c(f){const{props:p}=e,x=pw(e.parent)||{},b=[],g=new Set;let y={},E=1/0;for(let w=0;w<Q7;w++){const M=$7[w],_=n[M],L=p[M]!==void 0?p[M]:x[M],A=Dl(L),R=M===f?_.isActive:null;R===!1&&(E=w);let j=L===x[M]&&L!==p[M]&&A;if(j&&(i||o)&&e.manuallyAnimateOnMount&&(j=!1),_.protectedKeys={...y},!_.isActive&&R===null||!L&&!_.prevProp||Id(L)||typeof L=="boolean")continue;if(M==="exit"&&_.isActive&&R!==!0){_.prevResolvedValues&&(y={...y,..._.prevResolvedValues});continue}const N=J7(_.prevProp,L);let I=N||M===f&&_.isActive&&!j&&A||w>E&&A,D=!1;const P=Array.isArray(L)?L:[L];let z=P.reduce(s(M),{});R===!1&&(z={});const{prevResolvedValues:K={}}=_,q={...K,...z},B=Q=>{I=!0,g.has(Q)&&(D=!0,g.delete(Q)),_.needsAnimating[Q]=!0;const re=e.getValue(Q);re&&(re.liveStyle=!1)};for(const Q in q){const re=z[Q],F=K[Q];if(y.hasOwnProperty(Q))continue;let Y=!1;G0(re)&&G0(F)?Y=!gw(re,F)||N:Y=re!==F,Y?re!=null?B(Q):g.add(Q):re!==void 0&&g.has(Q)?B(Q):_.protectedKeys[Q]=!0}_.prevProp=L,_.prevResolvedValues=z,_.isActive&&(y={...y,...z}),(i||o)&&e.blockInitialAnimation&&(I=!1);const H=j&&N;I&&(!H||D)&&b.push(...P.map(Q=>{const re={type:M};if(typeof Q=="string"&&(i||o)&&!H&&e.manuallyAnimateOnMount&&e.parent){const{parent:F}=e,Y=Or(F,Q);if(F.enteringChildren&&Y){const{delayChildren:W}=Y.transition||{};re.delay=Bk(F.enteringChildren,e,W)}}return{animation:Q,options:re}}))}if(g.size){const w={};if(typeof p.initial!="boolean"){const M=Or(e,Array.isArray(p.initial)?p.initial[0]:p.initial);M&&M.transition&&(w.transition=M.transition)}g.forEach(M=>{const _=e.getBaseTarget(M),L=e.getValue(M);L&&(L.liveStyle=!0),w[M]=_??null}),b.push({animation:w})}let T=!!b.length;return i&&(p.initial===!1||p.initial===p.animate)&&!e.manuallyAnimateOnMount&&(T=!1),i=!1,o=!1,T?t(b):Promise.resolve()}function d(f,p){var b;if(n[f].isActive===p)return Promise.resolve();(b=e.variantChildren)==null||b.forEach(g=>{var y;return(y=g.animationState)==null?void 0:y.setActive(f,p)}),n[f].isActive=p;const x=c(f);for(const g in n)n[g].protectedKeys={};return x}return{animateChanges:c,setActive:d,setAnimateFunction:l,getState:()=>n,reset:()=>{n=_2(),o=!0}}}function J7(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!gw(t,e):!1}function vr(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function _2(){return{animate:vr(!0),whileInView:vr(),whileHover:vr(),whileTap:vr(),whileDrag:vr(),whileFocus:vr(),exit:vr()}}function np(e,t){e.min=t.min,e.max=t.max}function ha(e,t){np(e.x,t.x),np(e.y,t.y)}function M2(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const xw=1e-4,eB=1-xw,tB=1+xw,bw=.01,nB=0-bw,aB=0+bw;function Sn(e){return e.max-e.min}function iB(e,t,n){return Math.abs(e-t)<=n}function R2(e,t,n,i=.5){e.origin=i,e.originPoint=Rt(t.min,t.max,e.origin),e.scale=Sn(n)/Sn(t),e.translate=Rt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=eB&&e.scale<=tB||isNaN(e.scale))&&(e.scale=1),(e.translate>=nB&&e.translate<=aB||isNaN(e.translate))&&(e.translate=0)}function Tl(e,t,n,i){R2(e.x,t.x,n.x,i?i.originX:void 0),R2(e.y,t.y,n.y,i?i.originY:void 0)}function D2(e,t,n,i=0){const o=i?Rt(n.min,n.max,i):n.min;e.min=o+t.min,e.max=e.min+Sn(t)}function rB(e,t,n,i){D2(e.x,t.x,n.x,i==null?void 0:i.x),D2(e.y,t.y,n.y,i==null?void 0:i.y)}function L2(e,t,n,i=0){const o=i?Rt(n.min,n.max,i):n.min;e.min=t.min-o,e.max=e.min+Sn(t)}function fd(e,t,n,i){L2(e.x,t.x,n.x,i==null?void 0:i.x),L2(e.y,t.y,n.y,i==null?void 0:i.y)}function O2(e,t,n,i,o){return e-=t,e=dd(e,1/n,i),o!==void 0&&(e=dd(e,1/o,i)),e}function sB(e,t=0,n=1,i=.5,o,s=e,l=e){if(Da.test(t)&&(t=parseFloat(t),t=Rt(l.min,l.max,t/100)-l.min),typeof t!="number")return;let c=Rt(s.min,s.max,i);e===s&&(c-=t),e.min=O2(e.min,t,n,c,o),e.max=O2(e.max,t,n,c,o)}function I2(e,t,[n,i,o],s,l){sB(e,t[n],t[i],t[o],t.scale,s,l)}const oB=["x","scaleX","originX"],lB=["y","scaleY","originY"];function j2(e,t,n,i){I2(e.x,t,oB,n?n.x:void 0,i?i.x:void 0),I2(e.y,t,lB,n?n.y:void 0,i?i.y:void 0)}function P2(e){return e.translate===0&&e.scale===1}function yw(e){return P2(e.x)&&P2(e.y)}function B2(e,t){return e.min===t.min&&e.max===t.max}function uB(e,t){return B2(e.x,t.x)&&B2(e.y,t.y)}function z2(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function vw(e,t){return z2(e.x,t.x)&&z2(e.y,t.y)}function U2(e){return Sn(e.x)/Sn(e.y)}function H2(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Aa(e){return[e("x"),e("y")]}function cB(e,t,n){let i="";const o=e.x.translate/t.x,s=e.y.translate/t.y,l=(n==null?void 0:n.z)||0;if((o||s||l)&&(i=`translate3d(${o}px, ${s}px, ${l}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:f,rotate:p,pathRotation:x,rotateX:b,rotateY:g,skewX:y,skewY:E}=n;f&&(i=`perspective(${f}px) ${i}`),p&&(i+=`rotate(${p}deg) `),x&&(i+=`rotate(${x}deg) `),b&&(i+=`rotateX(${b}deg) `),g&&(i+=`rotateY(${g}deg) `),y&&(i+=`skewX(${y}deg) `),E&&(i+=`skewY(${E}deg) `)}const c=e.x.scale*t.x,d=e.y.scale*t.y;return(c!==1||d!==1)&&(i+=`scale(${c}, ${d})`),i||"none"}const dB=ag.length,F2=e=>typeof e=="string"?parseFloat(e):e,V2=e=>typeof e=="number"||Be.test(e);function fB(e,t,n,i,o,s){o?(e.opacity=Rt(0,n.opacity??1,hB(i)),e.opacityExit=Rt(t.opacity??1,0,mB(i))):s&&(e.opacity=Rt(t.opacity??1,n.opacity??1,i));for(let l=0;l<dB;l++){const c=ag[l];let d=q2(t,c),f=q2(n,c);if(d===void 0&&f===void 0)continue;d||(d=0),f||(f=0),d===0||f===0||V2(d)===V2(f)?(e[c]=Math.max(Rt(F2(d),F2(f),i),0),(Da.test(f)||Da.test(d))&&(e[c]+="%")):e[c]=f}(t.rotate||n.rotate)&&(e.rotate=Rt(t.rotate||0,n.rotate||0,i))}function q2(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const hB=Ew(0,.5,fk),mB=Ew(.5,.95,sa);function Ew(e,t,n){return i=>i<e?0:i>t?1:n(Ml(e,t,i))}function pB(e,t,n){const i=mn(e)?e:Hs(e);return i.start(eg("",i,t,n)),i.animation}function Ll(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}const gB=(e,t)=>e.depth-t.depth;class xB{constructor(){this.children=[],this.isDirty=!1}add(t){Fp(this.children,t),this.isDirty=!0}remove(t){id(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(gB),this.isDirty=!1,this.children.forEach(t)}}function bB(e,t){const n=Tn.now(),i=({timestamp:o})=>{const s=o-n;s>=t&&(qi(i),e(s-t))};return Dt.setup(i,!0),()=>qi(i)}function Fc(e){return mn(e)?e.get():e}class yB{constructor(){this.members=[]}add(t){Fp(this.members,t);for(let n=this.members.length-1;n>=0;n--){const i=this.members[n];if(i===t||i===this.lead||i===this.prevLead)continue;const o=i.instance;(!o||o.isConnected===!1)&&!i.snapshot&&(id(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(id(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 i=this.members.indexOf(t)-1;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1&&((n=o.instance)==null?void 0:n.isConnected)!==!1)return this.promote(o),!0}return!1}promote(t,n){var o;const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.updateSnapshot(),t.scheduleRender();const{layoutDependency:s}=i.options,{layoutDependency:l}=t.options;(s===void 0||s!==l)&&(t.resumeFrom=i,n&&(i.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),(o=t.root)!=null&&o.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,i,o,s,l;(i=(n=t.options).onExitComplete)==null||i.call(n),(l=(o=t.resumingFrom)==null?void 0:(s=o.options).onExitComplete)==null||l.call(s)})}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 Vc={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Jm=["","X","Y","Z"],vB=1e3;let EB=0;function e0(e,t,n,i){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),i&&(i[e]=0))}function Tw(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Vk(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Dt,!(o||s))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&Tw(i)}function Sw({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:o}){return class{constructor(l={},c=t==null?void 0:t()){this.id=EB++,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(kB),this.nodes.forEach(MB),this.nodes.forEach(RB),this.nodes.forEach(wB)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let d=0;d<this.path.length;d++)this.path[d].shouldResetTransform=!0;this.root===this&&(this.nodes=new xB)}addEventListener(l,c){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new Vp),this.eventHandlers.get(l).add(c)}notifyListeners(l,...c){const d=this.eventHandlers.get(l);d&&d.notify(...c)}hasListeners(l){return this.eventHandlers.has(l)}mount(l){if(this.instance)return;this.isSVG=sg(l)&&!k7(l),this.instance=l;const{layoutId:c,layout:d,visualElement:f}=this.options;if(f&&!f.current&&f.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(d||c)&&(this.isLayoutDirty=!0),e){let p,x=0;const b=()=>this.root.updateBlockedByResize=!1;Dt.read(()=>{x=window.innerWidth}),e(l,()=>{const g=window.innerWidth;g!==x&&(x=g,this.root.updateBlockedByResize=!0,p&&p(),p=bB(b,250),Vc.hasAnimatedSinceResize&&(Vc.hasAnimatedSinceResize=!1,this.nodes.forEach(X2)))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&f&&(c||d)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:x,hasRelativeLayoutChanged:b,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||f.getDefaultTransition()||jB,{onLayoutAnimationStart:E,onLayoutAnimationComplete:T}=f.getProps(),w=!this.targetLayout||!vw(this.targetLayout,g),M=!x&&b;if(this.options.layoutRoot||this.resumeFrom||M||x&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const _={...Jp(y,"layout"),onPlay:E,onComplete:T};(f.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_),this.setAnimationOrigin(p,M,_.path)}else x||X2(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),qi(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(DB),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Tw(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let p=0;p<this.path.length;p++){const x=this.path[p];x.shouldResetTransform=!0,(typeof x.latestValues.x=="string"||typeof x.latestValues.y=="string")&&(x.isLayoutDirty=!0),x.updateScroll("snapshot"),x.options.layoutRoot&&x.willUpdate(!1)}const{layoutId:c,layout:d}=this.options;if(c===void 0&&!d)return;const f=this.getTransformTemplate();this.prevTransformTemplateValue=f?f(this.latestValues,""):void 0,this.updateSnapshot(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const d=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),d&&this.nodes.forEach(CB),this.nodes.forEach(Y2);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(G2);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(NB),this.nodes.forEach(_B),this.nodes.forEach(TB),this.nodes.forEach(SB)):this.nodes.forEach(G2),this.clearAllSnapshots();const c=Tn.now();hn.delta=Oa(0,1e3/60,c-hn.timestamp),hn.timestamp=c,hn.isProcessing=!0,Ym.update.process(hn),Ym.preRender.process(hn),Ym.render.process(hn),hn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ig.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(AB),this.sharedNodes.forEach(LB)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Dt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Dt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Sn(this.snapshot.measuredBox.x)&&!Sn(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 d=0;d<this.path.length;d++)this.path[d].updateScroll();const l=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=rn()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:c}=this.options;c&&c.notify("LayoutMeasure",this.layout.layoutBox,l?l.layoutBox:void 0)}updateScroll(l="measure"){let c=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(c=!1),c&&this.instance){const d=i(this.instance);this.scroll={animationId:this.root.animationId,phase:l,isRoot:d,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:d}}}resetTransform(){if(!o)return;const l=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,c=this.projectionDelta&&!yw(this.projectionDelta),d=this.getTransformTemplate(),f=d?d(this.latestValues,""):void 0,p=f!==this.prevTransformTemplateValue;l&&this.instance&&(c||kr(this.latestValues)||p)&&(o(this.instance,f),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const c=this.measurePageBox();let d=this.removeElementScroll(c);return l&&(d=this.removeTransform(d)),PB(d),{animationId:this.root.animationId,measuredBox:c,layoutBox:d,latestValues:{},source:this.id}}measurePageBox(){var f;const{visualElement:l}=this.options;if(!l)return rn();const c=l.measureViewportBox();if(!(((f=this.scroll)==null?void 0:f.wasRoot)||this.path.some(BB))){const{scroll:p}=this.root;p&&(_a(c.x,p.offset.x),_a(c.y,p.offset.y))}return c}removeElementScroll(l){var d;const c=rn();if(ha(c,l),(d=this.scroll)!=null&&d.wasRoot)return c;for(let f=0;f<this.path.length;f++){const p=this.path[f],{scroll:x,options:b}=p;p!==this.root&&x&&b.layoutScroll&&(x.wasRoot&&ha(c,l),_a(c.x,x.offset.x),_a(c.y,x.offset.y))}return c}applyTransform(l,c=!1,d){var p,x;const f=d||rn();ha(f,l);for(let b=0;b<this.path.length;b++){const g=this.path[b];!c&&g.options.layoutScroll&&g.scroll&&g!==g.root&&(_a(f.x,-g.scroll.offset.x),_a(f.y,-g.scroll.offset.y)),kr(g.latestValues)&&Hc(f,g.latestValues,(p=g.layout)==null?void 0:p.layoutBox)}return kr(this.latestValues)&&Hc(f,this.latestValues,(x=this.layout)==null?void 0:x.layoutBox),f}removeTransform(l){var d;const c=rn();ha(c,l);for(let f=0;f<this.path.length;f++){const p=this.path[f];if(!kr(p.latestValues))continue;let x;p.instance&&(J0(p.latestValues)&&p.updateSnapshot(),x=rn(),ha(x,p.measurePageBox())),j2(c,p.latestValues,(d=p.snapshot)==null?void 0:d.layoutBox,x)}return kr(this.latestValues)&&j2(c,this.latestValues),c}setTargetDelta(l){this.targetDelta=l,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(l){this.options={...this.options,...l,crossfade:l.crossfade!==void 0?l.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!==hn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){var g;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const d=!!this.resumingFrom||this!==c;if(!(l||d&&this.isSharedProjectionDirty||this.isProjectionDirty||(g=this.parent)!=null&&g.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:p,layoutId:x}=this.options;if(!this.layout||!(p||x))return;this.resolvedRelativeTargetAt=hn.timestamp;const b=this.getClosestProjectingParent();b&&this.linkedParentVersion!==b.layoutVersion&&!b.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&b&&b.layout?this.createRelativeTarget(b,this.layout.layoutBox,b.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=rn(),this.targetWithTransforms=rn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),rB(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):ha(this.target,this.layout.layoutBox),sw(this.target,this.targetDelta)):ha(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&b&&!!b.resumingFrom==!!this.resumingFrom&&!b.options.layoutScroll&&b.target&&this.animationProgress!==1?this.createRelativeTarget(b,this.target,b.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||J0(this.parent.latestValues)||rw(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(l,c,d){this.relativeParent=l,this.linkedParentVersion=l.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=rn(),this.relativeTargetOrigin=rn(),fd(this.relativeTargetOrigin,c,d,this.options.layoutAnchor||void 0),ha(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var y;const l=this.getLead(),c=!!this.resumingFrom||this!==l;let d=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&(d=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(d=!1),this.resolvedRelativeTargetAt===hn.timestamp&&(d=!1),d)return;const{layout:f,layoutId:p}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(f||p))return;ha(this.layoutCorrected,this.layout.layoutBox);const x=this.treeScale.x,b=this.treeScale.y;I7(this.layoutCorrected,this.treeScale,this.path,c),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=rn());const{target:g}=l;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(M2(this.prevProjectionDelta.x,this.projectionDelta.x),M2(this.prevProjectionDelta.y,this.projectionDelta.y)),Tl(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==x||this.treeScale.y!==b||!H2(this.projectionDelta.x,this.prevProjectionDelta.x)||!H2(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",g))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){var c;if((c=this.options.visualElement)==null||c.scheduleRender(),l){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Os(),this.projectionDelta=Os(),this.projectionDeltaWithTransform=Os()}setAnimationOrigin(l,c=!1,d){const f=this.snapshot,p=f?f.latestValues:{},x={...this.latestValues},b=Os();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const g=rn(),y=f?f.source:void 0,E=this.layout?this.layout.source:void 0,T=y!==E,w=this.getStack(),M=!w||w.members.length<=1,_=!!(T&&!M&&this.options.crossfade===!0&&!this.path.some(IB));this.animationProgress=0;let L;const A=d==null?void 0:d.interpolateProjection(l);this.mixTargetDelta=R=>{const j=R/1e3,N=A==null?void 0:A(j);N?(b.x.translate=N.x,b.x.scale=Rt(l.x.scale,1,j),b.x.origin=l.x.origin,b.x.originPoint=l.x.originPoint,b.y.translate=N.y,b.y.scale=Rt(l.y.scale,1,j),b.y.origin=l.y.origin,b.y.originPoint=l.y.originPoint):(K2(b.x,l.x,j),K2(b.y,l.y,j)),this.setTargetDelta(b),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(fd(g,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),OB(this.relativeTarget,this.relativeTargetOrigin,g,j),L&&uB(this.relativeTarget,L)&&(this.isProjectionDirty=!1),L||(L=rn()),ha(L,this.relativeTarget)),T&&(this.animationValues=x,fB(x,p,this.latestValues,j,_,M)),N&&N.rotate!==void 0&&(this.animationValues||(this.animationValues=x),this.animationValues.pathRotation=N.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=j},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){var c,d,f;this.notifyListeners("animationStart"),(c=this.currentAnimation)==null||c.stop(),(f=(d=this.resumingFrom)==null?void 0:d.currentAnimation)==null||f.stop(),this.pendingAnimation&&(qi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Dt.update(()=>{Vc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Hs(0)),this.motionValue.jump(0,!1),this.currentAnimation=pB(this.motionValue,[0,1e3],{...l,velocity:0,isSync:!0,onUpdate:p=>{this.mixTargetDelta(p),l.onUpdate&&l.onUpdate(p)},onComplete:()=>{l.onComplete&&l.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 l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(vB),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:c,target:d,layout:f,latestValues:p}=l;if(!(!c||!d||!f)){if(this!==l&&this.layout&&f&&kw(this.options.animationType,this.layout.layoutBox,f.layoutBox)){d=this.target||rn();const x=Sn(this.layout.layoutBox.x);d.x.min=l.target.x.min,d.x.max=d.x.min+x;const b=Sn(this.layout.layoutBox.y);d.y.min=l.target.y.min,d.y.max=d.y.min+b}ha(c,d),Hc(c,p),Tl(this.projectionDeltaWithTransform,this.layoutCorrected,c,p)}}registerSharedNode(l,c){this.sharedNodes.has(l)||this.sharedNodes.set(l,new yB),this.sharedNodes.get(l).add(c);const f=c.options.initialPromotionConfig;c.promote({transition:f?f.transition:void 0,preserveFollowOpacity:f&&f.shouldPreserveFollowOpacity?f.shouldPreserveFollowOpacity(c):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){var c;const{layoutId:l}=this.options;return l?((c=this.getStack())==null?void 0:c.lead)||this:this}getPrevLead(){var c;const{layoutId:l}=this.options;return l?(c=this.getStack())==null?void 0:c.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:c,preserveFollowOpacity:d}={}){const f=this.getStack();f&&f.promote(this,d),l&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let c=!1;const{latestValues:d}=l;if((d.z||d.rotate||d.rotateX||d.rotateY||d.rotateZ||d.skewX||d.skewY)&&(c=!0),!c)return;const f={};d.z&&e0("z",l,f,this.animationValues);for(let p=0;p<Jm.length;p++)e0(`rotate${Jm[p]}`,l,f,this.animationValues),e0(`skew${Jm[p]}`,l,f,this.animationValues);l.render();for(const p in f)l.setStaticValue(p,f[p]),this.animationValues&&(this.animationValues[p]=f[p]);l.scheduleRender()}applyProjectionStyles(l,c){if(!this.instance||this.isSVG)return;if(!this.isVisible){l.visibility="hidden";return}const d=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,l.visibility="",l.opacity="",l.pointerEvents=Fc(c==null?void 0:c.pointerEvents)||"",l.transform=d?d(this.latestValues,""):"none";return}const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){this.options.layoutId&&(l.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,l.pointerEvents=Fc(c==null?void 0:c.pointerEvents)||""),this.hasProjected&&!kr(this.latestValues)&&(l.transform=d?d({},""):"none",this.hasProjected=!1);return}l.visibility="";const p=f.animationValues||f.latestValues;this.applyTransformsToTarget();let x=cB(this.projectionDeltaWithTransform,this.treeScale,p);d&&(x=d(p,x)),l.transform=x;const{x:b,y:g}=this.projectionDelta;l.transformOrigin=`${b.origin*100}% ${g.origin*100}% 0`,f.animationValues?l.opacity=f===this?p.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:p.opacityExit:l.opacity=f===this?p.opacity!==void 0?p.opacity:"":p.opacityExit!==void 0?p.opacityExit:0;for(const y in tp){if(p[y]===void 0)continue;const{correct:E,applyTo:T,isCSSVariable:w}=tp[y],M=x==="none"?p[y]:E(p[y],f);if(T){const _=T.length;for(let L=0;L<_;L++)l[T[L]]=M}else w?this.options.visualElement.renderState.vars[y]=M:l[y]=M}this.options.layoutId&&(l.pointerEvents=f===this?Fc(c==null?void 0:c.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>{var c;return(c=l.currentAnimation)==null?void 0:c.stop()}),this.root.nodes.forEach(Y2),this.root.sharedNodes.clear()}}}function TB(e){e.updateLayout()}function SB(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:i,measuredBox:o}=e.layout,{animationType:s}=e.options,l=t.source!==e.layout.source;if(s==="size")Aa(x=>{const b=l?t.measuredBox[x]:t.layoutBox[x],g=Sn(b);b.min=i[x].min,b.max=b.min+g});else if(s==="x"||s==="y"){const x=s==="x"?"y":"x";np(l?t.measuredBox[x]:t.layoutBox[x],i[x])}else kw(s,t.layoutBox,i)&&Aa(x=>{const b=l?t.measuredBox[x]:t.layoutBox[x],g=Sn(i[x]);b.max=b.min+g,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[x].max=e.relativeTarget[x].min+g)});const c=Os();Tl(c,i,t.layoutBox);const d=Os();l?Tl(d,e.applyTransform(o,!0),t.measuredBox):Tl(d,i,t.layoutBox);const f=!yw(c);let p=!1;if(!e.resumeFrom){const x=e.getClosestProjectingParent();if(x&&!x.resumeFrom){const{snapshot:b,layout:g}=x;if(b&&g){const y=e.options.layoutAnchor||void 0,E=rn();fd(E,t.layoutBox,b.layoutBox,y);const T=rn();fd(T,i,g.layoutBox,y),vw(E,T)||(p=!0),x.options.layoutRoot&&(e.relativeTarget=T,e.relativeTargetOrigin=E,e.relativeParent=x)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:t,delta:d,layoutDelta:c,hasLayoutChanged:f,hasRelativeLayoutChanged:p})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function kB(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 wB(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function AB(e){e.clearSnapshot()}function Y2(e){e.clearMeasurements()}function CB(e){e.isLayoutDirty=!0,e.updateLayout()}function G2(e){e.isLayoutDirty=!1}function NB(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function _B(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function X2(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function MB(e){e.resolveTargetDelta()}function RB(e){e.calcProjection()}function DB(e){e.resetSkewAndRotation()}function LB(e){e.removeLeadSnapshot()}function K2(e,t,n){e.translate=Rt(t.translate,0,n),e.scale=Rt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function $2(e,t,n,i){e.min=Rt(t.min,n.min,i),e.max=Rt(t.max,n.max,i)}function OB(e,t,n,i){$2(e.x,t.x,n.x,i),$2(e.y,t.y,n.y,i)}function IB(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const jB={duration:.45,ease:[.4,0,.1,1]},Q2=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),W2=Q2("applewebkit/")&&!Q2("chrome/")?Math.round:sa;function Z2(e){e.min=W2(e.min),e.max=W2(e.max)}function PB(e){Z2(e.x),Z2(e.y)}function kw(e,t,n){return e==="position"||e==="preserve-aspect"&&!iB(U2(t),U2(n),.2)}function BB(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const zB=Sw({attachResizeListener:(e,t)=>Ll(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}),t0={current:void 0},ww=Sw({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!t0.current){const e=new zB({});e.mount(window),e.setOptions({layoutScroll:!0}),t0.current=e}return t0.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),dg=C.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function J2(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function UB(...e){return t=>{let n=!1;const i=e.map(o=>{const s=J2(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<i.length;o++){const s=i[o];typeof s=="function"?s():J2(e[o],null)}}}}function HB(...e){return C.useCallback(UB(...e),e)}class FB extends C.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Pc(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const i=n.offsetParent,o=Pc(i)&&i.offsetWidth||0,s=Pc(i)&&i.offsetHeight||0,l=getComputedStyle(n),c=this.props.sizeRef.current;c.height=parseFloat(l.height),c.width=parseFloat(l.width),c.top=n.offsetTop,c.left=n.offsetLeft,c.right=o-c.width-c.left,c.bottom=s-c.height-c.top,c.direction=l.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function VB({children:e,isPresent:t,anchorX:n,anchorY:i,root:o,pop:s}){var b;const l=C.useId(),c=C.useRef(null),d=C.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:f}=C.useContext(dg),p=s!==!1?((b=e.props)==null?void 0:b.ref)??(e==null?void 0:e.ref):void 0,x=HB(c,p);return C.useInsertionEffect(()=>{const{width:g,height:y,top:E,left:T,right:w,bottom:M,direction:_}=d.current;if(t||s===!1||!c.current||!g||!y)return;const L=_==="rtl",A=n==="left"?L?`right: ${w}`:`left: ${T}`:L?`left: ${T}`:`right: ${w}`,R=i==="bottom"?`bottom: ${M}`:`top: ${E}`;c.current.dataset.motionPopId=l;const j=document.createElement("style");f&&(j.nonce=f);const N=o??document.head;return N.appendChild(j),j.sheet&&j.sheet.insertRule(`
|
|
556
|
-
[data-motion-pop-id="${l}"] {
|
|
557
|
-
position: absolute !important;
|
|
558
|
-
width: ${g}px !important;
|
|
559
|
-
height: ${y}px !important;
|
|
560
|
-
${A}px !important;
|
|
561
|
-
${R}px !important;
|
|
562
|
-
}
|
|
563
|
-
`),()=>{var I;(I=c.current)==null||I.removeAttribute("data-motion-pop-id"),N.contains(j)&&N.removeChild(j)}},[t]),m.jsx(FB,{isPresent:t,childRef:c,sizeRef:d,pop:s,children:s===!1?e:C.cloneElement(e,{ref:x})})}const qB=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:o,presenceAffectsLayout:s,mode:l,anchorX:c,anchorY:d,root:f})=>{const p=Hp(YB),x=C.useId(),b=C.useRef(n),g=C.useRef(i);ad(()=>{b.current=n,g.current=i});let y=!0,E=C.useMemo(()=>(y=!1,{id:x,initial:t,isPresent:n,custom:o,onExitComplete:T=>{p.set(T,!0);for(const w of p.values())if(!w)return;i&&i()},register:T=>(p.set(T,!1),()=>{var w;p.delete(T),!b.current&&!p.size&&((w=g.current)==null||w.call(g))})}),[n,p,i]);return s&&y&&(E={...E}),C.useMemo(()=>{p.forEach((T,w)=>p.set(w,!1))},[n]),C.useEffect(()=>{!n&&!p.size&&i&&i()},[n]),e=m.jsx(VB,{pop:l==="popLayout",isPresent:n,anchorX:c,anchorY:d,root:f,children:e}),m.jsx(Dd.Provider,{value:E,children:e})};function YB(){return new Map}function Aw(e=!0){const t=C.useContext(Dd);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:o}=t,s=C.useId();C.useEffect(()=>{if(e)return o(s)},[e]);const l=C.useCallback(()=>e&&i&&i(s),[s,i,e]);return!n&&i?[!1,l]:[!0]}const Nc=e=>e.key||"";function eE(e){const t=[];return C.Children.forEach(e,n=>{C.isValidElement(n)&&t.push(n)}),t}const GB=({children:e,custom:t,initial:n=!0,onExitComplete:i,presenceAffectsLayout:o=!0,mode:s="sync",propagate:l=!1,anchorX:c="left",anchorY:d="top",root:f})=>{const[p,x]=Aw(l),b=C.useMemo(()=>eE(e),[e]),g=l&&!p?[]:b.map(Nc),y=C.useRef(!0),E=C.useRef(b),T=Hp(()=>new Map),w=C.useRef(new Set),[M,_]=C.useState(b),[L,A]=C.useState(b);ad(()=>{l&&!p&&!L.length&&(x==null||x())},[p,l,L.length,x]),ad(()=>{y.current=!1,E.current=b;for(let N=0;N<L.length;N++){const I=Nc(L[N]);g.includes(I)?(T.delete(I),w.current.delete(I)):T.get(I)!==!0&&T.set(I,!1)}},[L,g.length,g.join("-")]);const R=[];if(b!==M){let N=[...b];for(let I=0;I<L.length;I++){const D=L[I],P=Nc(D);g.includes(P)||(N.splice(I,0,D),R.push(D))}return s==="wait"&&R.length&&(N=R),A(eE(N)),_(b),null}const{forceRender:j}=C.useContext(Up);return m.jsx(m.Fragment,{children:L.map(N=>{const I=Nc(N),D=l&&!p?!1:b===L||g.includes(I),P=()=>{if(w.current.has(I))return;if(T.has(I))w.current.add(I),T.set(I,!0);else return;let z=!0;T.forEach(K=>{K||(z=!1)}),z&&(j==null||j(),A(E.current),l&&(x==null||x()),i&&i())};return m.jsx(qB,{isPresent:D,initial:!y.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:s,root:f,onExitComplete:D?void 0:P,anchorX:c,anchorY:d,children:N},I)})})},Cw=C.createContext({strict:!1}),tE={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 nE=!1;function XB(){if(nE)return;const e={};for(const t in tE)e[t]={isEnabled:n=>tE[t].some(i=>!!n[i])};nw(e),nE=!0}function Nw(){return XB(),R7()}function KB(e){const t=Nw();for(const n in e)t[n]={...t[n],...e[n]};nw(t)}const Pd=C.createContext({});function $B(e,t){if(jd(e)){const{initial:n,animate:i}=e;return{initial:n===!1||Dl(n)?n:void 0,animate:Dl(i)?i:void 0}}return e.inherit!==!1?t:{}}function QB(e){const{initial:t,animate:n}=$B(e,C.useContext(Pd));return C.useMemo(()=>({initial:t,animate:n}),[aE(t),aE(n)])}function aE(e){return Array.isArray(e)?e.join(" "):e}const fg=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function _w(e,t,n){for(const i in t)!mn(t[i])&&!uw(i,n)&&(e[i]=t[i])}function WB({transformTemplate:e},t){return C.useMemo(()=>{const n=fg();return ug(n,t,e),Object.assign({},n.vars,n.style)},[t])}function ZB(e,t){const n=e.style||{},i={};return _w(i,n,e),Object.assign(i,WB(e,t)),i}function JB(e,t){const n={},i=ZB(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.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=i,n}const Mw=()=>({...fg(),attrs:{}});function ez(e,t,n,i){const o=C.useMemo(()=>{const s=Mw();return dw(s,t,hw(i),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};_w(s,e.style,e),o.style={...s,...o.style}}return o}const tz=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 hd(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||tz.has(e)}function nz(e,t){return e.startsWith("on")?!hd(e):(t==null?void 0:t(e))??!hd(e)}function az(e,t,n,i){const o={};for(const s in e)s==="values"&&typeof e.values=="object"||mn(e[s])||(nz(s,i)||n===!0&&hd(s)||!t&&!hd(s)||e.draggable&&s.startsWith("onDrag"))&&(o[s]=e[s]);return o}const iz=["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 hg(e){return typeof e!="string"||e.includes("-")?!1:!!(iz.indexOf(e)>-1||/[A-Z]/u.test(e))}function rz(e,t,n,{latestValues:i},o,s=!1,l,c){const f=(l??hg(e)?ez:JB)(t,i,o,e),p=az(t,typeof e=="string",s,c),x=e!==C.Fragment?{...p,...f,ref:n}:{},{children:b}=t,g=C.useMemo(()=>mn(b)?b.get():b,[b]);return C.createElement(e,{...x,children:g})}function sz({scrapeMotionValuesFromProps:e,createRenderState:t},n,i,o){return{latestValues:oz(n,i,o,e),renderState:t()}}function oz(e,t,n,i){const o={},s=i(e,{});for(const b in s)o[b]=Fc(s[b]);let{initial:l,animate:c}=e;const d=jd(e),f=ew(e);t&&f&&!d&&e.inherit!==!1&&(l===void 0&&(l=t.initial),c===void 0&&(c=t.animate));let p=n?n.initial===!1:!1;p=p||l===!1;const x=p?c:l;if(x&&typeof x!="boolean"&&!Id(x)){const b=Array.isArray(x)?x:[x];for(let g=0;g<b.length;g++){const y=tg(e,b[g]);if(y){const{transitionEnd:E,transition:T,...w}=y;for(const M in w){let _=w[M];if(Array.isArray(_)){const L=p?_.length-1:0;_=_[L]}_!==null&&(o[M]=_)}for(const M in E)o[M]=E[M]}}}return o}const Rw=e=>(t,n)=>{const i=C.useContext(Pd),o=C.useContext(Dd),s=()=>sz(e,t,i,o);return n?s():Hp(s)},lz=Rw({scrapeMotionValuesFromProps:cg,createRenderState:fg}),uz=Rw({scrapeMotionValuesFromProps:mw,createRenderState:Mw}),cz=Symbol.for("motionComponentSymbol");function dz(e,t,n){const i=C.useRef(n);C.useInsertionEffect(()=>{i.current=n});const o=C.useRef(null);return C.useCallback(s=>{var c;s&&((c=e.onMount)==null||c.call(e,s)),t&&(s?t.mount(s):t.unmount());const l=i.current;if(typeof l=="function")if(s){const d=l(s);typeof d=="function"&&(o.current=d)}else o.current?(o.current(),o.current=null):l(s);else l&&(l.current=s)},[t])}const Dw=C.createContext({});function Ms(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function fz(e,t,n,i,o,s){var _,L;const{visualElement:l}=C.useContext(Pd),c=C.useContext(Cw),d=C.useContext(Dd),f=C.useContext(dg),p=f.reducedMotion,x=f.skipAnimations,b=C.useRef(null),g=C.useRef(!1);i=i||c.renderer,!b.current&&i&&(b.current=i(e,{visualState:t,parent:l,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:p,skipAnimations:x,isSVG:s}),g.current&&b.current&&(b.current.manuallyAnimateOnMount=!0));const y=b.current,E=C.useContext(Dw);y&&!y.projection&&o&&(y.type==="html"||y.type==="svg")&&hz(b.current,n,o,E);const T=C.useRef(!1);C.useInsertionEffect(()=>{y&&T.current&&y.update(n,d)});const w=n[Fk],M=C.useRef(!!w&&typeof window<"u"&&!((_=window.MotionHandoffIsComplete)!=null&&_.call(window,w))&&((L=window.MotionHasOptimisedAnimation)==null?void 0:L.call(window,w)));return ad(()=>{g.current=!0,y&&(T.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),y.scheduleRenderMicrotask(),M.current&&y.animationState&&y.animationState.animateChanges())}),C.useEffect(()=>{y&&(!M.current&&y.animationState&&y.animationState.animateChanges(),M.current&&(queueMicrotask(()=>{var A;(A=window.MotionHandoffMarkAsComplete)==null||A.call(window,w)}),M.current=!1),y.enteringChildren=void 0)}),y}function hz(e,t,n,i){const{layoutId:o,layout:s,drag:l,dragConstraints:c,layoutScroll:d,layoutRoot:f,layoutAnchor:p,layoutCrossfade:x}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Lw(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!l||c&&Ms(c),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,crossfade:x,layoutScroll:d,layoutRoot:f,layoutAnchor:p})}function Lw(e){if(e)return e.options.allowProjection!==!1?e.projection:Lw(e.parent)}function n0(e,{forwardMotionProps:t=!1,type:n}={},i,o){i&&KB(i);const s=n?n==="svg":hg(e),l=s?uz:lz;function c(f,p){let x;const b={...C.useContext(dg),...f,layoutId:mz(f)},{isStatic:g,isValidProp:y}=b,E=QB(f),T=l(f,g);if(!g&&typeof window<"u"){pz();const w=gz(b);x=w.MeasureLayout,E.visualElement=fz(e,T,b,o,w.ProjectionNode,s)}return m.jsxs(Pd.Provider,{value:E,children:[x&&E.visualElement?m.jsx(x,{visualElement:E.visualElement,...b}):null,rz(e,f,dz(T,E.visualElement,p),T,g,t,s,y)]})}c.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const d=C.forwardRef(c);return d[cz]=e,d}function mz({layoutId:e}){const t=C.useContext(Up).id;return t&&e!==void 0?t+"-"+e:e}function pz(e,t){C.useContext(Cw).strict}function gz(e){const t=Nw(),{drag:n,layout:i}=t;if(!n&&!i)return{};const o={...n,...i};return{MeasureLayout:n!=null&&n.isEnabled(e)||i!=null&&i.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function xz(e,t){if(typeof Proxy>"u")return n0;const n=new Map,i=(s,l)=>n0(s,l,e,t),o=(s,l)=>i(s,l);return new Proxy(o,{get:(s,l)=>l==="create"?i:(n.has(l)||n.set(l,n0(l,void 0,e,t)),n.get(l))})}const bz=(e,t)=>t.isSVG??hg(e)?new X7(t):new F7(t,{allowProjection:e!==C.Fragment});class yz extends Xi{constructor(t){super(t),t.animationState||(t.animationState=Z7(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Id(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 vz=0;class Ez extends Xi{constructor(){super(...arguments),this.id=vz++,this.isExitComplete=!1}update(){var s;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;if(t&&i===!1){if(this.isExitComplete){const{initial:l,custom:c}=this.node.getProps();if(typeof l=="string"||typeof l=="object"&&l!==null&&!Array.isArray(l)){const d=Or(this.node,l,c);if(d){const{transition:f,transitionEnd:p,...x}=d;for(const b in x)(s=this.node.getValue(b))==null||s.jump(x[b])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.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 Tz={animation:{Feature:yz},exit:{Feature:Ez}};function $l(e){return{point:{x:e.pageX,y:e.pageY}}}const Sz=e=>t=>rg(t)&&e(t,$l(t));function Sl(e,t,n,i){return Ll(e,t,Sz(n),i)}const Ow=({current:e})=>e?e.ownerDocument.defaultView:null,iE=(e,t)=>Math.abs(e-t);function kz(e,t){const n=iE(e.x,t.x),i=iE(e.y,t.y);return Math.sqrt(n**2+i**2)}const rE=new Set(["auto","scroll"]);class Iw{constructor(t,n,{transformPagePoint:i,contextWindow:o=window,dragSnapToOrigin:s=!1,distanceThreshold:l=3,element:c}={}){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=y=>{this.handleScroll(y.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=_c(this.lastRawMoveEventInfo,this.transformPagePoint));const y=a0(this.lastMoveEventInfo,this.history),E=this.startEvent!==null,T=kz(y.offset,{x:0,y:0})>=this.distanceThreshold;if(!E&&!T)return;const{point:w}=y,{timestamp:M}=hn;this.history.push({...w,timestamp:M});const{onStart:_,onMove:L}=this.handlers;E||(_&&_(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),L&&L(this.lastMoveEvent,y)},this.handlePointerMove=(y,E)=>{this.lastMoveEvent=y,this.lastRawMoveEventInfo=E,this.lastMoveEventInfo=_c(E,this.transformPagePoint),Dt.update(this.updatePoint,!0)},this.handlePointerUp=(y,E)=>{this.end();const{onEnd:T,onSessionEnd:w,resumeAnimation:M}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&M&&M(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const _=a0(y.type==="pointercancel"?this.lastMoveEventInfo:_c(E,this.transformPagePoint),this.history);this.startEvent&&T&&T(y,_),w&&w(y,_)},!rg(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=l,this.contextWindow=o||window;const d=$l(t),f=_c(d,this.transformPagePoint),{point:p}=f,{timestamp:x}=hn;this.history=[{...p,timestamp:x}];const{onSessionStart:b}=n;b&&b(t,a0(f,this.history));const g={passive:!0,capture:!0};this.removeListeners=Gl(Sl(this.contextWindow,"pointermove",this.handlePointerMove,g),Sl(this.contextWindow,"pointerup",this.handlePointerUp,g),Sl(this.contextWindow,"pointercancel",this.handlePointerUp,g)),c&&this.startScrollTracking(c)}startScrollTracking(t){let n=t.parentElement;for(;n;){const i=getComputedStyle(n);(rE.has(i.overflowX)||rE.has(i.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 i=t===window,o=i?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:o.x-n.x,y:o.y-n.y};s.x===0&&s.y===0||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,o),Dt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),qi(this.updatePoint)}}function _c(e,t){return t?{point:t(e.point)}:e}function sE(e,t){return{x:e.x-t.x,y:e.y-t.y}}function a0({point:e},t){return{point:e,delta:sE(e,jw(t)),offset:sE(e,wz(t)),velocity:Az(t,.1)}}function wz(e){return e[0]}function jw(e){return e[e.length-1]}function Az(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const o=jw(e);for(;n>=0&&(i=e[n],!(o.timestamp-i.timestamp>Yn(t)));)n--;if(!i)return{x:0,y:0};i===e[0]&&e.length>2&&o.timestamp-i.timestamp>Yn(t)*2&&(i=e[1]);const s=ra(o.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const l={x:(o.x-i.x)/s,y:(o.y-i.y)/s};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function Cz(e,{min:t,max:n},i){return t!==void 0&&e<t?e=i?Rt(t,e,i.min):Math.max(e,t):n!==void 0&&e>n&&(e=i?Rt(n,e,i.max):Math.min(e,n)),e}function oE(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 Nz(e,{top:t,left:n,bottom:i,right:o}){return{x:oE(e.x,n,o),y:oE(e.y,t,i)}}function lE(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,i]=[i,n]),{min:n,max:i}}function _z(e,t){return{x:lE(e.x,t.x),y:lE(e.y,t.y)}}function Mz(e,t){let n=.5;const i=Sn(e),o=Sn(t);return o>i?n=Ml(t.min,t.max-i,e.min):i>o&&(n=Ml(e.min,e.max-o,t.min)),Oa(0,1,n)}function Rz(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 ap=.35;function Dz(e=ap){return e===!1?e=0:e===!0&&(e=ap),{x:uE(e,"left","right"),y:uE(e,"top","bottom")}}function uE(e,t,n){return{min:cE(e,t),max:cE(e,n)}}function cE(e,t){return typeof e=="number"?e:e[t]||0}const Lz=new WeakMap;class Oz{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=rn(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:i}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const s=x=>{n&&this.snapToCursor($l(x).point),this.stopAnimation()},l=(x,b)=>{const{drag:g,dragPropagation:y,onDragStart:E}=this.getProps();if(g&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=o7(g),!this.openDragLock))return;this.latestPointerEvent=x,this.latestPanInfo=b,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Aa(w=>{let M=this.getAxisMotionValue(w).get()||0;if(Da.test(M)){const{projection:_}=this.visualElement;if(_&&_.layout){const L=_.layout.layoutBox[w];L&&(M=Sn(L)*(parseFloat(M)/100))}}this.originPoint[w]=M}),E&&Dt.update(()=>E(x,b),!1,!0),X0(this.visualElement,"transform");const{animationState:T}=this.visualElement;T&&T.setActive("whileDrag",!0)},c=(x,b)=>{this.latestPointerEvent=x,this.latestPanInfo=b;const{dragPropagation:g,dragDirectionLock:y,onDirectionLock:E,onDrag:T}=this.getProps();if(!g&&!this.openDragLock)return;const{offset:w}=b;if(y&&this.currentDirection===null){this.currentDirection=jz(w),this.currentDirection!==null&&E&&E(this.currentDirection);return}this.updateAxis("x",b.point,w),this.updateAxis("y",b.point,w),this.visualElement.render(),T&&Dt.update(()=>T(x,b),!1,!0)},d=(x,b)=>{this.latestPointerEvent=x,this.latestPanInfo=b,this.stop(x,b),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:x}=this.getProps();(x||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:p}=this.getProps();this.panSession=new Iw(t,{onSessionStart:s,onStart:l,onMove:c,onSessionEnd:d,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,distanceThreshold:i,contextWindow:Ow(this.visualElement),element:this.visualElement.current})}stop(t,n){const i=t||this.latestPointerEvent,o=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!o||!i)return;const{velocity:l}=o;this.startAnimation(l);const{onDragEnd:c}=this.getProps();c&&Dt.postRender(()=>c(i,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:i}=this.getProps();!i&&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,i){const{drag:o}=this.getProps();if(!i||!Mc(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let l=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(l=Cz(l,this.constraints[t],this.elastic[t])),s.set(l)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,o=this.constraints;t&&Ms(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&i?this.constraints=Nz(i.layoutBox,t):this.constraints=!1,this.elastic=Dz(n),o!==this.constraints&&!Ms(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&Aa(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=Rz(i.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ms(t))return!1;const i=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;o.root&&(o.root.scroll=void 0,o.root.updateScroll());const s=j7(i,o.root,this.visualElement.getTransformPagePoint());let l=_z(o.layout.layoutBox,s);if(n){const c=n(L7(l));this.hasMutatedConstraints=!!c,c&&(l=iw(c))}return l}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:o,dragTransition:s,dragSnapToOrigin:l,onDragTransitionEnd:c}=this.getProps(),d=this.constraints||{},f=Aa(p=>{if(!Mc(p,n,this.currentDirection))return;let x=d&&d[p]||{};(l===!0||l===p)&&(x={min:0,max:0});const b=o?200:1e6,g=o?40:1e7,y={type:"inertia",velocity:i?t[p]:0,bounceStiffness:b,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...s,...x};return this.startAxisValueAnimation(p,y)});return Promise.all(f).then(c)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return X0(this.visualElement,t),i.start(eg(t,i,0,n,this.visualElement,!1))}stopAnimation(){Aa(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,o=this.visualElement.getProps()[n];return o||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){Aa(n=>{const{drag:i}=this.getProps();if(!Mc(n,i,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:l,max:c}=o.layout.layoutBox[n],d=s.get()||0;s.set(t[n]-Rt(l,c,.5)+d)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Ms(n)||!i||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Aa(l=>{const c=this.getAxisMotionValue(l);if(c&&this.constraints!==!1){const d=c.get();o[l]=Mz({min:d,max:d},this.constraints[l])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),Aa(l=>{if(!Mc(l,t,null))return;const c=this.getAxisMotionValue(l),{min:d,max:f}=this.constraints[l];c.set(Rt(d,f,o[l]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Lz.set(this.visualElement,this);const t=this.visualElement.current,n=Sl(t,"pointerdown",f=>{const{drag:p,dragListener:x=!0}=this.getProps(),b=f.target,g=b!==t&&h7(b);p&&x&&!g&&this.start(f)});let i;const o=()=>{const{dragConstraints:f}=this.getProps();Ms(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),i||(i=Iz(t,f.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,l=s.addEventListener("measure",o);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),Dt.read(o);const c=Ll(window,"resize",()=>this.scalePositionWithinConstraints()),d=s.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:p})=>{this.isDragging&&p&&(Aa(x=>{const b=this.getAxisMotionValue(x);b&&(this.originPoint[x]+=f[x].translate,b.set(b.get()+f[x].translate))}),this.visualElement.render())}));return()=>{c(),n(),l(),d&&d(),i&&i()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:l=ap,dragMomentum:c=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:o,dragConstraints:s,dragElastic:l,dragMomentum:c}}}function dE(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Iz(e,t,n){const i=b2(e,dE(n)),o=b2(t,dE(n));return()=>{i(),o()}}function Mc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function jz(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Pz extends Xi{constructor(t){super(t),this.removeGroupControls=sa,this.removeListeners=sa,this.controls=new Oz(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||sa}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 i0=e=>(t,n)=>{e&&Dt.update(()=>e(t,n),!1,!0)};class Bz extends Xi{constructor(){super(...arguments),this.removePointerDownListener=sa}onPointerDown(t){this.session=new Iw(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ow(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:o}=this.node.getProps();return{onSessionStart:i0(t),onStart:i0(n),onMove:i0(i),onEnd:(s,l)=>{delete this.session,o&&Dt.postRender(()=>o(s,l))}}}mount(){this.removePointerDownListener=Sl(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 r0=!1;class zz extends C.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:o}=this.props,{projection:s}=t;s&&(n.group&&n.group.add(s),i&&i.register&&o&&i.register(s),r0&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Vc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:o,isPresent:s}=this.props,{projection:l}=i;return l&&(l.isPresent=s,t.layoutDependency!==n&&l.setOptions({...l.options,layoutDependency:n}),r0=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?l.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?l.promote():l.relegate()||Dt.postRender(()=>{const c=l.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:i}=t;i&&(i.options.layoutAnchor=n,i.root.didUpdate(),ig.postRender(()=>{!i.currentAnimation&&i.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:o}=t;r0=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),i&&i.deregister&&i.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Pw(e){const[t,n]=Aw(),i=C.useContext(Up);return m.jsx(zz,{...e,layoutGroup:i,switchLayoutGroup:C.useContext(Dw),isPresent:t,safeToRemove:n})}const Uz={pan:{Feature:Bz},drag:{Feature:Pz,ProjectionNode:ww,MeasureLayout:Pw}};function fE(e,t,n){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=i[o];s&&Dt.postRender(()=>s(t,$l(t)))}class Hz extends Xi{mount(){const{current:t}=this.node;t&&(this.unmount=u7(t,(n,i)=>(fE(this.node,i,"Start"),o=>fE(this.node,o,"End"))))}unmount(){}}class Fz extends Xi{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=Gl(Ll(this.node.current,"focus",()=>this.onFocus()),Ll(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function hE(e,t,n){const{props:i}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=i[o];s&&Dt.postRender(()=>s(t,$l(t)))}class Vz extends Xi{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:i}=this.node.props;this.unmount=p7(t,(o,s)=>(hE(this.node,s,"Start"),(l,{success:c})=>hE(this.node,l,c?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(i==null?void 0:i.tap)===!1})}unmount(){}}const ip=new WeakMap,s0=new WeakMap,qz=e=>{const t=ip.get(e.target);t&&t(e)},Yz=e=>{e.forEach(qz)};function Gz({root:e,...t}){const n=e||document;s0.has(n)||s0.set(n,{});const i=s0.get(n),o=JSON.stringify(t);return i[o]||(i[o]=new IntersectionObserver(Yz,{root:e,...t})),i[o]}function Xz(e,t,n){const i=Gz(t);return ip.set(e,n),i.observe(e),()=>{ip.delete(e),i.unobserve(e)}}const Kz={some:0,all:1};class $z extends Xi{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var d;(d=this.stopObserver)==null||d.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:o="some",once:s}=t,l={root:n?n.current:void 0,rootMargin:i,threshold:typeof o=="number"?o:Kz[o]},c=f=>{const{isIntersecting:p}=f;if(this.isInView===p||(this.isInView=p,s&&!p&&this.hasEnteredView))return;p&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",p);const{onViewportEnter:x,onViewportLeave:b}=this.node.getProps(),g=p?x:b;g&&g(f)};this.stopObserver=Xz(this.node.current,l,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Qz(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function Qz({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Wz={inView:{Feature:$z},tap:{Feature:Vz},focus:{Feature:Fz},hover:{Feature:Hz}},Zz={layout:{ProjectionNode:ww,MeasureLayout:Pw}},Jz={...Tz,...Wz,...Uz,...Zz},eU=xz(Jz,bz),tU=eU;function nU(e){switch(e){case"correct":return{Icon:ga,color:"var(--brand)"};case"wrong":return{Icon:Ir,color:"var(--warning)"};case"mastery":case"level-up":return{Icon:TE,color:"var(--gold)"};case"unlock":return{Icon:u0,color:"var(--brand)"};case"streak":return{Icon:SE,color:"var(--review)"};case"energy-full":return{Icon:d0,color:"var(--brand)"};case"exam-pass":return{Icon:dC,color:"var(--exam)"};case"lesson-complete":return{Icon:KC,color:"var(--gold)"};default:return{Icon:u0,color:"var(--brand)"}}}function aU(){const e=FE(),t=C.useRef(null),n=C.useRef([]),i=C.useRef(0),[o,s]=C.useState(null);return C.useEffect(()=>{if(e)return;const l=t.current;if(!l)return;const c=l.getContext("2d");if(!c)return;const d=()=>{const b=Math.min(window.devicePixelRatio||1,2);l.width=window.innerWidth*b,l.height=window.innerHeight*b,l.style.width=window.innerWidth+"px",l.style.height=window.innerHeight+"px",c.setTransform(b,0,0,b,0,0)};d(),window.addEventListener("resize",d);const f=()=>{c.clearRect(0,0,window.innerWidth,window.innerHeight);const b=n.current;for(let g=b.length-1;g>=0;g--){const y=b[g];if(y.x+=y.vx,y.y+=y.vy,y.vy+=.25,y.vx*=.99,y.rot+=y.vr,y.life--,y.life<=0){b.splice(g,1);continue}const E=Math.min(1,y.life/y.maxLife);c.save(),c.globalAlpha=E,c.translate(y.x,y.y),c.rotate(y.rot),c.fillStyle=y.color,y.shape==="circle"?(c.beginPath(),c.arc(0,0,y.size,0,Math.PI*2),c.fill()):c.fillRect(-y.size/2,-y.size/2,y.size,y.size*.6),c.restore()}i.current=b.length>0?requestAnimationFrame(f):0},x=Sy(b=>{var w,M;const g=r5(b.kind),y=Math.round(g.particles*(b.intensity??1)),E=((w=b.origin)==null?void 0:w.x)??window.innerWidth/2,T=((M=b.origin)==null?void 0:M.y)??window.innerHeight/2;for(let _=0;_<y;_++){const L=Math.PI*2*_/y+Math.random()*.3,A=3+Math.random()*6,R=g.durationMs/16*(.7+Math.random()*.5);n.current.push({x:E,y:T,vx:Math.cos(L)*A,vy:Math.sin(L)*A-2,life:R,maxLife:R,color:g.colors[_%g.colors.length],size:4+Math.random()*5,rot:Math.random()*Math.PI,vr:(Math.random()-.5)*.3,shape:Math.random()<.5?"rect":"circle"})}i.current===0&&(i.current=requestAnimationFrame(f))});return()=>{x(),window.removeEventListener("resize",d),i.current&&cancelAnimationFrame(i.current),i.current=0,n.current=[]}},[e]),C.useEffect(()=>{if(!e)return;let l=0;return Sy(d=>{const f=++l;s({kind:d.kind,id:f}),setTimeout(()=>{f===l&&s(null)},600)})},[e]),e?m.jsx(GB,{children:o&&(()=>{const{Icon:l,color:c}=nU(o.kind);return m.jsx(tU.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:m.jsx(l,{className:"w-24 h-24",color:c,strokeWidth:1.5})},o.id)})()}):m.jsx("canvas",{ref:t,className:"fixed inset-0 pointer-events-none z-[60]","aria-hidden":"true"})}const mE=["direct","guide","practice"];function iU(){const e=Xe(),[t,n]=C.useState([]),[i,o]=C.useState([]),[s,l]=C.useState({}),[c,d]=C.useState(null),[f,p]=C.useState(null),[x,b]=C.useState(null),[g,y]=C.useState(null),E=C.useCallback(le=>{y(le instanceof Error?le.message:String(le)),console.error(le)},[]),[T,w]=C.useState([]),[M,_]=C.useState(null),[L,A]=C.useState([]),[R,j]=C.useState(null),[N,I]=C.useState("map"),[D,P]=C.useState(null),[z,K]=C.useState(new Set),[q,B]=C.useState(null),H=C.useRef({active:!1,terminate:null}),[G,Q]=C.useState({open:!1,pendingAction:null}),re=C.useRef(null),[F,Y]=C.useState(null),[W,U]=C.useState(!1),[ae,J]=C.useState(!0),[ne,me]=C.useState(!0),Z=n9(),[we,Fe]=C.useState("notebook"),[Se,ve]=C.useState("chat"),Oe=C.useRef(Se);Oe.current=Se;const Ie=C.useRef(Z);C.useEffect(()=>{Ie.current!==Z&&(Z===1?(J(!0),me(!0)):Z===2&&Ie.current===3&&Fe(Wj(Oe.current)),Ie.current=Z)},[Z]);const $e=Z===3?Se==="rail":Z===2?we==="rail":ae,Nt=Z===3?Se==="notebook":Z===2?we==="notebook":ne,Ot=Z!==3||Se==="chat",Te=()=>{Z===1?J(le=>!le):Z===2?Fe(le=>le==="rail"?"notebook":"rail"):ve(le=>le==="rail"?"chat":"rail")},Ze=()=>{Z===1?me(le=>!le):Z===2?Fe(le=>le==="notebook"?"rail":"notebook"):ve(le=>le==="notebook"?"chat":"notebook")},rt=C.useRef(null),bt=le=>{var Re,He;if(Z!==3)return;const ye=le.touches[0];rt.current={x:ye.clientX,y:ye.clientY,multi:le.touches.length>1,noswipe:!!((He=(Re=le.target).closest)!=null&&He.call(Re,"[data-noswipe]"))}},gt=le=>{const ye=rt.current;if(rt.current=null,!ye||ye.multi||ye.noswipe||Z!==3)return;const Re=le.changedTouches[0],He=Zj(Oe.current,Re.clientX-ye.x,Re.clientY-ye.y);He&&ve(He)},[lt,st]=C.useState(!1),[Ue,pe]=C.useState(null),[Ce,je]=C.useState([]),Le=Gj(x,q),at=OE(),Me=Vj(Le.activeId,at),[tt,We]=C.useState(""),se=C.useCallback(le=>{We(le)},[]),qe=C.useCallback((le,ye,Re)=>{if(le.type==="content"){if(Y("content"),Re){const He=xt=>{document.querySelector(`mark[data-note-id="${Re}"]`)?window.dispatchEvent(new CustomEvent("lookatstudy-jump-to-note",{detail:Re})):xt>0&&setTimeout(()=>He(xt-1),150)};setTimeout(()=>He(10),100)}}else if(le.threadId!==Le.activeId&&Le.setActiveId(le.threadId),Re){const He=xt=>{document.querySelector(`mark[data-note-id="${Re}"]`)?window.dispatchEvent(new CustomEvent("lookatstudy-jump-to-chat-note",{detail:Re})):xt>0&&setTimeout(()=>He(xt-1),150)};setTimeout(()=>He(10),120)}},[Le]),[Je,Ft]=C.useState(null);C.useEffect(()=>{if(!q){Ft(null);return}let le=!1;return fe.getNodeSummary(q,at).then(ye=>{le||Ft(ye)}).catch(()=>{le||Ft(null)}),()=>{le=!0}},[q,at]);const it=C.useMemo(()=>i.find(le=>le.id===q)??null,[i,q]),Ur=C.useMemo(()=>Ce.map(le=>({...le,label:e(`starter.${le.key}.label`),hint:e(`starter.${le.key}.hint`),message:e(`starter.${le.key}.message`,{title:(it==null?void 0:it.title)??""})})),[Ce,it,e]),pn=C.useRef(null),ci=C.useCallback(()=>{var le;it&&((le=pn.current)==null||le.call(pn,e("chat.action.startLearningPrompt",{title:it.title}),e("chat.action.startLearning",{title:it.title})))},[it,e]),On=C.useCallback(async()=>{try{const[le,ye,Re,He,xt,Ht]=await Promise.all([fe.listCourses(),fe.getStreak(),fe.listSouls(),fe.getActiveSoul(),fe.getXpStatus(),fe.getDueReviews()]);n(le),d(ye),A(Re),p(xt),j(He),K(new Set(Ht)),x&&!le.some(kn=>kn.id===x)&&(b(null),B(null),o([]),l({}),P(null),w([]),_(null))}catch(le){y(le instanceof Error?le.message:String(le))}},[x]);C.useEffect(()=>{On()},[On]);const la=C.useCallback(async()=>{try{pe(await fe.isAgentReady())}catch{pe({ready:!1,missing:e("error.checkReadyFailed")})}},[e]);C.useEffect(()=>{la();const le=()=>la();return window.addEventListener("llm-config-changed",le),()=>window.removeEventListener("llm-config-changed",le)},[la]);const Ki=C.useRef(0),di=C.useRef(0);C.useEffect(()=>{Ki.current=(f==null?void 0:f.todayXp)??0},[f]),C.useEffect(()=>{di.current=(c==null?void 0:c.currentStreak)??0},[c]);const Hr=C.useCallback(async()=>{const le=i.filter(He=>He.type==="lesson"||He.type==="exam"),ye=await Promise.all(le.map(async He=>{const xt=await fe.getProgress(He.id);return[He.id,xt]})),Re={};for(const[He,xt]of ye)xt&&(Re[He]=xt);l(Re)},[i]);C.useEffect(()=>fe.on("state:changed",ye=>{ye==="xp"?fe.getXpStatus().then(Re=>{p(Re),Ki.current<100&&Re.todayXp>=100&&Mr("energy-full")}).catch(()=>{}):ye==="streak"?fe.getStreak().then(Re=>{d(Re),Re.currentStreak>di.current&&Mr("streak")}).catch(()=>{}):ye==="mastery"&&(Mr("mastery"),On(),Hr())}),[On,Hr]),C.useEffect(()=>{x&&(fe.getCourseLanguages(x).then(w).catch(()=>w([])),fe.getCourseLanguage(x).then(_).catch(()=>_(null)))},[x]),C.useEffect(()=>{x&&(fe.getCourseTree(x,M??void 0).then(async le=>{o(le);const ye=le.filter(xt=>xt.type==="lesson"||xt.type==="exam"),Re=await Promise.all(ye.map(async xt=>{const Ht=await fe.getProgress(xt.id);return[xt.id,Ht]})),He={};for(const[xt,Ht]of Re)Ht&&(He[xt]=Ht);l(He)}).catch(E),fe.getDashboard(x).then(P).catch(E))},[x,M,E]),C.useEffect(()=>{if(!q){je([]);return}fe.getStarterPrompts(q).then(je).catch(()=>je([]))},[q]),C.useEffect(()=>{const le=ye=>{if(ye.key==="Escape"&&Le.activeId&&(fe.abortAgentChatThread(Le.activeId).catch(()=>{}),U(!1),st(!1)),(ye.ctrlKey||ye.metaKey)&&ye.key==="k"&&(ye.preventDefault(),st(Re=>!Re)),(ye.ctrlKey||ye.metaKey)&&ye.key==="b"&&(ye.preventDefault(),Te()),(ye.ctrlKey||ye.metaKey)&&ye.key==="Tab"){if(ye.preventDefault(),H.current.active)return;const Re=Le.threads;if(Re.length>1){const He=Re.findIndex(Ht=>Ht.id===Le.activeId),xt=ye.shiftKey?(He-1+Re.length)%Re.length:(He+1)%Re.length;Le.setActiveId(Re[xt].id)}}(!ye.target||!ye.target.matches("input, textarea, select"))&&(ye.key==="1"&&I("map"),ye.key==="2"&&I("import"),ye.key==="s"&&(ye.ctrlKey||ye.metaKey)&&(ye.preventDefault(),U(!0)))};return window.addEventListener("keydown",le),()=>window.removeEventListener("keydown",le)},[q]);const Fr=C.useCallback(async le=>{var ye;try{if(le.type==="exam"){B(le.id),Y("content");return}if(((ye=s[le.id])==null?void 0:ye.status)==="locked"){B(null);return}await fe.markNodeAttempted(le.id);const Re=await fe.getStreak();await Hr(),d(Re),B(le.id),Y("content"),no(!1)}catch(Re){E(Re)}},[s,Hr,E]),$i=C.useCallback(le=>{if(H.current.active){Q({open:!0,pendingAction:le});return}le()},[]),Qi=C.useCallback(le=>{if(H.current.active&&le.id!==q){Q({open:!0,pendingAction:()=>void Fr(le)});return}Fr(le)},[Fr,q]),Bd=C.useCallback(le=>{H.current=le},[]),Ql=C.useCallback(async()=>{const le=G.pendingAction;Q({open:!1,pendingAction:null});const ye=H.current;if(H.current={active:!1,terminate:null},ye.active&&ye.terminate)try{await ye.terminate()}catch{}le==null||le()},[G.pendingAction]);Fs(re,G.open),C.useEffect(()=>{if(!G.open)return;const le=ye=>{ye.key==="Escape"&&Q({open:!1,pendingAction:null})};return window.addEventListener("keydown",le),()=>window.removeEventListener("keydown",le)},[G.open]);const Wl=async le=>{try{await fe.setActiveSoul(le),j(le)}catch(ye){E(ye)}},Zl=C.useCallback(async(le,ye,Re)=>{try{await fe.applyProposal(le),Me.markProposalStatus(ye,Re,!0)}catch(He){E(He)}},[Me,E]),Ws=C.useCallback(async(le,ye,Re)=>{try{await fe.rejectProposal(le),Me.markProposalStatus(ye,Re,!1)}catch(He){E(He)}},[Me,E]),Wi=t.find(le=>le.id===x),Zs=C.useMemo(()=>{const le=new Set(i.map(ye=>ye.id));return new Set([...z].filter(ye=>le.has(ye)))},[z,i]),Zi=Zs.size,va=C.useMemo(()=>i.filter(le=>le.type==="section").sort((le,ye)=>le.orderIdx-ye.orderIdx),[i]),nn=C.useMemo(()=>{const le=mE.map(Re=>L.find(He=>He.name===Re)).filter(Re=>!!Re),ye=L.filter(Re=>!mE.includes(Re.name));return[...le,...ye]},[L]),kt=VI(x),Pa=YI(),Ut=Bp();C.useEffect(()=>fe.on("exam:status",ye=>{if(ye.status!=="ready"||ye.nodeId===q)return;const Re=i.find(He=>He.id===ye.nodeId);Re&&Ut.show(e("exam.ready.toast",{title:Re.title}),{duration:4e3})}),[q,i,Ut,e]);const zd=C.useCallback(async le=>{const ye=t.find(Re=>Re.id===le);try{await fe.deleteCourse(le),Ut.show(e("import.deleted",{title:(ye==null?void 0:ye.title)??le}),{duration:3e3}),On()}catch(Re){E(Re)}},[t,On,E,Ut,e]),Js=C.useCallback(async(le,ye,Re)=>{if(!le.trim()||Me.streaming)return;if(!Le.activeId){const xt=await Le.ensureThreadForSend(le,ye);if(xt){Me.send(le,xt,ye,Re);return}Ut.show(e("toast.threadCreateFailed"));return}const He=Le.activeThread;He&&!He.title&&Le.update(He.id,{title:(ye??le).trim()}),Me.send(le,void 0,ye,Re)},[Me,Le,Ut,e]),eo=C.useRef(Me.streaming);eo.current=Me.streaming;const Ji=C.useCallback(le=>{const ye=Yj(le,e),Re=qj(le,e),He=xt=>{var Ht;if(!eo.current){(Ht=pn.current)==null||Ht.call(pn,ye,Re);return}xt>0&&setTimeout(()=>He(xt-1),2e3)};He(10)},[e]);pn.current=Js;const Vr=new Set(["concept_map","diagram","compare_table","code_walkthrough"]),Gn=C.useMemo(()=>{const le=Yv(Me.messages).filter(Re=>{var He;return Vr.has(((He=Re.output)==null?void 0:He.artifactType)??"")});if(le.length)return le[le.length-1];const ye=kt.items.filter(Re=>Vr.has(Re.artifactType)).map(Re=>{try{return{id:Re.id,toolName:Re.artifactType,output:JSON.parse(Re.data)}}catch{return null}}).filter(Re=>Re!==null);return ye.length?ye[ye.length-1]:null},[Me.messages,kt.items]),Ba=C.useRef(new Set);C.useEffect(()=>{!Gn||Ba.current.has(Gn.id)||(Ba.current.add(Gn.id),Me.streaming&&Y("board"))},[Gn,Me.streaming]);const er=C.useMemo(()=>Me.messages.reduce((le,ye)=>le+ye.parts.reduce((Re,He)=>He.type==="text"?Re+ME(He.text):Re,0),0),[Me.messages]),za=C.useRef(!1);C.useEffect(()=>{Zi>0&&!za.current&&(za.current=!0,Ut.show(e("review.nudge",{n:Zi}),{duration:4e3}))},[Zi,Ut,e]);const Gt=C.useMemo(()=>Yv(Me.messages),[Me.messages]),to=C.useRef(new Set);C.useEffect(()=>{for(const le of Gt){const ye=le.output;if(!ye||!ye.artifactType)continue;const Re=`${ye.artifactType}:${JSON.stringify(ye)}`;to.current.has(Re)||(to.current.add(Re),kt.save({nodeId:q,artifactType:ye.artifactType,title:ye.title??null,data:ye}),Ut.show(e("toast.artifactSaved"),{duration:3e3}))}},[Gt,kt,q,Ut,e]),C.useEffect(()=>{N!=="map"&&Y(null)},[N]);const[Jl,ua]=C.useState(!1),[fi,no]=C.useState(!1);return m.jsxs("div",{className:"h-[var(--app-height,100vh)] flex flex-col bg-surface-1 text-neutral-900 dark:text-neutral-100 overflow-hidden",children:[m.jsx(sU,{streak:c,xp:f,fontSize:Pa.size,onFontBump:Pa.bump,onOpenSettings:()=>U(!0),leftVisible:$e,rightVisible:Nt,onToggleLeft:Te,onToggleRight:Ze,tier:Z,bottomBar:Z===3?m.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:up,label:e("pane.map"),testid:"t3-btn-rail"},{k:"chat",icon:MC,label:e("pane.chat"),testid:"t3-btn-chat"},{k:"notebook",icon:jC,label:e("pane.notes"),testid:"t3-btn-notebook"}].map(({k:le,icon:ye,label:Re,testid:He})=>m.jsx("button",{role:"tab","aria-selected":Se===le,"aria-label":Re,"data-testid":He,"data-tooltip":Re,onClick:()=>ve(le),className:`w-8 h-7 flex items-center justify-center rounded-md transition-colors ${Se===le?"bg-brand/20 text-brand":"text-ink-muted active:bg-ink/10"}`,children:m.jsx(ye,{className:"w-4 h-4"})},le))}):void 0}),g&&m.jsx(uU,{message:g,onClose:()=>y(null)}),m.jsxs("div",{className:"flex-1 flex min-h-0 min-w-0",onTouchStart:bt,onTouchEnd:gt,children:[$e&&m.jsx(u5,{fullWidth:Z===3,view:N,onViewChange:I,courseTitle:(Wi==null?void 0:Wi.title)??null,courseId:x,courses:t,sections:va,tree:i,progressMap:s,selectedNodeId:q,dueCount:Zi,dueNodeIds:Zs,overallMastery:(D==null?void 0:D.overallMastery)??0,streak:(c==null?void 0:c.currentStreak)??0,streaming:Me.streaming,onJumpNode:le=>{if(Me.streaming)return;const ye=i.find(Re=>Re.id===le);ye&&Qi(ye),Z===3&&ve("chat")},onOpenReview:()=>ua(!0),onSelectCourse:le=>$i(()=>{b(le),On()}),onDeleteCourse:le=>$i(()=>{zd(le)}),onCoursesChanged:()=>{On()},availableLanguages:T,currentLocale:M,onLocaleChange:async le=>{x&&(await fe.setCourseLanguage(x,le),_(le))}}),m.jsxs(m.Fragment,{children:[Ot&&m.jsx("div",{className:"flex flex-col h-full bg-surface-1 shrink-0 min-w-0 motion-safe:transition-[width] motion-safe:duration-200",style:Z===3?{flex:1}:Nt?{width:"clamp(480px, 36vw, 800px)"}:{flex:1},"data-testid":"chat-panel",children:x?(it==null?void 0:it.type)==="exam"?m.jsx(Cj,{examNode:it,locale:at,onSessionChange:Bd,paused:G.open,onExamCompleted:()=>{fe.getProgress(it.id).then(le=>{le&&l(ye=>({...ye,[it.id]:le}))})}}):m.jsxs(m.Fragment,{children:[m.jsx(Xj,{threads:Le.threads,activeThread:Le.activeThread,focusNodeTitle:(it==null?void 0:it.title)??null,onPickThread:le=>{Me.streaming||Le.setActiveId(le)},onCreate:()=>{Me.streaming||(Le.create({title:null}),Ut.show(e("toast.threadCreated")))},onRename:(le,ye)=>{Le.update(le,{title:ye}),Ut.show(e("toast.threadRenamed"))},onArchive:le=>{Le.update(le,{status:"archived"}),Ut.show(e("toast.threadArchived"),{duration:5e3,action:{label:e("action.undo"),onClick:()=>Le.update(le,{status:"active"})}})},onDelete:le=>{const ye=Le.removeWithUndo(le);ye&&(Ut.show(`${e("toast.threadDeleted")}${ye.title?`「${ye.title}」`:""}`,{duration:5e3,action:{label:e("action.undo"),onClick:()=>{Le.restore(ye),Ut.show(e("toast.restored"))}}}),setTimeout(()=>{fe.threadDelete(ye.id).catch(()=>{})},5500))}}),m.jsx($I,{messages:Me.messages,streaming:Me.streaming,onApplyProposal:Zl,onRejectProposal:Ws,summary:Je,onStartLearning:Ue!=null&&Ue.ready?ci:void 0,agentReady:(Ue==null?void 0:Ue.ready)??!1,onGotoSettings:()=>U(!0),hasNode:!!it,selectedNodeId:q,threadId:Le.activeId,onPickQuizAction:le=>{Js(le)},onQuizCompleted:Ji,cardMode:Z===3,chatNotes:kt.items.filter(le=>le.artifactType==="user_note"&&le.sourceAnchor),onSaveChatNote:(le,ye,Re,He)=>{!it||!Le.activeId||(kt.saveUserNote({nodeId:it.id,text:le,sourceType:"chat",sourceAnchor:{type:"chat",threadId:Le.activeId,msgId:ye,startOffset:Re,endOffset:He}}),Ut.show(e("toast.noteSaved"),{duration:2e3}))}}),m.jsx(Ej,{nodeId:q,agentReady:(Ue==null?void 0:Ue.ready)??!1,streaming:Me.streaming,souls:nn,activeSoul:R,starterPrompts:Me.messages.length>0?Ur:[],onPickSoul:Wl,onSend:Js,onStop:Me.stop,onLogFriction:q?(le,ye)=>{fe.logFriction(q,le,ye),Ut.show(e("chat.friction.saved"),{duration:2500})}:void 0,onGotoSettings:()=>U(!0),insertText:tt,historyTokens:er})]}):m.jsx("div",{className:"flex-1 flex items-center justify-center px-6","data-testid":"chat-no-course",children:m.jsxs("div",{className:"text-center max-w-sm",children:[m.jsx("div",{className:"text-5xl mb-4 opacity-30",children:"📚"}),m.jsx("div",{className:"text-title font-bold text-ink mb-2",children:e("course.empty.title")}),m.jsx("div",{className:"text-body text-ink-muted leading-relaxed",children:e("course.empty.desc")})]})})}),Nt&&m.jsx("main",{className:Z===3?"flex-1 min-w-0 bg-surface-2":"flex-1 min-w-[440px] bg-surface-2","data-testid":Z===3?"notebook-pane-full":void 0,children:m.jsx(BI,{selectedNode:it,items:kt.items,loading:kt.loading,forceTab:F,canvasArtifact:Gn,onUserTabChange:()=>Y(null),onRemove:le=>{kt.remove(le),Ut.show(e("toast.noteDeleted"))},onTogglePin:le=>{kt.togglePin(le)},onRecordQuizResult:(le,ye)=>{kt.recordQuizResult(le,ye)},onUpdateNoteComment:(le,ye)=>{kt.updateUserNoteComment(le,ye)},onSaveContentNote:(le,ye)=>{it&&(kt.saveUserNote({nodeId:it.id,text:le,sourceType:"content",sourceAnchor:ye}),Ut.show(e("toast.noteSaved"),{duration:2e3}))},onJumpToSource:qe,onQuoteToChat:se,locale:M,isReviewing:fi,onReviewDone:()=>no(!1)})})]})]}),W&&m.jsx(oU,{onClose:()=>U(!1)}),Jl&&m.jsx(lU,{onClose:()=>ua(!1),tree:i,dashboard:D,progressMap:s,onPickNode:le=>{$i(()=>{B(le),Y("content"),ua(!1),no(!0)})}}),G.open&&m.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50","data-testid":"exam-leave-modal",children:m.jsxs("div",{ref:re,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:[m.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[m.jsx(li,{className:"w-5 h-5 text-warning shrink-0"}),m.jsx("span",{className:"text-title font-bold text-ink",children:e("exam.leave.title")})]}),m.jsx("div",{className:"text-body text-ink-muted mb-5 leading-relaxed",children:e("exam.leave.message")}),m.jsxs("div",{className:"flex justify-end gap-2",children:[m.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")}),m.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 Ql(),"data-testid":"exam-leave-confirm",children:e("exam.leave.confirm")})]})]})}),lt&&m.jsx(Mj,{onClose:()=>st(!1),onPick:le=>{st(!1),rU(le)},hasNode:!!q}),m.jsx(v5,{}),m.jsx(aU,{})]})}function rU(e){window.dispatchEvent(new CustomEvent("lookatstudy-command",{detail:e}))}function sU({streak:e,xp:t,fontSize:n,onFontBump:i,onOpenSettings:o,leftVisible:s,rightVisible:l,onToggleLeft:c,onToggleRight:d,tier:f,bottomBar:p}){const x=Xe();return p?m.jsx("header",{className:"app-header shrink-0",children:m.jsxs("div",{className:"flex items-center h-12 px-4",children:[m.jsx("div",{className:"flex-1 flex items-center min-w-0",children:t&&m.jsxs("div",{className:"flex items-center gap-1 shrink-0","data-testid":"xp-bar",title:x("header.energy"),children:[m.jsx(d0,{className:`w-3.5 h-3.5 text-brand ${t.todayXp>=100?"energy-breathe":""}`,fill:t.todayXp>=100?"currentColor":"none","aria-hidden":"true"}),m.jsx("span",{className:"text-label font-bold tabular-nums text-brand",children:t.todayXp})]})}),p,m.jsx("div",{className:"flex-1 flex items-center justify-end",children:m.jsx("button",{onClick:o,"data-testid":"header-settings","aria-label":x("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:x("header.settings"),children:m.jsx(Gc,{className:"w-4 h-4"})})})]})}):m.jsx("header",{className:"app-header shrink-0 flex flex-col",children:m.jsxs("div",{className:"flex items-center pt-2.5 pb-3 px-6 justify-between",children:[m.jsx("div",{className:"flex items-center gap-2 min-w-0",children:m.jsxs("h1",{className:"text-body font-extrabold tracking-tight text-neutral-900 dark:text-neutral-100 select-none min-w-0 truncate",children:["Lookat",m.jsx("span",{className:"text-brand",children:"Study"})]})}),m.jsxs("div",{className:"flex items-center gap-3",children:[f!==3&&m.jsxs("div",{className:"flex items-center gap-0.5",children:[m.jsx("button",{onClick:c,"data-testid":"layout-toggle-left",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:x("header.toggleLeft"),children:m.jsx(LC,{className:"w-4 h-4"})}),m.jsx("button",{onClick:d,"data-testid":"layout-toggle-right",className:`w-7 h-7 flex items-center justify-center rounded-md transition-colors ${l?"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:x("header.toggleRight"),children:m.jsx(OC,{className:"w-4 h-4"})})]}),f!==3&&m.jsxs("div",{className:"flex items-center gap-0.5","data-testid":"font-size-control",children:[m.jsx("button",{onClick:()=>i("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:x("header.font.smaller"),children:"A-"}),m.jsx("button",{onClick:()=>i("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:x("header.font.larger"),children:"A+"})]}),t&&m.jsxs("div",{className:"flex items-center gap-1.5","data-testid":"xp-bar",title:x("header.energy"),children:[m.jsx(d0,{className:`w-3.5 h-3.5 text-brand ${t.todayXp>=100?"energy-breathe":""}`,fill:t.todayXp>=100?"currentColor":"none","aria-hidden":"true"}),m.jsx("div",{className:"w-16 h-2 bg-neutral-200 dark:bg-neutral-800 rounded-full overflow-hidden",children:m.jsx("div",{className:"h-full rounded-full bg-brand transition-all duration-500",style:{width:`${Math.min(100,Math.max(3,t.todayXp))}%`}})}),m.jsx("span",{className:"text-label font-bold tabular-nums text-brand",children:t.todayXp})]}),t&&m.jsx("div",{className:"flex items-center gap-1 px-2 py-0.5 rounded-full bg-brand/10","data-testid":"level-badge",title:x("header.level.title"),children:m.jsxs("span",{className:"text-label font-bold text-brand",children:["Lv.",t.level]})}),e&&m.jsx(cU,{streak:e}),m.jsx("button",{onClick:o,"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:x("header.settings"),children:m.jsx(Gc,{className:"w-4 h-4"})})]})]})})}function oU({onClose:e}){const t=Xe(),n=C.useRef(null);return Fs(n,!0),m.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end","data-testid":"settings-drawer",children:[m.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:e}),m.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:[m.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)] shrink-0",children:[m.jsx("h2",{className:"text-body font-bold",children:t("settings.title")}),m.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:"✕"})]}),m.jsx("div",{className:"flex-1 overflow-y-auto",children:m.jsx(Lj,{})})]})]})}function lU({onClose:e,tree:t,onPickNode:n,dashboard:i,progressMap:o}){const s=Xe(),l=C.useRef(null);Fs(l,!0);const[c,d]=C.useState([]);C.useEffect(()=>{fe.getAllSrsItems().then(_=>d(_)).catch(()=>d([]))},[]);const f=C.useMemo(()=>new Map(c.map(_=>[_.nodeId,_])),[c]),p=C.useMemo(()=>{const _=new Map(t.map(A=>[A.id,A])),L=c.filter(A=>_.has(A.nodeId));return{overdue:L.filter(A=>A.overdue),short:L.filter(A=>!A.overdue&&A.intervalDays>0&&A.intervalDays<=7),long:L.filter(A=>!A.overdue&&A.intervalDays>7),inactive:L.filter(A=>A.repetitions===0&&!A.overdue)}},[c,t]),x=C.useMemo(()=>t.filter(L=>L.type==="section"&&(L.world??"study")==="study").sort((L,A)=>L.orderIdx-A.orderIdx).map(L=>({section:L,lessons:t.filter(A=>A.parentId===L.id&&A.type==="lesson").sort((A,R)=>A.orderIdx-R.orderIdx)})),[t]),b=C.useMemo(()=>{const _=new Map;for(const L of(i==null?void 0:i.sections)??[])_.set(L.sectionId,L.avgMastery);return _},[i]),g=C.useMemo(()=>t.filter(_=>{var A;const L=(A=o[_.id])==null?void 0:A.status;return _.type==="lesson"&&(_.world??"study")==="study"&&(L==="in_progress"||L==="mastered")}),[t,o]),[y,E]=C.useState(new Set),T=_=>E(L=>{const A=new Set(L);return A.has(_)?A.delete(_):A.add(_),A}),w=_=>{const L=f.get(_);return L?L.overdue?{color:"bg-review",title:s("review.quadrant.overdue")}:L.intervalDays>0&&L.intervalDays<=7?{color:"bg-gold",title:s("review.quadrant.short")}:L.intervalDays>7?{color:"bg-brand",title:s("review.quadrant.long")}:null:null},M=p.overdue.length>0;return m.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end","data-testid":"review-drawer",children:[m.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:e}),m.jsxs("div",{ref:l,role:"dialog","aria-modal":"true","aria-label":s("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:[m.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)] shrink-0",children:[m.jsxs("h2",{className:"text-body font-bold flex items-center gap-1.5",children:[m.jsx(La,{className:"w-4 h-4","aria-hidden":"true"})," ",s("review.title")]}),m.jsx("button",{onClick:e,"data-testid":"review-close","aria-label":s("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:"✕"})]}),m.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-5","data-testid":"review-panel",children:[g.length>0&&m.jsxs("button",{onClick:()=>{const _=g[Math.floor(Math.random()*g.length)];_&&n(_.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:[m.jsx(qC,{className:"w-4 h-4"}),s("review.interleave")]}),c.length>0&&m.jsxs("div",{children:[m.jsx("div",{className:"text-caption font-bold text-ink-muted uppercase tracking-wider mb-2",children:s("review.srsHint")}),m.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:[{items:p.overdue,label:s("review.quadrant.overdue"),dot:"bg-review"},{items:p.short,label:s("review.quadrant.short"),dot:"bg-gold"},{items:p.long,label:s("review.quadrant.long"),dot:"bg-brand"},{items:p.inactive,label:s("review.quadrant.inactive"),dot:"bg-ink-faint"}].filter(_=>_.items.length>0).map(_=>m.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 rounded-full bg-surface-3",children:[m.jsx("span",{className:`w-2 h-2 rounded-full ${_.dot}`}),m.jsx("span",{className:"text-label text-ink-muted",children:_.label}),m.jsx("span",{className:"text-label font-extrabold text-ink-strong tabular-nums",children:_.items.length})]},_.label))}),M&&m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"text-label text-ink-faint mb-1.5",children:s("review.overdueQuickHint")}),m.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.overdue.slice(0,8).map(_=>{const L=t.find(A=>A.id===_.nodeId);return L?m.jsx("button",{onClick:()=>n(_.nodeId),"data-testid":`review-overdue-${_.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:L.title},_.nodeId):null})})]})]}),x.length>0&&m.jsxs("div",{children:[m.jsx("div",{className:"text-caption font-bold text-ink-muted uppercase tracking-wider mb-2",children:s("review.myProgress")}),m.jsx("div",{className:"space-y-1",children:x.map(({section:_,lessons:L})=>{const A=Math.round((b.get(_.id)??0)*100),R=y.has(_.id),j=L.filter(N=>{var D;const I=(D=o[N.id])==null?void 0:D.status;return I==="in_progress"||I==="mastered"});return m.jsxs("div",{children:[m.jsxs("button",{onClick:()=>T(_.id),className:"w-full flex items-center gap-2 p-2 rounded-lg hover:bg-surface-3 transition-colors",children:[R?m.jsx(op,{className:"w-3.5 h-3.5 text-ink-muted shrink-0"}):m.jsx(mC,{className:"w-3.5 h-3.5 text-ink-muted shrink-0"}),m.jsx("span",{className:"text-body text-ink-strong font-bold truncate flex-1 text-left",children:_.title}),j.length>0&&m.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[m.jsx("div",{className:"w-16 h-1.5 bg-surface-3 rounded-full overflow-hidden",children:m.jsx("div",{className:`h-full rounded-full ${A>=100?"bg-gold":"bg-brand"}`,style:{width:`${Math.max(3,A)}%`}})}),m.jsxs("span",{className:"text-label tabular-nums text-ink-muted w-8 text-right",children:[A,"%"]})]})]}),R&&m.jsx("div",{className:"ml-5 mt-0.5 mb-1 space-y-0.5","data-testid":"review-lesson-list",children:L.length===0?m.jsx("div",{className:"text-label text-ink-faint py-1.5 pl-1",children:"—"}):L.map(N=>{const I=o[N.id],D=I?Math.round((I.mastery??0)*100):null,P=w(N.id),z=(I==null?void 0:I.status)==="in_progress"||(I==null?void 0:I.status)==="mastered";return m.jsxs("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded-lg transition-colors ${(P==null?void 0:P.color)==="bg-review"?"bg-review/8":"hover:bg-surface-3"}`,children:[P?m.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${P.color} shrink-0`,title:P.title}):m.jsx("span",{className:"w-1.5 h-1.5 shrink-0"}),m.jsx("span",{className:`text-label truncate flex-1 ${z?"text-ink-strong":"text-ink-faint"}`,children:N.title}),D!==null&&m.jsxs("span",{className:"text-label tabular-nums text-ink-muted shrink-0 w-8 text-right",children:[D,"%"]}),z&&m.jsx("button",{onClick:()=>n(N.id),"data-testid":`review-lesson-${N.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:s("review.reviewLesson")})]},N.id)})})]},_.id)})})]}),i&&i.frictionByNode.length>0&&m.jsxs("div",{children:[m.jsx("div",{className:"text-caption font-bold text-review uppercase tracking-wider mb-1.5",children:s("dashboard.mini.struggle")}),i.frictionByNode.map(_=>m.jsxs("button",{onClick:()=>n(_.nodeId),className:"flex items-center gap-2 py-0.5 w-full text-left hover:bg-surface-3 rounded px-1",children:[m.jsxs("span",{className:"text-label text-review font-bold tabular-nums",children:[_.count,"×"]}),m.jsx("span",{className:"text-label text-ink-strong truncate flex-1",children:_.title})]},_.nodeId))]}),g.length===0&&c.length===0&&x.length===0&&m.jsxs("div",{className:"text-center py-16","data-testid":"review-empty",children:[m.jsx("div",{className:"text-4xl mb-3 opacity-30",children:"📖"}),m.jsx("div",{className:"text-body text-ink-muted",children:s("review.empty.title")}),m.jsx("div",{className:"text-label text-ink-faint mt-1",children:s("review.empty.desc")})]})]})]})]})}function uU({message:e,onClose:t}){const n=Xe();return m.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:[m.jsxs("span",{children:["⚠️ ",e]}),m.jsx("button",{className:"ml-3 underline text-warning-light",onClick:t,children:n("action.close")})]})}function cU({streak:e}){const t=Xe();return m.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:[m.jsx(SE,{className:"w-4 h-4 text-review flame-flicker"}),m.jsx("span",{className:"text-body font-extrabold text-review",children:e.currentStreak}),e.freezeCount>0&&m.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:[m.jsx(VC,{className:"w-3 h-3 text-review/80","aria-hidden":"true"}),m.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 dU({rejected:e}){const t=navigator.language.startsWith("zh"),[n,i]=sp.useState(""),o=s=>{s.preventDefault();const l=n.trim();if(!l)return;const c=l.includes("token=")?new URL(l).searchParams.get("token")??"":l;c&&qc(async()=>{const{setWebToken:d}=await import("./api-web-BydHmVA4.js");return{setWebToken:d}},[],import.meta.url).then(({setWebToken:d})=>d(c))};return m.jsx("div",{className:"min-h-[var(--app-height,100vh)] bg-[#0e2a12] flex items-center justify-center p-6",children:m.jsxs("form",{onSubmit:o,className:"w-full max-w-sm text-center",children:[m.jsx("div",{className:"text-4xl mb-3",children:"🎈"}),m.jsx("h1",{className:"text-title font-bold text-white mb-1",children:"LookatStudy"}),m.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&&m.jsx("p",{className:"text-label text-warning-light mb-3",children:t?"上次的令牌被拒绝了,请重新输入":"Previous token was rejected, please re-enter"}),m.jsx("input",{type:"text",value:n,onChange:s=>i(s.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"}),m.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"}),m.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 Bw=rC.createRoot(document.getElementById("root"));function fU(){Bw.render(m.jsx(sp.StrictMode,{children:m.jsx(LI,{children:m.jsx(iU,{})})}))}function pE(e){Bw.render(m.jsx(sp.StrictMode,{children:m.jsx(dU,{rejected:e})}))}async function hU(){const{installAppHeight:e}=await qc(async()=>{const{installAppHeight:t}=await import("./app-height-D5bf5z0g.js");return{installAppHeight:t}},[],import.meta.url);if(e(),!window.api){const t=await qc(()=>import("./api-web-BydHmVA4.js"),[],import.meta.url);if(window.addEventListener(t.TOKEN_REJECTED_EVENT,()=>pE(!0)),!t.hasWebToken()){pE(!1);return}try{await t.installWebApi()}catch(n){console.error("[boot] web api 安装失败:",n)}}fU()}hU();export{qc as _,Ol as g};
|