plotlink-ows 0.1.18 → 1.0.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/README.md +167 -67
- package/app/lib/publish.ts +134 -32
- package/app/routes/dashboard.ts +64 -13
- package/app/routes/publish.ts +52 -1
- package/app/routes/settings.ts +194 -0
- package/app/routes/stories.ts +75 -8
- package/app/routes/terminal.ts +167 -63
- package/app/server.ts +7 -1
- package/app/web/components/Dashboard.tsx +83 -32
- package/app/web/components/PreviewPanel.tsx +280 -41
- package/app/web/components/Settings.tsx +227 -3
- package/app/web/components/StoriesPage.tsx +121 -8
- package/app/web/components/StoryBrowser.tsx +32 -8
- package/app/web/components/TerminalPanel.tsx +384 -78
- package/app/web/dist/assets/index-BuOxhUWG.css +32 -0
- package/app/web/dist/assets/index-De8CpT47.js +129 -0
- package/app/web/dist/index.html +2 -2
- package/app/web/styles.css +18 -0
- package/bin/plotlink-ows.js +16 -61
- package/package.json +7 -2
- package/scripts/fix-index-status.ts +93 -0
- package/app/web/dist/assets/index-D5gfwaEX.css +0 -32
- package/app/web/dist/assets/index-pBt5Q_bN.js +0 -117
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const u of a)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&s(c)}).observe(document,{childList:!0,subtree:!0});function n(a){const u={};return a.integrity&&(u.integrity=a.integrity),a.referrerPolicy&&(u.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?u.credentials="include":a.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function s(a){if(a.ep)return;a.ep=!0;const u=n(a);fetch(a.href,u)}})();function nu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Dh={exports:{}},Rl={};/**
|
|
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 Mg;function V1(){if(Mg)return Rl;Mg=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(s,a,u){var c=null;if(u!==void 0&&(c=""+u),a.key!==void 0&&(c=""+a.key),"key"in a){u={};for(var d in a)d!=="key"&&(u[d]=a[d])}else u=a;return a=u.ref,{$$typeof:e,type:s,key:c,ref:a!==void 0?a:null,props:u}}return Rl.Fragment=t,Rl.jsx=n,Rl.jsxs=n,Rl}var Rg;function W1(){return Rg||(Rg=1,Dh.exports=V1()),Dh.exports}var E=W1(),Ah={exports:{}},we={};/**
|
|
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 Bg;function Y1(){if(Bg)return we;Bg=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),S=Symbol.iterator;function y(D){return D===null||typeof D!="object"?null:(D=S&&D[S]||D["@@iterator"],typeof D=="function"?D:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,B={};function A(D,Y,w){this.props=D,this.context=Y,this.refs=B,this.updater=w||b}A.prototype.isReactComponent={},A.prototype.setState=function(D,Y){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,Y,"setState")},A.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function Z(){}Z.prototype=A.prototype;function P(D,Y,w){this.props=D,this.context=Y,this.refs=B,this.updater=w||b}var ee=P.prototype=new Z;ee.constructor=P,C(ee,A.prototype),ee.isPureReactComponent=!0;var ne=Array.isArray;function z(){}var ie={H:null,A:null,T:null,S:null},ue=Object.prototype.hasOwnProperty;function _e(D,Y,w){var se=w.ref;return{$$typeof:e,type:D,key:Y,ref:se!==void 0?se:null,props:w}}function H(D,Y){return _e(D.type,Y,D.props)}function te(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function V(D){var Y={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(w){return Y[w]})}var I=/\/+/g;function K(D,Y){return typeof D=="object"&&D!==null&&D.key!=null?V(""+D.key):Y.toString(36)}function j(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(z,z):(D.status="pending",D.then(function(Y){D.status==="pending"&&(D.status="fulfilled",D.value=Y)},function(Y){D.status==="pending"&&(D.status="rejected",D.reason=Y)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function M(D,Y,w,se,de){var ce=typeof D;(ce==="undefined"||ce==="boolean")&&(D=null);var xe=!1;if(D===null)xe=!0;else switch(ce){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(D.$$typeof){case e:case t:xe=!0;break;case g:return xe=D._init,M(xe(D._payload),Y,w,se,de)}}if(xe)return de=de(D),xe=se===""?"."+K(D,0):se,ne(de)?(w="",xe!=null&&(w=xe.replace(I,"$&/")+"/"),M(de,Y,w,"",function(Ot){return Ot})):de!=null&&(te(de)&&(de=H(de,w+(de.key==null||D&&D.key===de.key?"":(""+de.key).replace(I,"$&/")+"/")+xe)),Y.push(de)),1;xe=0;var We=se===""?".":se+":";if(ne(D))for(var Ae=0;Ae<D.length;Ae++)se=D[Ae],ce=We+K(se,Ae),xe+=M(se,Y,w,ce,de);else if(Ae=y(D),typeof Ae=="function")for(D=Ae.call(D),Ae=0;!(se=D.next()).done;)se=se.value,ce=We+K(se,Ae++),xe+=M(se,Y,w,ce,de);else if(ce==="object"){if(typeof D.then=="function")return M(j(D),Y,w,se,de);throw Y=String(D),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return xe}function q(D,Y,w){if(D==null)return D;var se=[],de=0;return M(D,se,"","",function(ce){return Y.call(w,ce,de++)}),se}function W(D){if(D._status===-1){var Y=D._result;Y=Y(),Y.then(function(w){(D._status===0||D._status===-1)&&(D._status=1,D._result=w)},function(w){(D._status===0||D._status===-1)&&(D._status=2,D._result=w)}),D._status===-1&&(D._status=0,D._result=Y)}if(D._status===1)return D._result.default;throw D._result}var fe=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},k={map:q,forEach:function(D,Y,w){q(D,function(){Y.apply(this,arguments)},w)},count:function(D){var Y=0;return q(D,function(){Y++}),Y},toArray:function(D){return q(D,function(Y){return Y})||[]},only:function(D){if(!te(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return we.Activity=m,we.Children=k,we.Component=A,we.Fragment=n,we.Profiler=a,we.PureComponent=P,we.StrictMode=s,we.Suspense=p,we.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ie,we.__COMPILER_RUNTIME={__proto__:null,c:function(D){return ie.H.useMemoCache(D)}},we.cache=function(D){return function(){return D.apply(null,arguments)}},we.cacheSignal=function(){return null},we.cloneElement=function(D,Y,w){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var se=C({},D.props),de=D.key;if(Y!=null)for(ce in Y.key!==void 0&&(de=""+Y.key),Y)!ue.call(Y,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&Y.ref===void 0||(se[ce]=Y[ce]);var ce=arguments.length-2;if(ce===1)se.children=w;else if(1<ce){for(var xe=Array(ce),We=0;We<ce;We++)xe[We]=arguments[We+2];se.children=xe}return _e(D.type,de,se)},we.createContext=function(D){return D={$$typeof:c,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:u,_context:D},D},we.createElement=function(D,Y,w){var se,de={},ce=null;if(Y!=null)for(se in Y.key!==void 0&&(ce=""+Y.key),Y)ue.call(Y,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(de[se]=Y[se]);var xe=arguments.length-2;if(xe===1)de.children=w;else if(1<xe){for(var We=Array(xe),Ae=0;Ae<xe;Ae++)We[Ae]=arguments[Ae+2];de.children=We}if(D&&D.defaultProps)for(se in xe=D.defaultProps,xe)de[se]===void 0&&(de[se]=xe[se]);return _e(D,ce,de)},we.createRef=function(){return{current:null}},we.forwardRef=function(D){return{$$typeof:d,render:D}},we.isValidElement=te,we.lazy=function(D){return{$$typeof:g,_payload:{_status:-1,_result:D},_init:W}},we.memo=function(D,Y){return{$$typeof:h,type:D,compare:Y===void 0?null:Y}},we.startTransition=function(D){var Y=ie.T,w={};ie.T=w;try{var se=D(),de=ie.S;de!==null&&de(w,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(z,fe)}catch(ce){fe(ce)}finally{Y!==null&&w.types!==null&&(Y.types=w.types),ie.T=Y}},we.unstable_useCacheRefresh=function(){return ie.H.useCacheRefresh()},we.use=function(D){return ie.H.use(D)},we.useActionState=function(D,Y,w){return ie.H.useActionState(D,Y,w)},we.useCallback=function(D,Y){return ie.H.useCallback(D,Y)},we.useContext=function(D){return ie.H.useContext(D)},we.useDebugValue=function(){},we.useDeferredValue=function(D,Y){return ie.H.useDeferredValue(D,Y)},we.useEffect=function(D,Y){return ie.H.useEffect(D,Y)},we.useEffectEvent=function(D){return ie.H.useEffectEvent(D)},we.useId=function(){return ie.H.useId()},we.useImperativeHandle=function(D,Y,w){return ie.H.useImperativeHandle(D,Y,w)},we.useInsertionEffect=function(D,Y){return ie.H.useInsertionEffect(D,Y)},we.useLayoutEffect=function(D,Y){return ie.H.useLayoutEffect(D,Y)},we.useMemo=function(D,Y){return ie.H.useMemo(D,Y)},we.useOptimistic=function(D,Y){return ie.H.useOptimistic(D,Y)},we.useReducer=function(D,Y,w){return ie.H.useReducer(D,Y,w)},we.useRef=function(D){return ie.H.useRef(D)},we.useState=function(D){return ie.H.useState(D)},we.useSyncExternalStore=function(D,Y,w){return ie.H.useSyncExternalStore(D,Y,w)},we.useTransition=function(){return ie.H.useTransition()},we.version="19.2.3",we}var Og;function sd(){return Og||(Og=1,Ah.exports=Y1()),Ah.exports}var ge=sd();const K1=nu(ge);var Mh={exports:{}},Bl={},Rh={exports:{}},Bh={};/**
|
|
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 zg;function X1(){return zg||(zg=1,(function(e){function t(M,q){var W=M.length;M.push(q);e:for(;0<W;){var fe=W-1>>>1,k=M[fe];if(0<a(k,q))M[fe]=q,M[W]=k,W=fe;else break e}}function n(M){return M.length===0?null:M[0]}function s(M){if(M.length===0)return null;var q=M[0],W=M.pop();if(W!==q){M[0]=W;e:for(var fe=0,k=M.length,D=k>>>1;fe<D;){var Y=2*(fe+1)-1,w=M[Y],se=Y+1,de=M[se];if(0>a(w,W))se<k&&0>a(de,w)?(M[fe]=de,M[se]=W,fe=se):(M[fe]=w,M[Y]=W,fe=Y);else if(se<k&&0>a(de,W))M[fe]=de,M[se]=W,fe=se;else break e}}return q}function a(M,q){var W=M.sortIndex-q.sortIndex;return W!==0?W:M.id-q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var p=[],h=[],g=1,m=null,S=3,y=!1,b=!1,C=!1,B=!1,A=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;function ee(M){for(var q=n(h);q!==null;){if(q.callback===null)s(h);else if(q.startTime<=M)s(h),q.sortIndex=q.expirationTime,t(p,q);else break;q=n(h)}}function ne(M){if(C=!1,ee(M),!b)if(n(p)!==null)b=!0,z||(z=!0,V());else{var q=n(h);q!==null&&j(ne,q.startTime-M)}}var z=!1,ie=-1,ue=5,_e=-1;function H(){return B?!0:!(e.unstable_now()-_e<ue)}function te(){if(B=!1,z){var M=e.unstable_now();_e=M;var q=!0;try{e:{b=!1,C&&(C=!1,Z(ie),ie=-1),y=!0;var W=S;try{t:{for(ee(M),m=n(p);m!==null&&!(m.expirationTime>M&&H());){var fe=m.callback;if(typeof fe=="function"){m.callback=null,S=m.priorityLevel;var k=fe(m.expirationTime<=M);if(M=e.unstable_now(),typeof k=="function"){m.callback=k,ee(M),q=!0;break t}m===n(p)&&s(p),ee(M)}else s(p);m=n(p)}if(m!==null)q=!0;else{var D=n(h);D!==null&&j(ne,D.startTime-M),q=!1}}break e}finally{m=null,S=W,y=!1}q=void 0}}finally{q?V():z=!1}}}var V;if(typeof P=="function")V=function(){P(te)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,K=I.port2;I.port1.onmessage=te,V=function(){K.postMessage(null)}}else V=function(){A(te,0)};function j(M,q){ie=A(function(){M(e.unstable_now())},q)}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(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ue=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return S},e.unstable_next=function(M){switch(S){case 1:case 2:case 3:var q=3;break;default:q=S}var W=S;S=q;try{return M()}finally{S=W}},e.unstable_requestPaint=function(){B=!0},e.unstable_runWithPriority=function(M,q){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var W=S;S=M;try{return q()}finally{S=W}},e.unstable_scheduleCallback=function(M,q,W){var fe=e.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?fe+W:fe):W=fe,M){case 1:var k=-1;break;case 2:k=250;break;case 5:k=1073741823;break;case 4:k=1e4;break;default:k=5e3}return k=W+k,M={id:g++,callback:q,priorityLevel:M,startTime:W,expirationTime:k,sortIndex:-1},W>fe?(M.sortIndex=W,t(h,M),n(p)===null&&M===n(h)&&(C?(Z(ie),ie=-1):C=!0,j(ne,W-fe))):(M.sortIndex=k,t(p,M),b||y||(b=!0,z||(z=!0,V()))),M},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(M){var q=S;return function(){var W=S;S=q;try{return M.apply(this,arguments)}finally{S=W}}}})(Bh)),Bh}var Lg;function G1(){return Lg||(Lg=1,Rh.exports=X1()),Rh.exports}var Oh={exports:{}},It={};/**
|
|
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 Ng;function $1(){if(Ng)return It;Ng=1;var e=sd();function t(p){var h="https://react.dev/errors/"+p;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+p+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var s={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},a=Symbol.for("react.portal");function u(p,h,g){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:m==null?null:""+m,children:p,containerInfo:h,implementation:g}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(p,h){if(p==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return It.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,It.createPortal=function(p,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return u(p,h,null,g)},It.flushSync=function(p){var h=c.T,g=s.p;try{if(c.T=null,s.p=2,p)return p()}finally{c.T=h,s.p=g,s.d.f()}},It.preconnect=function(p,h){typeof p=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,s.d.C(p,h))},It.prefetchDNS=function(p){typeof p=="string"&&s.d.D(p)},It.preinit=function(p,h){if(typeof p=="string"&&h&&typeof h.as=="string"){var g=h.as,m=d(g,h.crossOrigin),S=typeof h.integrity=="string"?h.integrity:void 0,y=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?s.d.S(p,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:m,integrity:S,fetchPriority:y}):g==="script"&&s.d.X(p,{crossOrigin:m,integrity:S,fetchPriority:y,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},It.preinitModule=function(p,h){if(typeof p=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=d(h.as,h.crossOrigin);s.d.M(p,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&s.d.M(p)},It.preload=function(p,h){if(typeof p=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,m=d(g,h.crossOrigin);s.d.L(p,g,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},It.preloadModule=function(p,h){if(typeof p=="string")if(h){var g=d(h.as,h.crossOrigin);s.d.m(p,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else s.d.m(p)},It.requestFormReset=function(p){s.d.r(p)},It.unstable_batchedUpdates=function(p,h){return p(h)},It.useFormState=function(p,h,g){return c.H.useFormState(p,h,g)},It.useFormStatus=function(){return c.H.useHostTransitionStatus()},It.version="19.2.3",It}var Hg;function Z1(){if(Hg)return Oh.exports;Hg=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(),Oh.exports=$1(),Oh.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 jg;function Q1(){if(jg)return Bl;jg=1;var e=G1(),t=sd(),n=Z1();function s(i){var r="https://react.dev/errors/"+i;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)r+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+i+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function u(i){var r=i,l=i;if(i.alternate)for(;r.return;)r=r.return;else{i=r;do r=i,(r.flags&4098)!==0&&(l=r.return),i=r.return;while(i)}return r.tag===3?l:null}function c(i){if(i.tag===13){var r=i.memoizedState;if(r===null&&(i=i.alternate,i!==null&&(r=i.memoizedState)),r!==null)return r.dehydrated}return null}function d(i){if(i.tag===31){var r=i.memoizedState;if(r===null&&(i=i.alternate,i!==null&&(r=i.memoizedState)),r!==null)return r.dehydrated}return null}function p(i){if(u(i)!==i)throw Error(s(188))}function h(i){var r=i.alternate;if(!r){if(r=u(i),r===null)throw Error(s(188));return r!==i?null:i}for(var l=i,o=r;;){var f=l.return;if(f===null)break;var _=f.alternate;if(_===null){if(o=f.return,o!==null){l=o;continue}break}if(f.child===_.child){for(_=f.child;_;){if(_===l)return p(f),i;if(_===o)return p(f),r;_=_.sibling}throw Error(s(188))}if(l.return!==o.return)l=f,o=_;else{for(var v=!1,x=f.child;x;){if(x===l){v=!0,l=f,o=_;break}if(x===o){v=!0,o=f,l=_;break}x=x.sibling}if(!v){for(x=_.child;x;){if(x===l){v=!0,l=_,o=f;break}if(x===o){v=!0,o=_,l=f;break}x=x.sibling}if(!v)throw Error(s(189))}}if(l.alternate!==o)throw Error(s(190))}if(l.tag!==3)throw Error(s(188));return l.stateNode.current===l?i:r}function g(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i;for(i=i.child;i!==null;){if(r=g(i),r!==null)return r;i=i.sibling}return null}var m=Object.assign,S=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),Z=Symbol.for("react.consumer"),P=Symbol.for("react.context"),ee=Symbol.for("react.forward_ref"),ne=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),ie=Symbol.for("react.memo"),ue=Symbol.for("react.lazy"),_e=Symbol.for("react.activity"),H=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function V(i){return i===null||typeof i!="object"?null:(i=te&&i[te]||i["@@iterator"],typeof i=="function"?i:null)}var I=Symbol.for("react.client.reference");function K(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===I?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case C:return"Fragment";case A:return"Profiler";case B:return"StrictMode";case ne:return"Suspense";case z:return"SuspenseList";case _e:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case b:return"Portal";case P:return i.displayName||"Context";case Z:return(i._context.displayName||"Context")+".Consumer";case ee:var r=i.render;return i=i.displayName,i||(i=r.displayName||r.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case ie:return r=i.displayName||null,r!==null?r:K(i.type)||"Memo";case ue:r=i._payload,i=i._init;try{return K(i(r))}catch{}}return null}var j=Array.isArray,M=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},fe=[],k=-1;function D(i){return{current:i}}function Y(i){0>k||(i.current=fe[k],fe[k]=null,k--)}function w(i,r){k++,fe[k]=i.current,i.current=r}var se=D(null),de=D(null),ce=D(null),xe=D(null);function We(i,r){switch(w(ce,r),w(de,i),w(se,null),r.nodeType){case 9:case 11:i=(i=r.documentElement)&&(i=i.namespaceURI)?Jm(i):0;break;default:if(i=r.tagName,r=r.namespaceURI)r=Jm(r),i=eg(r,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}Y(se),w(se,i)}function Ae(){Y(se),Y(de),Y(ce)}function Ot(i){i.memoizedState!==null&&w(xe,i);var r=se.current,l=eg(r,i.type);r!==l&&(w(de,i),w(se,l))}function Wt(i){de.current===i&&(Y(se),Y(de)),xe.current===i&&(Y(xe),Tl._currentValue=W)}var Jt,He;function hi(i){if(Jt===void 0)try{throw Error()}catch(l){var r=l.stack.trim().match(/\n( *(at )?)/);Jt=r&&r[1]||"",He=-1<l.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Jt+i+He}var jr=!1;function Ur(i,r){if(!i||jr)return"";jr=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(r){var Q=function(){throw Error()};if(Object.defineProperty(Q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Q,[])}catch(F){var U=F}Reflect.construct(i,[],Q)}else{try{Q.call()}catch(F){U=F}i.call(Q.prototype)}}else{try{throw Error()}catch(F){U=F}(Q=i())&&typeof Q.catch=="function"&&Q.catch(function(){})}}catch(F){if(F&&U&&typeof F.stack=="string")return[F.stack,U.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=o.DetermineComponentFrameRoot(),v=_[0],x=_[1];if(v&&x){var T=v.split(`
|
|
44
|
-
`),N=x.split(`
|
|
45
|
-
`);for(f=o=0;o<T.length&&!T[o].includes("DetermineComponentFrameRoot");)o++;for(;f<N.length&&!N[f].includes("DetermineComponentFrameRoot");)f++;if(o===T.length||f===N.length)for(o=T.length-1,f=N.length-1;1<=o&&0<=f&&T[o]!==N[f];)f--;for(;1<=o&&0<=f;o--,f--)if(T[o]!==N[f]){if(o!==1||f!==1)do if(o--,f--,0>f||T[o]!==N[f]){var X=`
|
|
46
|
-
`+T[o].replace(" at new "," at ");return i.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",i.displayName)),X}while(1<=o&&0<=f);break}}}finally{jr=!1,Error.prepareStackTrace=l}return(l=i?i.displayName||i.name:"")?hi(l):""}function fa(i,r){switch(i.tag){case 26:case 27:case 5:return hi(i.type);case 16:return hi("Lazy");case 13:return i.child!==r&&r!==null?hi("Suspense Fallback"):hi("Suspense");case 19:return hi("SuspenseList");case 0:case 15:return Ur(i.type,!1);case 11:return Ur(i.type.render,!1);case 1:return Ur(i.type,!0);case 31:return hi("Activity");default:return""}}function da(i){try{var r="",l=null;do r+=fa(i,l),l=i,i=i.return;while(i);return r}catch(o){return`
|
|
47
|
-
Error generating stack: `+o.message+`
|
|
48
|
-
`+o.stack}}var Pr=Object.prototype.hasOwnProperty,Ir=e.unstable_scheduleCallback,Us=e.unstable_cancelCallback,du=e.unstable_shouldYield,pu=e.unstable_requestPaint,Yt=e.unstable_now,_u=e.unstable_getCurrentPriorityLevel,G=e.unstable_ImmediatePriority,ae=e.unstable_UserBlockingPriority,Se=e.unstable_NormalPriority,Me=e.unstable_LowPriority,Fe=e.unstable_IdlePriority,fi=e.log,rn=e.unstable_setDisableYieldValue,Kt=null,bt=null;function ei(i){if(typeof fi=="function"&&rn(i),bt&&typeof bt.setStrictMode=="function")try{bt.setStrictMode(Kt,i)}catch{}}var $e=Math.clz32?Math.clz32:M0,Dn=Math.log,Ui=Math.LN2;function M0(i){return i>>>=0,i===0?32:31-(Dn(i)/Ui|0)|0}var pa=256,_a=262144,ma=4194304;function or(i){var r=i&42;if(r!==0)return r;switch(i&-i){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 i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function ga(i,r,l){var o=i.pendingLanes;if(o===0)return 0;var f=0,_=i.suspendedLanes,v=i.pingedLanes;i=i.warmLanes;var x=o&134217727;return x!==0?(o=x&~_,o!==0?f=or(o):(v&=x,v!==0?f=or(v):l||(l=x&~i,l!==0&&(f=or(l))))):(x=o&~_,x!==0?f=or(x):v!==0?f=or(v):l||(l=o&~i,l!==0&&(f=or(l)))),f===0?0:r!==0&&r!==f&&(r&_)===0&&(_=f&-f,l=r&-r,_>=l||_===32&&(l&4194048)!==0)?r:f}function Ps(i,r){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&r)===0}function R0(i,r){switch(i){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 zd(){var i=ma;return ma<<=1,(ma&62914560)===0&&(ma=4194304),i}function mu(i){for(var r=[],l=0;31>l;l++)r.push(i);return r}function Is(i,r){i.pendingLanes|=r,r!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function B0(i,r,l,o,f,_){var v=i.pendingLanes;i.pendingLanes=l,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=l,i.entangledLanes&=l,i.errorRecoveryDisabledLanes&=l,i.shellSuspendCounter=0;var x=i.entanglements,T=i.expirationTimes,N=i.hiddenUpdates;for(l=v&~l;0<l;){var X=31-$e(l),Q=1<<X;x[X]=0,T[X]=-1;var U=N[X];if(U!==null)for(N[X]=null,X=0;X<U.length;X++){var F=U[X];F!==null&&(F.lane&=-536870913)}l&=~Q}o!==0&&Ld(i,o,0),_!==0&&f===0&&i.tag!==0&&(i.suspendedLanes|=_&~(v&~r))}function Ld(i,r,l){i.pendingLanes|=r,i.suspendedLanes&=~r;var o=31-$e(r);i.entangledLanes|=r,i.entanglements[o]=i.entanglements[o]|1073741824|l&261930}function Nd(i,r){var l=i.entangledLanes|=r;for(i=i.entanglements;l;){var o=31-$e(l),f=1<<o;f&r|i[o]&r&&(i[o]|=r),l&=~f}}function Hd(i,r){var l=r&-r;return l=(l&42)!==0?1:gu(l),(l&(i.suspendedLanes|r))!==0?0:l}function gu(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function vu(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function jd(){var i=q.p;return i!==0?i:(i=window.event,i===void 0?32:wg(i.type))}function Ud(i,r){var l=q.p;try{return q.p=i,r()}finally{q.p=l}}var An=Math.random().toString(36).slice(2),zt="__reactFiber$"+An,ti="__reactProps$"+An,Fr="__reactContainer$"+An,yu="__reactEvents$"+An,O0="__reactListeners$"+An,z0="__reactHandles$"+An,Pd="__reactResources$"+An,Fs="__reactMarker$"+An;function Su(i){delete i[zt],delete i[ti],delete i[yu],delete i[O0],delete i[z0]}function qr(i){var r=i[zt];if(r)return r;for(var l=i.parentNode;l;){if(r=l[Fr]||l[zt]){if(l=r.alternate,r.child!==null||l!==null&&l.child!==null)for(i=ag(i);i!==null;){if(l=i[zt])return l;i=ag(i)}return r}i=l,l=i.parentNode}return null}function Vr(i){if(i=i[zt]||i[Fr]){var r=i.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return i}return null}function qs(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i.stateNode;throw Error(s(33))}function Wr(i){var r=i[Pd];return r||(r=i[Pd]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Et(i){i[Fs]=!0}var Id=new Set,Fd={};function ur(i,r){Yr(i,r),Yr(i+"Capture",r)}function Yr(i,r){for(Fd[i]=r,i=0;i<r.length;i++)Id.add(r[i])}var L0=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]*$"),qd={},Vd={};function N0(i){return Pr.call(Vd,i)?!0:Pr.call(qd,i)?!1:L0.test(i)?Vd[i]=!0:(qd[i]=!0,!1)}function va(i,r,l){if(N0(r))if(l===null)i.removeAttribute(r);else{switch(typeof l){case"undefined":case"function":case"symbol":i.removeAttribute(r);return;case"boolean":var o=r.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){i.removeAttribute(r);return}}i.setAttribute(r,""+l)}}function ya(i,r,l){if(l===null)i.removeAttribute(r);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(r);return}i.setAttribute(r,""+l)}}function sn(i,r,l,o){if(o===null)i.removeAttribute(l);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(l);return}i.setAttributeNS(r,l,""+o)}}function Ci(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Wd(i){var r=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function H0(i,r,l){var o=Object.getOwnPropertyDescriptor(i.constructor.prototype,r);if(!i.hasOwnProperty(r)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var f=o.get,_=o.set;return Object.defineProperty(i,r,{configurable:!0,get:function(){return f.call(this)},set:function(v){l=""+v,_.call(this,v)}}),Object.defineProperty(i,r,{enumerable:o.enumerable}),{getValue:function(){return l},setValue:function(v){l=""+v},stopTracking:function(){i._valueTracker=null,delete i[r]}}}}function bu(i){if(!i._valueTracker){var r=Wd(i)?"checked":"value";i._valueTracker=H0(i,r,""+i[r])}}function Yd(i){if(!i)return!1;var r=i._valueTracker;if(!r)return!0;var l=r.getValue(),o="";return i&&(o=Wd(i)?i.checked?"true":"false":i.value),i=o,i!==l?(r.setValue(i),!0):!1}function Sa(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var j0=/[\n"\\]/g;function ki(i){return i.replace(j0,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function xu(i,r,l,o,f,_,v,x){i.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?i.type=v:i.removeAttribute("type"),r!=null?v==="number"?(r===0&&i.value===""||i.value!=r)&&(i.value=""+Ci(r)):i.value!==""+Ci(r)&&(i.value=""+Ci(r)):v!=="submit"&&v!=="reset"||i.removeAttribute("value"),r!=null?wu(i,v,Ci(r)):l!=null?wu(i,v,Ci(l)):o!=null&&i.removeAttribute("value"),f==null&&_!=null&&(i.defaultChecked=!!_),f!=null&&(i.checked=f&&typeof f!="function"&&typeof f!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?i.name=""+Ci(x):i.removeAttribute("name")}function Kd(i,r,l,o,f,_,v,x){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(i.type=_),r!=null||l!=null){if(!(_!=="submit"&&_!=="reset"||r!=null)){bu(i);return}l=l!=null?""+Ci(l):"",r=r!=null?""+Ci(r):l,x||r===i.value||(i.value=r),i.defaultValue=r}o=o??f,o=typeof o!="function"&&typeof o!="symbol"&&!!o,i.checked=x?i.checked:!!o,i.defaultChecked=!!o,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(i.name=v),bu(i)}function wu(i,r,l){r==="number"&&Sa(i.ownerDocument)===i||i.defaultValue===""+l||(i.defaultValue=""+l)}function Kr(i,r,l,o){if(i=i.options,r){r={};for(var f=0;f<l.length;f++)r["$"+l[f]]=!0;for(l=0;l<i.length;l++)f=r.hasOwnProperty("$"+i[l].value),i[l].selected!==f&&(i[l].selected=f),f&&o&&(i[l].defaultSelected=!0)}else{for(l=""+Ci(l),r=null,f=0;f<i.length;f++){if(i[f].value===l){i[f].selected=!0,o&&(i[f].defaultSelected=!0);return}r!==null||i[f].disabled||(r=i[f])}r!==null&&(r.selected=!0)}}function Xd(i,r,l){if(r!=null&&(r=""+Ci(r),r!==i.value&&(i.value=r),l==null)){i.defaultValue!==r&&(i.defaultValue=r);return}i.defaultValue=l!=null?""+Ci(l):""}function Gd(i,r,l,o){if(r==null){if(o!=null){if(l!=null)throw Error(s(92));if(j(o)){if(1<o.length)throw Error(s(93));o=o[0]}l=o}l==null&&(l=""),r=l}l=Ci(r),i.defaultValue=l,o=i.textContent,o===l&&o!==""&&o!==null&&(i.value=o),bu(i)}function Xr(i,r){if(r){var l=i.firstChild;if(l&&l===i.lastChild&&l.nodeType===3){l.nodeValue=r;return}}i.textContent=r}var U0=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 $d(i,r,l){var o=r.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?o?i.setProperty(r,""):r==="float"?i.cssFloat="":i[r]="":o?i.setProperty(r,l):typeof l!="number"||l===0||U0.has(r)?r==="float"?i.cssFloat=l:i[r]=(""+l).trim():i[r]=l+"px"}function Zd(i,r,l){if(r!=null&&typeof r!="object")throw Error(s(62));if(i=i.style,l!=null){for(var o in l)!l.hasOwnProperty(o)||r!=null&&r.hasOwnProperty(o)||(o.indexOf("--")===0?i.setProperty(o,""):o==="float"?i.cssFloat="":i[o]="");for(var f in r)o=r[f],r.hasOwnProperty(f)&&l[f]!==o&&$d(i,f,o)}else for(var _ in r)r.hasOwnProperty(_)&&$d(i,_,r[_])}function Cu(i){if(i.indexOf("-")===-1)return!1;switch(i){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 P0=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"]]),I0=/^[\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 ba(i){return I0.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function ln(){}var ku=null;function Eu(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Gr=null,$r=null;function Qd(i){var r=Vr(i);if(r&&(i=r.stateNode)){var l=i[ti]||null;e:switch(i=r.stateNode,r.type){case"input":if(xu(i,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),r=l.name,l.type==="radio"&&r!=null){for(l=i;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+ki(""+r)+'"][type="radio"]'),r=0;r<l.length;r++){var o=l[r];if(o!==i&&o.form===i.form){var f=o[ti]||null;if(!f)throw Error(s(90));xu(o,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(r=0;r<l.length;r++)o=l[r],o.form===i.form&&Yd(o)}break e;case"textarea":Xd(i,l.value,l.defaultValue);break e;case"select":r=l.value,r!=null&&Kr(i,!!l.multiple,r,!1)}}}var Tu=!1;function Jd(i,r,l){if(Tu)return i(r,l);Tu=!0;try{var o=i(r);return o}finally{if(Tu=!1,(Gr!==null||$r!==null)&&(oo(),Gr&&(r=Gr,i=$r,$r=Gr=null,Qd(r),i)))for(r=0;r<i.length;r++)Qd(i[r])}}function Vs(i,r){var l=i.stateNode;if(l===null)return null;var o=l[ti]||null;if(o===null)return null;l=o[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":(o=!o.disabled)||(i=i.type,o=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!o;break e;default:i=!1}if(i)return null;if(l&&typeof l!="function")throw Error(s(231,r,typeof l));return l}var an=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Du=!1;if(an)try{var Ws={};Object.defineProperty(Ws,"passive",{get:function(){Du=!0}}),window.addEventListener("test",Ws,Ws),window.removeEventListener("test",Ws,Ws)}catch{Du=!1}var Mn=null,Au=null,xa=null;function ep(){if(xa)return xa;var i,r=Au,l=r.length,o,f="value"in Mn?Mn.value:Mn.textContent,_=f.length;for(i=0;i<l&&r[i]===f[i];i++);var v=l-i;for(o=1;o<=v&&r[l-o]===f[_-o];o++);return xa=f.slice(i,1<o?1-o:void 0)}function wa(i){var r=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&r===13&&(i=13)):i=r,i===10&&(i=13),32<=i||i===13?i:0}function Ca(){return!0}function tp(){return!1}function ii(i){function r(l,o,f,_,v){this._reactName=l,this._targetInst=f,this.type=o,this.nativeEvent=_,this.target=v,this.currentTarget=null;for(var x in i)i.hasOwnProperty(x)&&(l=i[x],this[x]=l?l(_):_[x]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?Ca:tp,this.isPropagationStopped=tp,this}return m(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Ca)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Ca)},persist:function(){},isPersistent:Ca}),r}var cr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ka=ii(cr),Ys=m({},cr,{view:0,detail:0}),F0=ii(Ys),Mu,Ru,Ks,Ea=m({},Ys,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ou,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Ks&&(Ks&&i.type==="mousemove"?(Mu=i.screenX-Ks.screenX,Ru=i.screenY-Ks.screenY):Ru=Mu=0,Ks=i),Mu)},movementY:function(i){return"movementY"in i?i.movementY:Ru}}),ip=ii(Ea),q0=m({},Ea,{dataTransfer:0}),V0=ii(q0),W0=m({},Ys,{relatedTarget:0}),Bu=ii(W0),Y0=m({},cr,{animationName:0,elapsedTime:0,pseudoElement:0}),K0=ii(Y0),X0=m({},cr,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),G0=ii(X0),$0=m({},cr,{data:0}),np=ii($0),Z0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Q0={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"},J0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function eb(i){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(i):(i=J0[i])?!!r[i]:!1}function Ou(){return eb}var tb=m({},Ys,{key:function(i){if(i.key){var r=Z0[i.key]||i.key;if(r!=="Unidentified")return r}return i.type==="keypress"?(i=wa(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?Q0[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ou,charCode:function(i){return i.type==="keypress"?wa(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?wa(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),ib=ii(tb),nb=m({},Ea,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),rp=ii(nb),rb=m({},Ys,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ou}),sb=ii(rb),lb=m({},cr,{propertyName:0,elapsedTime:0,pseudoElement:0}),ab=ii(lb),ob=m({},Ea,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),ub=ii(ob),cb=m({},cr,{newState:0,oldState:0}),hb=ii(cb),fb=[9,13,27,32],zu=an&&"CompositionEvent"in window,Xs=null;an&&"documentMode"in document&&(Xs=document.documentMode);var db=an&&"TextEvent"in window&&!Xs,sp=an&&(!zu||Xs&&8<Xs&&11>=Xs),lp=" ",ap=!1;function op(i,r){switch(i){case"keyup":return fb.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function up(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Zr=!1;function pb(i,r){switch(i){case"compositionend":return up(r);case"keypress":return r.which!==32?null:(ap=!0,lp);case"textInput":return i=r.data,i===lp&&ap?null:i;default:return null}}function _b(i,r){if(Zr)return i==="compositionend"||!zu&&op(i,r)?(i=ep(),xa=Au=Mn=null,Zr=!1,i):null;switch(i){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 sp&&r.locale!=="ko"?null:r.data;default:return null}}var mb={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 cp(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r==="input"?!!mb[i.type]:r==="textarea"}function hp(i,r,l,o){Gr?$r?$r.push(o):$r=[o]:Gr=o,r=mo(r,"onChange"),0<r.length&&(l=new ka("onChange","change",null,l,o),i.push({event:l,listeners:r}))}var Gs=null,$s=null;function gb(i){Km(i,0)}function Ta(i){var r=qs(i);if(Yd(r))return i}function fp(i,r){if(i==="change")return r}var dp=!1;if(an){var Lu;if(an){var Nu="oninput"in document;if(!Nu){var pp=document.createElement("div");pp.setAttribute("oninput","return;"),Nu=typeof pp.oninput=="function"}Lu=Nu}else Lu=!1;dp=Lu&&(!document.documentMode||9<document.documentMode)}function _p(){Gs&&(Gs.detachEvent("onpropertychange",mp),$s=Gs=null)}function mp(i){if(i.propertyName==="value"&&Ta($s)){var r=[];hp(r,$s,i,Eu(i)),Jd(gb,r)}}function vb(i,r,l){i==="focusin"?(_p(),Gs=r,$s=l,Gs.attachEvent("onpropertychange",mp)):i==="focusout"&&_p()}function yb(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Ta($s)}function Sb(i,r){if(i==="click")return Ta(r)}function bb(i,r){if(i==="input"||i==="change")return Ta(r)}function xb(i,r){return i===r&&(i!==0||1/i===1/r)||i!==i&&r!==r}var di=typeof Object.is=="function"?Object.is:xb;function Zs(i,r){if(di(i,r))return!0;if(typeof i!="object"||i===null||typeof r!="object"||r===null)return!1;var l=Object.keys(i),o=Object.keys(r);if(l.length!==o.length)return!1;for(o=0;o<l.length;o++){var f=l[o];if(!Pr.call(r,f)||!di(i[f],r[f]))return!1}return!0}function gp(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function vp(i,r){var l=gp(i);i=0;for(var o;l;){if(l.nodeType===3){if(o=i+l.textContent.length,i<=r&&o>=r)return{node:l,offset:r-i};i=o}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=gp(l)}}function yp(i,r){return i&&r?i===r?!0:i&&i.nodeType===3?!1:r&&r.nodeType===3?yp(i,r.parentNode):"contains"in i?i.contains(r):i.compareDocumentPosition?!!(i.compareDocumentPosition(r)&16):!1:!1}function Sp(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var r=Sa(i.document);r instanceof i.HTMLIFrameElement;){try{var l=typeof r.contentWindow.location.href=="string"}catch{l=!1}if(l)i=r.contentWindow;else break;r=Sa(i.document)}return r}function Hu(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r&&(r==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||r==="textarea"||i.contentEditable==="true")}var wb=an&&"documentMode"in document&&11>=document.documentMode,Qr=null,ju=null,Qs=null,Uu=!1;function bp(i,r,l){var o=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Uu||Qr==null||Qr!==Sa(o)||(o=Qr,"selectionStart"in o&&Hu(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Qs&&Zs(Qs,o)||(Qs=o,o=mo(ju,"onSelect"),0<o.length&&(r=new ka("onSelect","select",null,r,l),i.push({event:r,listeners:o}),r.target=Qr)))}function hr(i,r){var l={};return l[i.toLowerCase()]=r.toLowerCase(),l["Webkit"+i]="webkit"+r,l["Moz"+i]="moz"+r,l}var Jr={animationend:hr("Animation","AnimationEnd"),animationiteration:hr("Animation","AnimationIteration"),animationstart:hr("Animation","AnimationStart"),transitionrun:hr("Transition","TransitionRun"),transitionstart:hr("Transition","TransitionStart"),transitioncancel:hr("Transition","TransitionCancel"),transitionend:hr("Transition","TransitionEnd")},Pu={},xp={};an&&(xp=document.createElement("div").style,"AnimationEvent"in window||(delete Jr.animationend.animation,delete Jr.animationiteration.animation,delete Jr.animationstart.animation),"TransitionEvent"in window||delete Jr.transitionend.transition);function fr(i){if(Pu[i])return Pu[i];if(!Jr[i])return i;var r=Jr[i],l;for(l in r)if(r.hasOwnProperty(l)&&l in xp)return Pu[i]=r[l];return i}var wp=fr("animationend"),Cp=fr("animationiteration"),kp=fr("animationstart"),Cb=fr("transitionrun"),kb=fr("transitionstart"),Eb=fr("transitioncancel"),Ep=fr("transitionend"),Tp=new Map,Iu="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(" ");Iu.push("scrollEnd");function Pi(i,r){Tp.set(i,r),ur(r,[i])}var Da=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Ei=[],es=0,Fu=0;function Aa(){for(var i=es,r=Fu=es=0;r<i;){var l=Ei[r];Ei[r++]=null;var o=Ei[r];Ei[r++]=null;var f=Ei[r];Ei[r++]=null;var _=Ei[r];if(Ei[r++]=null,o!==null&&f!==null){var v=o.pending;v===null?f.next=f:(f.next=v.next,v.next=f),o.pending=f}_!==0&&Dp(l,f,_)}}function Ma(i,r,l,o){Ei[es++]=i,Ei[es++]=r,Ei[es++]=l,Ei[es++]=o,Fu|=o,i.lanes|=o,i=i.alternate,i!==null&&(i.lanes|=o)}function qu(i,r,l,o){return Ma(i,r,l,o),Ra(i)}function dr(i,r){return Ma(i,null,null,r),Ra(i)}function Dp(i,r,l){i.lanes|=l;var o=i.alternate;o!==null&&(o.lanes|=l);for(var f=!1,_=i.return;_!==null;)_.childLanes|=l,o=_.alternate,o!==null&&(o.childLanes|=l),_.tag===22&&(i=_.stateNode,i===null||i._visibility&1||(f=!0)),i=_,_=_.return;return i.tag===3?(_=i.stateNode,f&&r!==null&&(f=31-$e(l),i=_.hiddenUpdates,o=i[f],o===null?i[f]=[r]:o.push(r),r.lane=l|536870912),_):null}function Ra(i){if(50<Sl)throw Sl=0,Qc=null,Error(s(185));for(var r=i.return;r!==null;)i=r,r=i.return;return i.tag===3?i.stateNode:null}var ts={};function Tb(i,r,l,o){this.tag=i,this.key=l,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=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function pi(i,r,l,o){return new Tb(i,r,l,o)}function Vu(i){return i=i.prototype,!(!i||!i.isReactComponent)}function on(i,r){var l=i.alternate;return l===null?(l=pi(i.tag,r,i.key,i.mode),l.elementType=i.elementType,l.type=i.type,l.stateNode=i.stateNode,l.alternate=i,i.alternate=l):(l.pendingProps=r,l.type=i.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=i.flags&65011712,l.childLanes=i.childLanes,l.lanes=i.lanes,l.child=i.child,l.memoizedProps=i.memoizedProps,l.memoizedState=i.memoizedState,l.updateQueue=i.updateQueue,r=i.dependencies,l.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},l.sibling=i.sibling,l.index=i.index,l.ref=i.ref,l.refCleanup=i.refCleanup,l}function Ap(i,r){i.flags&=65011714;var l=i.alternate;return l===null?(i.childLanes=0,i.lanes=r,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=l.childLanes,i.lanes=l.lanes,i.child=l.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=l.memoizedProps,i.memoizedState=l.memoizedState,i.updateQueue=l.updateQueue,i.type=l.type,r=l.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),i}function Ba(i,r,l,o,f,_){var v=0;if(o=i,typeof i=="function")Vu(i)&&(v=1);else if(typeof i=="string")v=B1(i,l,se.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case _e:return i=pi(31,l,r,f),i.elementType=_e,i.lanes=_,i;case C:return pr(l.children,f,_,r);case B:v=8,f|=24;break;case A:return i=pi(12,l,r,f|2),i.elementType=A,i.lanes=_,i;case ne:return i=pi(13,l,r,f),i.elementType=ne,i.lanes=_,i;case z:return i=pi(19,l,r,f),i.elementType=z,i.lanes=_,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case P:v=10;break e;case Z:v=9;break e;case ee:v=11;break e;case ie:v=14;break e;case ue:v=16,o=null;break e}v=29,l=Error(s(130,i===null?"null":typeof i,"")),o=null}return r=pi(v,l,r,f),r.elementType=i,r.type=o,r.lanes=_,r}function pr(i,r,l,o){return i=pi(7,i,o,r),i.lanes=l,i}function Wu(i,r,l){return i=pi(6,i,null,r),i.lanes=l,i}function Mp(i){var r=pi(18,null,null,0);return r.stateNode=i,r}function Yu(i,r,l){return r=pi(4,i.children!==null?i.children:[],i.key,r),r.lanes=l,r.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},r}var Rp=new WeakMap;function Ti(i,r){if(typeof i=="object"&&i!==null){var l=Rp.get(i);return l!==void 0?l:(r={value:i,source:r,stack:da(r)},Rp.set(i,r),r)}return{value:i,source:r,stack:da(r)}}var is=[],ns=0,Oa=null,Js=0,Di=[],Ai=0,Rn=null,Wi=1,Yi="";function un(i,r){is[ns++]=Js,is[ns++]=Oa,Oa=i,Js=r}function Bp(i,r,l){Di[Ai++]=Wi,Di[Ai++]=Yi,Di[Ai++]=Rn,Rn=i;var o=Wi;i=Yi;var f=32-$e(o)-1;o&=~(1<<f),l+=1;var _=32-$e(r)+f;if(30<_){var v=f-f%5;_=(o&(1<<v)-1).toString(32),o>>=v,f-=v,Wi=1<<32-$e(r)+f|l<<f|o,Yi=_+i}else Wi=1<<_|l<<f|o,Yi=i}function Ku(i){i.return!==null&&(un(i,1),Bp(i,1,0))}function Xu(i){for(;i===Oa;)Oa=is[--ns],is[ns]=null,Js=is[--ns],is[ns]=null;for(;i===Rn;)Rn=Di[--Ai],Di[Ai]=null,Yi=Di[--Ai],Di[Ai]=null,Wi=Di[--Ai],Di[Ai]=null}function Op(i,r){Di[Ai++]=Wi,Di[Ai++]=Yi,Di[Ai++]=Rn,Wi=r.id,Yi=r.overflow,Rn=i}var Lt=null,et=null,Ne=!1,Bn=null,Mi=!1,Gu=Error(s(519));function On(i){var r=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw el(Ti(r,i)),Gu}function zp(i){var r=i.stateNode,l=i.type,o=i.memoizedProps;switch(r[zt]=i,r[ti]=o,l){case"dialog":Be("cancel",r),Be("close",r);break;case"iframe":case"object":case"embed":Be("load",r);break;case"video":case"audio":for(l=0;l<xl.length;l++)Be(xl[l],r);break;case"source":Be("error",r);break;case"img":case"image":case"link":Be("error",r),Be("load",r);break;case"details":Be("toggle",r);break;case"input":Be("invalid",r),Kd(r,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Be("invalid",r);break;case"textarea":Be("invalid",r),Gd(r,o.value,o.defaultValue,o.children)}l=o.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||r.textContent===""+l||o.suppressHydrationWarning===!0||Zm(r.textContent,l)?(o.popover!=null&&(Be("beforetoggle",r),Be("toggle",r)),o.onScroll!=null&&Be("scroll",r),o.onScrollEnd!=null&&Be("scrollend",r),o.onClick!=null&&(r.onclick=ln),r=!0):r=!1,r||On(i,!0)}function Lp(i){for(Lt=i.return;Lt;)switch(Lt.tag){case 5:case 31:case 13:Mi=!1;return;case 27:case 3:Mi=!0;return;default:Lt=Lt.return}}function rs(i){if(i!==Lt)return!1;if(!Ne)return Lp(i),Ne=!0,!1;var r=i.tag,l;if((l=r!==3&&r!==27)&&((l=r===5)&&(l=i.type,l=!(l!=="form"&&l!=="button")||dh(i.type,i.memoizedProps)),l=!l),l&&et&&On(i),Lp(i),r===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(s(317));et=lg(i)}else if(r===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(s(317));et=lg(i)}else r===27?(r=et,Kn(i.type)?(i=vh,vh=null,et=i):et=r):et=Lt?Bi(i.stateNode.nextSibling):null;return!0}function _r(){et=Lt=null,Ne=!1}function $u(){var i=Bn;return i!==null&&(li===null?li=i:li.push.apply(li,i),Bn=null),i}function el(i){Bn===null?Bn=[i]:Bn.push(i)}var Zu=D(null),mr=null,cn=null;function zn(i,r,l){w(Zu,r._currentValue),r._currentValue=l}function hn(i){i._currentValue=Zu.current,Y(Zu)}function Qu(i,r,l){for(;i!==null;){var o=i.alternate;if((i.childLanes&r)!==r?(i.childLanes|=r,o!==null&&(o.childLanes|=r)):o!==null&&(o.childLanes&r)!==r&&(o.childLanes|=r),i===l)break;i=i.return}}function Ju(i,r,l,o){var f=i.child;for(f!==null&&(f.return=i);f!==null;){var _=f.dependencies;if(_!==null){var v=f.child;_=_.firstContext;e:for(;_!==null;){var x=_;_=f;for(var T=0;T<r.length;T++)if(x.context===r[T]){_.lanes|=l,x=_.alternate,x!==null&&(x.lanes|=l),Qu(_.return,l,i),o||(v=null);break e}_=x.next}}else if(f.tag===18){if(v=f.return,v===null)throw Error(s(341));v.lanes|=l,_=v.alternate,_!==null&&(_.lanes|=l),Qu(v,l,i),v=null}else v=f.child;if(v!==null)v.return=f;else for(v=f;v!==null;){if(v===i){v=null;break}if(f=v.sibling,f!==null){f.return=v.return,v=f;break}v=v.return}f=v}}function ss(i,r,l,o){i=null;for(var f=r,_=!1;f!==null;){if(!_){if((f.flags&524288)!==0)_=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var v=f.alternate;if(v===null)throw Error(s(387));if(v=v.memoizedProps,v!==null){var x=f.type;di(f.pendingProps.value,v.value)||(i!==null?i.push(x):i=[x])}}else if(f===xe.current){if(v=f.alternate,v===null)throw Error(s(387));v.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(i!==null?i.push(Tl):i=[Tl])}f=f.return}i!==null&&Ju(r,i,l,o),r.flags|=262144}function za(i){for(i=i.firstContext;i!==null;){if(!di(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function gr(i){mr=i,cn=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Nt(i){return Np(mr,i)}function La(i,r){return mr===null&&gr(i),Np(i,r)}function Np(i,r){var l=r._currentValue;if(r={context:r,memoizedValue:l,next:null},cn===null){if(i===null)throw Error(s(308));cn=r,i.dependencies={lanes:0,firstContext:r},i.flags|=524288}else cn=cn.next=r;return l}var Db=typeof AbortController<"u"?AbortController:function(){var i=[],r=this.signal={aborted:!1,addEventListener:function(l,o){i.push(o)}};this.abort=function(){r.aborted=!0,i.forEach(function(l){return l()})}},Ab=e.unstable_scheduleCallback,Mb=e.unstable_NormalPriority,pt={$$typeof:P,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ec(){return{controller:new Db,data:new Map,refCount:0}}function tl(i){i.refCount--,i.refCount===0&&Ab(Mb,function(){i.controller.abort()})}var il=null,tc=0,ls=0,as=null;function Rb(i,r){if(il===null){var l=il=[];tc=0,ls=rh(),as={status:"pending",value:void 0,then:function(o){l.push(o)}}}return tc++,r.then(Hp,Hp),r}function Hp(){if(--tc===0&&il!==null){as!==null&&(as.status="fulfilled");var i=il;il=null,ls=0,as=null;for(var r=0;r<i.length;r++)(0,i[r])()}}function Bb(i,r){var l=[],o={status:"pending",value:null,reason:null,then:function(f){l.push(f)}};return i.then(function(){o.status="fulfilled",o.value=r;for(var f=0;f<l.length;f++)(0,l[f])(r)},function(f){for(o.status="rejected",o.reason=f,f=0;f<l.length;f++)(0,l[f])(void 0)}),o}var jp=M.S;M.S=function(i,r){bm=Yt(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&Rb(i,r),jp!==null&&jp(i,r)};var vr=D(null);function ic(){var i=vr.current;return i!==null?i:Ze.pooledCache}function Na(i,r){r===null?w(vr,vr.current):w(vr,r.pool)}function Up(){var i=ic();return i===null?null:{parent:pt._currentValue,pool:i}}var os=Error(s(460)),nc=Error(s(474)),Ha=Error(s(542)),ja={then:function(){}};function Pp(i){return i=i.status,i==="fulfilled"||i==="rejected"}function Ip(i,r,l){switch(l=i[l],l===void 0?i.push(r):l!==r&&(r.then(ln,ln),r=l),r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,qp(i),i;default:if(typeof r.status=="string")r.then(ln,ln);else{if(i=Ze,i!==null&&100<i.shellSuspendCounter)throw Error(s(482));i=r,i.status="pending",i.then(function(o){if(r.status==="pending"){var f=r;f.status="fulfilled",f.value=o}},function(o){if(r.status==="pending"){var f=r;f.status="rejected",f.reason=o}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,qp(i),i}throw Sr=r,os}}function yr(i){try{var r=i._init;return r(i._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Sr=l,os):l}}var Sr=null;function Fp(){if(Sr===null)throw Error(s(459));var i=Sr;return Sr=null,i}function qp(i){if(i===os||i===Ha)throw Error(s(483))}var us=null,nl=0;function Ua(i){var r=nl;return nl+=1,us===null&&(us=[]),Ip(us,i,r)}function rl(i,r){r=r.props.ref,i.ref=r!==void 0?r:null}function Pa(i,r){throw r.$$typeof===S?Error(s(525)):(i=Object.prototype.toString.call(r),Error(s(31,i==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":i)))}function Vp(i){function r(O,R){if(i){var L=O.deletions;L===null?(O.deletions=[R],O.flags|=16):L.push(R)}}function l(O,R){if(!i)return null;for(;R!==null;)r(O,R),R=R.sibling;return null}function o(O){for(var R=new Map;O!==null;)O.key!==null?R.set(O.key,O):R.set(O.index,O),O=O.sibling;return R}function f(O,R){return O=on(O,R),O.index=0,O.sibling=null,O}function _(O,R,L){return O.index=L,i?(L=O.alternate,L!==null?(L=L.index,L<R?(O.flags|=67108866,R):L):(O.flags|=67108866,R)):(O.flags|=1048576,R)}function v(O){return i&&O.alternate===null&&(O.flags|=67108866),O}function x(O,R,L,$){return R===null||R.tag!==6?(R=Wu(L,O.mode,$),R.return=O,R):(R=f(R,L),R.return=O,R)}function T(O,R,L,$){var me=L.type;return me===C?X(O,R,L.props.children,$,L.key):R!==null&&(R.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===ue&&yr(me)===R.type)?(R=f(R,L.props),rl(R,L),R.return=O,R):(R=Ba(L.type,L.key,L.props,null,O.mode,$),rl(R,L),R.return=O,R)}function N(O,R,L,$){return R===null||R.tag!==4||R.stateNode.containerInfo!==L.containerInfo||R.stateNode.implementation!==L.implementation?(R=Yu(L,O.mode,$),R.return=O,R):(R=f(R,L.children||[]),R.return=O,R)}function X(O,R,L,$,me){return R===null||R.tag!==7?(R=pr(L,O.mode,$,me),R.return=O,R):(R=f(R,L),R.return=O,R)}function Q(O,R,L){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=Wu(""+R,O.mode,L),R.return=O,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case y:return L=Ba(R.type,R.key,R.props,null,O.mode,L),rl(L,R),L.return=O,L;case b:return R=Yu(R,O.mode,L),R.return=O,R;case ue:return R=yr(R),Q(O,R,L)}if(j(R)||V(R))return R=pr(R,O.mode,L,null),R.return=O,R;if(typeof R.then=="function")return Q(O,Ua(R),L);if(R.$$typeof===P)return Q(O,La(O,R),L);Pa(O,R)}return null}function U(O,R,L,$){var me=R!==null?R.key:null;if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return me!==null?null:x(O,R,""+L,$);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case y:return L.key===me?T(O,R,L,$):null;case b:return L.key===me?N(O,R,L,$):null;case ue:return L=yr(L),U(O,R,L,$)}if(j(L)||V(L))return me!==null?null:X(O,R,L,$,null);if(typeof L.then=="function")return U(O,R,Ua(L),$);if(L.$$typeof===P)return U(O,R,La(O,L),$);Pa(O,L)}return null}function F(O,R,L,$,me){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return O=O.get(L)||null,x(R,O,""+$,me);if(typeof $=="object"&&$!==null){switch($.$$typeof){case y:return O=O.get($.key===null?L:$.key)||null,T(R,O,$,me);case b:return O=O.get($.key===null?L:$.key)||null,N(R,O,$,me);case ue:return $=yr($),F(O,R,L,$,me)}if(j($)||V($))return O=O.get(L)||null,X(R,O,$,me,null);if(typeof $.then=="function")return F(O,R,L,Ua($),me);if($.$$typeof===P)return F(O,R,L,La(R,$),me);Pa(R,$)}return null}function he(O,R,L,$){for(var me=null,Ue=null,pe=R,ke=R=0,Le=null;pe!==null&&ke<L.length;ke++){pe.index>ke?(Le=pe,pe=null):Le=pe.sibling;var Pe=U(O,pe,L[ke],$);if(Pe===null){pe===null&&(pe=Le);break}i&&pe&&Pe.alternate===null&&r(O,pe),R=_(Pe,R,ke),Ue===null?me=Pe:Ue.sibling=Pe,Ue=Pe,pe=Le}if(ke===L.length)return l(O,pe),Ne&&un(O,ke),me;if(pe===null){for(;ke<L.length;ke++)pe=Q(O,L[ke],$),pe!==null&&(R=_(pe,R,ke),Ue===null?me=pe:Ue.sibling=pe,Ue=pe);return Ne&&un(O,ke),me}for(pe=o(pe);ke<L.length;ke++)Le=F(pe,O,ke,L[ke],$),Le!==null&&(i&&Le.alternate!==null&&pe.delete(Le.key===null?ke:Le.key),R=_(Le,R,ke),Ue===null?me=Le:Ue.sibling=Le,Ue=Le);return i&&pe.forEach(function(Qn){return r(O,Qn)}),Ne&&un(O,ke),me}function ye(O,R,L,$){if(L==null)throw Error(s(151));for(var me=null,Ue=null,pe=R,ke=R=0,Le=null,Pe=L.next();pe!==null&&!Pe.done;ke++,Pe=L.next()){pe.index>ke?(Le=pe,pe=null):Le=pe.sibling;var Qn=U(O,pe,Pe.value,$);if(Qn===null){pe===null&&(pe=Le);break}i&&pe&&Qn.alternate===null&&r(O,pe),R=_(Qn,R,ke),Ue===null?me=Qn:Ue.sibling=Qn,Ue=Qn,pe=Le}if(Pe.done)return l(O,pe),Ne&&un(O,ke),me;if(pe===null){for(;!Pe.done;ke++,Pe=L.next())Pe=Q(O,Pe.value,$),Pe!==null&&(R=_(Pe,R,ke),Ue===null?me=Pe:Ue.sibling=Pe,Ue=Pe);return Ne&&un(O,ke),me}for(pe=o(pe);!Pe.done;ke++,Pe=L.next())Pe=F(pe,O,ke,Pe.value,$),Pe!==null&&(i&&Pe.alternate!==null&&pe.delete(Pe.key===null?ke:Pe.key),R=_(Pe,R,ke),Ue===null?me=Pe:Ue.sibling=Pe,Ue=Pe);return i&&pe.forEach(function(q1){return r(O,q1)}),Ne&&un(O,ke),me}function Xe(O,R,L,$){if(typeof L=="object"&&L!==null&&L.type===C&&L.key===null&&(L=L.props.children),typeof L=="object"&&L!==null){switch(L.$$typeof){case y:e:{for(var me=L.key;R!==null;){if(R.key===me){if(me=L.type,me===C){if(R.tag===7){l(O,R.sibling),$=f(R,L.props.children),$.return=O,O=$;break e}}else if(R.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===ue&&yr(me)===R.type){l(O,R.sibling),$=f(R,L.props),rl($,L),$.return=O,O=$;break e}l(O,R);break}else r(O,R);R=R.sibling}L.type===C?($=pr(L.props.children,O.mode,$,L.key),$.return=O,O=$):($=Ba(L.type,L.key,L.props,null,O.mode,$),rl($,L),$.return=O,O=$)}return v(O);case b:e:{for(me=L.key;R!==null;){if(R.key===me)if(R.tag===4&&R.stateNode.containerInfo===L.containerInfo&&R.stateNode.implementation===L.implementation){l(O,R.sibling),$=f(R,L.children||[]),$.return=O,O=$;break e}else{l(O,R);break}else r(O,R);R=R.sibling}$=Yu(L,O.mode,$),$.return=O,O=$}return v(O);case ue:return L=yr(L),Xe(O,R,L,$)}if(j(L))return he(O,R,L,$);if(V(L)){if(me=V(L),typeof me!="function")throw Error(s(150));return L=me.call(L),ye(O,R,L,$)}if(typeof L.then=="function")return Xe(O,R,Ua(L),$);if(L.$$typeof===P)return Xe(O,R,La(O,L),$);Pa(O,L)}return typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint"?(L=""+L,R!==null&&R.tag===6?(l(O,R.sibling),$=f(R,L),$.return=O,O=$):(l(O,R),$=Wu(L,O.mode,$),$.return=O,O=$),v(O)):l(O,R)}return function(O,R,L,$){try{nl=0;var me=Xe(O,R,L,$);return us=null,me}catch(pe){if(pe===os||pe===Ha)throw pe;var Ue=pi(29,pe,null,O.mode);return Ue.lanes=$,Ue.return=O,Ue}finally{}}}var br=Vp(!0),Wp=Vp(!1),Ln=!1;function rc(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function sc(i,r){i=i.updateQueue,r.updateQueue===i&&(r.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Nn(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Hn(i,r,l){var o=i.updateQueue;if(o===null)return null;if(o=o.shared,(Ie&2)!==0){var f=o.pending;return f===null?r.next=r:(r.next=f.next,f.next=r),o.pending=r,r=Ra(i),Dp(i,null,l),r}return Ma(i,o,r,l),Ra(i)}function sl(i,r,l){if(r=r.updateQueue,r!==null&&(r=r.shared,(l&4194048)!==0)){var o=r.lanes;o&=i.pendingLanes,l|=o,r.lanes=l,Nd(i,l)}}function lc(i,r){var l=i.updateQueue,o=i.alternate;if(o!==null&&(o=o.updateQueue,l===o)){var f=null,_=null;if(l=l.firstBaseUpdate,l!==null){do{var v={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};_===null?f=_=v:_=_.next=v,l=l.next}while(l!==null);_===null?f=_=r:_=_.next=r}else f=_=r;l={baseState:o.baseState,firstBaseUpdate:f,lastBaseUpdate:_,shared:o.shared,callbacks:o.callbacks},i.updateQueue=l;return}i=l.lastBaseUpdate,i===null?l.firstBaseUpdate=r:i.next=r,l.lastBaseUpdate=r}var ac=!1;function ll(){if(ac){var i=as;if(i!==null)throw i}}function al(i,r,l,o){ac=!1;var f=i.updateQueue;Ln=!1;var _=f.firstBaseUpdate,v=f.lastBaseUpdate,x=f.shared.pending;if(x!==null){f.shared.pending=null;var T=x,N=T.next;T.next=null,v===null?_=N:v.next=N,v=T;var X=i.alternate;X!==null&&(X=X.updateQueue,x=X.lastBaseUpdate,x!==v&&(x===null?X.firstBaseUpdate=N:x.next=N,X.lastBaseUpdate=T))}if(_!==null){var Q=f.baseState;v=0,X=N=T=null,x=_;do{var U=x.lane&-536870913,F=U!==x.lane;if(F?(ze&U)===U:(o&U)===U){U!==0&&U===ls&&(ac=!0),X!==null&&(X=X.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});e:{var he=i,ye=x;U=r;var Xe=l;switch(ye.tag){case 1:if(he=ye.payload,typeof he=="function"){Q=he.call(Xe,Q,U);break e}Q=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=ye.payload,U=typeof he=="function"?he.call(Xe,Q,U):he,U==null)break e;Q=m({},Q,U);break e;case 2:Ln=!0}}U=x.callback,U!==null&&(i.flags|=64,F&&(i.flags|=8192),F=f.callbacks,F===null?f.callbacks=[U]:F.push(U))}else F={lane:U,tag:x.tag,payload:x.payload,callback:x.callback,next:null},X===null?(N=X=F,T=Q):X=X.next=F,v|=U;if(x=x.next,x===null){if(x=f.shared.pending,x===null)break;F=x,x=F.next,F.next=null,f.lastBaseUpdate=F,f.shared.pending=null}}while(!0);X===null&&(T=Q),f.baseState=T,f.firstBaseUpdate=N,f.lastBaseUpdate=X,_===null&&(f.shared.lanes=0),Fn|=v,i.lanes=v,i.memoizedState=Q}}function Yp(i,r){if(typeof i!="function")throw Error(s(191,i));i.call(r)}function Kp(i,r){var l=i.callbacks;if(l!==null)for(i.callbacks=null,i=0;i<l.length;i++)Yp(l[i],r)}var cs=D(null),Ia=D(0);function Xp(i,r){i=Sn,w(Ia,i),w(cs,r),Sn=i|r.baseLanes}function oc(){w(Ia,Sn),w(cs,cs.current)}function uc(){Sn=Ia.current,Y(cs),Y(Ia)}var _i=D(null),Ri=null;function jn(i){var r=i.alternate;w(ht,ht.current&1),w(_i,i),Ri===null&&(r===null||cs.current!==null||r.memoizedState!==null)&&(Ri=i)}function cc(i){w(ht,ht.current),w(_i,i),Ri===null&&(Ri=i)}function Gp(i){i.tag===22?(w(ht,ht.current),w(_i,i),Ri===null&&(Ri=i)):Un()}function Un(){w(ht,ht.current),w(_i,_i.current)}function mi(i){Y(_i),Ri===i&&(Ri=null),Y(ht)}var ht=D(0);function Fa(i){for(var r=i;r!==null;){if(r.tag===13){var l=r.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||mh(l)||gh(l)))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===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var fn=0,Ce=null,Ye=null,_t=null,qa=!1,hs=!1,xr=!1,Va=0,ol=0,fs=null,Ob=0;function at(){throw Error(s(321))}function hc(i,r){if(r===null)return!1;for(var l=0;l<r.length&&l<i.length;l++)if(!di(i[l],r[l]))return!1;return!0}function fc(i,r,l,o,f,_){return fn=_,Ce=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,M.H=i===null||i.memoizedState===null?B_:Tc,xr=!1,_=l(o,f),xr=!1,hs&&(_=Zp(r,l,o,f)),$p(i),_}function $p(i){M.H=hl;var r=Ye!==null&&Ye.next!==null;if(fn=0,_t=Ye=Ce=null,qa=!1,ol=0,fs=null,r)throw Error(s(300));i===null||mt||(i=i.dependencies,i!==null&&za(i)&&(mt=!0))}function Zp(i,r,l,o){Ce=i;var f=0;do{if(hs&&(fs=null),ol=0,hs=!1,25<=f)throw Error(s(301));if(f+=1,_t=Ye=null,i.updateQueue!=null){var _=i.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}M.H=O_,_=r(l,o)}while(hs);return _}function zb(){var i=M.H,r=i.useState()[0];return r=typeof r.then=="function"?ul(r):r,i=i.useState()[0],(Ye!==null?Ye.memoizedState:null)!==i&&(Ce.flags|=1024),r}function dc(){var i=Va!==0;return Va=0,i}function pc(i,r,l){r.updateQueue=i.updateQueue,r.flags&=-2053,i.lanes&=~l}function _c(i){if(qa){for(i=i.memoizedState;i!==null;){var r=i.queue;r!==null&&(r.pending=null),i=i.next}qa=!1}fn=0,_t=Ye=Ce=null,hs=!1,ol=Va=0,fs=null}function Xt(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _t===null?Ce.memoizedState=_t=i:_t=_t.next=i,_t}function ft(){if(Ye===null){var i=Ce.alternate;i=i!==null?i.memoizedState:null}else i=Ye.next;var r=_t===null?Ce.memoizedState:_t.next;if(r!==null)_t=r,Ye=i;else{if(i===null)throw Ce.alternate===null?Error(s(467)):Error(s(310));Ye=i,i={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},_t===null?Ce.memoizedState=_t=i:_t=_t.next=i}return _t}function Wa(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ul(i){var r=ol;return ol+=1,fs===null&&(fs=[]),i=Ip(fs,i,r),r=Ce,(_t===null?r.memoizedState:_t.next)===null&&(r=r.alternate,M.H=r===null||r.memoizedState===null?B_:Tc),i}function Ya(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return ul(i);if(i.$$typeof===P)return Nt(i)}throw Error(s(438,String(i)))}function mc(i){var r=null,l=Ce.updateQueue;if(l!==null&&(r=l.memoCache),r==null){var o=Ce.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(r={data:o.data.map(function(f){return f.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),l===null&&(l=Wa(),Ce.updateQueue=l),l.memoCache=r,l=r.data[r.index],l===void 0)for(l=r.data[r.index]=Array(i),o=0;o<i;o++)l[o]=H;return r.index++,l}function dn(i,r){return typeof r=="function"?r(i):r}function Ka(i){var r=ft();return gc(r,Ye,i)}function gc(i,r,l){var o=i.queue;if(o===null)throw Error(s(311));o.lastRenderedReducer=l;var f=i.baseQueue,_=o.pending;if(_!==null){if(f!==null){var v=f.next;f.next=_.next,_.next=v}r.baseQueue=f=_,o.pending=null}if(_=i.baseState,f===null)i.memoizedState=_;else{r=f.next;var x=v=null,T=null,N=r,X=!1;do{var Q=N.lane&-536870913;if(Q!==N.lane?(ze&Q)===Q:(fn&Q)===Q){var U=N.revertLane;if(U===0)T!==null&&(T=T.next={lane:0,revertLane:0,gesture:null,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null}),Q===ls&&(X=!0);else if((fn&U)===U){N=N.next,U===ls&&(X=!0);continue}else Q={lane:0,revertLane:N.revertLane,gesture:null,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null},T===null?(x=T=Q,v=_):T=T.next=Q,Ce.lanes|=U,Fn|=U;Q=N.action,xr&&l(_,Q),_=N.hasEagerState?N.eagerState:l(_,Q)}else U={lane:Q,revertLane:N.revertLane,gesture:N.gesture,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null},T===null?(x=T=U,v=_):T=T.next=U,Ce.lanes|=Q,Fn|=Q;N=N.next}while(N!==null&&N!==r);if(T===null?v=_:T.next=x,!di(_,i.memoizedState)&&(mt=!0,X&&(l=as,l!==null)))throw l;i.memoizedState=_,i.baseState=v,i.baseQueue=T,o.lastRenderedState=_}return f===null&&(o.lanes=0),[i.memoizedState,o.dispatch]}function vc(i){var r=ft(),l=r.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=i;var o=l.dispatch,f=l.pending,_=r.memoizedState;if(f!==null){l.pending=null;var v=f=f.next;do _=i(_,v.action),v=v.next;while(v!==f);di(_,r.memoizedState)||(mt=!0),r.memoizedState=_,r.baseQueue===null&&(r.baseState=_),l.lastRenderedState=_}return[_,o]}function Qp(i,r,l){var o=Ce,f=ft(),_=Ne;if(_){if(l===void 0)throw Error(s(407));l=l()}else l=r();var v=!di((Ye||f).memoizedState,l);if(v&&(f.memoizedState=l,mt=!0),f=f.queue,bc(t_.bind(null,o,f,i),[i]),f.getSnapshot!==r||v||_t!==null&&_t.memoizedState.tag&1){if(o.flags|=2048,ds(9,{destroy:void 0},e_.bind(null,o,f,l,r),null),Ze===null)throw Error(s(349));_||(fn&127)!==0||Jp(o,r,l)}return l}function Jp(i,r,l){i.flags|=16384,i={getSnapshot:r,value:l},r=Ce.updateQueue,r===null?(r=Wa(),Ce.updateQueue=r,r.stores=[i]):(l=r.stores,l===null?r.stores=[i]:l.push(i))}function e_(i,r,l,o){r.value=l,r.getSnapshot=o,i_(r)&&n_(i)}function t_(i,r,l){return l(function(){i_(r)&&n_(i)})}function i_(i){var r=i.getSnapshot;i=i.value;try{var l=r();return!di(i,l)}catch{return!0}}function n_(i){var r=dr(i,2);r!==null&&ai(r,i,2)}function yc(i){var r=Xt();if(typeof i=="function"){var l=i;if(i=l(),xr){ei(!0);try{l()}finally{ei(!1)}}}return r.memoizedState=r.baseState=i,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:dn,lastRenderedState:i},r}function r_(i,r,l,o){return i.baseState=l,gc(i,Ye,typeof o=="function"?o:dn)}function Lb(i,r,l,o,f){if($a(i))throw Error(s(485));if(i=r.action,i!==null){var _={payload:f,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){_.listeners.push(v)}};M.T!==null?l(!0):_.isTransition=!1,o(_),l=r.pending,l===null?(_.next=r.pending=_,s_(r,_)):(_.next=l.next,r.pending=l.next=_)}}function s_(i,r){var l=r.action,o=r.payload,f=i.state;if(r.isTransition){var _=M.T,v={};M.T=v;try{var x=l(f,o),T=M.S;T!==null&&T(v,x),l_(i,r,x)}catch(N){Sc(i,r,N)}finally{_!==null&&v.types!==null&&(_.types=v.types),M.T=_}}else try{_=l(f,o),l_(i,r,_)}catch(N){Sc(i,r,N)}}function l_(i,r,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(o){a_(i,r,o)},function(o){return Sc(i,r,o)}):a_(i,r,l)}function a_(i,r,l){r.status="fulfilled",r.value=l,o_(r),i.state=l,r=i.pending,r!==null&&(l=r.next,l===r?i.pending=null:(l=l.next,r.next=l,s_(i,l)))}function Sc(i,r,l){var o=i.pending;if(i.pending=null,o!==null){o=o.next;do r.status="rejected",r.reason=l,o_(r),r=r.next;while(r!==o)}i.action=null}function o_(i){i=i.listeners;for(var r=0;r<i.length;r++)(0,i[r])()}function u_(i,r){return r}function c_(i,r){if(Ne){var l=Ze.formState;if(l!==null){e:{var o=Ce;if(Ne){if(et){t:{for(var f=et,_=Mi;f.nodeType!==8;){if(!_){f=null;break t}if(f=Bi(f.nextSibling),f===null){f=null;break t}}_=f.data,f=_==="F!"||_==="F"?f:null}if(f){et=Bi(f.nextSibling),o=f.data==="F!";break e}}On(o)}o=!1}o&&(r=l[0])}}return l=Xt(),l.memoizedState=l.baseState=r,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:u_,lastRenderedState:r},l.queue=o,l=A_.bind(null,Ce,o),o.dispatch=l,o=yc(!1),_=Ec.bind(null,Ce,!1,o.queue),o=Xt(),f={state:r,dispatch:null,action:i,pending:null},o.queue=f,l=Lb.bind(null,Ce,f,_,l),f.dispatch=l,o.memoizedState=i,[r,l,!1]}function h_(i){var r=ft();return f_(r,Ye,i)}function f_(i,r,l){if(r=gc(i,r,u_)[0],i=Ka(dn)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var o=ul(r)}catch(v){throw v===os?Ha:v}else o=r;r=ft();var f=r.queue,_=f.dispatch;return l!==r.memoizedState&&(Ce.flags|=2048,ds(9,{destroy:void 0},Nb.bind(null,f,l),null)),[o,_,i]}function Nb(i,r){i.action=r}function d_(i){var r=ft(),l=Ye;if(l!==null)return f_(r,l,i);ft(),r=r.memoizedState,l=ft();var o=l.queue.dispatch;return l.memoizedState=i,[r,o,!1]}function ds(i,r,l,o){return i={tag:i,create:l,deps:o,inst:r,next:null},r=Ce.updateQueue,r===null&&(r=Wa(),Ce.updateQueue=r),l=r.lastEffect,l===null?r.lastEffect=i.next=i:(o=l.next,l.next=i,i.next=o,r.lastEffect=i),i}function p_(){return ft().memoizedState}function Xa(i,r,l,o){var f=Xt();Ce.flags|=i,f.memoizedState=ds(1|r,{destroy:void 0},l,o===void 0?null:o)}function Ga(i,r,l,o){var f=ft();o=o===void 0?null:o;var _=f.memoizedState.inst;Ye!==null&&o!==null&&hc(o,Ye.memoizedState.deps)?f.memoizedState=ds(r,_,l,o):(Ce.flags|=i,f.memoizedState=ds(1|r,_,l,o))}function __(i,r){Xa(8390656,8,i,r)}function bc(i,r){Ga(2048,8,i,r)}function Hb(i){Ce.flags|=4;var r=Ce.updateQueue;if(r===null)r=Wa(),Ce.updateQueue=r,r.events=[i];else{var l=r.events;l===null?r.events=[i]:l.push(i)}}function m_(i){var r=ft().memoizedState;return Hb({ref:r,nextImpl:i}),function(){if((Ie&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function g_(i,r){return Ga(4,2,i,r)}function v_(i,r){return Ga(4,4,i,r)}function y_(i,r){if(typeof r=="function"){i=i();var l=r(i);return function(){typeof l=="function"?l():r(null)}}if(r!=null)return i=i(),r.current=i,function(){r.current=null}}function S_(i,r,l){l=l!=null?l.concat([i]):null,Ga(4,4,y_.bind(null,r,i),l)}function xc(){}function b_(i,r){var l=ft();r=r===void 0?null:r;var o=l.memoizedState;return r!==null&&hc(r,o[1])?o[0]:(l.memoizedState=[i,r],i)}function x_(i,r){var l=ft();r=r===void 0?null:r;var o=l.memoizedState;if(r!==null&&hc(r,o[1]))return o[0];if(o=i(),xr){ei(!0);try{i()}finally{ei(!1)}}return l.memoizedState=[o,r],o}function wc(i,r,l){return l===void 0||(fn&1073741824)!==0&&(ze&261930)===0?i.memoizedState=r:(i.memoizedState=l,i=wm(),Ce.lanes|=i,Fn|=i,l)}function w_(i,r,l,o){return di(l,r)?l:cs.current!==null?(i=wc(i,l,o),di(i,r)||(mt=!0),i):(fn&42)===0||(fn&1073741824)!==0&&(ze&261930)===0?(mt=!0,i.memoizedState=l):(i=wm(),Ce.lanes|=i,Fn|=i,r)}function C_(i,r,l,o,f){var _=q.p;q.p=_!==0&&8>_?_:8;var v=M.T,x={};M.T=x,Ec(i,!1,r,l);try{var T=f(),N=M.S;if(N!==null&&N(x,T),T!==null&&typeof T=="object"&&typeof T.then=="function"){var X=Bb(T,o);cl(i,r,X,yi(i))}else cl(i,r,o,yi(i))}catch(Q){cl(i,r,{then:function(){},status:"rejected",reason:Q},yi())}finally{q.p=_,v!==null&&x.types!==null&&(v.types=x.types),M.T=v}}function jb(){}function Cc(i,r,l,o){if(i.tag!==5)throw Error(s(476));var f=k_(i).queue;C_(i,f,r,W,l===null?jb:function(){return E_(i),l(o)})}function k_(i){var r=i.memoizedState;if(r!==null)return r;r={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:dn,lastRenderedState:W},next:null};var l={};return r.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:dn,lastRenderedState:l},next:null},i.memoizedState=r,i=i.alternate,i!==null&&(i.memoizedState=r),r}function E_(i){var r=k_(i);r.next===null&&(r=i.alternate.memoizedState),cl(i,r.next.queue,{},yi())}function kc(){return Nt(Tl)}function T_(){return ft().memoizedState}function D_(){return ft().memoizedState}function Ub(i){for(var r=i.return;r!==null;){switch(r.tag){case 24:case 3:var l=yi();i=Nn(l);var o=Hn(r,i,l);o!==null&&(ai(o,r,l),sl(o,r,l)),r={cache:ec()},i.payload=r;return}r=r.return}}function Pb(i,r,l){var o=yi();l={lane:o,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},$a(i)?M_(r,l):(l=qu(i,r,l,o),l!==null&&(ai(l,i,o),R_(l,r,o)))}function A_(i,r,l){var o=yi();cl(i,r,l,o)}function cl(i,r,l,o){var f={lane:o,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if($a(i))M_(r,f);else{var _=i.alternate;if(i.lanes===0&&(_===null||_.lanes===0)&&(_=r.lastRenderedReducer,_!==null))try{var v=r.lastRenderedState,x=_(v,l);if(f.hasEagerState=!0,f.eagerState=x,di(x,v))return Ma(i,r,f,0),Ze===null&&Aa(),!1}catch{}finally{}if(l=qu(i,r,f,o),l!==null)return ai(l,i,o),R_(l,r,o),!0}return!1}function Ec(i,r,l,o){if(o={lane:2,revertLane:rh(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},$a(i)){if(r)throw Error(s(479))}else r=qu(i,l,o,2),r!==null&&ai(r,i,2)}function $a(i){var r=i.alternate;return i===Ce||r!==null&&r===Ce}function M_(i,r){hs=qa=!0;var l=i.pending;l===null?r.next=r:(r.next=l.next,l.next=r),i.pending=r}function R_(i,r,l){if((l&4194048)!==0){var o=r.lanes;o&=i.pendingLanes,l|=o,r.lanes=l,Nd(i,l)}}var hl={readContext:Nt,use:Ya,useCallback:at,useContext:at,useEffect:at,useImperativeHandle:at,useLayoutEffect:at,useInsertionEffect:at,useMemo:at,useReducer:at,useRef:at,useState:at,useDebugValue:at,useDeferredValue:at,useTransition:at,useSyncExternalStore:at,useId:at,useHostTransitionStatus:at,useFormState:at,useActionState:at,useOptimistic:at,useMemoCache:at,useCacheRefresh:at};hl.useEffectEvent=at;var B_={readContext:Nt,use:Ya,useCallback:function(i,r){return Xt().memoizedState=[i,r===void 0?null:r],i},useContext:Nt,useEffect:__,useImperativeHandle:function(i,r,l){l=l!=null?l.concat([i]):null,Xa(4194308,4,y_.bind(null,r,i),l)},useLayoutEffect:function(i,r){return Xa(4194308,4,i,r)},useInsertionEffect:function(i,r){Xa(4,2,i,r)},useMemo:function(i,r){var l=Xt();r=r===void 0?null:r;var o=i();if(xr){ei(!0);try{i()}finally{ei(!1)}}return l.memoizedState=[o,r],o},useReducer:function(i,r,l){var o=Xt();if(l!==void 0){var f=l(r);if(xr){ei(!0);try{l(r)}finally{ei(!1)}}}else f=r;return o.memoizedState=o.baseState=f,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:f},o.queue=i,i=i.dispatch=Pb.bind(null,Ce,i),[o.memoizedState,i]},useRef:function(i){var r=Xt();return i={current:i},r.memoizedState=i},useState:function(i){i=yc(i);var r=i.queue,l=A_.bind(null,Ce,r);return r.dispatch=l,[i.memoizedState,l]},useDebugValue:xc,useDeferredValue:function(i,r){var l=Xt();return wc(l,i,r)},useTransition:function(){var i=yc(!1);return i=C_.bind(null,Ce,i.queue,!0,!1),Xt().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,r,l){var o=Ce,f=Xt();if(Ne){if(l===void 0)throw Error(s(407));l=l()}else{if(l=r(),Ze===null)throw Error(s(349));(ze&127)!==0||Jp(o,r,l)}f.memoizedState=l;var _={value:l,getSnapshot:r};return f.queue=_,__(t_.bind(null,o,_,i),[i]),o.flags|=2048,ds(9,{destroy:void 0},e_.bind(null,o,_,l,r),null),l},useId:function(){var i=Xt(),r=Ze.identifierPrefix;if(Ne){var l=Yi,o=Wi;l=(o&~(1<<32-$e(o)-1)).toString(32)+l,r="_"+r+"R_"+l,l=Va++,0<l&&(r+="H"+l.toString(32)),r+="_"}else l=Ob++,r="_"+r+"r_"+l.toString(32)+"_";return i.memoizedState=r},useHostTransitionStatus:kc,useFormState:c_,useActionState:c_,useOptimistic:function(i){var r=Xt();r.memoizedState=r.baseState=i;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=l,r=Ec.bind(null,Ce,!0,l),l.dispatch=r,[i,r]},useMemoCache:mc,useCacheRefresh:function(){return Xt().memoizedState=Ub.bind(null,Ce)},useEffectEvent:function(i){var r=Xt(),l={impl:i};return r.memoizedState=l,function(){if((Ie&2)!==0)throw Error(s(440));return l.impl.apply(void 0,arguments)}}},Tc={readContext:Nt,use:Ya,useCallback:b_,useContext:Nt,useEffect:bc,useImperativeHandle:S_,useInsertionEffect:g_,useLayoutEffect:v_,useMemo:x_,useReducer:Ka,useRef:p_,useState:function(){return Ka(dn)},useDebugValue:xc,useDeferredValue:function(i,r){var l=ft();return w_(l,Ye.memoizedState,i,r)},useTransition:function(){var i=Ka(dn)[0],r=ft().memoizedState;return[typeof i=="boolean"?i:ul(i),r]},useSyncExternalStore:Qp,useId:T_,useHostTransitionStatus:kc,useFormState:h_,useActionState:h_,useOptimistic:function(i,r){var l=ft();return r_(l,Ye,i,r)},useMemoCache:mc,useCacheRefresh:D_};Tc.useEffectEvent=m_;var O_={readContext:Nt,use:Ya,useCallback:b_,useContext:Nt,useEffect:bc,useImperativeHandle:S_,useInsertionEffect:g_,useLayoutEffect:v_,useMemo:x_,useReducer:vc,useRef:p_,useState:function(){return vc(dn)},useDebugValue:xc,useDeferredValue:function(i,r){var l=ft();return Ye===null?wc(l,i,r):w_(l,Ye.memoizedState,i,r)},useTransition:function(){var i=vc(dn)[0],r=ft().memoizedState;return[typeof i=="boolean"?i:ul(i),r]},useSyncExternalStore:Qp,useId:T_,useHostTransitionStatus:kc,useFormState:d_,useActionState:d_,useOptimistic:function(i,r){var l=ft();return Ye!==null?r_(l,Ye,i,r):(l.baseState=i,[i,l.queue.dispatch])},useMemoCache:mc,useCacheRefresh:D_};O_.useEffectEvent=m_;function Dc(i,r,l,o){r=i.memoizedState,l=l(o,r),l=l==null?r:m({},r,l),i.memoizedState=l,i.lanes===0&&(i.updateQueue.baseState=l)}var Ac={enqueueSetState:function(i,r,l){i=i._reactInternals;var o=yi(),f=Nn(o);f.payload=r,l!=null&&(f.callback=l),r=Hn(i,f,o),r!==null&&(ai(r,i,o),sl(r,i,o))},enqueueReplaceState:function(i,r,l){i=i._reactInternals;var o=yi(),f=Nn(o);f.tag=1,f.payload=r,l!=null&&(f.callback=l),r=Hn(i,f,o),r!==null&&(ai(r,i,o),sl(r,i,o))},enqueueForceUpdate:function(i,r){i=i._reactInternals;var l=yi(),o=Nn(l);o.tag=2,r!=null&&(o.callback=r),r=Hn(i,o,l),r!==null&&(ai(r,i,l),sl(r,i,l))}};function z_(i,r,l,o,f,_,v){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(o,_,v):r.prototype&&r.prototype.isPureReactComponent?!Zs(l,o)||!Zs(f,_):!0}function L_(i,r,l,o){i=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(l,o),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(l,o),r.state!==i&&Ac.enqueueReplaceState(r,r.state,null)}function wr(i,r){var l=r;if("ref"in r){l={};for(var o in r)o!=="ref"&&(l[o]=r[o])}if(i=i.defaultProps){l===r&&(l=m({},l));for(var f in i)l[f]===void 0&&(l[f]=i[f])}return l}function N_(i){Da(i)}function H_(i){console.error(i)}function j_(i){Da(i)}function Za(i,r){try{var l=i.onUncaughtError;l(r.value,{componentStack:r.stack})}catch(o){setTimeout(function(){throw o})}}function U_(i,r,l){try{var o=i.onCaughtError;o(l.value,{componentStack:l.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Mc(i,r,l){return l=Nn(l),l.tag=3,l.payload={element:null},l.callback=function(){Za(i,r)},l}function P_(i){return i=Nn(i),i.tag=3,i}function I_(i,r,l,o){var f=l.type.getDerivedStateFromError;if(typeof f=="function"){var _=o.value;i.payload=function(){return f(_)},i.callback=function(){U_(r,l,o)}}var v=l.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(i.callback=function(){U_(r,l,o),typeof f!="function"&&(qn===null?qn=new Set([this]):qn.add(this));var x=o.stack;this.componentDidCatch(o.value,{componentStack:x!==null?x:""})})}function Ib(i,r,l,o,f){if(l.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(r=l.alternate,r!==null&&ss(r,l,f,!0),l=_i.current,l!==null){switch(l.tag){case 31:case 13:return Ri===null?uo():l.alternate===null&&ot===0&&(ot=3),l.flags&=-257,l.flags|=65536,l.lanes=f,o===ja?l.flags|=16384:(r=l.updateQueue,r===null?l.updateQueue=new Set([o]):r.add(o),th(i,o,f)),!1;case 22:return l.flags|=65536,o===ja?l.flags|=16384:(r=l.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([o])},l.updateQueue=r):(l=r.retryQueue,l===null?r.retryQueue=new Set([o]):l.add(o)),th(i,o,f)),!1}throw Error(s(435,l.tag))}return th(i,o,f),uo(),!1}if(Ne)return r=_i.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=f,o!==Gu&&(i=Error(s(422),{cause:o}),el(Ti(i,l)))):(o!==Gu&&(r=Error(s(423),{cause:o}),el(Ti(r,l))),i=i.current.alternate,i.flags|=65536,f&=-f,i.lanes|=f,o=Ti(o,l),f=Mc(i.stateNode,o,f),lc(i,f),ot!==4&&(ot=2)),!1;var _=Error(s(520),{cause:o});if(_=Ti(_,l),yl===null?yl=[_]:yl.push(_),ot!==4&&(ot=2),r===null)return!0;o=Ti(o,l),l=r;do{switch(l.tag){case 3:return l.flags|=65536,i=f&-f,l.lanes|=i,i=Mc(l.stateNode,o,i),lc(l,i),!1;case 1:if(r=l.type,_=l.stateNode,(l.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(qn===null||!qn.has(_))))return l.flags|=65536,f&=-f,l.lanes|=f,f=P_(f),I_(f,i,l,o),lc(l,f),!1}l=l.return}while(l!==null);return!1}var Rc=Error(s(461)),mt=!1;function Ht(i,r,l,o){r.child=i===null?Wp(r,null,l,o):br(r,i.child,l,o)}function F_(i,r,l,o,f){l=l.render;var _=r.ref;if("ref"in o){var v={};for(var x in o)x!=="ref"&&(v[x]=o[x])}else v=o;return gr(r),o=fc(i,r,l,v,_,f),x=dc(),i!==null&&!mt?(pc(i,r,f),pn(i,r,f)):(Ne&&x&&Ku(r),r.flags|=1,Ht(i,r,o,f),r.child)}function q_(i,r,l,o,f){if(i===null){var _=l.type;return typeof _=="function"&&!Vu(_)&&_.defaultProps===void 0&&l.compare===null?(r.tag=15,r.type=_,V_(i,r,_,o,f)):(i=Ba(l.type,null,o,r,r.mode,f),i.ref=r.ref,i.return=r,r.child=i)}if(_=i.child,!Uc(i,f)){var v=_.memoizedProps;if(l=l.compare,l=l!==null?l:Zs,l(v,o)&&i.ref===r.ref)return pn(i,r,f)}return r.flags|=1,i=on(_,o),i.ref=r.ref,i.return=r,r.child=i}function V_(i,r,l,o,f){if(i!==null){var _=i.memoizedProps;if(Zs(_,o)&&i.ref===r.ref)if(mt=!1,r.pendingProps=o=_,Uc(i,f))(i.flags&131072)!==0&&(mt=!0);else return r.lanes=i.lanes,pn(i,r,f)}return Bc(i,r,l,o,f)}function W_(i,r,l,o){var f=o.children,_=i!==null?i.memoizedState:null;if(i===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((r.flags&128)!==0){if(_=_!==null?_.baseLanes|l:l,i!==null){for(o=r.child=i.child,f=0;o!==null;)f=f|o.lanes|o.childLanes,o=o.sibling;o=f&~_}else o=0,r.child=null;return Y_(i,r,_,l,o)}if((l&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},i!==null&&Na(r,_!==null?_.cachePool:null),_!==null?Xp(r,_):oc(),Gp(r);else return o=r.lanes=536870912,Y_(i,r,_!==null?_.baseLanes|l:l,l,o)}else _!==null?(Na(r,_.cachePool),Xp(r,_),Un(),r.memoizedState=null):(i!==null&&Na(r,null),oc(),Un());return Ht(i,r,f,l),r.child}function fl(i,r){return i!==null&&i.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Y_(i,r,l,o,f){var _=ic();return _=_===null?null:{parent:pt._currentValue,pool:_},r.memoizedState={baseLanes:l,cachePool:_},i!==null&&Na(r,null),oc(),Gp(r),i!==null&&ss(i,r,o,!0),r.childLanes=f,null}function Qa(i,r){return r=eo({mode:r.mode,children:r.children},i.mode),r.ref=i.ref,i.child=r,r.return=i,r}function K_(i,r,l){return br(r,i.child,null,l),i=Qa(r,r.pendingProps),i.flags|=2,mi(r),r.memoizedState=null,i}function Fb(i,r,l){var o=r.pendingProps,f=(r.flags&128)!==0;if(r.flags&=-129,i===null){if(Ne){if(o.mode==="hidden")return i=Qa(r,o),r.lanes=536870912,fl(null,i);if(cc(r),(i=et)?(i=sg(i,Mi),i=i!==null&&i.data==="&"?i:null,i!==null&&(r.memoizedState={dehydrated:i,treeContext:Rn!==null?{id:Wi,overflow:Yi}:null,retryLane:536870912,hydrationErrors:null},l=Mp(i),l.return=r,r.child=l,Lt=r,et=null)):i=null,i===null)throw On(r);return r.lanes=536870912,null}return Qa(r,o)}var _=i.memoizedState;if(_!==null){var v=_.dehydrated;if(cc(r),f)if(r.flags&256)r.flags&=-257,r=K_(i,r,l);else if(r.memoizedState!==null)r.child=i.child,r.flags|=128,r=null;else throw Error(s(558));else if(mt||ss(i,r,l,!1),f=(l&i.childLanes)!==0,mt||f){if(o=Ze,o!==null&&(v=Hd(o,l),v!==0&&v!==_.retryLane))throw _.retryLane=v,dr(i,v),ai(o,i,v),Rc;uo(),r=K_(i,r,l)}else i=_.treeContext,et=Bi(v.nextSibling),Lt=r,Ne=!0,Bn=null,Mi=!1,i!==null&&Op(r,i),r=Qa(r,o),r.flags|=4096;return r}return i=on(i.child,{mode:o.mode,children:o.children}),i.ref=r.ref,r.child=i,i.return=r,i}function Ja(i,r){var l=r.ref;if(l===null)i!==null&&i.ref!==null&&(r.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(s(284));(i===null||i.ref!==l)&&(r.flags|=4194816)}}function Bc(i,r,l,o,f){return gr(r),l=fc(i,r,l,o,void 0,f),o=dc(),i!==null&&!mt?(pc(i,r,f),pn(i,r,f)):(Ne&&o&&Ku(r),r.flags|=1,Ht(i,r,l,f),r.child)}function X_(i,r,l,o,f,_){return gr(r),r.updateQueue=null,l=Zp(r,o,l,f),$p(i),o=dc(),i!==null&&!mt?(pc(i,r,_),pn(i,r,_)):(Ne&&o&&Ku(r),r.flags|=1,Ht(i,r,l,_),r.child)}function G_(i,r,l,o,f){if(gr(r),r.stateNode===null){var _=ts,v=l.contextType;typeof v=="object"&&v!==null&&(_=Nt(v)),_=new l(o,_),r.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=Ac,r.stateNode=_,_._reactInternals=r,_=r.stateNode,_.props=o,_.state=r.memoizedState,_.refs={},rc(r),v=l.contextType,_.context=typeof v=="object"&&v!==null?Nt(v):ts,_.state=r.memoizedState,v=l.getDerivedStateFromProps,typeof v=="function"&&(Dc(r,l,v,o),_.state=r.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(v=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),v!==_.state&&Ac.enqueueReplaceState(_,_.state,null),al(r,o,_,f),ll(),_.state=r.memoizedState),typeof _.componentDidMount=="function"&&(r.flags|=4194308),o=!0}else if(i===null){_=r.stateNode;var x=r.memoizedProps,T=wr(l,x);_.props=T;var N=_.context,X=l.contextType;v=ts,typeof X=="object"&&X!==null&&(v=Nt(X));var Q=l.getDerivedStateFromProps;X=typeof Q=="function"||typeof _.getSnapshotBeforeUpdate=="function",x=r.pendingProps!==x,X||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(x||N!==v)&&L_(r,_,o,v),Ln=!1;var U=r.memoizedState;_.state=U,al(r,o,_,f),ll(),N=r.memoizedState,x||U!==N||Ln?(typeof Q=="function"&&(Dc(r,l,Q,o),N=r.memoizedState),(T=Ln||z_(r,l,T,o,U,N,v))?(X||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(r.flags|=4194308)):(typeof _.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=o,r.memoizedState=N),_.props=o,_.state=N,_.context=v,o=T):(typeof _.componentDidMount=="function"&&(r.flags|=4194308),o=!1)}else{_=r.stateNode,sc(i,r),v=r.memoizedProps,X=wr(l,v),_.props=X,Q=r.pendingProps,U=_.context,N=l.contextType,T=ts,typeof N=="object"&&N!==null&&(T=Nt(N)),x=l.getDerivedStateFromProps,(N=typeof x=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(v!==Q||U!==T)&&L_(r,_,o,T),Ln=!1,U=r.memoizedState,_.state=U,al(r,o,_,f),ll();var F=r.memoizedState;v!==Q||U!==F||Ln||i!==null&&i.dependencies!==null&&za(i.dependencies)?(typeof x=="function"&&(Dc(r,l,x,o),F=r.memoizedState),(X=Ln||z_(r,l,X,o,U,F,T)||i!==null&&i.dependencies!==null&&za(i.dependencies))?(N||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(o,F,T),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(o,F,T)),typeof _.componentDidUpdate=="function"&&(r.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof _.componentDidUpdate!="function"||v===i.memoizedProps&&U===i.memoizedState||(r.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||v===i.memoizedProps&&U===i.memoizedState||(r.flags|=1024),r.memoizedProps=o,r.memoizedState=F),_.props=o,_.state=F,_.context=T,o=X):(typeof _.componentDidUpdate!="function"||v===i.memoizedProps&&U===i.memoizedState||(r.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||v===i.memoizedProps&&U===i.memoizedState||(r.flags|=1024),o=!1)}return _=o,Ja(i,r),o=(r.flags&128)!==0,_||o?(_=r.stateNode,l=o&&typeof l.getDerivedStateFromError!="function"?null:_.render(),r.flags|=1,i!==null&&o?(r.child=br(r,i.child,null,f),r.child=br(r,null,l,f)):Ht(i,r,l,f),r.memoizedState=_.state,i=r.child):i=pn(i,r,f),i}function $_(i,r,l,o){return _r(),r.flags|=256,Ht(i,r,l,o),r.child}var Oc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function zc(i){return{baseLanes:i,cachePool:Up()}}function Lc(i,r,l){return i=i!==null?i.childLanes&~l:0,r&&(i|=vi),i}function Z_(i,r,l){var o=r.pendingProps,f=!1,_=(r.flags&128)!==0,v;if((v=_)||(v=i!==null&&i.memoizedState===null?!1:(ht.current&2)!==0),v&&(f=!0,r.flags&=-129),v=(r.flags&32)!==0,r.flags&=-33,i===null){if(Ne){if(f?jn(r):Un(),(i=et)?(i=sg(i,Mi),i=i!==null&&i.data!=="&"?i:null,i!==null&&(r.memoizedState={dehydrated:i,treeContext:Rn!==null?{id:Wi,overflow:Yi}:null,retryLane:536870912,hydrationErrors:null},l=Mp(i),l.return=r,r.child=l,Lt=r,et=null)):i=null,i===null)throw On(r);return gh(i)?r.lanes=32:r.lanes=536870912,null}var x=o.children;return o=o.fallback,f?(Un(),f=r.mode,x=eo({mode:"hidden",children:x},f),o=pr(o,f,l,null),x.return=r,o.return=r,x.sibling=o,r.child=x,o=r.child,o.memoizedState=zc(l),o.childLanes=Lc(i,v,l),r.memoizedState=Oc,fl(null,o)):(jn(r),Nc(r,x))}var T=i.memoizedState;if(T!==null&&(x=T.dehydrated,x!==null)){if(_)r.flags&256?(jn(r),r.flags&=-257,r=Hc(i,r,l)):r.memoizedState!==null?(Un(),r.child=i.child,r.flags|=128,r=null):(Un(),x=o.fallback,f=r.mode,o=eo({mode:"visible",children:o.children},f),x=pr(x,f,l,null),x.flags|=2,o.return=r,x.return=r,o.sibling=x,r.child=o,br(r,i.child,null,l),o=r.child,o.memoizedState=zc(l),o.childLanes=Lc(i,v,l),r.memoizedState=Oc,r=fl(null,o));else if(jn(r),gh(x)){if(v=x.nextSibling&&x.nextSibling.dataset,v)var N=v.dgst;v=N,o=Error(s(419)),o.stack="",o.digest=v,el({value:o,source:null,stack:null}),r=Hc(i,r,l)}else if(mt||ss(i,r,l,!1),v=(l&i.childLanes)!==0,mt||v){if(v=Ze,v!==null&&(o=Hd(v,l),o!==0&&o!==T.retryLane))throw T.retryLane=o,dr(i,o),ai(v,i,o),Rc;mh(x)||uo(),r=Hc(i,r,l)}else mh(x)?(r.flags|=192,r.child=i.child,r=null):(i=T.treeContext,et=Bi(x.nextSibling),Lt=r,Ne=!0,Bn=null,Mi=!1,i!==null&&Op(r,i),r=Nc(r,o.children),r.flags|=4096);return r}return f?(Un(),x=o.fallback,f=r.mode,T=i.child,N=T.sibling,o=on(T,{mode:"hidden",children:o.children}),o.subtreeFlags=T.subtreeFlags&65011712,N!==null?x=on(N,x):(x=pr(x,f,l,null),x.flags|=2),x.return=r,o.return=r,o.sibling=x,r.child=o,fl(null,o),o=r.child,x=i.child.memoizedState,x===null?x=zc(l):(f=x.cachePool,f!==null?(T=pt._currentValue,f=f.parent!==T?{parent:T,pool:T}:f):f=Up(),x={baseLanes:x.baseLanes|l,cachePool:f}),o.memoizedState=x,o.childLanes=Lc(i,v,l),r.memoizedState=Oc,fl(i.child,o)):(jn(r),l=i.child,i=l.sibling,l=on(l,{mode:"visible",children:o.children}),l.return=r,l.sibling=null,i!==null&&(v=r.deletions,v===null?(r.deletions=[i],r.flags|=16):v.push(i)),r.child=l,r.memoizedState=null,l)}function Nc(i,r){return r=eo({mode:"visible",children:r},i.mode),r.return=i,i.child=r}function eo(i,r){return i=pi(22,i,null,r),i.lanes=0,i}function Hc(i,r,l){return br(r,i.child,null,l),i=Nc(r,r.pendingProps.children),i.flags|=2,r.memoizedState=null,i}function Q_(i,r,l){i.lanes|=r;var o=i.alternate;o!==null&&(o.lanes|=r),Qu(i.return,r,l)}function jc(i,r,l,o,f,_){var v=i.memoizedState;v===null?i.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:o,tail:l,tailMode:f,treeForkCount:_}:(v.isBackwards=r,v.rendering=null,v.renderingStartTime=0,v.last=o,v.tail=l,v.tailMode=f,v.treeForkCount=_)}function J_(i,r,l){var o=r.pendingProps,f=o.revealOrder,_=o.tail;o=o.children;var v=ht.current,x=(v&2)!==0;if(x?(v=v&1|2,r.flags|=128):v&=1,w(ht,v),Ht(i,r,o,l),o=Ne?Js:0,!x&&i!==null&&(i.flags&128)!==0)e:for(i=r.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Q_(i,l,r);else if(i.tag===19)Q_(i,l,r);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(f){case"forwards":for(l=r.child,f=null;l!==null;)i=l.alternate,i!==null&&Fa(i)===null&&(f=l),l=l.sibling;l=f,l===null?(f=r.child,r.child=null):(f=l.sibling,l.sibling=null),jc(r,!1,f,l,_,o);break;case"backwards":case"unstable_legacy-backwards":for(l=null,f=r.child,r.child=null;f!==null;){if(i=f.alternate,i!==null&&Fa(i)===null){r.child=f;break}i=f.sibling,f.sibling=l,l=f,f=i}jc(r,!0,l,null,_,o);break;case"together":jc(r,!1,null,null,void 0,o);break;default:r.memoizedState=null}return r.child}function pn(i,r,l){if(i!==null&&(r.dependencies=i.dependencies),Fn|=r.lanes,(l&r.childLanes)===0)if(i!==null){if(ss(i,r,l,!1),(l&r.childLanes)===0)return null}else return null;if(i!==null&&r.child!==i.child)throw Error(s(153));if(r.child!==null){for(i=r.child,l=on(i,i.pendingProps),r.child=l,l.return=r;i.sibling!==null;)i=i.sibling,l=l.sibling=on(i,i.pendingProps),l.return=r;l.sibling=null}return r.child}function Uc(i,r){return(i.lanes&r)!==0?!0:(i=i.dependencies,!!(i!==null&&za(i)))}function qb(i,r,l){switch(r.tag){case 3:We(r,r.stateNode.containerInfo),zn(r,pt,i.memoizedState.cache),_r();break;case 27:case 5:Ot(r);break;case 4:We(r,r.stateNode.containerInfo);break;case 10:zn(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,cc(r),null;break;case 13:var o=r.memoizedState;if(o!==null)return o.dehydrated!==null?(jn(r),r.flags|=128,null):(l&r.child.childLanes)!==0?Z_(i,r,l):(jn(r),i=pn(i,r,l),i!==null?i.sibling:null);jn(r);break;case 19:var f=(i.flags&128)!==0;if(o=(l&r.childLanes)!==0,o||(ss(i,r,l,!1),o=(l&r.childLanes)!==0),f){if(o)return J_(i,r,l);r.flags|=128}if(f=r.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),w(ht,ht.current),o)break;return null;case 22:return r.lanes=0,W_(i,r,l,r.pendingProps);case 24:zn(r,pt,i.memoizedState.cache)}return pn(i,r,l)}function em(i,r,l){if(i!==null)if(i.memoizedProps!==r.pendingProps)mt=!0;else{if(!Uc(i,l)&&(r.flags&128)===0)return mt=!1,qb(i,r,l);mt=(i.flags&131072)!==0}else mt=!1,Ne&&(r.flags&1048576)!==0&&Bp(r,Js,r.index);switch(r.lanes=0,r.tag){case 16:e:{var o=r.pendingProps;if(i=yr(r.elementType),r.type=i,typeof i=="function")Vu(i)?(o=wr(i,o),r.tag=1,r=G_(null,r,i,o,l)):(r.tag=0,r=Bc(null,r,i,o,l));else{if(i!=null){var f=i.$$typeof;if(f===ee){r.tag=11,r=F_(null,r,i,o,l);break e}else if(f===ie){r.tag=14,r=q_(null,r,i,o,l);break e}}throw r=K(i)||i,Error(s(306,r,""))}}return r;case 0:return Bc(i,r,r.type,r.pendingProps,l);case 1:return o=r.type,f=wr(o,r.pendingProps),G_(i,r,o,f,l);case 3:e:{if(We(r,r.stateNode.containerInfo),i===null)throw Error(s(387));o=r.pendingProps;var _=r.memoizedState;f=_.element,sc(i,r),al(r,o,null,l);var v=r.memoizedState;if(o=v.cache,zn(r,pt,o),o!==_.cache&&Ju(r,[pt],l,!0),ll(),o=v.element,_.isDehydrated)if(_={element:o,isDehydrated:!1,cache:v.cache},r.updateQueue.baseState=_,r.memoizedState=_,r.flags&256){r=$_(i,r,o,l);break e}else if(o!==f){f=Ti(Error(s(424)),r),el(f),r=$_(i,r,o,l);break e}else{switch(i=r.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(et=Bi(i.firstChild),Lt=r,Ne=!0,Bn=null,Mi=!0,l=Wp(r,null,o,l),r.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(_r(),o===f){r=pn(i,r,l);break e}Ht(i,r,o,l)}r=r.child}return r;case 26:return Ja(i,r),i===null?(l=hg(r.type,null,r.pendingProps,null))?r.memoizedState=l:Ne||(l=r.type,i=r.pendingProps,o=go(ce.current).createElement(l),o[zt]=r,o[ti]=i,jt(o,l,i),Et(o),r.stateNode=o):r.memoizedState=hg(r.type,i.memoizedProps,r.pendingProps,i.memoizedState),null;case 27:return Ot(r),i===null&&Ne&&(o=r.stateNode=og(r.type,r.pendingProps,ce.current),Lt=r,Mi=!0,f=et,Kn(r.type)?(vh=f,et=Bi(o.firstChild)):et=f),Ht(i,r,r.pendingProps.children,l),Ja(i,r),i===null&&(r.flags|=4194304),r.child;case 5:return i===null&&Ne&&((f=o=et)&&(o=y1(o,r.type,r.pendingProps,Mi),o!==null?(r.stateNode=o,Lt=r,et=Bi(o.firstChild),Mi=!1,f=!0):f=!1),f||On(r)),Ot(r),f=r.type,_=r.pendingProps,v=i!==null?i.memoizedProps:null,o=_.children,dh(f,_)?o=null:v!==null&&dh(f,v)&&(r.flags|=32),r.memoizedState!==null&&(f=fc(i,r,zb,null,null,l),Tl._currentValue=f),Ja(i,r),Ht(i,r,o,l),r.child;case 6:return i===null&&Ne&&((i=l=et)&&(l=S1(l,r.pendingProps,Mi),l!==null?(r.stateNode=l,Lt=r,et=null,i=!0):i=!1),i||On(r)),null;case 13:return Z_(i,r,l);case 4:return We(r,r.stateNode.containerInfo),o=r.pendingProps,i===null?r.child=br(r,null,o,l):Ht(i,r,o,l),r.child;case 11:return F_(i,r,r.type,r.pendingProps,l);case 7:return Ht(i,r,r.pendingProps,l),r.child;case 8:return Ht(i,r,r.pendingProps.children,l),r.child;case 12:return Ht(i,r,r.pendingProps.children,l),r.child;case 10:return o=r.pendingProps,zn(r,r.type,o.value),Ht(i,r,o.children,l),r.child;case 9:return f=r.type._context,o=r.pendingProps.children,gr(r),f=Nt(f),o=o(f),r.flags|=1,Ht(i,r,o,l),r.child;case 14:return q_(i,r,r.type,r.pendingProps,l);case 15:return V_(i,r,r.type,r.pendingProps,l);case 19:return J_(i,r,l);case 31:return Fb(i,r,l);case 22:return W_(i,r,l,r.pendingProps);case 24:return gr(r),o=Nt(pt),i===null?(f=ic(),f===null&&(f=Ze,_=ec(),f.pooledCache=_,_.refCount++,_!==null&&(f.pooledCacheLanes|=l),f=_),r.memoizedState={parent:o,cache:f},rc(r),zn(r,pt,f)):((i.lanes&l)!==0&&(sc(i,r),al(r,null,null,l),ll()),f=i.memoizedState,_=r.memoizedState,f.parent!==o?(f={parent:o,cache:o},r.memoizedState=f,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=f),zn(r,pt,o)):(o=_.cache,zn(r,pt,o),o!==f.cache&&Ju(r,[pt],l,!0))),Ht(i,r,r.pendingProps.children,l),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function _n(i){i.flags|=4}function Pc(i,r,l,o,f){if((r=(i.mode&32)!==0)&&(r=!1),r){if(i.flags|=16777216,(f&335544128)===f)if(i.stateNode.complete)i.flags|=8192;else if(Tm())i.flags|=8192;else throw Sr=ja,nc}else i.flags&=-16777217}function tm(i,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!mg(r))if(Tm())i.flags|=8192;else throw Sr=ja,nc}function to(i,r){r!==null&&(i.flags|=4),i.flags&16384&&(r=i.tag!==22?zd():536870912,i.lanes|=r,gs|=r)}function dl(i,r){if(!Ne)switch(i.tailMode){case"hidden":r=i.tail;for(var l=null;r!==null;)r.alternate!==null&&(l=r),r=r.sibling;l===null?i.tail=null:l.sibling=null;break;case"collapsed":l=i.tail;for(var o=null;l!==null;)l.alternate!==null&&(o=l),l=l.sibling;o===null?r||i.tail===null?i.tail=null:i.tail.sibling=null:o.sibling=null}}function tt(i){var r=i.alternate!==null&&i.alternate.child===i.child,l=0,o=0;if(r)for(var f=i.child;f!==null;)l|=f.lanes|f.childLanes,o|=f.subtreeFlags&65011712,o|=f.flags&65011712,f.return=i,f=f.sibling;else for(f=i.child;f!==null;)l|=f.lanes|f.childLanes,o|=f.subtreeFlags,o|=f.flags,f.return=i,f=f.sibling;return i.subtreeFlags|=o,i.childLanes=l,r}function Vb(i,r,l){var o=r.pendingProps;switch(Xu(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(r),null;case 1:return tt(r),null;case 3:return l=r.stateNode,o=null,i!==null&&(o=i.memoizedState.cache),r.memoizedState.cache!==o&&(r.flags|=2048),hn(pt),Ae(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(i===null||i.child===null)&&(rs(r)?_n(r):i===null||i.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,$u())),tt(r),null;case 26:var f=r.type,_=r.memoizedState;return i===null?(_n(r),_!==null?(tt(r),tm(r,_)):(tt(r),Pc(r,f,null,o,l))):_?_!==i.memoizedState?(_n(r),tt(r),tm(r,_)):(tt(r),r.flags&=-16777217):(i=i.memoizedProps,i!==o&&_n(r),tt(r),Pc(r,f,i,o,l)),null;case 27:if(Wt(r),l=ce.current,f=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==o&&_n(r);else{if(!o){if(r.stateNode===null)throw Error(s(166));return tt(r),null}i=se.current,rs(r)?zp(r):(i=og(f,o,l),r.stateNode=i,_n(r))}return tt(r),null;case 5:if(Wt(r),f=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==o&&_n(r);else{if(!o){if(r.stateNode===null)throw Error(s(166));return tt(r),null}if(_=se.current,rs(r))zp(r);else{var v=go(ce.current);switch(_){case 1:_=v.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:_=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":_=v.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":_=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":_=v.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof o.is=="string"?v.createElement("select",{is:o.is}):v.createElement("select"),o.multiple?_.multiple=!0:o.size&&(_.size=o.size);break;default:_=typeof o.is=="string"?v.createElement(f,{is:o.is}):v.createElement(f)}}_[zt]=r,_[ti]=o;e:for(v=r.child;v!==null;){if(v.tag===5||v.tag===6)_.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===r)break e;for(;v.sibling===null;){if(v.return===null||v.return===r)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}r.stateNode=_;e:switch(jt(_,f,o),f){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&_n(r)}}return tt(r),Pc(r,r.type,i===null?null:i.memoizedProps,r.pendingProps,l),null;case 6:if(i&&r.stateNode!=null)i.memoizedProps!==o&&_n(r);else{if(typeof o!="string"&&r.stateNode===null)throw Error(s(166));if(i=ce.current,rs(r)){if(i=r.stateNode,l=r.memoizedProps,o=null,f=Lt,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}i[zt]=r,i=!!(i.nodeValue===l||o!==null&&o.suppressHydrationWarning===!0||Zm(i.nodeValue,l)),i||On(r,!0)}else i=go(i).createTextNode(o),i[zt]=r,r.stateNode=i}return tt(r),null;case 31:if(l=r.memoizedState,i===null||i.memoizedState!==null){if(o=rs(r),l!==null){if(i===null){if(!o)throw Error(s(318));if(i=r.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(s(557));i[zt]=r}else _r(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;tt(r),i=!1}else l=$u(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=l),i=!0;if(!i)return r.flags&256?(mi(r),r):(mi(r),null);if((r.flags&128)!==0)throw Error(s(558))}return tt(r),null;case 13:if(o=r.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(f=rs(r),o!==null&&o.dehydrated!==null){if(i===null){if(!f)throw Error(s(318));if(f=r.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(s(317));f[zt]=r}else _r(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;tt(r),f=!1}else f=$u(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=f),f=!0;if(!f)return r.flags&256?(mi(r),r):(mi(r),null)}return mi(r),(r.flags&128)!==0?(r.lanes=l,r):(l=o!==null,i=i!==null&&i.memoizedState!==null,l&&(o=r.child,f=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(f=o.alternate.memoizedState.cachePool.pool),_=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(_=o.memoizedState.cachePool.pool),_!==f&&(o.flags|=2048)),l!==i&&l&&(r.child.flags|=8192),to(r,r.updateQueue),tt(r),null);case 4:return Ae(),i===null&&oh(r.stateNode.containerInfo),tt(r),null;case 10:return hn(r.type),tt(r),null;case 19:if(Y(ht),o=r.memoizedState,o===null)return tt(r),null;if(f=(r.flags&128)!==0,_=o.rendering,_===null)if(f)dl(o,!1);else{if(ot!==0||i!==null&&(i.flags&128)!==0)for(i=r.child;i!==null;){if(_=Fa(i),_!==null){for(r.flags|=128,dl(o,!1),i=_.updateQueue,r.updateQueue=i,to(r,i),r.subtreeFlags=0,i=l,l=r.child;l!==null;)Ap(l,i),l=l.sibling;return w(ht,ht.current&1|2),Ne&&un(r,o.treeForkCount),r.child}i=i.sibling}o.tail!==null&&Yt()>lo&&(r.flags|=128,f=!0,dl(o,!1),r.lanes=4194304)}else{if(!f)if(i=Fa(_),i!==null){if(r.flags|=128,f=!0,i=i.updateQueue,r.updateQueue=i,to(r,i),dl(o,!0),o.tail===null&&o.tailMode==="hidden"&&!_.alternate&&!Ne)return tt(r),null}else 2*Yt()-o.renderingStartTime>lo&&l!==536870912&&(r.flags|=128,f=!0,dl(o,!1),r.lanes=4194304);o.isBackwards?(_.sibling=r.child,r.child=_):(i=o.last,i!==null?i.sibling=_:r.child=_,o.last=_)}return o.tail!==null?(i=o.tail,o.rendering=i,o.tail=i.sibling,o.renderingStartTime=Yt(),i.sibling=null,l=ht.current,w(ht,f?l&1|2:l&1),Ne&&un(r,o.treeForkCount),i):(tt(r),null);case 22:case 23:return mi(r),uc(),o=r.memoizedState!==null,i!==null?i.memoizedState!==null!==o&&(r.flags|=8192):o&&(r.flags|=8192),o?(l&536870912)!==0&&(r.flags&128)===0&&(tt(r),r.subtreeFlags&6&&(r.flags|=8192)):tt(r),l=r.updateQueue,l!==null&&to(r,l.retryQueue),l=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(l=i.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==l&&(r.flags|=2048),i!==null&&Y(vr),null;case 24:return l=null,i!==null&&(l=i.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),hn(pt),tt(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function Wb(i,r){switch(Xu(r),r.tag){case 1:return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 3:return hn(pt),Ae(),i=r.flags,(i&65536)!==0&&(i&128)===0?(r.flags=i&-65537|128,r):null;case 26:case 27:case 5:return Wt(r),null;case 31:if(r.memoizedState!==null){if(mi(r),r.alternate===null)throw Error(s(340));_r()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 13:if(mi(r),i=r.memoizedState,i!==null&&i.dehydrated!==null){if(r.alternate===null)throw Error(s(340));_r()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 19:return Y(ht),null;case 4:return Ae(),null;case 10:return hn(r.type),null;case 22:case 23:return mi(r),uc(),i!==null&&Y(vr),i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 24:return hn(pt),null;case 25:return null;default:return null}}function im(i,r){switch(Xu(r),r.tag){case 3:hn(pt),Ae();break;case 26:case 27:case 5:Wt(r);break;case 4:Ae();break;case 31:r.memoizedState!==null&&mi(r);break;case 13:mi(r);break;case 19:Y(ht);break;case 10:hn(r.type);break;case 22:case 23:mi(r),uc(),i!==null&&Y(vr);break;case 24:hn(pt)}}function pl(i,r){try{var l=r.updateQueue,o=l!==null?l.lastEffect:null;if(o!==null){var f=o.next;l=f;do{if((l.tag&i)===i){o=void 0;var _=l.create,v=l.inst;o=_(),v.destroy=o}l=l.next}while(l!==f)}}catch(x){Ve(r,r.return,x)}}function Pn(i,r,l){try{var o=r.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var _=f.next;o=_;do{if((o.tag&i)===i){var v=o.inst,x=v.destroy;if(x!==void 0){v.destroy=void 0,f=r;var T=l,N=x;try{N()}catch(X){Ve(f,T,X)}}}o=o.next}while(o!==_)}}catch(X){Ve(r,r.return,X)}}function nm(i){var r=i.updateQueue;if(r!==null){var l=i.stateNode;try{Kp(r,l)}catch(o){Ve(i,i.return,o)}}}function rm(i,r,l){l.props=wr(i.type,i.memoizedProps),l.state=i.memoizedState;try{l.componentWillUnmount()}catch(o){Ve(i,r,o)}}function _l(i,r){try{var l=i.ref;if(l!==null){switch(i.tag){case 26:case 27:case 5:var o=i.stateNode;break;case 30:o=i.stateNode;break;default:o=i.stateNode}typeof l=="function"?i.refCleanup=l(o):l.current=o}}catch(f){Ve(i,r,f)}}function Ki(i,r){var l=i.ref,o=i.refCleanup;if(l!==null)if(typeof o=="function")try{o()}catch(f){Ve(i,r,f)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(f){Ve(i,r,f)}else l.current=null}function sm(i){var r=i.type,l=i.memoizedProps,o=i.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":l.autoFocus&&o.focus();break e;case"img":l.src?o.src=l.src:l.srcSet&&(o.srcset=l.srcSet)}}catch(f){Ve(i,i.return,f)}}function Ic(i,r,l){try{var o=i.stateNode;d1(o,i.type,l,r),o[ti]=r}catch(f){Ve(i,i.return,f)}}function lm(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Kn(i.type)||i.tag===4}function Fc(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||lm(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Kn(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function qc(i,r,l){var o=i.tag;if(o===5||o===6)i=i.stateNode,r?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(i,r):(r=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,r.appendChild(i),l=l._reactRootContainer,l!=null||r.onclick!==null||(r.onclick=ln));else if(o!==4&&(o===27&&Kn(i.type)&&(l=i.stateNode,r=null),i=i.child,i!==null))for(qc(i,r,l),i=i.sibling;i!==null;)qc(i,r,l),i=i.sibling}function io(i,r,l){var o=i.tag;if(o===5||o===6)i=i.stateNode,r?l.insertBefore(i,r):l.appendChild(i);else if(o!==4&&(o===27&&Kn(i.type)&&(l=i.stateNode),i=i.child,i!==null))for(io(i,r,l),i=i.sibling;i!==null;)io(i,r,l),i=i.sibling}function am(i){var r=i.stateNode,l=i.memoizedProps;try{for(var o=i.type,f=r.attributes;f.length;)r.removeAttributeNode(f[0]);jt(r,o,l),r[zt]=i,r[ti]=l}catch(_){Ve(i,i.return,_)}}var mn=!1,gt=!1,Vc=!1,om=typeof WeakSet=="function"?WeakSet:Set,Tt=null;function Yb(i,r){if(i=i.containerInfo,hh=Co,i=Sp(i),Hu(i)){if("selectionStart"in i)var l={start:i.selectionStart,end:i.selectionEnd};else e:{l=(l=i.ownerDocument)&&l.defaultView||window;var o=l.getSelection&&l.getSelection();if(o&&o.rangeCount!==0){l=o.anchorNode;var f=o.anchorOffset,_=o.focusNode;o=o.focusOffset;try{l.nodeType,_.nodeType}catch{l=null;break e}var v=0,x=-1,T=-1,N=0,X=0,Q=i,U=null;t:for(;;){for(var F;Q!==l||f!==0&&Q.nodeType!==3||(x=v+f),Q!==_||o!==0&&Q.nodeType!==3||(T=v+o),Q.nodeType===3&&(v+=Q.nodeValue.length),(F=Q.firstChild)!==null;)U=Q,Q=F;for(;;){if(Q===i)break t;if(U===l&&++N===f&&(x=v),U===_&&++X===o&&(T=v),(F=Q.nextSibling)!==null)break;Q=U,U=Q.parentNode}Q=F}l=x===-1||T===-1?null:{start:x,end:T}}else l=null}l=l||{start:0,end:0}}else l=null;for(fh={focusedElem:i,selectionRange:l},Co=!1,Tt=r;Tt!==null;)if(r=Tt,i=r.child,(r.subtreeFlags&1028)!==0&&i!==null)i.return=r,Tt=i;else for(;Tt!==null;){switch(r=Tt,_=r.alternate,i=r.flags,r.tag){case 0:if((i&4)!==0&&(i=r.updateQueue,i=i!==null?i.events:null,i!==null))for(l=0;l<i.length;l++)f=i[l],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&_!==null){i=void 0,l=r,f=_.memoizedProps,_=_.memoizedState,o=l.stateNode;try{var he=wr(l.type,f);i=o.getSnapshotBeforeUpdate(he,_),o.__reactInternalSnapshotBeforeUpdate=i}catch(ye){Ve(l,l.return,ye)}}break;case 3:if((i&1024)!==0){if(i=r.stateNode.containerInfo,l=i.nodeType,l===9)_h(i);else if(l===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":_h(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(s(163))}if(i=r.sibling,i!==null){i.return=r.return,Tt=i;break}Tt=r.return}}function um(i,r,l){var o=l.flags;switch(l.tag){case 0:case 11:case 15:vn(i,l),o&4&&pl(5,l);break;case 1:if(vn(i,l),o&4)if(i=l.stateNode,r===null)try{i.componentDidMount()}catch(v){Ve(l,l.return,v)}else{var f=wr(l.type,r.memoizedProps);r=r.memoizedState;try{i.componentDidUpdate(f,r,i.__reactInternalSnapshotBeforeUpdate)}catch(v){Ve(l,l.return,v)}}o&64&&nm(l),o&512&&_l(l,l.return);break;case 3:if(vn(i,l),o&64&&(i=l.updateQueue,i!==null)){if(r=null,l.child!==null)switch(l.child.tag){case 27:case 5:r=l.child.stateNode;break;case 1:r=l.child.stateNode}try{Kp(i,r)}catch(v){Ve(l,l.return,v)}}break;case 27:r===null&&o&4&&am(l);case 26:case 5:vn(i,l),r===null&&o&4&&sm(l),o&512&&_l(l,l.return);break;case 12:vn(i,l);break;case 31:vn(i,l),o&4&&fm(i,l);break;case 13:vn(i,l),o&4&&dm(i,l),o&64&&(i=l.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(l=t1.bind(null,l),b1(i,l))));break;case 22:if(o=l.memoizedState!==null||mn,!o){r=r!==null&&r.memoizedState!==null||gt,f=mn;var _=gt;mn=o,(gt=r)&&!_?yn(i,l,(l.subtreeFlags&8772)!==0):vn(i,l),mn=f,gt=_}break;case 30:break;default:vn(i,l)}}function cm(i){var r=i.alternate;r!==null&&(i.alternate=null,cm(r)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(r=i.stateNode,r!==null&&Su(r)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var nt=null,ni=!1;function gn(i,r,l){for(l=l.child;l!==null;)hm(i,r,l),l=l.sibling}function hm(i,r,l){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(Kt,l)}catch{}switch(l.tag){case 26:gt||Ki(l,r),gn(i,r,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:gt||Ki(l,r);var o=nt,f=ni;Kn(l.type)&&(nt=l.stateNode,ni=!1),gn(i,r,l),Cl(l.stateNode),nt=o,ni=f;break;case 5:gt||Ki(l,r);case 6:if(o=nt,f=ni,nt=null,gn(i,r,l),nt=o,ni=f,nt!==null)if(ni)try{(nt.nodeType===9?nt.body:nt.nodeName==="HTML"?nt.ownerDocument.body:nt).removeChild(l.stateNode)}catch(_){Ve(l,r,_)}else try{nt.removeChild(l.stateNode)}catch(_){Ve(l,r,_)}break;case 18:nt!==null&&(ni?(i=nt,ng(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,l.stateNode),ks(i)):ng(nt,l.stateNode));break;case 4:o=nt,f=ni,nt=l.stateNode.containerInfo,ni=!0,gn(i,r,l),nt=o,ni=f;break;case 0:case 11:case 14:case 15:Pn(2,l,r),gt||Pn(4,l,r),gn(i,r,l);break;case 1:gt||(Ki(l,r),o=l.stateNode,typeof o.componentWillUnmount=="function"&&rm(l,r,o)),gn(i,r,l);break;case 21:gn(i,r,l);break;case 22:gt=(o=gt)||l.memoizedState!==null,gn(i,r,l),gt=o;break;default:gn(i,r,l)}}function fm(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{ks(i)}catch(l){Ve(r,r.return,l)}}}function dm(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{ks(i)}catch(l){Ve(r,r.return,l)}}function Kb(i){switch(i.tag){case 31:case 13:case 19:var r=i.stateNode;return r===null&&(r=i.stateNode=new om),r;case 22:return i=i.stateNode,r=i._retryCache,r===null&&(r=i._retryCache=new om),r;default:throw Error(s(435,i.tag))}}function no(i,r){var l=Kb(i);r.forEach(function(o){if(!l.has(o)){l.add(o);var f=i1.bind(null,i,o);o.then(f,f)}})}function ri(i,r){var l=r.deletions;if(l!==null)for(var o=0;o<l.length;o++){var f=l[o],_=i,v=r,x=v;e:for(;x!==null;){switch(x.tag){case 27:if(Kn(x.type)){nt=x.stateNode,ni=!1;break e}break;case 5:nt=x.stateNode,ni=!1;break e;case 3:case 4:nt=x.stateNode.containerInfo,ni=!0;break e}x=x.return}if(nt===null)throw Error(s(160));hm(_,v,f),nt=null,ni=!1,_=f.alternate,_!==null&&(_.return=null),f.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)pm(r,i),r=r.sibling}var Ii=null;function pm(i,r){var l=i.alternate,o=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:ri(r,i),si(i),o&4&&(Pn(3,i,i.return),pl(3,i),Pn(5,i,i.return));break;case 1:ri(r,i),si(i),o&512&&(gt||l===null||Ki(l,l.return)),o&64&&mn&&(i=i.updateQueue,i!==null&&(o=i.callbacks,o!==null&&(l=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=l===null?o:l.concat(o))));break;case 26:var f=Ii;if(ri(r,i),si(i),o&512&&(gt||l===null||Ki(l,l.return)),o&4){var _=l!==null?l.memoizedState:null;if(o=i.memoizedState,l===null)if(o===null)if(i.stateNode===null){e:{o=i.type,l=i.memoizedProps,f=f.ownerDocument||f;t:switch(o){case"title":_=f.getElementsByTagName("title")[0],(!_||_[Fs]||_[zt]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=f.createElement(o),f.head.insertBefore(_,f.querySelector("head > title"))),jt(_,o,l),_[zt]=i,Et(_),o=_;break e;case"link":var v=pg("link","href",f).get(o+(l.href||""));if(v){for(var x=0;x<v.length;x++)if(_=v[x],_.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&_.getAttribute("rel")===(l.rel==null?null:l.rel)&&_.getAttribute("title")===(l.title==null?null:l.title)&&_.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){v.splice(x,1);break t}}_=f.createElement(o),jt(_,o,l),f.head.appendChild(_);break;case"meta":if(v=pg("meta","content",f).get(o+(l.content||""))){for(x=0;x<v.length;x++)if(_=v[x],_.getAttribute("content")===(l.content==null?null:""+l.content)&&_.getAttribute("name")===(l.name==null?null:l.name)&&_.getAttribute("property")===(l.property==null?null:l.property)&&_.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&_.getAttribute("charset")===(l.charSet==null?null:l.charSet)){v.splice(x,1);break t}}_=f.createElement(o),jt(_,o,l),f.head.appendChild(_);break;default:throw Error(s(468,o))}_[zt]=i,Et(_),o=_}i.stateNode=o}else _g(f,i.type,i.stateNode);else i.stateNode=dg(f,o,i.memoizedProps);else _!==o?(_===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):_.count--,o===null?_g(f,i.type,i.stateNode):dg(f,o,i.memoizedProps)):o===null&&i.stateNode!==null&&Ic(i,i.memoizedProps,l.memoizedProps)}break;case 27:ri(r,i),si(i),o&512&&(gt||l===null||Ki(l,l.return)),l!==null&&o&4&&Ic(i,i.memoizedProps,l.memoizedProps);break;case 5:if(ri(r,i),si(i),o&512&&(gt||l===null||Ki(l,l.return)),i.flags&32){f=i.stateNode;try{Xr(f,"")}catch(he){Ve(i,i.return,he)}}o&4&&i.stateNode!=null&&(f=i.memoizedProps,Ic(i,f,l!==null?l.memoizedProps:f)),o&1024&&(Vc=!0);break;case 6:if(ri(r,i),si(i),o&4){if(i.stateNode===null)throw Error(s(162));o=i.memoizedProps,l=i.stateNode;try{l.nodeValue=o}catch(he){Ve(i,i.return,he)}}break;case 3:if(So=null,f=Ii,Ii=vo(r.containerInfo),ri(r,i),Ii=f,si(i),o&4&&l!==null&&l.memoizedState.isDehydrated)try{ks(r.containerInfo)}catch(he){Ve(i,i.return,he)}Vc&&(Vc=!1,_m(i));break;case 4:o=Ii,Ii=vo(i.stateNode.containerInfo),ri(r,i),si(i),Ii=o;break;case 12:ri(r,i),si(i);break;case 31:ri(r,i),si(i),o&4&&(o=i.updateQueue,o!==null&&(i.updateQueue=null,no(i,o)));break;case 13:ri(r,i),si(i),i.child.flags&8192&&i.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(so=Yt()),o&4&&(o=i.updateQueue,o!==null&&(i.updateQueue=null,no(i,o)));break;case 22:f=i.memoizedState!==null;var T=l!==null&&l.memoizedState!==null,N=mn,X=gt;if(mn=N||f,gt=X||T,ri(r,i),gt=X,mn=N,si(i),o&8192)e:for(r=i.stateNode,r._visibility=f?r._visibility&-2:r._visibility|1,f&&(l===null||T||mn||gt||Cr(i)),l=null,r=i;;){if(r.tag===5||r.tag===26){if(l===null){T=l=r;try{if(_=T.stateNode,f)v=_.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{x=T.stateNode;var Q=T.memoizedProps.style,U=Q!=null&&Q.hasOwnProperty("display")?Q.display:null;x.style.display=U==null||typeof U=="boolean"?"":(""+U).trim()}}catch(he){Ve(T,T.return,he)}}}else if(r.tag===6){if(l===null){T=r;try{T.stateNode.nodeValue=f?"":T.memoizedProps}catch(he){Ve(T,T.return,he)}}}else if(r.tag===18){if(l===null){T=r;try{var F=T.stateNode;f?rg(F,!0):rg(T.stateNode,!1)}catch(he){Ve(T,T.return,he)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===i)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;l===r&&(l=null),r=r.return}l===r&&(l=null),r.sibling.return=r.return,r=r.sibling}o&4&&(o=i.updateQueue,o!==null&&(l=o.retryQueue,l!==null&&(o.retryQueue=null,no(i,l))));break;case 19:ri(r,i),si(i),o&4&&(o=i.updateQueue,o!==null&&(i.updateQueue=null,no(i,o)));break;case 30:break;case 21:break;default:ri(r,i),si(i)}}function si(i){var r=i.flags;if(r&2){try{for(var l,o=i.return;o!==null;){if(lm(o)){l=o;break}o=o.return}if(l==null)throw Error(s(160));switch(l.tag){case 27:var f=l.stateNode,_=Fc(i);io(i,_,f);break;case 5:var v=l.stateNode;l.flags&32&&(Xr(v,""),l.flags&=-33);var x=Fc(i);io(i,x,v);break;case 3:case 4:var T=l.stateNode.containerInfo,N=Fc(i);qc(i,N,T);break;default:throw Error(s(161))}}catch(X){Ve(i,i.return,X)}i.flags&=-3}r&4096&&(i.flags&=-4097)}function _m(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var r=i;_m(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),i=i.sibling}}function vn(i,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)um(i,r.alternate,r),r=r.sibling}function Cr(i){for(i=i.child;i!==null;){var r=i;switch(r.tag){case 0:case 11:case 14:case 15:Pn(4,r,r.return),Cr(r);break;case 1:Ki(r,r.return);var l=r.stateNode;typeof l.componentWillUnmount=="function"&&rm(r,r.return,l),Cr(r);break;case 27:Cl(r.stateNode);case 26:case 5:Ki(r,r.return),Cr(r);break;case 22:r.memoizedState===null&&Cr(r);break;case 30:Cr(r);break;default:Cr(r)}i=i.sibling}}function yn(i,r,l){for(l=l&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var o=r.alternate,f=i,_=r,v=_.flags;switch(_.tag){case 0:case 11:case 15:yn(f,_,l),pl(4,_);break;case 1:if(yn(f,_,l),o=_,f=o.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(N){Ve(o,o.return,N)}if(o=_,f=o.updateQueue,f!==null){var x=o.stateNode;try{var T=f.shared.hiddenCallbacks;if(T!==null)for(f.shared.hiddenCallbacks=null,f=0;f<T.length;f++)Yp(T[f],x)}catch(N){Ve(o,o.return,N)}}l&&v&64&&nm(_),_l(_,_.return);break;case 27:am(_);case 26:case 5:yn(f,_,l),l&&o===null&&v&4&&sm(_),_l(_,_.return);break;case 12:yn(f,_,l);break;case 31:yn(f,_,l),l&&v&4&&fm(f,_);break;case 13:yn(f,_,l),l&&v&4&&dm(f,_);break;case 22:_.memoizedState===null&&yn(f,_,l),_l(_,_.return);break;case 30:break;default:yn(f,_,l)}r=r.sibling}}function Wc(i,r){var l=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(l=i.memoizedState.cachePool.pool),i=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(i=r.memoizedState.cachePool.pool),i!==l&&(i!=null&&i.refCount++,l!=null&&tl(l))}function Yc(i,r){i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&tl(i))}function Fi(i,r,l,o){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)mm(i,r,l,o),r=r.sibling}function mm(i,r,l,o){var f=r.flags;switch(r.tag){case 0:case 11:case 15:Fi(i,r,l,o),f&2048&&pl(9,r);break;case 1:Fi(i,r,l,o);break;case 3:Fi(i,r,l,o),f&2048&&(i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&tl(i)));break;case 12:if(f&2048){Fi(i,r,l,o),i=r.stateNode;try{var _=r.memoizedProps,v=_.id,x=_.onPostCommit;typeof x=="function"&&x(v,r.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(T){Ve(r,r.return,T)}}else Fi(i,r,l,o);break;case 31:Fi(i,r,l,o);break;case 13:Fi(i,r,l,o);break;case 23:break;case 22:_=r.stateNode,v=r.alternate,r.memoizedState!==null?_._visibility&2?Fi(i,r,l,o):ml(i,r):_._visibility&2?Fi(i,r,l,o):(_._visibility|=2,ps(i,r,l,o,(r.subtreeFlags&10256)!==0||!1)),f&2048&&Wc(v,r);break;case 24:Fi(i,r,l,o),f&2048&&Yc(r.alternate,r);break;default:Fi(i,r,l,o)}}function ps(i,r,l,o,f){for(f=f&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var _=i,v=r,x=l,T=o,N=v.flags;switch(v.tag){case 0:case 11:case 15:ps(_,v,x,T,f),pl(8,v);break;case 23:break;case 22:var X=v.stateNode;v.memoizedState!==null?X._visibility&2?ps(_,v,x,T,f):ml(_,v):(X._visibility|=2,ps(_,v,x,T,f)),f&&N&2048&&Wc(v.alternate,v);break;case 24:ps(_,v,x,T,f),f&&N&2048&&Yc(v.alternate,v);break;default:ps(_,v,x,T,f)}r=r.sibling}}function ml(i,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var l=i,o=r,f=o.flags;switch(o.tag){case 22:ml(l,o),f&2048&&Wc(o.alternate,o);break;case 24:ml(l,o),f&2048&&Yc(o.alternate,o);break;default:ml(l,o)}r=r.sibling}}var gl=8192;function _s(i,r,l){if(i.subtreeFlags&gl)for(i=i.child;i!==null;)gm(i,r,l),i=i.sibling}function gm(i,r,l){switch(i.tag){case 26:_s(i,r,l),i.flags&gl&&i.memoizedState!==null&&O1(l,Ii,i.memoizedState,i.memoizedProps);break;case 5:_s(i,r,l);break;case 3:case 4:var o=Ii;Ii=vo(i.stateNode.containerInfo),_s(i,r,l),Ii=o;break;case 22:i.memoizedState===null&&(o=i.alternate,o!==null&&o.memoizedState!==null?(o=gl,gl=16777216,_s(i,r,l),gl=o):_s(i,r,l));break;default:_s(i,r,l)}}function vm(i){var r=i.alternate;if(r!==null&&(i=r.child,i!==null)){r.child=null;do r=i.sibling,i.sibling=null,i=r;while(i!==null)}}function vl(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var l=0;l<r.length;l++){var o=r[l];Tt=o,Sm(o,i)}vm(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)ym(i),i=i.sibling}function ym(i){switch(i.tag){case 0:case 11:case 15:vl(i),i.flags&2048&&Pn(9,i,i.return);break;case 3:vl(i);break;case 12:vl(i);break;case 22:var r=i.stateNode;i.memoizedState!==null&&r._visibility&2&&(i.return===null||i.return.tag!==13)?(r._visibility&=-3,ro(i)):vl(i);break;default:vl(i)}}function ro(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var l=0;l<r.length;l++){var o=r[l];Tt=o,Sm(o,i)}vm(i)}for(i=i.child;i!==null;){switch(r=i,r.tag){case 0:case 11:case 15:Pn(8,r,r.return),ro(r);break;case 22:l=r.stateNode,l._visibility&2&&(l._visibility&=-3,ro(r));break;default:ro(r)}i=i.sibling}}function Sm(i,r){for(;Tt!==null;){var l=Tt;switch(l.tag){case 0:case 11:case 15:Pn(8,l,r);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var o=l.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:tl(l.memoizedState.cache)}if(o=l.child,o!==null)o.return=l,Tt=o;else e:for(l=i;Tt!==null;){o=Tt;var f=o.sibling,_=o.return;if(cm(o),o===l){Tt=null;break e}if(f!==null){f.return=_,Tt=f;break e}Tt=_}}}var Xb={getCacheForType:function(i){var r=Nt(pt),l=r.data.get(i);return l===void 0&&(l=i(),r.data.set(i,l)),l},cacheSignal:function(){return Nt(pt).controller.signal}},Gb=typeof WeakMap=="function"?WeakMap:Map,Ie=0,Ze=null,Re=null,ze=0,qe=0,gi=null,In=!1,ms=!1,Kc=!1,Sn=0,ot=0,Fn=0,kr=0,Xc=0,vi=0,gs=0,yl=null,li=null,Gc=!1,so=0,bm=0,lo=1/0,ao=null,qn=null,xt=0,Vn=null,vs=null,bn=0,$c=0,Zc=null,xm=null,Sl=0,Qc=null;function yi(){return(Ie&2)!==0&&ze!==0?ze&-ze:M.T!==null?rh():jd()}function wm(){if(vi===0)if((ze&536870912)===0||Ne){var i=_a;_a<<=1,(_a&3932160)===0&&(_a=262144),vi=i}else vi=536870912;return i=_i.current,i!==null&&(i.flags|=32),vi}function ai(i,r,l){(i===Ze&&(qe===2||qe===9)||i.cancelPendingCommit!==null)&&(ys(i,0),Wn(i,ze,vi,!1)),Is(i,l),((Ie&2)===0||i!==Ze)&&(i===Ze&&((Ie&2)===0&&(kr|=l),ot===4&&Wn(i,ze,vi,!1)),Xi(i))}function Cm(i,r,l){if((Ie&6)!==0)throw Error(s(327));var o=!l&&(r&127)===0&&(r&i.expiredLanes)===0||Ps(i,r),f=o?Qb(i,r):eh(i,r,!0),_=o;do{if(f===0){ms&&!o&&Wn(i,r,0,!1);break}else{if(l=i.current.alternate,_&&!$b(l)){f=eh(i,r,!1),_=!1;continue}if(f===2){if(_=r,i.errorRecoveryDisabledLanes&_)var v=0;else v=i.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){r=v;e:{var x=i;f=yl;var T=x.current.memoizedState.isDehydrated;if(T&&(ys(x,v).flags|=256),v=eh(x,v,!1),v!==2){if(Kc&&!T){x.errorRecoveryDisabledLanes|=_,kr|=_,f=4;break e}_=li,li=f,_!==null&&(li===null?li=_:li.push.apply(li,_))}f=v}if(_=!1,f!==2)continue}}if(f===1){ys(i,0),Wn(i,r,0,!0);break}e:{switch(o=i,_=f,_){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:Wn(o,r,vi,!In);break e;case 2:li=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(f=so+300-Yt(),10<f)){if(Wn(o,r,vi,!In),ga(o,0,!0)!==0)break e;bn=r,o.timeoutHandle=tg(km.bind(null,o,l,li,ao,Gc,r,vi,kr,gs,In,_,"Throttled",-0,0),f);break e}km(o,l,li,ao,Gc,r,vi,kr,gs,In,_,null,-0,0)}}break}while(!0);Xi(i)}function km(i,r,l,o,f,_,v,x,T,N,X,Q,U,F){if(i.timeoutHandle=-1,Q=r.subtreeFlags,Q&8192||(Q&16785408)===16785408){Q={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ln},gm(r,_,Q);var he=(_&62914560)===_?so-Yt():(_&4194048)===_?bm-Yt():0;if(he=z1(Q,he),he!==null){bn=_,i.cancelPendingCommit=he(Om.bind(null,i,r,_,l,o,f,v,x,T,X,Q,null,U,F)),Wn(i,_,v,!N);return}}Om(i,r,_,l,o,f,v,x,T)}function $b(i){for(var r=i;;){var l=r.tag;if((l===0||l===11||l===15)&&r.flags&16384&&(l=r.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var o=0;o<l.length;o++){var f=l[o],_=f.getSnapshot;f=f.value;try{if(!di(_(),f))return!1}catch{return!1}}if(l=r.child,r.subtreeFlags&16384&&l!==null)l.return=r,r=l;else{if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Wn(i,r,l,o){r&=~Xc,r&=~kr,i.suspendedLanes|=r,i.pingedLanes&=~r,o&&(i.warmLanes|=r),o=i.expirationTimes;for(var f=r;0<f;){var _=31-$e(f),v=1<<_;o[_]=-1,f&=~v}l!==0&&Ld(i,l,r)}function oo(){return(Ie&6)===0?(bl(0),!1):!0}function Jc(){if(Re!==null){if(qe===0)var i=Re.return;else i=Re,cn=mr=null,_c(i),us=null,nl=0,i=Re;for(;i!==null;)im(i.alternate,i),i=i.return;Re=null}}function ys(i,r){var l=i.timeoutHandle;l!==-1&&(i.timeoutHandle=-1,m1(l)),l=i.cancelPendingCommit,l!==null&&(i.cancelPendingCommit=null,l()),bn=0,Jc(),Ze=i,Re=l=on(i.current,null),ze=r,qe=0,gi=null,In=!1,ms=Ps(i,r),Kc=!1,gs=vi=Xc=kr=Fn=ot=0,li=yl=null,Gc=!1,(r&8)!==0&&(r|=r&32);var o=i.entangledLanes;if(o!==0)for(i=i.entanglements,o&=r;0<o;){var f=31-$e(o),_=1<<f;r|=i[f],o&=~_}return Sn=r,Aa(),l}function Em(i,r){Ce=null,M.H=hl,r===os||r===Ha?(r=Fp(),qe=3):r===nc?(r=Fp(),qe=4):qe=r===Rc?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,gi=r,Re===null&&(ot=1,Za(i,Ti(r,i.current)))}function Tm(){var i=_i.current;return i===null?!0:(ze&4194048)===ze?Ri===null:(ze&62914560)===ze||(ze&536870912)!==0?i===Ri:!1}function Dm(){var i=M.H;return M.H=hl,i===null?hl:i}function Am(){var i=M.A;return M.A=Xb,i}function uo(){ot=4,In||(ze&4194048)!==ze&&_i.current!==null||(ms=!0),(Fn&134217727)===0&&(kr&134217727)===0||Ze===null||Wn(Ze,ze,vi,!1)}function eh(i,r,l){var o=Ie;Ie|=2;var f=Dm(),_=Am();(Ze!==i||ze!==r)&&(ao=null,ys(i,r)),r=!1;var v=ot;e:do try{if(qe!==0&&Re!==null){var x=Re,T=gi;switch(qe){case 8:Jc(),v=6;break e;case 3:case 2:case 9:case 6:_i.current===null&&(r=!0);var N=qe;if(qe=0,gi=null,Ss(i,x,T,N),l&&ms){v=0;break e}break;default:N=qe,qe=0,gi=null,Ss(i,x,T,N)}}Zb(),v=ot;break}catch(X){Em(i,X)}while(!0);return r&&i.shellSuspendCounter++,cn=mr=null,Ie=o,M.H=f,M.A=_,Re===null&&(Ze=null,ze=0,Aa()),v}function Zb(){for(;Re!==null;)Mm(Re)}function Qb(i,r){var l=Ie;Ie|=2;var o=Dm(),f=Am();Ze!==i||ze!==r?(ao=null,lo=Yt()+500,ys(i,r)):ms=Ps(i,r);e:do try{if(qe!==0&&Re!==null){r=Re;var _=gi;t:switch(qe){case 1:qe=0,gi=null,Ss(i,r,_,1);break;case 2:case 9:if(Pp(_)){qe=0,gi=null,Rm(r);break}r=function(){qe!==2&&qe!==9||Ze!==i||(qe=7),Xi(i)},_.then(r,r);break e;case 3:qe=7;break e;case 4:qe=5;break e;case 7:Pp(_)?(qe=0,gi=null,Rm(r)):(qe=0,gi=null,Ss(i,r,_,7));break;case 5:var v=null;switch(Re.tag){case 26:v=Re.memoizedState;case 5:case 27:var x=Re;if(v?mg(v):x.stateNode.complete){qe=0,gi=null;var T=x.sibling;if(T!==null)Re=T;else{var N=x.return;N!==null?(Re=N,co(N)):Re=null}break t}}qe=0,gi=null,Ss(i,r,_,5);break;case 6:qe=0,gi=null,Ss(i,r,_,6);break;case 8:Jc(),ot=6;break e;default:throw Error(s(462))}}Jb();break}catch(X){Em(i,X)}while(!0);return cn=mr=null,M.H=o,M.A=f,Ie=l,Re!==null?0:(Ze=null,ze=0,Aa(),ot)}function Jb(){for(;Re!==null&&!du();)Mm(Re)}function Mm(i){var r=em(i.alternate,i,Sn);i.memoizedProps=i.pendingProps,r===null?co(i):Re=r}function Rm(i){var r=i,l=r.alternate;switch(r.tag){case 15:case 0:r=X_(l,r,r.pendingProps,r.type,void 0,ze);break;case 11:r=X_(l,r,r.pendingProps,r.type.render,r.ref,ze);break;case 5:_c(r);default:im(l,r),r=Re=Ap(r,Sn),r=em(l,r,Sn)}i.memoizedProps=i.pendingProps,r===null?co(i):Re=r}function Ss(i,r,l,o){cn=mr=null,_c(r),us=null,nl=0;var f=r.return;try{if(Ib(i,f,r,l,ze)){ot=1,Za(i,Ti(l,i.current)),Re=null;return}}catch(_){if(f!==null)throw Re=f,_;ot=1,Za(i,Ti(l,i.current)),Re=null;return}r.flags&32768?(Ne||o===1?i=!0:ms||(ze&536870912)!==0?i=!1:(In=i=!0,(o===2||o===9||o===3||o===6)&&(o=_i.current,o!==null&&o.tag===13&&(o.flags|=16384))),Bm(r,i)):co(r)}function co(i){var r=i;do{if((r.flags&32768)!==0){Bm(r,In);return}i=r.return;var l=Vb(r.alternate,r,Sn);if(l!==null){Re=l;return}if(r=r.sibling,r!==null){Re=r;return}Re=r=i}while(r!==null);ot===0&&(ot=5)}function Bm(i,r){do{var l=Wb(i.alternate,i);if(l!==null){l.flags&=32767,Re=l;return}if(l=i.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!r&&(i=i.sibling,i!==null)){Re=i;return}Re=i=l}while(i!==null);ot=6,Re=null}function Om(i,r,l,o,f,_,v,x,T){i.cancelPendingCommit=null;do ho();while(xt!==0);if((Ie&6)!==0)throw Error(s(327));if(r!==null){if(r===i.current)throw Error(s(177));if(_=r.lanes|r.childLanes,_|=Fu,B0(i,l,_,v,x,T),i===Ze&&(Re=Ze=null,ze=0),vs=r,Vn=i,bn=l,$c=_,Zc=f,xm=o,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,n1(Se,function(){return jm(),null})):(i.callbackNode=null,i.callbackPriority=0),o=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||o){o=M.T,M.T=null,f=q.p,q.p=2,v=Ie,Ie|=4;try{Yb(i,r,l)}finally{Ie=v,q.p=f,M.T=o}}xt=1,zm(),Lm(),Nm()}}function zm(){if(xt===1){xt=0;var i=Vn,r=vs,l=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||l){l=M.T,M.T=null;var o=q.p;q.p=2;var f=Ie;Ie|=4;try{pm(r,i);var _=fh,v=Sp(i.containerInfo),x=_.focusedElem,T=_.selectionRange;if(v!==x&&x&&x.ownerDocument&&yp(x.ownerDocument.documentElement,x)){if(T!==null&&Hu(x)){var N=T.start,X=T.end;if(X===void 0&&(X=N),"selectionStart"in x)x.selectionStart=N,x.selectionEnd=Math.min(X,x.value.length);else{var Q=x.ownerDocument||document,U=Q&&Q.defaultView||window;if(U.getSelection){var F=U.getSelection(),he=x.textContent.length,ye=Math.min(T.start,he),Xe=T.end===void 0?ye:Math.min(T.end,he);!F.extend&&ye>Xe&&(v=Xe,Xe=ye,ye=v);var O=vp(x,ye),R=vp(x,Xe);if(O&&R&&(F.rangeCount!==1||F.anchorNode!==O.node||F.anchorOffset!==O.offset||F.focusNode!==R.node||F.focusOffset!==R.offset)){var L=Q.createRange();L.setStart(O.node,O.offset),F.removeAllRanges(),ye>Xe?(F.addRange(L),F.extend(R.node,R.offset)):(L.setEnd(R.node,R.offset),F.addRange(L))}}}}for(Q=[],F=x;F=F.parentNode;)F.nodeType===1&&Q.push({element:F,left:F.scrollLeft,top:F.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;x<Q.length;x++){var $=Q[x];$.element.scrollLeft=$.left,$.element.scrollTop=$.top}}Co=!!hh,fh=hh=null}finally{Ie=f,q.p=o,M.T=l}}i.current=r,xt=2}}function Lm(){if(xt===2){xt=0;var i=Vn,r=vs,l=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||l){l=M.T,M.T=null;var o=q.p;q.p=2;var f=Ie;Ie|=4;try{um(i,r.alternate,r)}finally{Ie=f,q.p=o,M.T=l}}xt=3}}function Nm(){if(xt===4||xt===3){xt=0,pu();var i=Vn,r=vs,l=bn,o=xm;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?xt=5:(xt=0,vs=Vn=null,Hm(i,i.pendingLanes));var f=i.pendingLanes;if(f===0&&(qn=null),vu(l),r=r.stateNode,bt&&typeof bt.onCommitFiberRoot=="function")try{bt.onCommitFiberRoot(Kt,r,void 0,(r.current.flags&128)===128)}catch{}if(o!==null){r=M.T,f=q.p,q.p=2,M.T=null;try{for(var _=i.onRecoverableError,v=0;v<o.length;v++){var x=o[v];_(x.value,{componentStack:x.stack})}}finally{M.T=r,q.p=f}}(bn&3)!==0&&ho(),Xi(i),f=i.pendingLanes,(l&261930)!==0&&(f&42)!==0?i===Qc?Sl++:(Sl=0,Qc=i):Sl=0,bl(0)}}function Hm(i,r){(i.pooledCacheLanes&=r)===0&&(r=i.pooledCache,r!=null&&(i.pooledCache=null,tl(r)))}function ho(){return zm(),Lm(),Nm(),jm()}function jm(){if(xt!==5)return!1;var i=Vn,r=$c;$c=0;var l=vu(bn),o=M.T,f=q.p;try{q.p=32>l?32:l,M.T=null,l=Zc,Zc=null;var _=Vn,v=bn;if(xt=0,vs=Vn=null,bn=0,(Ie&6)!==0)throw Error(s(331));var x=Ie;if(Ie|=4,ym(_.current),mm(_,_.current,v,l),Ie=x,bl(0,!1),bt&&typeof bt.onPostCommitFiberRoot=="function")try{bt.onPostCommitFiberRoot(Kt,_)}catch{}return!0}finally{q.p=f,M.T=o,Hm(i,r)}}function Um(i,r,l){r=Ti(l,r),r=Mc(i.stateNode,r,2),i=Hn(i,r,2),i!==null&&(Is(i,2),Xi(i))}function Ve(i,r,l){if(i.tag===3)Um(i,i,l);else for(;r!==null;){if(r.tag===3){Um(r,i,l);break}else if(r.tag===1){var o=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(qn===null||!qn.has(o))){i=Ti(l,i),l=P_(2),o=Hn(r,l,2),o!==null&&(I_(l,o,r,i),Is(o,2),Xi(o));break}}r=r.return}}function th(i,r,l){var o=i.pingCache;if(o===null){o=i.pingCache=new Gb;var f=new Set;o.set(r,f)}else f=o.get(r),f===void 0&&(f=new Set,o.set(r,f));f.has(l)||(Kc=!0,f.add(l),i=e1.bind(null,i,r,l),r.then(i,i))}function e1(i,r,l){var o=i.pingCache;o!==null&&o.delete(r),i.pingedLanes|=i.suspendedLanes&l,i.warmLanes&=~l,Ze===i&&(ze&l)===l&&(ot===4||ot===3&&(ze&62914560)===ze&&300>Yt()-so?(Ie&2)===0&&ys(i,0):Xc|=l,gs===ze&&(gs=0)),Xi(i)}function Pm(i,r){r===0&&(r=zd()),i=dr(i,r),i!==null&&(Is(i,r),Xi(i))}function t1(i){var r=i.memoizedState,l=0;r!==null&&(l=r.retryLane),Pm(i,l)}function i1(i,r){var l=0;switch(i.tag){case 31:case 13:var o=i.stateNode,f=i.memoizedState;f!==null&&(l=f.retryLane);break;case 19:o=i.stateNode;break;case 22:o=i.stateNode._retryCache;break;default:throw Error(s(314))}o!==null&&o.delete(r),Pm(i,l)}function n1(i,r){return Ir(i,r)}var fo=null,bs=null,ih=!1,po=!1,nh=!1,Yn=0;function Xi(i){i!==bs&&i.next===null&&(bs===null?fo=bs=i:bs=bs.next=i),po=!0,ih||(ih=!0,s1())}function bl(i,r){if(!nh&&po){nh=!0;do for(var l=!1,o=fo;o!==null;){if(i!==0){var f=o.pendingLanes;if(f===0)var _=0;else{var v=o.suspendedLanes,x=o.pingedLanes;_=(1<<31-$e(42|i)+1)-1,_&=f&~(v&~x),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(l=!0,Vm(o,_))}else _=ze,_=ga(o,o===Ze?_:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(_&3)===0||Ps(o,_)||(l=!0,Vm(o,_));o=o.next}while(l);nh=!1}}function r1(){Im()}function Im(){po=ih=!1;var i=0;Yn!==0&&_1()&&(i=Yn);for(var r=Yt(),l=null,o=fo;o!==null;){var f=o.next,_=Fm(o,r);_===0?(o.next=null,l===null?fo=f:l.next=f,f===null&&(bs=l)):(l=o,(i!==0||(_&3)!==0)&&(po=!0)),o=f}xt!==0&&xt!==5||bl(i),Yn!==0&&(Yn=0)}function Fm(i,r){for(var l=i.suspendedLanes,o=i.pingedLanes,f=i.expirationTimes,_=i.pendingLanes&-62914561;0<_;){var v=31-$e(_),x=1<<v,T=f[v];T===-1?((x&l)===0||(x&o)!==0)&&(f[v]=R0(x,r)):T<=r&&(i.expiredLanes|=x),_&=~x}if(r=Ze,l=ze,l=ga(i,i===r?l:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),o=i.callbackNode,l===0||i===r&&(qe===2||qe===9)||i.cancelPendingCommit!==null)return o!==null&&o!==null&&Us(o),i.callbackNode=null,i.callbackPriority=0;if((l&3)===0||Ps(i,l)){if(r=l&-l,r===i.callbackPriority)return r;switch(o!==null&&Us(o),vu(l)){case 2:case 8:l=ae;break;case 32:l=Se;break;case 268435456:l=Fe;break;default:l=Se}return o=qm.bind(null,i),l=Ir(l,o),i.callbackPriority=r,i.callbackNode=l,r}return o!==null&&o!==null&&Us(o),i.callbackPriority=2,i.callbackNode=null,2}function qm(i,r){if(xt!==0&&xt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var l=i.callbackNode;if(ho()&&i.callbackNode!==l)return null;var o=ze;return o=ga(i,i===Ze?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),o===0?null:(Cm(i,o,r),Fm(i,Yt()),i.callbackNode!=null&&i.callbackNode===l?qm.bind(null,i):null)}function Vm(i,r){if(ho())return null;Cm(i,r,!0)}function s1(){g1(function(){(Ie&6)!==0?Ir(G,r1):Im()})}function rh(){if(Yn===0){var i=ls;i===0&&(i=pa,pa<<=1,(pa&261888)===0&&(pa=256)),Yn=i}return Yn}function Wm(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:ba(""+i)}function Ym(i,r){var l=r.ownerDocument.createElement("input");return l.name=r.name,l.value=r.value,i.id&&l.setAttribute("form",i.id),r.parentNode.insertBefore(l,r),i=new FormData(i),l.parentNode.removeChild(l),i}function l1(i,r,l,o,f){if(r==="submit"&&l&&l.stateNode===f){var _=Wm((f[ti]||null).action),v=o.submitter;v&&(r=(r=v[ti]||null)?Wm(r.formAction):v.getAttribute("formAction"),r!==null&&(_=r,v=null));var x=new ka("action","action",null,o,f);i.push({event:x,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(Yn!==0){var T=v?Ym(f,v):new FormData(f);Cc(l,{pending:!0,data:T,method:f.method,action:_},null,T)}}else typeof _=="function"&&(x.preventDefault(),T=v?Ym(f,v):new FormData(f),Cc(l,{pending:!0,data:T,method:f.method,action:_},_,T))},currentTarget:f}]})}}for(var sh=0;sh<Iu.length;sh++){var lh=Iu[sh],a1=lh.toLowerCase(),o1=lh[0].toUpperCase()+lh.slice(1);Pi(a1,"on"+o1)}Pi(wp,"onAnimationEnd"),Pi(Cp,"onAnimationIteration"),Pi(kp,"onAnimationStart"),Pi("dblclick","onDoubleClick"),Pi("focusin","onFocus"),Pi("focusout","onBlur"),Pi(Cb,"onTransitionRun"),Pi(kb,"onTransitionStart"),Pi(Eb,"onTransitionCancel"),Pi(Ep,"onTransitionEnd"),Yr("onMouseEnter",["mouseout","mouseover"]),Yr("onMouseLeave",["mouseout","mouseover"]),Yr("onPointerEnter",["pointerout","pointerover"]),Yr("onPointerLeave",["pointerout","pointerover"]),ur("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ur("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ur("onBeforeInput",["compositionend","keypress","textInput","paste"]),ur("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ur("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ur("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xl="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(" "),u1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(xl));function Km(i,r){r=(r&4)!==0;for(var l=0;l<i.length;l++){var o=i[l],f=o.event;o=o.listeners;e:{var _=void 0;if(r)for(var v=o.length-1;0<=v;v--){var x=o[v],T=x.instance,N=x.currentTarget;if(x=x.listener,T!==_&&f.isPropagationStopped())break e;_=x,f.currentTarget=N;try{_(f)}catch(X){Da(X)}f.currentTarget=null,_=T}else for(v=0;v<o.length;v++){if(x=o[v],T=x.instance,N=x.currentTarget,x=x.listener,T!==_&&f.isPropagationStopped())break e;_=x,f.currentTarget=N;try{_(f)}catch(X){Da(X)}f.currentTarget=null,_=T}}}}function Be(i,r){var l=r[yu];l===void 0&&(l=r[yu]=new Set);var o=i+"__bubble";l.has(o)||(Xm(r,i,2,!1),l.add(o))}function ah(i,r,l){var o=0;r&&(o|=4),Xm(l,i,o,r)}var _o="_reactListening"+Math.random().toString(36).slice(2);function oh(i){if(!i[_o]){i[_o]=!0,Id.forEach(function(l){l!=="selectionchange"&&(u1.has(l)||ah(l,!1,i),ah(l,!0,i))});var r=i.nodeType===9?i:i.ownerDocument;r===null||r[_o]||(r[_o]=!0,ah("selectionchange",!1,r))}}function Xm(i,r,l,o){switch(wg(r)){case 2:var f=H1;break;case 8:f=j1;break;default:f=wh}l=f.bind(null,r,l,i),f=void 0,!Du||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(f=!0),o?f!==void 0?i.addEventListener(r,l,{capture:!0,passive:f}):i.addEventListener(r,l,!0):f!==void 0?i.addEventListener(r,l,{passive:f}):i.addEventListener(r,l,!1)}function uh(i,r,l,o,f){var _=o;if((r&1)===0&&(r&2)===0&&o!==null)e:for(;;){if(o===null)return;var v=o.tag;if(v===3||v===4){var x=o.stateNode.containerInfo;if(x===f)break;if(v===4)for(v=o.return;v!==null;){var T=v.tag;if((T===3||T===4)&&v.stateNode.containerInfo===f)return;v=v.return}for(;x!==null;){if(v=qr(x),v===null)return;if(T=v.tag,T===5||T===6||T===26||T===27){o=_=v;continue e}x=x.parentNode}}o=o.return}Jd(function(){var N=_,X=Eu(l),Q=[];e:{var U=Tp.get(i);if(U!==void 0){var F=ka,he=i;switch(i){case"keypress":if(wa(l)===0)break e;case"keydown":case"keyup":F=ib;break;case"focusin":he="focus",F=Bu;break;case"focusout":he="blur",F=Bu;break;case"beforeblur":case"afterblur":F=Bu;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":F=ip;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":F=V0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":F=sb;break;case wp:case Cp:case kp:F=K0;break;case Ep:F=ab;break;case"scroll":case"scrollend":F=F0;break;case"wheel":F=ub;break;case"copy":case"cut":case"paste":F=G0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":F=rp;break;case"toggle":case"beforetoggle":F=hb}var ye=(r&4)!==0,Xe=!ye&&(i==="scroll"||i==="scrollend"),O=ye?U!==null?U+"Capture":null:U;ye=[];for(var R=N,L;R!==null;){var $=R;if(L=$.stateNode,$=$.tag,$!==5&&$!==26&&$!==27||L===null||O===null||($=Vs(R,O),$!=null&&ye.push(wl(R,$,L))),Xe)break;R=R.return}0<ye.length&&(U=new F(U,he,null,l,X),Q.push({event:U,listeners:ye}))}}if((r&7)===0){e:{if(U=i==="mouseover"||i==="pointerover",F=i==="mouseout"||i==="pointerout",U&&l!==ku&&(he=l.relatedTarget||l.fromElement)&&(qr(he)||he[Fr]))break e;if((F||U)&&(U=X.window===X?X:(U=X.ownerDocument)?U.defaultView||U.parentWindow:window,F?(he=l.relatedTarget||l.toElement,F=N,he=he?qr(he):null,he!==null&&(Xe=u(he),ye=he.tag,he!==Xe||ye!==5&&ye!==27&&ye!==6)&&(he=null)):(F=null,he=N),F!==he)){if(ye=ip,$="onMouseLeave",O="onMouseEnter",R="mouse",(i==="pointerout"||i==="pointerover")&&(ye=rp,$="onPointerLeave",O="onPointerEnter",R="pointer"),Xe=F==null?U:qs(F),L=he==null?U:qs(he),U=new ye($,R+"leave",F,l,X),U.target=Xe,U.relatedTarget=L,$=null,qr(X)===N&&(ye=new ye(O,R+"enter",he,l,X),ye.target=L,ye.relatedTarget=Xe,$=ye),Xe=$,F&&he)t:{for(ye=c1,O=F,R=he,L=0,$=O;$;$=ye($))L++;$=0;for(var me=R;me;me=ye(me))$++;for(;0<L-$;)O=ye(O),L--;for(;0<$-L;)R=ye(R),$--;for(;L--;){if(O===R||R!==null&&O===R.alternate){ye=O;break t}O=ye(O),R=ye(R)}ye=null}else ye=null;F!==null&&Gm(Q,U,F,ye,!1),he!==null&&Xe!==null&&Gm(Q,Xe,he,ye,!0)}}e:{if(U=N?qs(N):window,F=U.nodeName&&U.nodeName.toLowerCase(),F==="select"||F==="input"&&U.type==="file")var Ue=fp;else if(cp(U))if(dp)Ue=bb;else{Ue=yb;var pe=vb}else F=U.nodeName,!F||F.toLowerCase()!=="input"||U.type!=="checkbox"&&U.type!=="radio"?N&&Cu(N.elementType)&&(Ue=fp):Ue=Sb;if(Ue&&(Ue=Ue(i,N))){hp(Q,Ue,l,X);break e}pe&&pe(i,U,N),i==="focusout"&&N&&U.type==="number"&&N.memoizedProps.value!=null&&wu(U,"number",U.value)}switch(pe=N?qs(N):window,i){case"focusin":(cp(pe)||pe.contentEditable==="true")&&(Qr=pe,ju=N,Qs=null);break;case"focusout":Qs=ju=Qr=null;break;case"mousedown":Uu=!0;break;case"contextmenu":case"mouseup":case"dragend":Uu=!1,bp(Q,l,X);break;case"selectionchange":if(wb)break;case"keydown":case"keyup":bp(Q,l,X)}var ke;if(zu)e:{switch(i){case"compositionstart":var Le="onCompositionStart";break e;case"compositionend":Le="onCompositionEnd";break e;case"compositionupdate":Le="onCompositionUpdate";break e}Le=void 0}else Zr?op(i,l)&&(Le="onCompositionEnd"):i==="keydown"&&l.keyCode===229&&(Le="onCompositionStart");Le&&(sp&&l.locale!=="ko"&&(Zr||Le!=="onCompositionStart"?Le==="onCompositionEnd"&&Zr&&(ke=ep()):(Mn=X,Au="value"in Mn?Mn.value:Mn.textContent,Zr=!0)),pe=mo(N,Le),0<pe.length&&(Le=new np(Le,i,null,l,X),Q.push({event:Le,listeners:pe}),ke?Le.data=ke:(ke=up(l),ke!==null&&(Le.data=ke)))),(ke=db?pb(i,l):_b(i,l))&&(Le=mo(N,"onBeforeInput"),0<Le.length&&(pe=new np("onBeforeInput","beforeinput",null,l,X),Q.push({event:pe,listeners:Le}),pe.data=ke)),l1(Q,i,N,l,X)}Km(Q,r)})}function wl(i,r,l){return{instance:i,listener:r,currentTarget:l}}function mo(i,r){for(var l=r+"Capture",o=[];i!==null;){var f=i,_=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||_===null||(f=Vs(i,l),f!=null&&o.unshift(wl(i,f,_)),f=Vs(i,r),f!=null&&o.push(wl(i,f,_))),i.tag===3)return o;i=i.return}return[]}function c1(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Gm(i,r,l,o,f){for(var _=r._reactName,v=[];l!==null&&l!==o;){var x=l,T=x.alternate,N=x.stateNode;if(x=x.tag,T!==null&&T===o)break;x!==5&&x!==26&&x!==27||N===null||(T=N,f?(N=Vs(l,_),N!=null&&v.unshift(wl(l,N,T))):f||(N=Vs(l,_),N!=null&&v.push(wl(l,N,T)))),l=l.return}v.length!==0&&i.push({event:r,listeners:v})}var h1=/\r\n?/g,f1=/\u0000|\uFFFD/g;function $m(i){return(typeof i=="string"?i:""+i).replace(h1,`
|
|
49
|
-
`).replace(f1,"")}function Zm(i,r){return r=$m(r),$m(i)===r}function Ke(i,r,l,o,f,_){switch(l){case"children":typeof o=="string"?r==="body"||r==="textarea"&&o===""||Xr(i,o):(typeof o=="number"||typeof o=="bigint")&&r!=="body"&&Xr(i,""+o);break;case"className":ya(i,"class",o);break;case"tabIndex":ya(i,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":ya(i,l,o);break;case"style":Zd(i,o,_);break;case"data":if(r!=="object"){ya(i,"data",o);break}case"src":case"href":if(o===""&&(r!=="a"||l!=="href")){i.removeAttribute(l);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){i.removeAttribute(l);break}o=ba(""+o),i.setAttribute(l,o);break;case"action":case"formAction":if(typeof o=="function"){i.setAttribute(l,"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 _=="function"&&(l==="formAction"?(r!=="input"&&Ke(i,r,"name",f.name,f,null),Ke(i,r,"formEncType",f.formEncType,f,null),Ke(i,r,"formMethod",f.formMethod,f,null),Ke(i,r,"formTarget",f.formTarget,f,null)):(Ke(i,r,"encType",f.encType,f,null),Ke(i,r,"method",f.method,f,null),Ke(i,r,"target",f.target,f,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){i.removeAttribute(l);break}o=ba(""+o),i.setAttribute(l,o);break;case"onClick":o!=null&&(i.onclick=ln);break;case"onScroll":o!=null&&Be("scroll",i);break;case"onScrollEnd":o!=null&&Be("scrollend",i);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(s(61));if(l=o.__html,l!=null){if(f.children!=null)throw Error(s(60));i.innerHTML=l}}break;case"multiple":i.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":i.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){i.removeAttribute("xlink:href");break}l=ba(""+o),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?i.setAttribute(l,""+o):i.removeAttribute(l);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":o&&typeof o!="function"&&typeof o!="symbol"?i.setAttribute(l,""):i.removeAttribute(l);break;case"capture":case"download":o===!0?i.setAttribute(l,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?i.setAttribute(l,o):i.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?i.setAttribute(l,o):i.removeAttribute(l);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?i.removeAttribute(l):i.setAttribute(l,o);break;case"popover":Be("beforetoggle",i),Be("toggle",i),va(i,"popover",o);break;case"xlinkActuate":sn(i,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":sn(i,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":sn(i,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":sn(i,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":sn(i,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":sn(i,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":sn(i,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":sn(i,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":sn(i,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":va(i,"is",o);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=P0.get(l)||l,va(i,l,o))}}function ch(i,r,l,o,f,_){switch(l){case"style":Zd(i,o,_);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(s(61));if(l=o.__html,l!=null){if(f.children!=null)throw Error(s(60));i.innerHTML=l}}break;case"children":typeof o=="string"?Xr(i,o):(typeof o=="number"||typeof o=="bigint")&&Xr(i,""+o);break;case"onScroll":o!=null&&Be("scroll",i);break;case"onScrollEnd":o!=null&&Be("scrollend",i);break;case"onClick":o!=null&&(i.onclick=ln);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Fd.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(f=l.endsWith("Capture"),r=l.slice(2,f?l.length-7:void 0),_=i[ti]||null,_=_!=null?_[l]:null,typeof _=="function"&&i.removeEventListener(r,_,f),typeof o=="function")){typeof _!="function"&&_!==null&&(l in i?i[l]=null:i.hasAttribute(l)&&i.removeAttribute(l)),i.addEventListener(r,o,f);break e}l in i?i[l]=o:o===!0?i.setAttribute(l,""):va(i,l,o)}}}function jt(i,r,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Be("error",i),Be("load",i);var o=!1,f=!1,_;for(_ in l)if(l.hasOwnProperty(_)){var v=l[_];if(v!=null)switch(_){case"src":o=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Ke(i,r,_,v,l,null)}}f&&Ke(i,r,"srcSet",l.srcSet,l,null),o&&Ke(i,r,"src",l.src,l,null);return;case"input":Be("invalid",i);var x=_=v=f=null,T=null,N=null;for(o in l)if(l.hasOwnProperty(o)){var X=l[o];if(X!=null)switch(o){case"name":f=X;break;case"type":v=X;break;case"checked":T=X;break;case"defaultChecked":N=X;break;case"value":_=X;break;case"defaultValue":x=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(s(137,r));break;default:Ke(i,r,o,X,l,null)}}Kd(i,_,x,T,N,v,f,!1);return;case"select":Be("invalid",i),o=v=_=null;for(f in l)if(l.hasOwnProperty(f)&&(x=l[f],x!=null))switch(f){case"value":_=x;break;case"defaultValue":v=x;break;case"multiple":o=x;default:Ke(i,r,f,x,l,null)}r=_,l=v,i.multiple=!!o,r!=null?Kr(i,!!o,r,!1):l!=null&&Kr(i,!!o,l,!0);return;case"textarea":Be("invalid",i),_=f=o=null;for(v in l)if(l.hasOwnProperty(v)&&(x=l[v],x!=null))switch(v){case"value":o=x;break;case"defaultValue":f=x;break;case"children":_=x;break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(s(91));break;default:Ke(i,r,v,x,l,null)}Gd(i,o,f,_);return;case"option":for(T in l)if(l.hasOwnProperty(T)&&(o=l[T],o!=null))switch(T){case"selected":i.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:Ke(i,r,T,o,l,null)}return;case"dialog":Be("beforetoggle",i),Be("toggle",i),Be("cancel",i),Be("close",i);break;case"iframe":case"object":Be("load",i);break;case"video":case"audio":for(o=0;o<xl.length;o++)Be(xl[o],i);break;case"image":Be("error",i),Be("load",i);break;case"details":Be("toggle",i);break;case"embed":case"source":case"link":Be("error",i),Be("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(N in l)if(l.hasOwnProperty(N)&&(o=l[N],o!=null))switch(N){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Ke(i,r,N,o,l,null)}return;default:if(Cu(r)){for(X in l)l.hasOwnProperty(X)&&(o=l[X],o!==void 0&&ch(i,r,X,o,l,void 0));return}}for(x in l)l.hasOwnProperty(x)&&(o=l[x],o!=null&&Ke(i,r,x,o,l,null))}function d1(i,r,l,o){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,_=null,v=null,x=null,T=null,N=null,X=null;for(F in l){var Q=l[F];if(l.hasOwnProperty(F)&&Q!=null)switch(F){case"checked":break;case"value":break;case"defaultValue":T=Q;default:o.hasOwnProperty(F)||Ke(i,r,F,null,o,Q)}}for(var U in o){var F=o[U];if(Q=l[U],o.hasOwnProperty(U)&&(F!=null||Q!=null))switch(U){case"type":_=F;break;case"name":f=F;break;case"checked":N=F;break;case"defaultChecked":X=F;break;case"value":v=F;break;case"defaultValue":x=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(s(137,r));break;default:F!==Q&&Ke(i,r,U,F,o,Q)}}xu(i,v,x,T,N,X,_,f);return;case"select":F=v=x=U=null;for(_ in l)if(T=l[_],l.hasOwnProperty(_)&&T!=null)switch(_){case"value":break;case"multiple":F=T;default:o.hasOwnProperty(_)||Ke(i,r,_,null,o,T)}for(f in o)if(_=o[f],T=l[f],o.hasOwnProperty(f)&&(_!=null||T!=null))switch(f){case"value":U=_;break;case"defaultValue":x=_;break;case"multiple":v=_;default:_!==T&&Ke(i,r,f,_,o,T)}r=x,l=v,o=F,U!=null?Kr(i,!!l,U,!1):!!o!=!!l&&(r!=null?Kr(i,!!l,r,!0):Kr(i,!!l,l?[]:"",!1));return;case"textarea":F=U=null;for(x in l)if(f=l[x],l.hasOwnProperty(x)&&f!=null&&!o.hasOwnProperty(x))switch(x){case"value":break;case"children":break;default:Ke(i,r,x,null,o,f)}for(v in o)if(f=o[v],_=l[v],o.hasOwnProperty(v)&&(f!=null||_!=null))switch(v){case"value":U=f;break;case"defaultValue":F=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(s(91));break;default:f!==_&&Ke(i,r,v,f,o,_)}Xd(i,U,F);return;case"option":for(var he in l)if(U=l[he],l.hasOwnProperty(he)&&U!=null&&!o.hasOwnProperty(he))switch(he){case"selected":i.selected=!1;break;default:Ke(i,r,he,null,o,U)}for(T in o)if(U=o[T],F=l[T],o.hasOwnProperty(T)&&U!==F&&(U!=null||F!=null))switch(T){case"selected":i.selected=U&&typeof U!="function"&&typeof U!="symbol";break;default:Ke(i,r,T,U,o,F)}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 ye in l)U=l[ye],l.hasOwnProperty(ye)&&U!=null&&!o.hasOwnProperty(ye)&&Ke(i,r,ye,null,o,U);for(N in o)if(U=o[N],F=l[N],o.hasOwnProperty(N)&&U!==F&&(U!=null||F!=null))switch(N){case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(s(137,r));break;default:Ke(i,r,N,U,o,F)}return;default:if(Cu(r)){for(var Xe in l)U=l[Xe],l.hasOwnProperty(Xe)&&U!==void 0&&!o.hasOwnProperty(Xe)&&ch(i,r,Xe,void 0,o,U);for(X in o)U=o[X],F=l[X],!o.hasOwnProperty(X)||U===F||U===void 0&&F===void 0||ch(i,r,X,U,o,F);return}}for(var O in l)U=l[O],l.hasOwnProperty(O)&&U!=null&&!o.hasOwnProperty(O)&&Ke(i,r,O,null,o,U);for(Q in o)U=o[Q],F=l[Q],!o.hasOwnProperty(Q)||U===F||U==null&&F==null||Ke(i,r,Q,U,o,F)}function Qm(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function p1(){if(typeof performance.getEntriesByType=="function"){for(var i=0,r=0,l=performance.getEntriesByType("resource"),o=0;o<l.length;o++){var f=l[o],_=f.transferSize,v=f.initiatorType,x=f.duration;if(_&&x&&Qm(v)){for(v=0,x=f.responseEnd,o+=1;o<l.length;o++){var T=l[o],N=T.startTime;if(N>x)break;var X=T.transferSize,Q=T.initiatorType;X&&Qm(Q)&&(T=T.responseEnd,v+=X*(T<x?1:(x-N)/(T-N)))}if(--o,r+=8*(_+v)/(f.duration/1e3),i++,10<i)break}}if(0<i)return r/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var hh=null,fh=null;function go(i){return i.nodeType===9?i:i.ownerDocument}function Jm(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function eg(i,r){if(i===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&r==="foreignObject"?0:i}function dh(i,r){return i==="textarea"||i==="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 ph=null;function _1(){var i=window.event;return i&&i.type==="popstate"?i===ph?!1:(ph=i,!0):(ph=null,!1)}var tg=typeof setTimeout=="function"?setTimeout:void 0,m1=typeof clearTimeout=="function"?clearTimeout:void 0,ig=typeof Promise=="function"?Promise:void 0,g1=typeof queueMicrotask=="function"?queueMicrotask:typeof ig<"u"?function(i){return ig.resolve(null).then(i).catch(v1)}:tg;function v1(i){setTimeout(function(){throw i})}function Kn(i){return i==="head"}function ng(i,r){var l=r,o=0;do{var f=l.nextSibling;if(i.removeChild(l),f&&f.nodeType===8)if(l=f.data,l==="/$"||l==="/&"){if(o===0){i.removeChild(f),ks(r);return}o--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")o++;else if(l==="html")Cl(i.ownerDocument.documentElement);else if(l==="head"){l=i.ownerDocument.head,Cl(l);for(var _=l.firstChild;_;){var v=_.nextSibling,x=_.nodeName;_[Fs]||x==="SCRIPT"||x==="STYLE"||x==="LINK"&&_.rel.toLowerCase()==="stylesheet"||l.removeChild(_),_=v}}else l==="body"&&Cl(i.ownerDocument.body);l=f}while(l);ks(r)}function rg(i,r){var l=i;i=0;do{var o=l.nextSibling;if(l.nodeType===1?r?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(r?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),o&&o.nodeType===8)if(l=o.data,l==="/$"){if(i===0)break;i--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||i++;l=o}while(l)}function _h(i){var r=i.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var l=r;switch(r=r.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":_h(l),Su(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}i.removeChild(l)}}function y1(i,r,l,o){for(;i.nodeType===1;){var f=l;if(i.nodeName.toLowerCase()!==r.toLowerCase()){if(!o&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(o){if(!i[Fs])switch(r){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(_=i.getAttribute("rel"),_==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(_!==f.rel||i.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||i.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||i.getAttribute("title")!==(f.title==null?null:f.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(_=i.getAttribute("src"),(_!==(f.src==null?null:f.src)||i.getAttribute("type")!==(f.type==null?null:f.type)||i.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&_&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(r==="input"&&i.type==="hidden"){var _=f.name==null?null:""+f.name;if(f.type==="hidden"&&i.getAttribute("name")===_)return i}else return i;if(i=Bi(i.nextSibling),i===null)break}return null}function S1(i,r,l){if(r==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!l||(i=Bi(i.nextSibling),i===null))return null;return i}function sg(i,r){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!r||(i=Bi(i.nextSibling),i===null))return null;return i}function mh(i){return i.data==="$?"||i.data==="$~"}function gh(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function b1(i,r){var l=i.ownerDocument;if(i.data==="$~")i._reactRetry=r;else if(i.data!=="$?"||l.readyState!=="loading")r();else{var o=function(){r(),l.removeEventListener("DOMContentLoaded",o)};l.addEventListener("DOMContentLoaded",o),i._reactRetry=o}}function Bi(i){for(;i!=null;i=i.nextSibling){var r=i.nodeType;if(r===1||r===3)break;if(r===8){if(r=i.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return i}var vh=null;function lg(i){i=i.nextSibling;for(var r=0;i;){if(i.nodeType===8){var l=i.data;if(l==="/$"||l==="/&"){if(r===0)return Bi(i.nextSibling);r--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||r++}i=i.nextSibling}return null}function ag(i){i=i.previousSibling;for(var r=0;i;){if(i.nodeType===8){var l=i.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(r===0)return i;r--}else l!=="/$"&&l!=="/&"||r++}i=i.previousSibling}return null}function og(i,r,l){switch(r=go(l),i){case"html":if(i=r.documentElement,!i)throw Error(s(452));return i;case"head":if(i=r.head,!i)throw Error(s(453));return i;case"body":if(i=r.body,!i)throw Error(s(454));return i;default:throw Error(s(451))}}function Cl(i){for(var r=i.attributes;r.length;)i.removeAttributeNode(r[0]);Su(i)}var Oi=new Map,ug=new Set;function vo(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var xn=q.d;q.d={f:x1,r:w1,D:C1,C:k1,L:E1,m:T1,X:A1,S:D1,M:M1};function x1(){var i=xn.f(),r=oo();return i||r}function w1(i){var r=Vr(i);r!==null&&r.tag===5&&r.type==="form"?E_(r):xn.r(i)}var xs=typeof document>"u"?null:document;function cg(i,r,l){var o=xs;if(o&&typeof r=="string"&&r){var f=ki(r);f='link[rel="'+i+'"][href="'+f+'"]',typeof l=="string"&&(f+='[crossorigin="'+l+'"]'),ug.has(f)||(ug.add(f),i={rel:i,crossOrigin:l,href:r},o.querySelector(f)===null&&(r=o.createElement("link"),jt(r,"link",i),Et(r),o.head.appendChild(r)))}}function C1(i){xn.D(i),cg("dns-prefetch",i,null)}function k1(i,r){xn.C(i,r),cg("preconnect",i,r)}function E1(i,r,l){xn.L(i,r,l);var o=xs;if(o&&i&&r){var f='link[rel="preload"][as="'+ki(r)+'"]';r==="image"&&l&&l.imageSrcSet?(f+='[imagesrcset="'+ki(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(f+='[imagesizes="'+ki(l.imageSizes)+'"]')):f+='[href="'+ki(i)+'"]';var _=f;switch(r){case"style":_=ws(i);break;case"script":_=Cs(i)}Oi.has(_)||(i=m({rel:"preload",href:r==="image"&&l&&l.imageSrcSet?void 0:i,as:r},l),Oi.set(_,i),o.querySelector(f)!==null||r==="style"&&o.querySelector(kl(_))||r==="script"&&o.querySelector(El(_))||(r=o.createElement("link"),jt(r,"link",i),Et(r),o.head.appendChild(r)))}}function T1(i,r){xn.m(i,r);var l=xs;if(l&&i){var o=r&&typeof r.as=="string"?r.as:"script",f='link[rel="modulepreload"][as="'+ki(o)+'"][href="'+ki(i)+'"]',_=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=Cs(i)}if(!Oi.has(_)&&(i=m({rel:"modulepreload",href:i},r),Oi.set(_,i),l.querySelector(f)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(El(_)))return}o=l.createElement("link"),jt(o,"link",i),Et(o),l.head.appendChild(o)}}}function D1(i,r,l){xn.S(i,r,l);var o=xs;if(o&&i){var f=Wr(o).hoistableStyles,_=ws(i);r=r||"default";var v=f.get(_);if(!v){var x={loading:0,preload:null};if(v=o.querySelector(kl(_)))x.loading=5;else{i=m({rel:"stylesheet",href:i,"data-precedence":r},l),(l=Oi.get(_))&&yh(i,l);var T=v=o.createElement("link");Et(T),jt(T,"link",i),T._p=new Promise(function(N,X){T.onload=N,T.onerror=X}),T.addEventListener("load",function(){x.loading|=1}),T.addEventListener("error",function(){x.loading|=2}),x.loading|=4,yo(v,r,o)}v={type:"stylesheet",instance:v,count:1,state:x},f.set(_,v)}}}function A1(i,r){xn.X(i,r);var l=xs;if(l&&i){var o=Wr(l).hoistableScripts,f=Cs(i),_=o.get(f);_||(_=l.querySelector(El(f)),_||(i=m({src:i,async:!0},r),(r=Oi.get(f))&&Sh(i,r),_=l.createElement("script"),Et(_),jt(_,"link",i),l.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},o.set(f,_))}}function M1(i,r){xn.M(i,r);var l=xs;if(l&&i){var o=Wr(l).hoistableScripts,f=Cs(i),_=o.get(f);_||(_=l.querySelector(El(f)),_||(i=m({src:i,async:!0,type:"module"},r),(r=Oi.get(f))&&Sh(i,r),_=l.createElement("script"),Et(_),jt(_,"link",i),l.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},o.set(f,_))}}function hg(i,r,l,o){var f=(f=ce.current)?vo(f):null;if(!f)throw Error(s(446));switch(i){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(r=ws(l.href),l=Wr(f).hoistableStyles,o=l.get(r),o||(o={type:"style",instance:null,count:0,state:null},l.set(r,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){i=ws(l.href);var _=Wr(f).hoistableStyles,v=_.get(i);if(v||(f=f.ownerDocument||f,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(i,v),(_=f.querySelector(kl(i)))&&!_._p&&(v.instance=_,v.state.loading=5),Oi.has(i)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Oi.set(i,l),_||R1(f,i,l,v.state))),r&&o===null)throw Error(s(528,""));return v}if(r&&o!==null)throw Error(s(529,""));return null;case"script":return r=l.async,l=l.src,typeof l=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Cs(l),l=Wr(f).hoistableScripts,o=l.get(r),o||(o={type:"script",instance:null,count:0,state:null},l.set(r,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,i))}}function ws(i){return'href="'+ki(i)+'"'}function kl(i){return'link[rel="stylesheet"]['+i+"]"}function fg(i){return m({},i,{"data-precedence":i.precedence,precedence:null})}function R1(i,r,l,o){i.querySelector('link[rel="preload"][as="style"]['+r+"]")?o.loading=1:(r=i.createElement("link"),o.preload=r,r.addEventListener("load",function(){return o.loading|=1}),r.addEventListener("error",function(){return o.loading|=2}),jt(r,"link",l),Et(r),i.head.appendChild(r))}function Cs(i){return'[src="'+ki(i)+'"]'}function El(i){return"script[async]"+i}function dg(i,r,l){if(r.count++,r.instance===null)switch(r.type){case"style":var o=i.querySelector('style[data-href~="'+ki(l.href)+'"]');if(o)return r.instance=o,Et(o),o;var f=m({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return o=(i.ownerDocument||i).createElement("style"),Et(o),jt(o,"style",f),yo(o,l.precedence,i),r.instance=o;case"stylesheet":f=ws(l.href);var _=i.querySelector(kl(f));if(_)return r.state.loading|=4,r.instance=_,Et(_),_;o=fg(l),(f=Oi.get(f))&&yh(o,f),_=(i.ownerDocument||i).createElement("link"),Et(_);var v=_;return v._p=new Promise(function(x,T){v.onload=x,v.onerror=T}),jt(_,"link",o),r.state.loading|=4,yo(_,l.precedence,i),r.instance=_;case"script":return _=Cs(l.src),(f=i.querySelector(El(_)))?(r.instance=f,Et(f),f):(o=l,(f=Oi.get(_))&&(o=m({},l),Sh(o,f)),i=i.ownerDocument||i,f=i.createElement("script"),Et(f),jt(f,"link",o),i.head.appendChild(f),r.instance=f);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(o=r.instance,r.state.loading|=4,yo(o,l.precedence,i));return r.instance}function yo(i,r,l){for(var o=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=o.length?o[o.length-1]:null,_=f,v=0;v<o.length;v++){var x=o[v];if(x.dataset.precedence===r)_=x;else if(_!==f)break}_?_.parentNode.insertBefore(i,_.nextSibling):(r=l.nodeType===9?l.head:l,r.insertBefore(i,r.firstChild))}function yh(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.title==null&&(i.title=r.title)}function Sh(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.integrity==null&&(i.integrity=r.integrity)}var So=null;function pg(i,r,l){if(So===null){var o=new Map,f=So=new Map;f.set(l,o)}else f=So,o=f.get(l),o||(o=new Map,f.set(l,o));if(o.has(i))return o;for(o.set(i,null),l=l.getElementsByTagName(i),f=0;f<l.length;f++){var _=l[f];if(!(_[Fs]||_[zt]||i==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var v=_.getAttribute(r)||"";v=i+v;var x=o.get(v);x?x.push(_):o.set(v,[_])}}return o}function _g(i,r,l){i=i.ownerDocument||i,i.head.insertBefore(l,r==="title"?i.querySelector("head > title"):null)}function B1(i,r,l){if(l===1||r.itemProp!=null)return!1;switch(i){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 i=r.disabled,typeof r.precedence=="string"&&i==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 mg(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function O1(i,r,l,o){if(l.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var f=ws(o.href),_=r.querySelector(kl(f));if(_){r=_._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(i.count++,i=bo.bind(i),r.then(i,i)),l.state.loading|=4,l.instance=_,Et(_);return}_=r.ownerDocument||r,o=fg(o),(f=Oi.get(f))&&yh(o,f),_=_.createElement("link"),Et(_);var v=_;v._p=new Promise(function(x,T){v.onload=x,v.onerror=T}),jt(_,"link",o),l.instance=_}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(l,r),(r=l.state.preload)&&(l.state.loading&3)===0&&(i.count++,l=bo.bind(i),r.addEventListener("load",l),r.addEventListener("error",l))}}var bh=0;function z1(i,r){return i.stylesheets&&i.count===0&&wo(i,i.stylesheets),0<i.count||0<i.imgCount?function(l){var o=setTimeout(function(){if(i.stylesheets&&wo(i,i.stylesheets),i.unsuspend){var _=i.unsuspend;i.unsuspend=null,_()}},6e4+r);0<i.imgBytes&&bh===0&&(bh=62500*p1());var f=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&wo(i,i.stylesheets),i.unsuspend)){var _=i.unsuspend;i.unsuspend=null,_()}},(i.imgBytes>bh?50:800)+r);return i.unsuspend=l,function(){i.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function bo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)wo(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var xo=null;function wo(i,r){i.stylesheets=null,i.unsuspend!==null&&(i.count++,xo=new Map,r.forEach(L1,i),xo=null,bo.call(i))}function L1(i,r){if(!(r.state.loading&4)){var l=xo.get(i);if(l)var o=l.get(null);else{l=new Map,xo.set(i,l);for(var f=i.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<f.length;_++){var v=f[_];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(l.set(v.dataset.precedence,v),o=v)}o&&l.set(null,o)}f=r.instance,v=f.getAttribute("data-precedence"),_=l.get(v)||o,_===o&&l.set(null,f),l.set(v,f),this.count++,o=bo.bind(this),f.addEventListener("load",o),f.addEventListener("error",o),_?_.parentNode.insertBefore(f,_.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(f,i.firstChild)),r.state.loading|=4}}var Tl={$$typeof:P,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function N1(i,r,l,o,f,_,v,x,T){this.tag=1,this.containerInfo=i,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=mu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mu(0),this.hiddenUpdates=mu(null),this.identifierPrefix=o,this.onUncaughtError=f,this.onCaughtError=_,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=T,this.incompleteTransitions=new Map}function gg(i,r,l,o,f,_,v,x,T,N,X,Q){return i=new N1(i,r,l,v,T,N,X,Q,x),r=1,_===!0&&(r|=24),_=pi(3,null,null,r),i.current=_,_.stateNode=i,r=ec(),r.refCount++,i.pooledCache=r,r.refCount++,_.memoizedState={element:o,isDehydrated:l,cache:r},rc(_),i}function vg(i){return i?(i=ts,i):ts}function yg(i,r,l,o,f,_){f=vg(f),o.context===null?o.context=f:o.pendingContext=f,o=Nn(r),o.payload={element:l},_=_===void 0?null:_,_!==null&&(o.callback=_),l=Hn(i,o,r),l!==null&&(ai(l,i,r),sl(l,i,r))}function Sg(i,r){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var l=i.retryLane;i.retryLane=l!==0&&l<r?l:r}}function xh(i,r){Sg(i,r),(i=i.alternate)&&Sg(i,r)}function bg(i){if(i.tag===13||i.tag===31){var r=dr(i,67108864);r!==null&&ai(r,i,67108864),xh(i,67108864)}}function xg(i){if(i.tag===13||i.tag===31){var r=yi();r=gu(r);var l=dr(i,r);l!==null&&ai(l,i,r),xh(i,r)}}var Co=!0;function H1(i,r,l,o){var f=M.T;M.T=null;var _=q.p;try{q.p=2,wh(i,r,l,o)}finally{q.p=_,M.T=f}}function j1(i,r,l,o){var f=M.T;M.T=null;var _=q.p;try{q.p=8,wh(i,r,l,o)}finally{q.p=_,M.T=f}}function wh(i,r,l,o){if(Co){var f=Ch(o);if(f===null)uh(i,r,o,ko,l),Cg(i,o);else if(P1(f,i,r,l,o))o.stopPropagation();else if(Cg(i,o),r&4&&-1<U1.indexOf(i)){for(;f!==null;){var _=Vr(f);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var v=or(_.pendingLanes);if(v!==0){var x=_;for(x.pendingLanes|=2,x.entangledLanes|=2;v;){var T=1<<31-$e(v);x.entanglements[1]|=T,v&=~T}Xi(_),(Ie&6)===0&&(lo=Yt()+500,bl(0))}}break;case 31:case 13:x=dr(_,2),x!==null&&ai(x,_,2),oo(),xh(_,2)}if(_=Ch(o),_===null&&uh(i,r,o,ko,l),_===f)break;f=_}f!==null&&o.stopPropagation()}else uh(i,r,o,null,l)}}function Ch(i){return i=Eu(i),kh(i)}var ko=null;function kh(i){if(ko=null,i=qr(i),i!==null){var r=u(i);if(r===null)i=null;else{var l=r.tag;if(l===13){if(i=c(r),i!==null)return i;i=null}else if(l===31){if(i=d(r),i!==null)return i;i=null}else if(l===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;i=null}else r!==i&&(i=null)}}return ko=i,null}function wg(i){switch(i){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(_u()){case G:return 2;case ae:return 8;case Se:case Me:return 32;case Fe:return 268435456;default:return 32}default:return 32}}var Eh=!1,Xn=null,Gn=null,$n=null,Dl=new Map,Al=new Map,Zn=[],U1="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 Cg(i,r){switch(i){case"focusin":case"focusout":Xn=null;break;case"dragenter":case"dragleave":Gn=null;break;case"mouseover":case"mouseout":$n=null;break;case"pointerover":case"pointerout":Dl.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Al.delete(r.pointerId)}}function Ml(i,r,l,o,f,_){return i===null||i.nativeEvent!==_?(i={blockedOn:r,domEventName:l,eventSystemFlags:o,nativeEvent:_,targetContainers:[f]},r!==null&&(r=Vr(r),r!==null&&bg(r)),i):(i.eventSystemFlags|=o,r=i.targetContainers,f!==null&&r.indexOf(f)===-1&&r.push(f),i)}function P1(i,r,l,o,f){switch(r){case"focusin":return Xn=Ml(Xn,i,r,l,o,f),!0;case"dragenter":return Gn=Ml(Gn,i,r,l,o,f),!0;case"mouseover":return $n=Ml($n,i,r,l,o,f),!0;case"pointerover":var _=f.pointerId;return Dl.set(_,Ml(Dl.get(_)||null,i,r,l,o,f)),!0;case"gotpointercapture":return _=f.pointerId,Al.set(_,Ml(Al.get(_)||null,i,r,l,o,f)),!0}return!1}function kg(i){var r=qr(i.target);if(r!==null){var l=u(r);if(l!==null){if(r=l.tag,r===13){if(r=c(l),r!==null){i.blockedOn=r,Ud(i.priority,function(){xg(l)});return}}else if(r===31){if(r=d(l),r!==null){i.blockedOn=r,Ud(i.priority,function(){xg(l)});return}}else if(r===3&&l.stateNode.current.memoizedState.isDehydrated){i.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Eo(i){if(i.blockedOn!==null)return!1;for(var r=i.targetContainers;0<r.length;){var l=Ch(i.nativeEvent);if(l===null){l=i.nativeEvent;var o=new l.constructor(l.type,l);ku=o,l.target.dispatchEvent(o),ku=null}else return r=Vr(l),r!==null&&bg(r),i.blockedOn=l,!1;r.shift()}return!0}function Eg(i,r,l){Eo(i)&&l.delete(r)}function I1(){Eh=!1,Xn!==null&&Eo(Xn)&&(Xn=null),Gn!==null&&Eo(Gn)&&(Gn=null),$n!==null&&Eo($n)&&($n=null),Dl.forEach(Eg),Al.forEach(Eg)}function To(i,r){i.blockedOn===r&&(i.blockedOn=null,Eh||(Eh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,I1)))}var Do=null;function Tg(i){Do!==i&&(Do=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Do===i&&(Do=null);for(var r=0;r<i.length;r+=3){var l=i[r],o=i[r+1],f=i[r+2];if(typeof o!="function"){if(kh(o||l)===null)continue;break}var _=Vr(l);_!==null&&(i.splice(r,3),r-=3,Cc(_,{pending:!0,data:f,method:l.method,action:o},o,f))}}))}function ks(i){function r(T){return To(T,i)}Xn!==null&&To(Xn,i),Gn!==null&&To(Gn,i),$n!==null&&To($n,i),Dl.forEach(r),Al.forEach(r);for(var l=0;l<Zn.length;l++){var o=Zn[l];o.blockedOn===i&&(o.blockedOn=null)}for(;0<Zn.length&&(l=Zn[0],l.blockedOn===null);)kg(l),l.blockedOn===null&&Zn.shift();if(l=(i.ownerDocument||i).$$reactFormReplay,l!=null)for(o=0;o<l.length;o+=3){var f=l[o],_=l[o+1],v=f[ti]||null;if(typeof _=="function")v||Tg(l);else if(v){var x=null;if(_&&_.hasAttribute("formAction")){if(f=_,v=_[ti]||null)x=v.formAction;else if(kh(f)!==null)continue}else x=v.action;typeof x=="function"?l[o+1]=x:(l.splice(o,3),o-=3),Tg(l)}}}function Dg(){function i(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(v){return f=v})},focusReset:"manual",scroll:"manual"})}function r(){f!==null&&(f(),f=null),o||setTimeout(l,20)}function l(){if(!o&&!navigation.transition){var _=navigation.currentEntry;_&&_.url!=null&&navigation.navigate(_.url,{state:_.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,f=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(l,100),function(){o=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),f!==null&&(f(),f=null)}}}function Th(i){this._internalRoot=i}Ao.prototype.render=Th.prototype.render=function(i){var r=this._internalRoot;if(r===null)throw Error(s(409));var l=r.current,o=yi();yg(l,o,i,r,null,null)},Ao.prototype.unmount=Th.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var r=i.containerInfo;yg(i.current,2,null,i,null,null),oo(),r[Fr]=null}};function Ao(i){this._internalRoot=i}Ao.prototype.unstable_scheduleHydration=function(i){if(i){var r=jd();i={blockedOn:null,target:i,priority:r};for(var l=0;l<Zn.length&&r!==0&&r<Zn[l].priority;l++);Zn.splice(l,0,i),l===0&&kg(i)}};var Ag=t.version;if(Ag!=="19.2.3")throw Error(s(527,Ag,"19.2.3"));q.findDOMNode=function(i){var r=i._reactInternals;if(r===void 0)throw typeof i.render=="function"?Error(s(188)):(i=Object.keys(i).join(","),Error(s(268,i)));return i=h(r),i=i!==null?g(i):null,i=i===null?null:i.stateNode,i};var F1={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Mo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Mo.isDisabled&&Mo.supportsFiber)try{Kt=Mo.inject(F1),bt=Mo}catch{}}return Bl.createRoot=function(i,r){if(!a(i))throw Error(s(299));var l=!1,o="",f=N_,_=H_,v=j_;return r!=null&&(r.unstable_strictMode===!0&&(l=!0),r.identifierPrefix!==void 0&&(o=r.identifierPrefix),r.onUncaughtError!==void 0&&(f=r.onUncaughtError),r.onCaughtError!==void 0&&(_=r.onCaughtError),r.onRecoverableError!==void 0&&(v=r.onRecoverableError)),r=gg(i,1,!1,null,null,l,o,null,f,_,v,Dg),i[Fr]=r.current,oh(i),new Th(r)},Bl.hydrateRoot=function(i,r,l){if(!a(i))throw Error(s(299));var o=!1,f="",_=N_,v=H_,x=j_,T=null;return l!=null&&(l.unstable_strictMode===!0&&(o=!0),l.identifierPrefix!==void 0&&(f=l.identifierPrefix),l.onUncaughtError!==void 0&&(_=l.onUncaughtError),l.onCaughtError!==void 0&&(v=l.onCaughtError),l.onRecoverableError!==void 0&&(x=l.onRecoverableError),l.formState!==void 0&&(T=l.formState)),r=gg(i,1,!0,r,l??null,o,f,T,_,v,x,Dg),r.context=vg(null),l=r.current,o=yi(),o=gu(o),f=Nn(o),f.callback=null,Hn(l,f,o),l=o,r.current.lanes=l,Is(r,l),Xi(r),i[Fr]=r.current,oh(i),new Ao(r)},Bl.version="19.2.3",Bl}var Ug;function J1(){if(Ug)return Mh.exports;Ug=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(),Mh.exports=Q1(),Mh.exports}var ex=J1();const tx=nu(ex);function ix({onLogin:e}){const[t,n]=ge.useState(""),[s,a]=ge.useState(null),[u,c]=ge.useState(!1),d=async p=>{if(p.preventDefault(),!t.trim())return;c(!0),a(null);const h=await e(t);h&&a(h),c(!1)};return E.jsx("div",{className:"flex h-screen items-center justify-center p-4",children:E.jsxs("div",{className:"w-full max-w-sm",children:[E.jsxs("div",{className:"border-border rounded border p-6",children:[E.jsxs("div",{className:"mb-6 text-center",children:[E.jsx("h1",{className:"text-accent text-lg font-bold tracking-tight",children:"PlotLink OWS"}),E.jsx("p",{className:"text-muted mt-1 text-xs",children:"local writer agent"})]}),E.jsxs("form",{onSubmit:d,className:"space-y-4",children:[E.jsxs("div",{children:[E.jsx("label",{className:"text-muted mb-1.5 block text-xs uppercase tracking-wider",children:"Passphrase"}),E.jsx("input",{type:"password",value:t,onChange:p=>n(p.target.value),placeholder:"enter your passphrase",autoFocus:!0,className:"bg-surface border-border text-foreground placeholder:text-muted/50 w-full rounded border px-3 py-2 text-sm outline-none focus:border-accent"})]}),s&&E.jsx("p",{className:"text-error text-xs",children:s}),E.jsx("button",{type:"submit",disabled:u||!t.trim(),className:"border-accent text-accent hover:bg-accent/10 disabled:opacity-40 w-full rounded border px-4 py-2 text-sm font-medium transition-colors",children:u?"authenticating...":"unlock"})]})]}),E.jsx("p",{className:"text-muted mt-4 text-center text-[10px]",children:"enter your passphrase to unlock"})]})})}function nx({onSetup:e}){const[t,n]=ge.useState(""),[s,a]=ge.useState(""),[u,c]=ge.useState(null),[d,p]=ge.useState(!1),h=async g=>{if(g.preventDefault(),!t.trim()||t.length<4){c("Passphrase must be at least 4 characters");return}if(t!==s){c("Passphrases do not match");return}p(!0),c(null);const m=await e(t);m&&c(m),p(!1)};return E.jsx("div",{className:"flex h-screen items-center justify-center p-4",children:E.jsx("div",{className:"w-full max-w-sm",children:E.jsxs("div",{className:"border-border rounded border p-6",children:[E.jsxs("div",{className:"mb-6 text-center",children:[E.jsx("h1",{className:"text-accent text-lg font-bold tracking-tight",children:"PlotLink OWS"}),E.jsx("p",{className:"text-muted mt-1 text-xs",children:"first-time setup"})]}),E.jsx("p",{className:"text-muted mb-4 text-xs leading-relaxed",children:"Choose a passphrase to protect your local writer agent. This will be used to unlock the app and secure your OWS wallet."}),E.jsxs("form",{onSubmit:h,className:"space-y-4",children:[E.jsxs("div",{children:[E.jsx("label",{className:"text-muted mb-1.5 block text-xs uppercase tracking-wider",children:"Passphrase"}),E.jsx("input",{type:"password",value:t,onChange:g=>n(g.target.value),placeholder:"choose a passphrase",autoFocus:!0,className:"bg-surface border-border text-foreground placeholder:text-muted/50 w-full rounded border px-3 py-2 text-sm outline-none focus:border-accent"})]}),E.jsxs("div",{children:[E.jsx("label",{className:"text-muted mb-1.5 block text-xs uppercase tracking-wider",children:"Confirm"}),E.jsx("input",{type:"password",value:s,onChange:g=>a(g.target.value),placeholder:"repeat passphrase",className:"bg-surface border-border text-foreground placeholder:text-muted/50 w-full rounded border px-3 py-2 text-sm outline-none focus:border-accent"})]}),u&&E.jsx("p",{className:"text-error text-xs",children:u}),E.jsx("button",{type:"submit",disabled:d||!t.trim()||!s.trim(),className:"border-accent text-accent hover:bg-accent/10 disabled:opacity-40 w-full rounded border px-4 py-2 text-sm font-medium transition-colors",children:d?"setting up...":"create passphrase"})]})]})})})}const Pg="http://localhost:7777";function My({token:e}){const[t,n]=ge.useState(null),[s,a]=ge.useState(!1),[u,c]=ge.useState(!1),[d,p]=ge.useState(null),h=(b,C)=>fetch(b,{...C,headers:{...C==null?void 0:C.headers,Authorization:`Bearer ${e}`,"Content-Type":"application/json"}}),g=()=>{h(`${Pg}/api/wallet`).then(b=>b.json()).then(b=>n(b)).catch(()=>n({exists:!1,error:"Failed to load wallet"}))};ge.useEffect(()=>{g()},[]);const m=async()=>{a(!0),p(null);try{const b=await h(`${Pg}/api/wallet/create`,{method:"POST"}),C=await b.json();if(!b.ok)throw new Error(C.error||"Creation failed");g()}catch(b){p(b instanceof Error?b.message:"Failed to create wallet")}a(!1)},S=()=>{t!=null&&t.address&&(navigator.clipboard.writeText(t.address),c(!0),setTimeout(()=>c(!1),2e3))},y=b=>`${b.slice(0,6)}...${b.slice(-4)}`;return E.jsxs("div",{className:"border-border rounded border p-4",children:[E.jsx("h3",{className:"text-accent mb-3 text-xs font-bold uppercase tracking-wider",children:"OWS Wallet"}),!t&&E.jsx("p",{className:"text-muted text-xs",children:"loading..."}),t&&!t.exists&&E.jsxs("div",{className:"space-y-3",children:[E.jsx("p",{className:"text-muted text-xs",children:"No wallet created yet. Create one to enable autonomous transactions."}),d&&E.jsx("p",{className:"text-error text-xs",children:d}),E.jsx("button",{onClick:m,disabled:s,className:"border-accent text-accent hover:bg-accent/10 disabled:opacity-40 rounded border px-4 py-2 text-xs font-medium transition-colors",children:s?"creating...":"create wallet"})]}),t&&t.exists&&t.address&&E.jsxs("div",{className:"space-y-3",children:[E.jsxs("div",{className:"flex items-center justify-between",children:[E.jsx("span",{className:"text-muted text-[10px] uppercase tracking-wider",children:"Address (Base)"}),E.jsx("span",{className:`rounded border px-1.5 py-0.5 text-[9px] ${t.ethBalance&&parseFloat(t.ethBalance)>0?"border-accent/30 text-accent":"border-accent-dim/30 text-accent-dim"}`,children:t.ethBalance&&parseFloat(t.ethBalance)>0?"active":"no balance"})]}),E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("code",{className:"text-foreground bg-surface rounded px-2 py-1 text-xs font-mono",children:y(t.address)}),E.jsx("button",{onClick:S,className:"text-muted hover:text-accent text-xs transition-colors",children:u?"copied":"copy"})]}),E.jsxs("div",{className:"border-border space-y-1 border-t pt-3",children:[E.jsxs("div",{className:"flex justify-between text-xs",children:[E.jsx("span",{className:"text-muted",children:"ETH"}),E.jsxs("span",{className:"text-foreground font-medium",children:[t.ethBalance||"0.000000"," ETH"]})]}),E.jsxs("div",{className:"flex justify-between text-xs",children:[E.jsx("span",{className:"text-muted",children:"USDC"}),E.jsxs("span",{className:"text-foreground font-medium",children:["$",t.usdcBalance||"0.00"]})]}),E.jsxs("div",{className:"flex justify-between text-xs",children:[E.jsx("span",{className:"text-muted",children:"PLOT"}),E.jsxs("span",{className:"text-foreground font-medium",children:[t.plotBalance||"0.0000"," PLOT"]})]}),E.jsxs("div",{className:"flex justify-between text-xs",children:[E.jsx("span",{className:"text-muted",children:"Network"}),E.jsx("span",{className:"text-foreground",children:"Base"})]})]}),E.jsxs("div",{className:"border-border border-t pt-3",children:[E.jsx("p",{className:"text-muted mb-2 text-[10px] font-medium uppercase tracking-wider",children:"Fund Wallet"}),E.jsx("p",{className:"text-muted text-[10px]",children:"Send ETH on Base for gas (~$0.01 per publish):"}),E.jsx("code",{className:"text-foreground bg-surface mt-1 block break-all rounded px-2 py-1.5 text-[10px] font-mono",children:t.address})]})]})]})}function rx({token:e,onLogout:t}){const[n,s]=ge.useState(""),[a,u]=ge.useState(""),[c,d]=ge.useState(null),[p,h]=ge.useState(!1),[g,m]=ge.useState(!1),S=(b,C)=>fetch(b,{...C,headers:{...C==null?void 0:C.headers,Authorization:`Bearer ${e}`,"Content-Type":"application/json"}}),y=async()=>{if(d(null),h(!1),!n||n.length<4){d("Passphrase must be at least 4 characters");return}if(n!==a){d("Passphrases do not match");return}m(!0);try{const b=await S("/api/auth/reset-passphrase",{method:"POST",body:JSON.stringify({passphrase:n})});if(!b.ok){const C=await b.json();throw new Error(C.error||"Reset failed")}h(!0),s(""),u(""),setTimeout(()=>h(!1),3e3)}catch(b){d(b instanceof Error?b.message:"Reset failed")}m(!1)};return E.jsxs("div",{className:"mx-auto max-w-lg space-y-6 p-6",children:[E.jsx("h2",{className:"text-accent text-lg font-bold",children:"Settings"}),E.jsx(My,{token:e}),E.jsxs("div",{className:"border-border rounded border p-4",children:[E.jsx("h3",{className:"text-accent mb-3 text-xs font-bold uppercase tracking-wider",children:"Reset Passphrase"}),E.jsxs("div",{className:"space-y-3",children:[E.jsx("input",{type:"password",value:n,onChange:b=>s(b.target.value),placeholder:"new passphrase",className:"bg-surface border-border text-foreground placeholder:text-muted/50 w-full rounded border px-3 py-2 text-sm outline-none focus:border-accent"}),E.jsx("input",{type:"password",value:a,onChange:b=>u(b.target.value),placeholder:"confirm passphrase",className:"bg-surface border-border text-foreground placeholder:text-muted/50 w-full rounded border px-3 py-2 text-sm outline-none focus:border-accent"}),c&&E.jsx("p",{className:"text-error text-xs",children:c}),p&&E.jsx("p",{className:"text-xs text-accent",children:"passphrase updated"}),E.jsx("button",{onClick:y,disabled:g||!n.trim(),className:"border-border text-muted hover:border-accent hover:text-accent disabled:opacity-40 w-full rounded border px-4 py-2 text-xs font-medium transition-colors",children:g?"updating...":"update passphrase"})]})]}),E.jsxs("div",{className:"border-border rounded border p-4",children:[E.jsx("h3",{className:"text-accent mb-3 text-xs font-bold uppercase tracking-wider",children:"Session"}),E.jsx("button",{onClick:t,className:"border-border text-muted hover:border-error hover:text-error rounded border px-4 py-2 text-xs font-medium transition-colors",children:"logout"})]})]})}const sx="http://localhost:7777";function lx({token:e}){const[t,n]=ge.useState(null),s=(d,p)=>fetch(d,{...p,headers:{...p==null?void 0:p.headers,Authorization:`Bearer ${e}`,"Content-Type":"application/json"}}),a=()=>{s(`${sx}/api/dashboard`).then(d=>d.json()).then(n)};ge.useEffect(()=>{a()},[]);const u=d=>`${d.slice(0,6)}...${d.slice(-4)}`,c=d=>new Date(d).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});return t?E.jsxs("div",{className:"mx-auto max-w-2xl space-y-6 p-6",children:[E.jsx("h2",{className:"text-accent text-lg font-bold",children:"Writer Dashboard"}),E.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[E.jsxs("div",{className:"border-border rounded border p-3 text-center",children:[E.jsx("div",{className:"text-accent text-lg font-bold",children:t.stories.totalPublished}),E.jsx("div",{className:"text-muted text-[10px] uppercase tracking-wider",children:"published"})]}),E.jsxs("div",{className:"border-border rounded border p-3 text-center",children:[E.jsx("div",{className:"text-foreground text-lg font-bold",children:t.stories.pendingFiles}),E.jsx("div",{className:"text-muted text-[10px] uppercase tracking-wider",children:"pending"})]}),E.jsxs("div",{className:"border-border rounded border p-3 text-center",children:[E.jsx("div",{className:"text-foreground text-lg font-bold",children:t.stories.totalStories}),E.jsx("div",{className:"text-muted text-[10px] uppercase tracking-wider",children:"stories"})]}),E.jsxs("div",{className:"border-border rounded border p-3 text-center",children:[E.jsx("div",{className:"text-foreground text-lg font-bold",children:t.stories.totalFiles}),E.jsx("div",{className:"text-muted text-[10px] uppercase tracking-wider",children:"files"})]})]}),t.wallet&&E.jsxs("div",{className:"border-border rounded border p-4",children:[E.jsx("h3",{className:"text-accent mb-3 text-xs font-bold uppercase tracking-wider",children:"Wallet"}),E.jsxs("div",{className:"space-y-1.5",children:[E.jsxs("div",{className:"flex justify-between text-xs",children:[E.jsx("span",{className:"text-muted",children:"Address"}),E.jsx("code",{className:"text-foreground font-mono text-[10px]",children:u(t.wallet.address)})]}),E.jsxs("div",{className:"flex justify-between text-xs",children:[E.jsx("span",{className:"text-muted",children:"ETH Balance"}),E.jsxs("span",{className:"text-foreground",children:[t.wallet.ethFormatted," ETH"]})]}),E.jsxs("div",{className:"flex justify-between text-xs",children:[E.jsx("span",{className:"text-muted",children:"USDC Balance"}),E.jsxs("span",{className:"text-foreground",children:["$",t.wallet.usdcBalance]})]})]})]}),E.jsxs("div",{className:"border-border rounded border p-4",children:[E.jsx("h3",{className:"text-accent mb-3 text-xs font-bold uppercase tracking-wider",children:"Profit & Loss"}),E.jsxs("div",{className:"space-y-1.5",children:[E.jsxs("div",{className:"flex justify-between text-xs",children:[E.jsx("span",{className:"text-muted",children:"Total costs (gas)"}),E.jsxs("span",{className:"text-error",children:["-",t.pnl.totalCostsEth," ETH (~$",t.pnl.totalCostsUsd,")"]})]}),E.jsxs("div",{className:"flex justify-between text-xs",children:[E.jsx("span",{className:"text-muted",children:"Royalties earned"}),E.jsxs("span",{className:"text-accent",children:["+",t.pnl.totalRoyaltiesPlot," PLOT"]})]}),E.jsxs("div",{className:"flex justify-between text-xs",children:[E.jsx("span",{className:"text-muted",children:"Unclaimed royalties"}),E.jsxs("span",{className:"text-foreground",children:[t.royalties.unclaimed," PLOT"]})]}),E.jsxs("div",{className:"border-border flex justify-between border-t pt-1.5 text-xs font-medium",children:[E.jsx("span",{className:"text-muted",children:"Net P&L (USD)"}),E.jsxs("span",{className:parseFloat(t.pnl.netPnlUsd)>=0?"text-accent":"text-error",children:[parseFloat(t.pnl.netPnlUsd)>=0?"+":"","$",t.pnl.netPnlUsd]})]}),E.jsxs("div",{className:"flex justify-between text-xs",children:[E.jsx("span",{className:"text-muted",children:"Stories published"}),E.jsx("span",{className:"text-foreground",children:t.costs.storiesPublished})]})]})]}),E.jsxs("div",{className:"border-border rounded border p-4",children:[E.jsx("h3",{className:"text-accent mb-3 text-xs font-bold uppercase tracking-wider",children:"Published Stories"}),t.stories.published.length===0?E.jsx("p",{className:"text-muted text-xs",children:"no published stories yet"}):E.jsx("div",{className:"space-y-2",children:t.stories.published.map(d=>E.jsxs("div",{className:"bg-surface rounded p-3",children:[E.jsxs("div",{className:"flex items-center justify-between",children:[E.jsxs("div",{children:[E.jsx("span",{className:"text-foreground text-sm font-medium",children:d.title}),d.genre&&E.jsx("span",{className:"text-accent ml-2 text-[10px]",children:d.genre})]}),E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("span",{className:"rounded border border-green-700/30 px-1.5 py-0.5 text-[9px] text-accent",children:"published"}),d.storylineId?E.jsx("a",{href:`https://plotlink.xyz/story/${d.storylineId}`,target:"_blank",rel:"noopener noreferrer",className:"text-accent text-[10px] underline",children:"view"}):E.jsx("a",{href:"https://plotlink.xyz",target:"_blank",rel:"noopener noreferrer",className:"text-accent text-[10px] underline",children:"plotlink.xyz"})]})]}),E.jsxs("div",{className:"mt-1 flex items-center gap-3 text-[10px]",children:[E.jsx("span",{className:"text-muted",children:c(d.createdAt)}),d.txHash&&E.jsxs("a",{href:`https://basescan.org/tx/${d.txHash}`,target:"_blank",rel:"noopener noreferrer",className:"text-muted hover:text-accent font-mono",children:["tx:",d.txHash.slice(0,10),"..."]}),d.gasCostEth&&E.jsxs("span",{className:"text-muted",children:[d.gasCostEth," ETH",d.gasCostUsd?` (~$${d.gasCostUsd})`:""]})]})]},d.id))})]}),t.stories.pendingFiles>0&&E.jsx("div",{className:"border-border rounded border p-4",children:E.jsxs("p",{className:"text-muted text-xs",children:[t.stories.pendingFiles," file(s) pending publish — go to Stories to publish them."]})})]}):E.jsx("div",{className:"flex h-full items-center justify-center",children:E.jsx("span",{className:"text-muted text-sm",children:"loading dashboard..."})})}const ax={published:"✓",pending:"⏳",draft:"📝"},ox={published:"text-green-700",pending:"text-amber-700",draft:"text-muted"};function ux({authFetch:e,selectedStory:t,selectedFile:n,onSelectFile:s}){const[a,u]=ge.useState([]),[c,d]=ge.useState(new Set),p=ge.useCallback(async()=>{try{const m=await e("/api/stories");if(m.ok){const S=await m.json();u(S.stories)}}catch{}},[e]);ge.useEffect(()=>{p();const m=setInterval(p,5e3);return()=>clearInterval(m)},[p]),ge.useEffect(()=>{t&&d(m=>new Set(m).add(t))},[t]);const h=m=>{d(S=>{const y=new Set(S);return y.has(m)?y.delete(m):y.add(m),y})},g=m=>{const S=y=>{if(y==="structure.md")return 0;if(y==="genesis.md")return 1;const b=y.match(/^plot-(\d+)\.md$/);return b?2+parseInt(b[1]):100};return[...m].sort((y,b)=>S(y.file)-S(b.file))};return E.jsxs("div",{className:"h-full flex flex-col",children:[E.jsxs("div",{className:"px-3 py-1.5 border-b border-border flex items-center justify-between",children:[E.jsx("span",{className:"text-xs font-mono text-muted",children:"Stories"}),E.jsx("span",{className:"text-xs text-muted",children:a.length})]}),E.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:a.length===0?E.jsxs("div",{className:"p-3 text-sm text-muted",children:[E.jsx("p",{children:"No stories yet."}),E.jsx("p",{className:"mt-1 text-xs",children:"Use the terminal to start writing with Claude."})]}):a.filter(m=>m.name!=="_example").map(m=>E.jsxs("div",{children:[E.jsxs("button",{onClick:()=>h(m.name),className:"w-full px-3 py-2 text-left flex items-center gap-2 hover:bg-surface text-sm",children:[E.jsx("span",{className:"text-xs text-muted",children:c.has(m.name)?"▼":"▶"}),E.jsx("span",{className:"font-medium truncate",children:m.name}),E.jsxs("span",{className:"ml-auto text-xs text-muted",children:[m.publishedCount,"/",m.files.length]})]}),c.has(m.name)&&E.jsx("div",{className:"pl-4",children:g(m.files).map(S=>{const y=t===m.name&&n===S.file;return E.jsxs("button",{onClick:()=>s(m.name,S.file),className:`w-full px-3 py-1.5 text-left flex items-center gap-2 text-xs hover:bg-surface ${y?"bg-surface font-medium":""}`,children:[E.jsx("span",{className:ox[S.status],children:ax[S.status]}),E.jsx("span",{className:"truncate font-mono",children:S.file})]},S.file)})})]},m.name))})]})}/**
|
|
50
|
-
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
51
|
-
* @license MIT
|
|
52
|
-
*
|
|
53
|
-
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
54
|
-
* @license MIT
|
|
55
|
-
*
|
|
56
|
-
* Originally forked from (with the author's permission):
|
|
57
|
-
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
58
|
-
* http://bellard.org/jslinux/
|
|
59
|
-
* Copyright (c) 2011 Fabrice Bellard
|
|
60
|
-
*/var Ry=Object.defineProperty,cx=Object.getOwnPropertyDescriptor,hx=(e,t)=>{for(var n in t)Ry(e,n,{get:t[n],enumerable:!0})},ct=(e,t,n,s)=>{for(var a=s>1?void 0:s?cx(t,n):t,u=e.length-1,c;u>=0;u--)(c=e[u])&&(a=(s?c(t,n,a):c(a))||a);return s&&a&&Ry(t,n,a),a},oe=(e,t)=>(n,s)=>t(n,s,e),Ig="Terminal input",hf={get:()=>Ig,set:e=>Ig=e},Fg="Too much output to announce, navigate to rows manually to read",ff={get:()=>Fg,set:e=>Fg=e};function fx(e){return e.replace(/\r?\n/g,"\r")}function dx(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function px(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function _x(e,t,n,s){if(e.stopPropagation(),e.clipboardData){let a=e.clipboardData.getData("text/plain");By(a,t,n,s)}}function By(e,t,n,s){e=fx(e),e=dx(e,n.decPrivateModes.bracketedPasteMode&&s.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=""}function Oy(e,t,n){let s=n.getBoundingClientRect(),a=e.clientX-s.left-10,u=e.clientY-s.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${a}px`,t.style.top=`${u}px`,t.style.zIndex="1000",t.focus()}function qg(e,t,n,s,a){Oy(e,t,n),a&&s.rightClickSelect(e),t.value=s.selectionText,t.select()}function nr(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function ru(e,t=0,n=e.length){let s="";for(let a=t;a<n;++a){let u=e[a];u>65535?(u-=65536,s+=String.fromCharCode((u>>10)+55296)+String.fromCharCode(u%1024+56320)):s+=String.fromCharCode(u)}return s}var mx=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let s=0,a=0;if(this._interim){let u=e.charCodeAt(a++);56320<=u&&u<=57343?t[s++]=(this._interim-55296)*1024+u-56320+65536:(t[s++]=this._interim,t[s++]=u),this._interim=0}for(let u=a;u<n;++u){let c=e.charCodeAt(u);if(55296<=c&&c<=56319){if(++u>=n)return this._interim=c,s;let d=e.charCodeAt(u);56320<=d&&d<=57343?t[s++]=(c-55296)*1024+d-56320+65536:(t[s++]=c,t[s++]=d);continue}c!==65279&&(t[s++]=c)}return s}},gx=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let s=0,a,u,c,d,p=0,h=0;if(this.interim[0]){let S=!1,y=this.interim[0];y&=(y&224)===192?31:(y&240)===224?15:7;let b=0,C;for(;(C=this.interim[++b]&63)&&b<4;)y<<=6,y|=C;let B=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,A=B-b;for(;h<A;){if(h>=n)return 0;if(C=e[h++],(C&192)!==128){h--,S=!0;break}else this.interim[b++]=C,y<<=6,y|=C&63}S||(B===2?y<128?h--:t[s++]=y:B===3?y<2048||y>=55296&&y<=57343||y===65279||(t[s++]=y):y<65536||y>1114111||(t[s++]=y)),this.interim.fill(0)}let g=n-4,m=h;for(;m<n;){for(;m<g&&!((a=e[m])&128)&&!((u=e[m+1])&128)&&!((c=e[m+2])&128)&&!((d=e[m+3])&128);)t[s++]=a,t[s++]=u,t[s++]=c,t[s++]=d,m+=4;if(a=e[m++],a<128)t[s++]=a;else if((a&224)===192){if(m>=n)return this.interim[0]=a,s;if(u=e[m++],(u&192)!==128){m--;continue}if(p=(a&31)<<6|u&63,p<128){m--;continue}t[s++]=p}else if((a&240)===224){if(m>=n)return this.interim[0]=a,s;if(u=e[m++],(u&192)!==128){m--;continue}if(m>=n)return this.interim[0]=a,this.interim[1]=u,s;if(c=e[m++],(c&192)!==128){m--;continue}if(p=(a&15)<<12|(u&63)<<6|c&63,p<2048||p>=55296&&p<=57343||p===65279)continue;t[s++]=p}else if((a&248)===240){if(m>=n)return this.interim[0]=a,s;if(u=e[m++],(u&192)!==128){m--;continue}if(m>=n)return this.interim[0]=a,this.interim[1]=u,s;if(c=e[m++],(c&192)!==128){m--;continue}if(m>=n)return this.interim[0]=a,this.interim[1]=u,this.interim[2]=c,s;if(d=e[m++],(d&192)!==128){m--;continue}if(p=(a&7)<<18|(u&63)<<12|(c&63)<<6|d&63,p<65536||p>1114111)continue;t[s++]=p}}return s}},zy="",sr=" ",ra=class Ly{constructor(){this.fg=0,this.bg=0,this.extended=new Xo}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new Ly;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Xo=class Ny{constructor(t=0,n=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=n}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new Ny(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},ji=class Hy extends ra{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Xo,this.combinedData=""}static fromCharData(t){let n=new Hy;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?nr(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let n=!1;if(t[1].length>2)n=!0;else if(t[1].length===2){let s=t[1].charCodeAt(0);if(55296<=s&&s<=56319){let a=t[1].charCodeAt(1);56320<=a&&a<=57343?this.content=(s-55296)*1024+a-56320+65536|t[2]<<22:n=!0}else n=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;n&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Vg="di$target",df="di$dependencies",zh=new Map;function vx(e){return e[df]||[]}function Bt(e){if(zh.has(e))return zh.get(e);let t=function(n,s,a){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");yx(t,n,a)};return t._id=e,zh.set(e,t),t}function yx(e,t,n){t[Vg]===t?t[df].push({id:e,index:n}):(t[df]=[{id:e,index:n}],t[Vg]=t)}var Zt=Bt("BufferService"),jy=Bt("CoreMouseService"),Nr=Bt("CoreService"),Sx=Bt("CharsetService"),ld=Bt("InstantiationService"),Uy=Bt("LogService"),Qt=Bt("OptionsService"),Py=Bt("OscLinkService"),bx=Bt("UnicodeService"),sa=Bt("DecorationService"),pf=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){var g;let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let s=[],a=this._optionsService.rawOptions.linkHandler,u=new ji,c=n.getTrimmedLength(),d=-1,p=-1,h=!1;for(let m=0;m<c;m++)if(!(p===-1&&!n.hasContent(m))){if(n.loadCell(m,u),u.hasExtendedAttrs()&&u.extended.urlId)if(p===-1){p=m,d=u.extended.urlId;continue}else h=u.extended.urlId!==d;else p!==-1&&(h=!0);if(h||p!==-1&&m===c-1){let S=(g=this._oscLinkService.getLinkData(d))==null?void 0:g.uri;if(S){let y={start:{x:p+1,y:e},end:{x:m+(!h&&m===c-1?1:0),y:e}},b=!1;if(!(a!=null&&a.allowNonHttpProtocols))try{let C=new URL(S);["http:","https:"].includes(C.protocol)||(b=!0)}catch{b=!0}b||s.push({text:S,range:y,activate:(C,B)=>a?a.activate(C,B,y):xx(C,B),hover:(C,B)=>{var A;return(A=a==null?void 0:a.hover)==null?void 0:A.call(a,C,B,y)},leave:(C,B)=>{var A;return(A=a==null?void 0:a.leave)==null?void 0:A.call(a,C,B,y)}})}h=!1,u.hasExtendedAttrs()&&u.extended.urlId?(p=m,d=u.extended.urlId):(p=-1,d=-1)}}t(s)}};pf=ct([oe(0,Zt),oe(1,Qt),oe(2,Py)],pf);function xx(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
61
|
-
|
|
62
|
-
WARNING: This link could potentially be dangerous`)){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var su=Bt("CharSizeService"),kn=Bt("CoreBrowserService"),ad=Bt("MouseService"),En=Bt("RenderService"),wx=Bt("SelectionService"),Iy=Bt("CharacterJoinerService"),Ls=Bt("ThemeService"),Fy=Bt("LinkProviderService"),Cx=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Wg.isErrorNoTelemetry(e)?new Wg(e.message+`
|
|
63
|
-
|
|
64
|
-
`+e.stack):new Error(e.message+`
|
|
65
|
-
|
|
66
|
-
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},kx=new Cx;function Io(e){Ex(e)||kx.onUnexpectedError(e)}var _f="Canceled";function Ex(e){return e instanceof Tx?!0:e instanceof Error&&e.name===_f&&e.message===_f}var Tx=class extends Error{constructor(){super(_f),this.name=this.message}};function Dx(e){return new Error(`Illegal argument: ${e}`)}var Wg=class mf extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof mf)return t;let n=new mf;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},gf=class qy extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,qy.prototype)}};function Si(e,t=0){return e[e.length-(1+t)]}var Ax;(e=>{function t(u){return u<0}e.isLessThan=t;function n(u){return u<=0}e.isLessThanOrEqual=n;function s(u){return u>0}e.isGreaterThan=s;function a(u){return u===0}e.isNeitherLessOrGreaterThan=a,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(Ax||(Ax={}));function Mx(e,t){let n=this,s=!1,a;return function(){return s||(s=!0,t||(a=e.apply(n,arguments))),a}}var Vy;(e=>{function t(ee){return ee&&typeof ee=="object"&&typeof ee[Symbol.iterator]=="function"}e.is=t;let n=Object.freeze([]);function s(){return n}e.empty=s;function*a(ee){yield ee}e.single=a;function u(ee){return t(ee)?ee:a(ee)}e.wrap=u;function c(ee){return ee||n}e.from=c;function*d(ee){for(let ne=ee.length-1;ne>=0;ne--)yield ee[ne]}e.reverse=d;function p(ee){return!ee||ee[Symbol.iterator]().next().done===!0}e.isEmpty=p;function h(ee){return ee[Symbol.iterator]().next().value}e.first=h;function g(ee,ne){let z=0;for(let ie of ee)if(ne(ie,z++))return!0;return!1}e.some=g;function m(ee,ne){for(let z of ee)if(ne(z))return z}e.find=m;function*S(ee,ne){for(let z of ee)ne(z)&&(yield z)}e.filter=S;function*y(ee,ne){let z=0;for(let ie of ee)yield ne(ie,z++)}e.map=y;function*b(ee,ne){let z=0;for(let ie of ee)yield*ne(ie,z++)}e.flatMap=b;function*C(...ee){for(let ne of ee)yield*ne}e.concat=C;function B(ee,ne,z){let ie=z;for(let ue of ee)ie=ne(ie,ue);return ie}e.reduce=B;function*A(ee,ne,z=ee.length){for(ne<0&&(ne+=ee.length),z<0?z+=ee.length:z>ee.length&&(z=ee.length);ne<z;ne++)yield ee[ne]}e.slice=A;function Z(ee,ne=Number.POSITIVE_INFINITY){let z=[];if(ne===0)return[z,ee];let ie=ee[Symbol.iterator]();for(let ue=0;ue<ne;ue++){let _e=ie.next();if(_e.done)return[z,e.empty()];z.push(_e.value)}return[z,{[Symbol.iterator](){return ie}}]}e.consume=Z;async function P(ee){let ne=[];for await(let z of ee)ne.push(z);return Promise.resolve(ne)}e.asyncToArray=P})(Vy||(Vy={}));function Or(e){if(Vy.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(s){t.push(s)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function Rx(...e){return rt(()=>Or(e))}function rt(e){return{dispose:Mx(()=>{e()})}}var Wy=class Yy{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Or(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Yy.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};Wy.DISABLE_DISPOSED_WARNING=!1;var lr=Wy,De=class{constructor(){this._store=new lr,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};De.None=Object.freeze({dispose(){}});var Os=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},Cn=typeof window=="object"?window:globalThis,vf=class yf{constructor(t){this.element=t,this.next=yf.Undefined,this.prev=yf.Undefined}};vf.Undefined=new vf(void 0);var st=vf,Yg=class{constructor(){this._first=st.Undefined,this._last=st.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===st.Undefined}clear(){let e=this._first;for(;e!==st.Undefined;){let t=e.next;e.prev=st.Undefined,e.next=st.Undefined,e=t}this._first=st.Undefined,this._last=st.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new st(e);if(this._first===st.Undefined)this._first=n,this._last=n;else if(t){let a=this._last;this._last=n,n.prev=a,a.next=n}else{let a=this._first;this._first=n,n.next=a,a.prev=n}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(n))}}shift(){if(this._first!==st.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==st.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==st.Undefined&&e.next!==st.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===st.Undefined&&e.next===st.Undefined?(this._first=st.Undefined,this._last=st.Undefined):e.next===st.Undefined?(this._last=this._last.prev,this._last.next=st.Undefined):e.prev===st.Undefined&&(this._first=this._first.next,this._first.prev=st.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==st.Undefined;)yield e.element,e=e.next}},Bx=globalThis.performance&&typeof globalThis.performance.now=="function",Ox=class Ky{static create(t){return new Ky(t)}constructor(t){this._now=Bx&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},Pt;(e=>{e.None=()=>De.None;function t(V,I){return m(V,()=>{},0,void 0,!0,void 0,I)}e.defer=t;function n(V){return(I,K=null,j)=>{let M=!1,q;return q=V(W=>{if(!M)return q?q.dispose():M=!0,I.call(K,W)},null,j),M&&q.dispose(),q}}e.once=n;function s(V,I,K){return h((j,M=null,q)=>V(W=>j.call(M,I(W)),null,q),K)}e.map=s;function a(V,I,K){return h((j,M=null,q)=>V(W=>{I(W),j.call(M,W)},null,q),K)}e.forEach=a;function u(V,I,K){return h((j,M=null,q)=>V(W=>I(W)&&j.call(M,W),null,q),K)}e.filter=u;function c(V){return V}e.signal=c;function d(...V){return(I,K=null,j)=>{let M=Rx(...V.map(q=>q(W=>I.call(K,W))));return g(M,j)}}e.any=d;function p(V,I,K,j){let M=K;return s(V,q=>(M=I(M,q),M),j)}e.reduce=p;function h(V,I){let K,j={onWillAddFirstListener(){K=V(M.fire,M)},onDidRemoveLastListener(){K==null||K.dispose()}},M=new le(j);return I==null||I.add(M),M.event}function g(V,I){return I instanceof Array?I.push(V):I&&I.add(V),V}function m(V,I,K=100,j=!1,M=!1,q,W){let fe,k,D,Y=0,w,se={leakWarningThreshold:q,onWillAddFirstListener(){fe=V(ce=>{Y++,k=I(k,ce),j&&!D&&(de.fire(k),k=void 0),w=()=>{let xe=k;k=void 0,D=void 0,(!j||Y>1)&&de.fire(xe),Y=0},typeof K=="number"?(clearTimeout(D),D=setTimeout(w,K)):D===void 0&&(D=0,queueMicrotask(w))})},onWillRemoveListener(){M&&Y>0&&(w==null||w())},onDidRemoveLastListener(){w=void 0,fe.dispose()}},de=new le(se);return W==null||W.add(de),de.event}e.debounce=m;function S(V,I=0,K){return e.debounce(V,(j,M)=>j?(j.push(M),j):[M],I,void 0,!0,void 0,K)}e.accumulate=S;function y(V,I=(j,M)=>j===M,K){let j=!0,M;return u(V,q=>{let W=j||!I(q,M);return j=!1,M=q,W},K)}e.latch=y;function b(V,I,K){return[e.filter(V,I,K),e.filter(V,j=>!I(j),K)]}e.split=b;function C(V,I=!1,K=[],j){let M=K.slice(),q=V(k=>{M?M.push(k):fe.fire(k)});j&&j.add(q);let W=()=>{M==null||M.forEach(k=>fe.fire(k)),M=null},fe=new le({onWillAddFirstListener(){q||(q=V(k=>fe.fire(k)),j&&j.add(q))},onDidAddFirstListener(){M&&(I?setTimeout(W):W())},onDidRemoveLastListener(){q&&q.dispose(),q=null}});return j&&j.add(fe),fe.event}e.buffer=C;function B(V,I){return(K,j,M)=>{let q=I(new Z);return V(function(W){let fe=q.evaluate(W);fe!==A&&K.call(j,fe)},void 0,M)}}e.chain=B;let A=Symbol("HaltChainable");class Z{constructor(){this.steps=[]}map(I){return this.steps.push(I),this}forEach(I){return this.steps.push(K=>(I(K),K)),this}filter(I){return this.steps.push(K=>I(K)?K:A),this}reduce(I,K){let j=K;return this.steps.push(M=>(j=I(j,M),j)),this}latch(I=(K,j)=>K===j){let K=!0,j;return this.steps.push(M=>{let q=K||!I(M,j);return K=!1,j=M,q?M:A}),this}evaluate(I){for(let K of this.steps)if(I=K(I),I===A)break;return I}}function P(V,I,K=j=>j){let j=(...fe)=>W.fire(K(...fe)),M=()=>V.on(I,j),q=()=>V.removeListener(I,j),W=new le({onWillAddFirstListener:M,onDidRemoveLastListener:q});return W.event}e.fromNodeEventEmitter=P;function ee(V,I,K=j=>j){let j=(...fe)=>W.fire(K(...fe)),M=()=>V.addEventListener(I,j),q=()=>V.removeEventListener(I,j),W=new le({onWillAddFirstListener:M,onDidRemoveLastListener:q});return W.event}e.fromDOMEventEmitter=ee;function ne(V){return new Promise(I=>n(V)(I))}e.toPromise=ne;function z(V){let I=new le;return V.then(K=>{I.fire(K)},()=>{I.fire(void 0)}).finally(()=>{I.dispose()}),I.event}e.fromPromise=z;function ie(V,I){return V(K=>I.fire(K))}e.forward=ie;function ue(V,I,K){return I(K),V(j=>I(j))}e.runAndSubscribe=ue;class _e{constructor(I,K){this._observable=I,this._counter=0,this._hasChanged=!1;let j={onWillAddFirstListener:()=>{I.addObserver(this)},onDidRemoveLastListener:()=>{I.removeObserver(this)}};this.emitter=new le(j),K&&K.add(this.emitter)}beginUpdate(I){this._counter++}handlePossibleChange(I){}handleChange(I,K){this._hasChanged=!0}endUpdate(I){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function H(V,I){return new _e(V,I).emitter.event}e.fromObservable=H;function te(V){return(I,K,j)=>{let M=0,q=!1,W={beginUpdate(){M++},endUpdate(){M--,M===0&&(V.reportChanges(),q&&(q=!1,I.call(K)))},handlePossibleChange(){},handleChange(){q=!0}};V.addObserver(W),V.reportChanges();let fe={dispose(){V.removeObserver(W)}};return j instanceof lr?j.add(fe):Array.isArray(j)&&j.push(fe),fe}}e.fromObservableLight=te})(Pt||(Pt={}));var Sf=class bf{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${bf._idPool++}`,bf.all.add(this)}start(t){this._stopWatch=new Ox,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};Sf.all=new Set,Sf._idPool=0;var zx=Sf,Lx=-1,Xy=class Gy{constructor(t,n,s=(Gy._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=n,this.name=s,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,n){let s=this.threshold;if(s<=0||n<s)return;this._stacks||(this._stacks=new Map);let a=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,a+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=s*.5;let[u,c]=this.getMostFrequentStack(),d=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${c}):`;console.warn(d),console.warn(u);let p=new jx(d,u);this._errorHandler(p)}return()=>{let u=this._stacks.get(t.value)||0;this._stacks.set(t.value,u-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,n=0;for(let[s,a]of this._stacks)(!t||n<a)&&(t=[s,a],n=a);return t}};Xy._idPool=1;var Nx=Xy,Hx=class $y{constructor(t){this.value=t}static create(){let t=new Error;return new $y(t.stack??"")}print(){console.warn(this.value.split(`
|
|
67
|
-
`).slice(2).join(`
|
|
68
|
-
`))}},jx=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},Ux=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},Px=0,Lh=class{constructor(e){this.value=e,this.id=Px++}},Ix=2,Fx,le=class{constructor(e){var t,n,s,a;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new Nx((e==null?void 0:e.onListenerError)??Io,((n=this._options)==null?void 0:n.leakWarningThreshold)??Lx):void 0,this._perfMon=(s=this._options)!=null&&s._profName?new zx(this._options._profName):void 0,this._deliveryQueue=(a=this._options)==null?void 0:a.deliveryQueue}dispose(){var e,t,n,s;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(n=(t=this._options)==null?void 0:t.onDidRemoveLastListener)==null||n.call(t),(s=this._leakageMon)==null||s.dispose())}get event(){return this._event??(this._event=(e,t,n)=>{var c,d,p,h,g;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let m=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(m);let S=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],y=new Ux(`${m}. HINT: Stack shows most frequent listener (${S[1]}-times)`,S[0]);return(((c=this._options)==null?void 0:c.onListenerError)||Io)(y),De.None}if(this._disposed)return De.None;t&&(e=e.bind(t));let s=new Lh(e),a;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=Hx.create(),a=this._leakageMon.check(s.stack,this._size+1)),this._listeners?this._listeners instanceof Lh?(this._deliveryQueue??(this._deliveryQueue=new qx),this._listeners=[this._listeners,s]):this._listeners.push(s):((p=(d=this._options)==null?void 0:d.onWillAddFirstListener)==null||p.call(d,this),this._listeners=s,(g=(h=this._options)==null?void 0:h.onDidAddFirstListener)==null||g.call(h,this)),this._size++;let u=rt(()=>{a==null||a(),this._removeListener(s)});return n instanceof lr?n.add(u):Array.isArray(n)&&n.push(u),u}),this._event}_removeListener(e){var a,u,c,d;if((u=(a=this._options)==null?void 0:a.onWillRemoveListener)==null||u.call(a,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(d=(c=this._options)==null?void 0:c.onDidRemoveLastListener)==null||d.call(c,this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[n]=void 0;let s=this._deliveryQueue.current===this;if(this._size*Ix<=t.length){let p=0;for(let h=0;h<t.length;h++)t[h]?t[p++]=t[h]:s&&(this._deliveryQueue.end--,p<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=p}}_deliver(e,t){var s;if(!e)return;let n=((s=this._options)==null?void 0:s.onListenerError)||Io;if(!n){e.value(t);return}try{e.value(t)}catch(a){n(a)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){var t,n,s,a;if((t=this._deliveryQueue)!=null&&t.current&&(this._deliverQueue(this._deliveryQueue),(n=this._perfMon)==null||n.stop()),(s=this._perfMon)==null||s.start(this._size),this._listeners)if(this._listeners instanceof Lh)this._deliver(this._listeners,e);else{let u=this._deliveryQueue;u.enqueue(this,e,this._listeners.length),this._deliverQueue(u)}(a=this._perfMon)==null||a.stop()}hasListeners(){return this._size>0}},qx=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},xf=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new le,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new le,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,n){if(this.getZoomLevel(n)===t)return;let s=this.getWindowId(n);this.mapWindowIdToZoomLevel.set(s,t),this._onDidChangeZoomLevel.fire(s)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,n){this.mapWindowIdToZoomFactor.set(this.getWindowId(n),t)}setFullscreen(t,n){if(this.isFullscreen(n)===t)return;let s=this.getWindowId(n);this.mapWindowIdToFullScreen.set(s,t),this._onDidChangeFullscreen.fire(s)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};xf.INSTANCE=new xf;var od=xf;function Vx(e,t,n){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",n)}od.INSTANCE.onDidChangeZoomLevel;function Wx(e){return od.INSTANCE.getZoomFactor(e)}od.INSTANCE.onDidChangeFullscreen;var Ns=typeof navigator=="object"?navigator.userAgent:"",wf=Ns.indexOf("Firefox")>=0,Yx=Ns.indexOf("AppleWebKit")>=0,ud=Ns.indexOf("Chrome")>=0,Kx=!ud&&Ns.indexOf("Safari")>=0;Ns.indexOf("Electron/")>=0;Ns.indexOf("Android")>=0;var Nh=!1;if(typeof Cn.matchMedia=="function"){let e=Cn.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=Cn.matchMedia("(display-mode: fullscreen)");Nh=e.matches,Vx(Cn,e,({matches:n})=>{Nh&&t.matches||(Nh=n)})}var Rs="en",Cf=!1,kf=!1,Fo=!1,Zy=!1,Ro,qo=Rs,Kg=Rs,Xx,qi,Br=globalThis,Ut,Ty;typeof Br.vscode<"u"&&typeof Br.vscode.process<"u"?Ut=Br.vscode.process:typeof process<"u"&&typeof((Ty=process==null?void 0:process.versions)==null?void 0:Ty.node)=="string"&&(Ut=process);var Dy,Gx=typeof((Dy=Ut==null?void 0:Ut.versions)==null?void 0:Dy.electron)=="string",$x=Gx&&(Ut==null?void 0:Ut.type)==="renderer",Ay;if(typeof Ut=="object"){Cf=Ut.platform==="win32",kf=Ut.platform==="darwin",Fo=Ut.platform==="linux",Fo&&Ut.env.SNAP&&Ut.env.SNAP_REVISION,Ut.env.CI||Ut.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Ro=Rs,qo=Rs;let e=Ut.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);Ro=t.userLocale,Kg=t.osLocale,qo=t.resolvedLanguage||Rs,Xx=(Ay=t.languagePack)==null?void 0:Ay.translationsConfigFile}catch{}Zy=!0}else typeof navigator=="object"&&!$x?(qi=navigator.userAgent,Cf=qi.indexOf("Windows")>=0,kf=qi.indexOf("Macintosh")>=0,(qi.indexOf("Macintosh")>=0||qi.indexOf("iPad")>=0||qi.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Fo=qi.indexOf("Linux")>=0,(qi==null?void 0:qi.indexOf("Mobi"))>=0,qo=globalThis._VSCODE_NLS_LANGUAGE||Rs,Ro=navigator.language.toLowerCase(),Kg=Ro):console.error("Unable to resolve platform.");var Qy=Cf,en=kf,Zx=Fo,Xg=Zy,tn=qi,Jn=qo,Qx;(e=>{function t(){return Jn}e.value=t;function n(){return Jn.length===2?Jn==="en":Jn.length>=3?Jn[0]==="e"&&Jn[1]==="n"&&Jn[2]==="-":!1}e.isDefaultVariant=n;function s(){return Jn==="en"}e.isDefault=s})(Qx||(Qx={}));var Jx=typeof Br.postMessage=="function"&&!Br.importScripts;(()=>{if(Jx){let e=[];Br.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let s=0,a=e.length;s<a;s++){let u=e[s];if(u.id===n.data.vscodeScheduleAsyncWork){e.splice(s,1),u.callback();return}}});let t=0;return n=>{let s=++t;e.push({id:s,callback:n}),Br.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})();var ew=!!(tn&&tn.indexOf("Chrome")>=0);tn&&tn.indexOf("Firefox")>=0;!ew&&tn&&tn.indexOf("Safari")>=0;tn&&tn.indexOf("Edg/")>=0;tn&&tn.indexOf("Android")>=0;var Es=typeof navigator=="object"?navigator:{};Xg||document.queryCommandSupported&&document.queryCommandSupported("copy")||Es&&Es.clipboard&&Es.clipboard.writeText,Xg||Es&&Es.clipboard&&Es.clipboard.readText;var cd=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Hh=new cd,Gg=new cd,$g=new cd,tw=new Array(230),Jy;(e=>{function t(d){return Hh.keyCodeToStr(d)}e.toString=t;function n(d){return Hh.strToKeyCode(d)}e.fromString=n;function s(d){return Gg.keyCodeToStr(d)}e.toUserSettingsUS=s;function a(d){return $g.keyCodeToStr(d)}e.toUserSettingsGeneral=a;function u(d){return Gg.strToKeyCode(d)||$g.strToKeyCode(d)}e.fromUserSettings=u;function c(d){if(d>=98&&d<=113)return null;switch(d){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Hh.keyCodeToStr(d)}e.toElectronAccelerator=c})(Jy||(Jy={}));var iw=class eS{constructor(t,n,s,a,u){this.ctrlKey=t,this.shiftKey=n,this.altKey=s,this.metaKey=a,this.keyCode=u}equals(t){return t instanceof eS&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",n=this.shiftKey?"1":"0",s=this.altKey?"1":"0",a=this.metaKey?"1":"0";return`K${t}${n}${s}${a}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new nw([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},nw=class{constructor(e){if(e.length===0)throw Dx("chords");this.chords=e}getHashCode(){let e="";for(let t=0,n=this.chords.length;t<n;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function rw(e){if(e.charCode){let n=String.fromCharCode(e.charCode).toUpperCase();return Jy.fromString(n)}let t=e.keyCode;if(t===3)return 7;if(wf)switch(t){case 59:return 85;case 60:if(Zx)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(en)return 57;break}else if(Yx&&(en&&t===93||!en&&t===92))return 57;return tw[t]||0}var sw=en?256:2048,lw=512,aw=1024,ow=en?2048:256,Zg=class{constructor(e){var n;this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=(n=t.getModifierState)==null?void 0:n.call(t,"AltGraph"),this.keyCode=rw(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=sw),this.altKey&&(t|=lw),this.shiftKey&&(t|=aw),this.metaKey&&(t|=ow),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new iw(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},Qg=new WeakMap;function uw(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,n=e.parent.location;if(t.origin!=="null"&&n.origin!=="null"&&t.origin!==n.origin)return null}catch{return null}return e.parent}var cw=class{static getSameOriginWindowChain(e){let t=Qg.get(e);if(!t){t=[],Qg.set(e,t);let n=e,s;do s=uw(n),s?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=s;while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,s=0,a=this.getSameOriginWindowChain(e);for(let u of a){let c=u.window.deref();if(n+=(c==null?void 0:c.scrollY)??0,s+=(c==null?void 0:c.scrollX)??0,c===t||!u.iframeElement)break;let d=u.iframeElement.getBoundingClientRect();n+=d.top,s+=d.left}return{top:n,left:s}}},Bo=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=cw.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},Jg=class{constructor(e,t=0,n=0){var a;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=t;let s=!1;if(ud){let u=navigator.userAgent.match(/Chrome\/(\d+)/);s=(u?parseInt(u[1]):123)<=122}if(e){let u=e,c=e,d=((a=e.view)==null?void 0:a.devicePixelRatio)||1;if(typeof u.wheelDeltaY<"u")s?this.deltaY=u.wheelDeltaY/(120*d):this.deltaY=u.wheelDeltaY/120;else if(typeof c.VERTICAL_AXIS<"u"&&c.axis===c.VERTICAL_AXIS)this.deltaY=-c.detail/3;else if(e.type==="wheel"){let p=e;p.deltaMode===p.DOM_DELTA_LINE?wf&&!en?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof u.wheelDeltaX<"u")Kx&&Qy?this.deltaX=-(u.wheelDeltaX/120):s?this.deltaX=u.wheelDeltaX/(120*d):this.deltaX=u.wheelDeltaX/120;else if(typeof c.HORIZONTAL_AXIS<"u"&&c.axis===c.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let p=e;p.deltaMode===p.DOM_DELTA_LINE?wf&&!en?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(s?this.deltaY=e.wheelDelta/(120*d):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},tS=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),hw;(e=>{function t(n){return n===e.None||n===e.Cancelled||n instanceof fw?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Pt.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:tS})})(hw||(hw={}));var fw=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?tS:(this._emitter||(this._emitter=new le),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},hd=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new gf("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new gf("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},dw=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){if(this.isDisposed)throw new gf("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let s=n.setInterval(()=>{e()},t);this.disposable=rt(()=>{n.clearInterval(s),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},pw;(e=>{async function t(s){let a,u=await Promise.all(s.map(c=>c.then(d=>d,d=>{a||(a=d)})));if(typeof a<"u")throw a;return u}e.settled=t;function n(s){return new Promise(async(a,u)=>{try{await s(a,u)}catch(c){u(c)}})}e.withAsyncBody=n})(pw||(pw={}));var ev=class Li{static fromArray(t){return new Li(n=>{n.emitMany(t)})}static fromPromise(t){return new Li(async n=>{n.emitMany(await t)})}static fromPromises(t){return new Li(async n=>{await Promise.all(t.map(async s=>n.emitOne(await s)))})}static merge(t){return new Li(async n=>{await Promise.all(t.map(async s=>{for await(let a of s)n.emitOne(a)}))})}constructor(t,n){this._state=0,this._results=[],this._error=null,this._onReturn=n,this._onStateChanged=new le,queueMicrotask(async()=>{let s={emitOne:a=>this.emitOne(a),emitMany:a=>this.emitMany(a),reject:a=>this.reject(a)};try{await Promise.resolve(t(s)),this.resolve()}catch(a){this.reject(a)}finally{s.emitOne=void 0,s.emitMany=void 0,s.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await Pt.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var n;return(n=this._onReturn)==null||n.call(this),{done:!0,value:void 0}}}}static map(t,n){return new Li(async s=>{for await(let a of t)s.emitOne(n(a))})}map(t){return Li.map(this,t)}static filter(t,n){return new Li(async s=>{for await(let a of t)n(a)&&s.emitOne(a)})}filter(t){return Li.filter(this,t)}static coalesce(t){return Li.filter(t,n=>!!n)}coalesce(){return Li.coalesce(this)}static async toPromise(t){let n=[];for await(let s of t)n.push(s);return n}toPromise(){return Li.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};ev.EMPTY=ev.fromArray([]);var{getWindow:Ji,getWindowId:_w,onDidRegisterWindow:mw}=(function(){let e=new Map,t={window:Cn,disposables:new lr};e.set(Cn.vscodeWindowId,t);let n=new le,s=new le,a=new le;function u(c,d){return(typeof c=="number"?e.get(c):void 0)??(d?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:a.event,onDidUnregisterWindow:s.event,registerWindow(c){if(e.has(c.vscodeWindowId))return De.None;let d=new lr,p={window:c,disposables:d.add(new lr)};return e.set(c.vscodeWindowId,p),d.add(rt(()=>{e.delete(c.vscodeWindowId),s.fire(c)})),d.add(be(c,Dt.BEFORE_UNLOAD,()=>{a.fire(c)})),n.fire(p),d},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(c){return c.vscodeWindowId},hasWindow(c){return e.has(c)},getWindowById:u,getWindow(c){var h;let d=c;if((h=d==null?void 0:d.ownerDocument)!=null&&h.defaultView)return d.ownerDocument.defaultView.window;let p=c;return p!=null&&p.view?p.view.window:Cn},getDocument(c){return Ji(c).document}}})(),gw=class{constructor(e,t,n,s){this._node=e,this._type=t,this._handler=n,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function be(e,t,n,s){return new gw(e,t,n,s)}var tv=function(e,t,n,s){return be(e,t,n,s)},fd,vw=class extends dw{constructor(e){super(),this.defaultTarget=e&&Ji(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}},iv=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Io(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,n=new Map,s=new Map,a=u=>{n.set(u,!1);let c=e.get(u)??[];for(t.set(u,c),e.set(u,[]),s.set(u,!0);c.length>0;)c.sort(iv.sort),c.shift().execute();s.set(u,!1)};fd=(u,c,d=0)=>{let p=_w(u),h=new iv(c,d),g=e.get(p);return g||(g=[],e.set(p,g)),g.push(h),n.get(p)||(n.set(p,!0),u.requestAnimationFrame(()=>a(p))),h}})();function yw(e){let t=e.getBoundingClientRect(),n=Ji(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}var Dt={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},Sw=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=oi(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=oi(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=oi(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=oi(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=oi(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=oi(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=oi(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=oi(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=oi(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=oi(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=oi(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=oi(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=oi(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=oi(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function oi(e){return typeof e=="number"?`${e}px`:e}function Xl(e){return new Sw(e)}var iS=class{constructor(){this._hooks=new lr,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,s,a){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=s,this._onStopCallback=a;let u=e;try{e.setPointerCapture(t),this._hooks.add(rt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{u=Ji(e)}this._hooks.add(be(u,Dt.POINTER_MOVE,c=>{if(c.buttons!==n){this.stopMonitoring(!0);return}c.preventDefault(),this._pointerMoveCallback(c)})),this._hooks.add(be(u,Dt.POINTER_UP,c=>this.stopMonitoring(!0)))}};function bw(e,t,n){let s=null,a=null;if(typeof n.value=="function"?(s="value",a=n.value,a.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof n.get=="function"&&(s="get",a=n.get),!a)throw new Error("not supported");let u=`$memoize$${t}`;n[s]=function(...c){return this.hasOwnProperty(u)||Object.defineProperty(this,u,{configurable:!1,enumerable:!1,writable:!1,value:a.apply(this,c)}),this[u]}}var Zi;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(Zi||(Zi={}));var ql=class Ft extends De{constructor(){super(),this.dispatched=!1,this.targets=new Yg,this.ignoreTargets=new Yg,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Pt.runAndSubscribe(mw,({window:t,disposables:n})=>{n.add(be(t.document,"touchstart",s=>this.onTouchStart(s),{passive:!1})),n.add(be(t.document,"touchend",s=>this.onTouchEnd(t,s))),n.add(be(t.document,"touchmove",s=>this.onTouchMove(s),{passive:!1}))},{window:Cn,disposables:this._store}))}static addTarget(t){if(!Ft.isTouchDevice())return De.None;Ft.INSTANCE||(Ft.INSTANCE=new Ft);let n=Ft.INSTANCE.targets.push(t);return rt(n)}static ignoreTarget(t){if(!Ft.isTouchDevice())return De.None;Ft.INSTANCE||(Ft.INSTANCE=new Ft);let n=Ft.INSTANCE.ignoreTargets.push(t);return rt(n)}static isTouchDevice(){return"ontouchstart"in Cn||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let n=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let s=0,a=t.targetTouches.length;s<a;s++){let u=t.targetTouches.item(s);this.activeTouches[u.identifier]={id:u.identifier,initialTarget:u.target,initialTimeStamp:n,initialPageX:u.pageX,initialPageY:u.pageY,rollingTimestamps:[n],rollingPageX:[u.pageX],rollingPageY:[u.pageY]};let c=this.newGestureEvent(Zi.Start,u.target);c.pageX=u.pageX,c.pageY=u.pageY,this.dispatchEvent(c)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,n){let s=Date.now(),a=Object.keys(this.activeTouches).length;for(let u=0,c=n.changedTouches.length;u<c;u++){let d=n.changedTouches.item(u);if(!this.activeTouches.hasOwnProperty(String(d.identifier))){console.warn("move of an UNKNOWN touch",d);continue}let p=this.activeTouches[d.identifier],h=Date.now()-p.initialTimeStamp;if(h<Ft.HOLD_DELAY&&Math.abs(p.initialPageX-Si(p.rollingPageX))<30&&Math.abs(p.initialPageY-Si(p.rollingPageY))<30){let g=this.newGestureEvent(Zi.Tap,p.initialTarget);g.pageX=Si(p.rollingPageX),g.pageY=Si(p.rollingPageY),this.dispatchEvent(g)}else if(h>=Ft.HOLD_DELAY&&Math.abs(p.initialPageX-Si(p.rollingPageX))<30&&Math.abs(p.initialPageY-Si(p.rollingPageY))<30){let g=this.newGestureEvent(Zi.Contextmenu,p.initialTarget);g.pageX=Si(p.rollingPageX),g.pageY=Si(p.rollingPageY),this.dispatchEvent(g)}else if(a===1){let g=Si(p.rollingPageX),m=Si(p.rollingPageY),S=Si(p.rollingTimestamps)-p.rollingTimestamps[0],y=g-p.rollingPageX[0],b=m-p.rollingPageY[0],C=[...this.targets].filter(B=>p.initialTarget instanceof Node&&B.contains(p.initialTarget));this.inertia(t,C,s,Math.abs(y)/S,y>0?1:-1,g,Math.abs(b)/S,b>0?1:-1,m)}this.dispatchEvent(this.newGestureEvent(Zi.End,p.initialTarget)),delete this.activeTouches[d.identifier]}this.dispatched&&(n.preventDefault(),n.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,n){let s=document.createEvent("CustomEvent");return s.initEvent(t,!1,!0),s.initialTarget=n,s.tapCount=0,s}dispatchEvent(t){if(t.type===Zi.Tap){let n=new Date().getTime(),s=0;n-this._lastSetTapCountTime>Ft.CLEAR_TAP_COUNT_TIME?s=1:s=2,this._lastSetTapCountTime=n,t.tapCount=s}else(t.type===Zi.Change||t.type===Zi.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let s of this.ignoreTargets)if(s.contains(t.initialTarget))return;let n=[];for(let s of this.targets)if(s.contains(t.initialTarget)){let a=0,u=t.initialTarget;for(;u&&u!==s;)a++,u=u.parentElement;n.push([a,s])}n.sort((s,a)=>s[0]-a[0]);for(let[s,a]of n)a.dispatchEvent(t),this.dispatched=!0}}inertia(t,n,s,a,u,c,d,p,h){this.handle=fd(t,()=>{let g=Date.now(),m=g-s,S=0,y=0,b=!0;a+=Ft.SCROLL_FRICTION*m,d+=Ft.SCROLL_FRICTION*m,a>0&&(b=!1,S=u*a*m),d>0&&(b=!1,y=p*d*m);let C=this.newGestureEvent(Zi.Change);C.translationX=S,C.translationY=y,n.forEach(B=>B.dispatchEvent(C)),b||this.inertia(t,n,g,a,u,c+S,d,p,h+y)})}onTouchMove(t){let n=Date.now();for(let s=0,a=t.changedTouches.length;s<a;s++){let u=t.changedTouches.item(s);if(!this.activeTouches.hasOwnProperty(String(u.identifier))){console.warn("end of an UNKNOWN touch",u);continue}let c=this.activeTouches[u.identifier],d=this.newGestureEvent(Zi.Change,c.initialTarget);d.translationX=u.pageX-Si(c.rollingPageX),d.translationY=u.pageY-Si(c.rollingPageY),d.pageX=u.pageX,d.pageY=u.pageY,this.dispatchEvent(d),c.rollingPageX.length>3&&(c.rollingPageX.shift(),c.rollingPageY.shift(),c.rollingTimestamps.shift()),c.rollingPageX.push(u.pageX),c.rollingPageY.push(u.pageY),c.rollingTimestamps.push(n)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};ql.SCROLL_FRICTION=-.005,ql.HOLD_DELAY=700,ql.CLEAR_TAP_COUNT_TIME=400,ct([bw],ql,"isTouchDevice",1);var xw=ql,dd=class extends De{onclick(e,t){this._register(be(e,Dt.CLICK,n=>t(new Bo(Ji(e),n))))}onmousedown(e,t){this._register(be(e,Dt.MOUSE_DOWN,n=>t(new Bo(Ji(e),n))))}onmouseover(e,t){this._register(be(e,Dt.MOUSE_OVER,n=>t(new Bo(Ji(e),n))))}onmouseleave(e,t){this._register(be(e,Dt.MOUSE_LEAVE,n=>t(new Bo(Ji(e),n))))}onkeydown(e,t){this._register(be(e,Dt.KEY_DOWN,n=>t(new Zg(n))))}onkeyup(e,t){this._register(be(e,Dt.KEY_UP,n=>t(new Zg(n))))}oninput(e,t){this._register(be(e,Dt.INPUT,t))}onblur(e,t){this._register(be(e,Dt.BLUR,t))}onfocus(e,t){this._register(be(e,Dt.FOCUS,t))}onchange(e,t){this._register(be(e,Dt.CHANGE,t))}ignoreGesture(e){return xw.ignoreTarget(e)}},nv=11,ww=class extends dd{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=nv+"px",this.domNode.style.height=nv+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new iS),this._register(tv(this.bgDomNode,Dt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(tv(this.domNode,Dt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new vw),this._pointerdownScheduleRepeatTimer=this._register(new hd)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Ji(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},Cw=class Ef{constructor(t,n,s,a,u,c,d){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(n=n|0,s=s|0,a=a|0,u=u|0,c=c|0,d=d|0),this.rawScrollLeft=a,this.rawScrollTop=d,n<0&&(n=0),a+n>s&&(a=s-n),a<0&&(a=0),u<0&&(u=0),d+u>c&&(d=c-u),d<0&&(d=0),this.width=n,this.scrollWidth=s,this.scrollLeft=a,this.height=u,this.scrollHeight=c,this.scrollTop=d}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,n){return new Ef(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new Ef(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,n){let s=this.width!==t.width,a=this.scrollWidth!==t.scrollWidth,u=this.scrollLeft!==t.scrollLeft,c=this.height!==t.height,d=this.scrollHeight!==t.scrollHeight,p=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:n,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:s,scrollWidthChanged:a,scrollLeftChanged:u,heightChanged:c,scrollHeightChanged:d,scrollTopChanged:p}}},kw=class extends De{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new le),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new Cw(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var s;let n=this._state.withScrollDimensions(e,t);this._setState(n,!!this._smoothScrolling),(s=this._smoothScrolling)==null||s.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let s;t?s=new sv(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):s=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=s}else{let n=this._state.withScrollPosition(e);this._smoothScrolling=sv.start(this._state,n,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}},rv=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function jh(e,t){let n=t-e;return function(s){return e+n*Dw(s)}}function Ew(e,t,n){return function(s){return s<n?e(s/n):t((s-n)/(1-n))}}var sv=class Tf{constructor(t,n,s,a){this.from=t,this.to=n,this.duration=a,this.startTime=s,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(t,n,s){if(Math.abs(t-n)>2.5*s){let a,u;return t<n?(a=t+.75*s,u=n-.75*s):(a=t-.75*s,u=n+.75*s),Ew(jh(t,a),jh(u,n),.33)}return jh(t,n)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let n=(t-this.startTime)/this.duration;if(n<1){let s=this.scrollLeft(n),a=this.scrollTop(n);return new rv(s,a,!1)}return new rv(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,n,s){return Tf.start(t,n,s)}static start(t,n,s){s=s+10;let a=Date.now()-10;return new Tf(t,n,a,s)}};function Tw(e){return Math.pow(e,3)}function Dw(e){return 1-Tw(1-e)}var Aw=class extends De{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new hd)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)==null||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)==null||t.setClassName(this._invisibleClassName+(e?" fade":"")))}},Mw=140,nS=class extends dd{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new Aw(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new iS),this._shouldRender=!0,this.domNode=Xl(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(be(this.domNode.domNode,Dt.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new ww(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,s){this.slider=Xl(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof n=="number"&&this.slider.setWidth(n),typeof s=="number"&&this.slider.setHeight(s),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(be(this.slider.domNode,Dt.POINTER_DOWN,a=>{a.button===0&&(a.preventDefault(),this._sliderPointerDown(a))})),this.onclick(this.slider.domNode,a=>{a.leftButton&&a.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,n=t+this._scrollbarState.getSliderPosition(),s=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),a=this._sliderPointerPosition(e);n<=a&&a<=s?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,n=e.offsetY;else{let a=yw(this.domNode.domNode);t=e.pageX-a.left,n=e.pageY-a.top}let s=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(s):this._scrollbarState.getDesiredScrollPositionFromOffset(s)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),s=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,a=>{let u=this._sliderOrthogonalPointerPosition(a),c=Math.abs(u-n);if(Qy&&c>Mw){this._setDesiredScrollPositionNow(s.getScrollPosition());return}let d=this._sliderPointerPosition(a)-t;this._setDesiredScrollPositionNow(s.getDesiredScrollPositionFromDelta(d))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},rS=class Df{constructor(t,n,s,a,u,c){this._scrollbarSize=Math.round(n),this._oppositeScrollbarSize=Math.round(s),this._arrowSize=Math.round(t),this._visibleSize=a,this._scrollSize=u,this._scrollPosition=c,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Df(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let n=Math.round(t);return this._visibleSize!==n?(this._visibleSize=n,this._refreshComputedValues(),!0):!1}setScrollSize(t){let n=Math.round(t);return this._scrollSize!==n?(this._scrollSize=n,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let n=Math.round(t);return this._scrollPosition!==n?(this._scrollPosition=n,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,n,s,a,u){let c=Math.max(0,s-t),d=Math.max(0,c-2*n),p=a>0&&a>s;if(!p)return{computedAvailableSize:Math.round(c),computedIsNeeded:p,computedSliderSize:Math.round(d),computedSliderRatio:0,computedSliderPosition:0};let h=Math.round(Math.max(20,Math.floor(s*d/a))),g=(d-h)/(a-s),m=u*g;return{computedAvailableSize:Math.round(c),computedIsNeeded:p,computedSliderSize:Math.round(h),computedSliderRatio:g,computedSliderPosition:Math.round(m)}}_refreshComputedValues(){let t=Df._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let n=t-this._arrowSize-this._computedSliderSize/2;return Math.round(n/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let n=t-this._arrowSize,s=this._scrollPosition;return n<this._computedSliderPosition?s-=this._visibleSize:s+=this._visibleSize,s}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let n=this._computedSliderPosition+t;return Math.round(n/this._computedSliderRatio)}},Rw=class extends nS{constructor(e,t,n){let s=e.getScrollDimensions(),a=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new rS(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,s.width,s.scrollWidth,a.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},Bw=class extends nS{constructor(e,t,n){let s=e.getScrollDimensions(),a=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new rS(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,s.height,s.scrollHeight,a.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},Ow=500,lv=50,zw=class{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}},Af=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,n=0,s=1,a=this._rear;do{let u=a===this._front?t:Math.pow(2,-s);if(t-=u,n+=this._memory[a].score*u,a===this._front)break;a=(this._capacity+a-1)%this._capacity,s++}while(!0);return n<=.5}acceptStandardWheelEvent(t){if(ud){let n=Ji(t.browserEvent),s=Wx(n);this.accept(Date.now(),t.deltaX*s,t.deltaY*s)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,n,s){let a=null,u=new zw(t,n,s);this._front===-1&&this._rear===-1?(this._memory[0]=u,this._front=0,this._rear=0):(a=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=u),u.score=this._computeScore(u,a)}_computeScore(t,n){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let s=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(s+=.25),n){let a=Math.abs(t.deltaX),u=Math.abs(t.deltaY),c=Math.abs(n.deltaX),d=Math.abs(n.deltaY),p=Math.max(Math.min(a,c),1),h=Math.max(Math.min(u,d),1),g=Math.max(a,c),m=Math.max(u,d);g%p===0&&m%h===0&&(s-=.5)}return Math.min(Math.max(s,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};Af.INSTANCE=new Af;var Lw=Af,Nw=class extends dd{constructor(e,t,n){super(),this._onScroll=this._register(new le),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new le),this.onWillScroll=this._onWillScroll.event,this._options=jw(t),this._scrollable=n,this._register(this._scrollable.onScroll(a=>{this._onWillScroll.fire(a),this._onDidScroll(a),this._onScroll.fire(a)}));let s={onMouseWheel:a=>this._onMouseWheel(a),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Bw(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new Rw(this._scrollable,this._options,s)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=Xl(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Xl(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Xl(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,a=>this._onMouseOver(a)),this.onmouseleave(this._listenOnDomNode,a=>this._onMouseLeave(a)),this._hideTimeout=this._register(new hd),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Or(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,en&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new Jg(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Or(this._mouseWheelToDispose),e)){let t=n=>{this._onMouseWheel(new Jg(n))};this._mouseWheelToDispose.push(be(this._listenOnDomNode,Dt.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var a;if((a=e.browserEvent)!=null&&a.defaultPrevented)return;let t=Lw.INSTANCE;t.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let u=e.deltaY*this._options.mouseWheelScrollSensitivity,c=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&c+u===0?c=u=0:Math.abs(u)>=Math.abs(c)?c=0:u=0),this._options.flipAxes&&([u,c]=[c,u]);let d=!en&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||d)&&!c&&(c=u,u=0),e.browserEvent&&e.browserEvent.altKey&&(c=c*this._options.fastScrollSensitivity,u=u*this._options.fastScrollSensitivity);let p=this._scrollable.getFutureScrollPosition(),h={};if(u){let g=lv*u,m=p.scrollTop-(g<0?Math.floor(g):Math.ceil(g));this._verticalScrollbar.writeScrollPosition(h,m)}if(c){let g=lv*c,m=p.scrollLeft-(g<0?Math.floor(g):Math.ceil(g));this._horizontalScrollbar.writeScrollPosition(h,m)}h=this._scrollable.validateScrollPosition(h),(p.scrollLeft!==h.scrollLeft||p.scrollTop!==h.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(h):this._scrollable.setScrollPositionNow(h),n=!0)}let s=n;!s&&this._options.alwaysConsumeMouseWheel&&(s=!0),!s&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(s=!0),s&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0,s=n?" left":"",a=t?" top":"",u=n||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${s}`),this._topShadowDomNode.setClassName(`shadow${a}`),this._topLeftShadowDomNode.setClassName(`shadow${u}${a}${s}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),Ow)}},Hw=class extends Nw{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function jw(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,en&&(t.className+=" mac"),t}var Mf=class extends De{constructor(e,t,n,s,a,u,c,d){super(),this._bufferService=n,this._optionsService=c,this._renderService=d,this._onRequestScrollLines=this._register(new le),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let p=this._register(new kw({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:h=>fd(s.window,h)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{p.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new Hw(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},p)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(a.onProtocolChange(h=>{this._scrollableElement.updateOptions({handleMouseWheel:!(h&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Pt.runAndSubscribe(u.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=u.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(rt(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=s.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(rt(()=>this._styleElement.remove())),this._register(Pt.runAndSubscribe(u.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${u.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${u.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${u.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
69
|
-
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(h=>this._handleScroll(h)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){var e;return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:((e=this._optionsService.rawOptions.overviewRuler)==null?void 0:e.width)||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=t-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};Mf=ct([oe(2,Zt),oe(3,kn),oe(4,jy),oe(5,Ls),oe(6,Qt),oe(7,En)],Mf);var Rf=class extends De{constructor(e,t,n,s,a){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=s,this._renderService=a,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(u=>this._removeDecoration(u))),this._register(rt(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var s;let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((s=e==null?void 0:e.options)==null?void 0:s.layer)==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,t=e.element){if(!t)return;let n=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){var t;(t=this._decorationElements.get(e))==null||t.remove(),this._decorationElements.delete(e),e.dispose()}};Rf=ct([oe(1,Zt),oe(2,kn),oe(3,sa),oe(4,En)],Rf);var Uw=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,n){return t>=e.startBufferLine-this._linePadding[n||"full"]&&t<=e.endBufferLine+this._linePadding[n||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},Gi={full:0,left:0,center:0,right:0},er={full:0,left:0,center:0,right:0},Ol={full:0,left:0,center:0,right:0},Go=class extends De{constructor(e,t,n,s,a,u,c,d){var h;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=s,this._renderService=a,this._optionsService=u,this._themeService=c,this._coreBrowserService=d,this._colorZoneStore=new Uw,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(h=this._viewportElement.parentElement)==null||h.insertBefore(this._canvas,this._viewportElement),this._register(rt(()=>{var g;return(g=this._canvas)==null?void 0:g.remove()}));let p=this._canvas.getContext("2d");if(p)this._ctx=p;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){var e;return((e=this._optionsService.options.overviewRuler)==null?void 0:e.width)||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);er.full=this._canvas.width,er.left=e,er.center=t,er.right=e,this._refreshDrawHeightConstants(),Ol.full=1,Ol.left=1,Ol.center=1+er.left,Ol.right=1+er.left+er.center}_refreshDrawHeightConstants(){Gi.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);Gi.left=t,Gi.center=t,Gi.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Gi.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Gi.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Gi.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Gi.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(Ol[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Gi[e.position||"full"]/2),er[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Gi[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};Go=ct([oe(2,Zt),oe(3,sa),oe(4,En),oe(5,Qt),oe(6,Ls),oe(7,kn)],Go);var J;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
|
|
70
|
-
`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(J||(J={}));var Vo;(e=>(e.PAD="",e.HOP="",e.BPH="",e.NBH="",e.IND="",e.NEL="
",e.SSA="",e.ESA="",e.HTS="",e.HTJ="",e.VTS="",e.PLD="",e.PLU="",e.RI="",e.SS2="",e.SS3="",e.DCS="",e.PU1="",e.PU2="",e.STS="",e.CCH="",e.MW="",e.SPA="",e.EPA="",e.SOS="",e.SGCI="",e.SCI="",e.CSI="",e.ST="",e.OSC="",e.PM="",e.APC=""))(Vo||(Vo={}));var sS;(e=>e.ST=`${J.ESC}\\`)(sS||(sS={}));var Bf=class{constructor(e,t,n,s,a,u){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=s,this._coreService=a,this._renderService=u,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let n;t.start+=this._dataAlreadySent.length,this._isComposing?n=this._textarea.value.substring(t.start,this._compositionPosition.start):n=this._textarea.value.substring(t.start),n.length>0&&this._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,"");this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${J.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),n=this._renderService.dimensions.css.cell.height,s=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,a=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=a+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=n+"px",this._compositionView.style.lineHeight=n+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let u=this._compositionView.getBoundingClientRect();this._textarea.style.left=a+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(u.width,1)+"px",this._textarea.style.height=Math.max(u.height,1)+"px",this._textarea.style.lineHeight=u.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};Bf=ct([oe(2,Zt),oe(3,Qt),oe(4,Nr),oe(5,En)],Bf);var At=0,Mt=0,Rt=0,ut=0,av={css:"#00000000",rgba:0},St;(e=>{function t(a,u,c,d){return d!==void 0?`#${Er(a)}${Er(u)}${Er(c)}${Er(d)}`:`#${Er(a)}${Er(u)}${Er(c)}`}e.toCss=t;function n(a,u,c,d=255){return(a<<24|u<<16|c<<8|d)>>>0}e.toRgba=n;function s(a,u,c,d){return{css:e.toCss(a,u,c,d),rgba:e.toRgba(a,u,c,d)}}e.toColor=s})(St||(St={}));var it;(e=>{function t(p,h){if(ut=(h.rgba&255)/255,ut===1)return{css:h.css,rgba:h.rgba};let g=h.rgba>>24&255,m=h.rgba>>16&255,S=h.rgba>>8&255,y=p.rgba>>24&255,b=p.rgba>>16&255,C=p.rgba>>8&255;At=y+Math.round((g-y)*ut),Mt=b+Math.round((m-b)*ut),Rt=C+Math.round((S-C)*ut);let B=St.toCss(At,Mt,Rt),A=St.toRgba(At,Mt,Rt);return{css:B,rgba:A}}e.blend=t;function n(p){return(p.rgba&255)===255}e.isOpaque=n;function s(p,h,g){let m=Wo.ensureContrastRatio(p.rgba,h.rgba,g);if(m)return St.toColor(m>>24&255,m>>16&255,m>>8&255)}e.ensureContrastRatio=s;function a(p){let h=(p.rgba|255)>>>0;return[At,Mt,Rt]=Wo.toChannels(h),{css:St.toCss(At,Mt,Rt),rgba:h}}e.opaque=a;function u(p,h){return ut=Math.round(h*255),[At,Mt,Rt]=Wo.toChannels(p.rgba),{css:St.toCss(At,Mt,Rt,ut),rgba:St.toRgba(At,Mt,Rt,ut)}}e.opacity=u;function c(p,h){return ut=p.rgba&255,u(p,ut*h/255)}e.multiplyOpacity=c;function d(p){return[p.rgba>>24&255,p.rgba>>16&255,p.rgba>>8&255]}e.toColorRGB=d})(it||(it={}));var lt;(e=>{let t,n;try{let a=document.createElement("canvas");a.width=1,a.height=1;let u=a.getContext("2d",{willReadFrequently:!0});u&&(t=u,t.globalCompositeOperation="copy",n=t.createLinearGradient(0,0,1,1))}catch{}function s(a){if(a.match(/#[\da-f]{3,8}/i))switch(a.length){case 4:return At=parseInt(a.slice(1,2).repeat(2),16),Mt=parseInt(a.slice(2,3).repeat(2),16),Rt=parseInt(a.slice(3,4).repeat(2),16),St.toColor(At,Mt,Rt);case 5:return At=parseInt(a.slice(1,2).repeat(2),16),Mt=parseInt(a.slice(2,3).repeat(2),16),Rt=parseInt(a.slice(3,4).repeat(2),16),ut=parseInt(a.slice(4,5).repeat(2),16),St.toColor(At,Mt,Rt,ut);case 7:return{css:a,rgba:(parseInt(a.slice(1),16)<<8|255)>>>0};case 9:return{css:a,rgba:parseInt(a.slice(1),16)>>>0}}let u=a.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(u)return At=parseInt(u[1]),Mt=parseInt(u[2]),Rt=parseInt(u[3]),ut=Math.round((u[5]===void 0?1:parseFloat(u[5]))*255),St.toColor(At,Mt,Rt,ut);if(!t||!n)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=n,t.fillStyle=a,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[At,Mt,Rt,ut]=t.getImageData(0,0,1,1).data,ut!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:St.toRgba(At,Mt,Rt,ut),css:a}}e.toColor=s})(lt||(lt={}));var Gt;(e=>{function t(s){return n(s>>16&255,s>>8&255,s&255)}e.relativeLuminance=t;function n(s,a,u){let c=s/255,d=a/255,p=u/255,h=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4),g=d<=.03928?d/12.92:Math.pow((d+.055)/1.055,2.4),m=p<=.03928?p/12.92:Math.pow((p+.055)/1.055,2.4);return h*.2126+g*.7152+m*.0722}e.relativeLuminance2=n})(Gt||(Gt={}));var Wo;(e=>{function t(c,d){if(ut=(d&255)/255,ut===1)return d;let p=d>>24&255,h=d>>16&255,g=d>>8&255,m=c>>24&255,S=c>>16&255,y=c>>8&255;return At=m+Math.round((p-m)*ut),Mt=S+Math.round((h-S)*ut),Rt=y+Math.round((g-y)*ut),St.toRgba(At,Mt,Rt)}e.blend=t;function n(c,d,p){let h=Gt.relativeLuminance(c>>8),g=Gt.relativeLuminance(d>>8);if(wn(h,g)<p){if(g<h){let y=s(c,d,p),b=wn(h,Gt.relativeLuminance(y>>8));if(b<p){let C=a(c,d,p),B=wn(h,Gt.relativeLuminance(C>>8));return b>B?y:C}return y}let m=a(c,d,p),S=wn(h,Gt.relativeLuminance(m>>8));if(S<p){let y=s(c,d,p),b=wn(h,Gt.relativeLuminance(y>>8));return S>b?m:y}return m}}e.ensureContrastRatio=n;function s(c,d,p){let h=c>>24&255,g=c>>16&255,m=c>>8&255,S=d>>24&255,y=d>>16&255,b=d>>8&255,C=wn(Gt.relativeLuminance2(S,y,b),Gt.relativeLuminance2(h,g,m));for(;C<p&&(S>0||y>0||b>0);)S-=Math.max(0,Math.ceil(S*.1)),y-=Math.max(0,Math.ceil(y*.1)),b-=Math.max(0,Math.ceil(b*.1)),C=wn(Gt.relativeLuminance2(S,y,b),Gt.relativeLuminance2(h,g,m));return(S<<24|y<<16|b<<8|255)>>>0}e.reduceLuminance=s;function a(c,d,p){let h=c>>24&255,g=c>>16&255,m=c>>8&255,S=d>>24&255,y=d>>16&255,b=d>>8&255,C=wn(Gt.relativeLuminance2(S,y,b),Gt.relativeLuminance2(h,g,m));for(;C<p&&(S<255||y<255||b<255);)S=Math.min(255,S+Math.ceil((255-S)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),b=Math.min(255,b+Math.ceil((255-b)*.1)),C=wn(Gt.relativeLuminance2(S,y,b),Gt.relativeLuminance2(h,g,m));return(S<<24|y<<16|b<<8|255)>>>0}e.increaseLuminance=a;function u(c){return[c>>24&255,c>>16&255,c>>8&255,c&255]}e.toChannels=u})(Wo||(Wo={}));function Er(e){let t=e.toString(16);return t.length<2?"0"+t:t}function wn(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var Pw=class extends ra{constructor(e,t,n){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},$o=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new ji}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let n=[],s=t.translateToString(!0),a=0,u=0,c=0,d=t.getFg(0),p=t.getBg(0);for(let h=0;h<t.getTrimmedLength();h++)if(t.loadCell(h,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==d||this._workCell.bg!==p){if(h-a>1){let g=this._getJoinedRanges(s,c,u,t,a);for(let m=0;m<g.length;m++)n.push(g[m])}a=h,c=u,d=this._workCell.fg,p=this._workCell.bg}u+=this._workCell.getChars().length||sr.length}if(this._bufferService.cols-a>1){let h=this._getJoinedRanges(s,c,u,t,a);for(let g=0;g<h.length;g++)n.push(h[g])}return n}_getJoinedRanges(e,t,n,s,a){let u=e.substring(t,n),c=[];try{c=this._characterJoiners[0].handler(u)}catch(d){console.error(d)}for(let d=1;d<this._characterJoiners.length;d++)try{let p=this._characterJoiners[d].handler(u);for(let h=0;h<p.length;h++)$o._mergeRanges(c,p[h])}catch(p){console.error(p)}return this._stringRangesToCellRanges(c,s,a),c}_stringRangesToCellRanges(e,t,n){let s=0,a=!1,u=0,c=e[s];if(c){for(let d=n;d<this._bufferService.cols;d++){let p=t.getWidth(d),h=t.getString(d).length||sr.length;if(p!==0){if(!a&&c[0]<=u&&(c[0]=d,a=!0),c[1]<=u){if(c[1]=d,c=e[++s],!c)break;c[0]<=u?(c[0]=d,a=!0):a=!1}u+=h}}c&&(c[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let n=!1;for(let s=0;s<e.length;s++){let a=e[s];if(n){if(t[1]<=a[0])return e[s-1][1]=t[1],e;if(t[1]<=a[1])return e[s-1][1]=Math.max(t[1],a[1]),e.splice(s,1),e;e.splice(s,1),s--}else{if(t[1]<=a[0])return e.splice(s,0,t),e;if(t[1]<=a[1])return a[0]=Math.min(t[0],a[0]),e;t[0]<a[1]&&(a[0]=Math.min(t[0],a[0]),n=!0);continue}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};$o=ct([oe(0,Zt)],$o);function Iw(e){return 57508<=e&&e<=57558}function Fw(e){return 9472<=e&&e<=9631}function qw(e){return Iw(e)||Fw(e)}function Vw(){return{css:{canvas:Oo(),cell:Oo()},device:{canvas:Oo(),cell:Oo(),char:{width:0,height:0,left:0,top:0}}}}function Oo(){return{width:0,height:0}}var Of=class{constructor(e,t,n,s,a,u,c){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=s,this._coreService=a,this._decorationService=u,this._themeService=c,this._workCell=new ji,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,s,a,u,c,d,p,h,g){let m=[],S=this._characterJoinerService.getJoinedCharacters(t),y=this._themeService.colors,b=e.getNoBgTrimmedLength();n&&b<u+1&&(b=u+1);let C,B=0,A="",Z=0,P=0,ee=0,ne=0,z=!1,ie=0,ue=!1,_e=0,H=0,te=[],V=h!==-1&&g!==-1;for(let I=0;I<b;I++){e.loadCell(I,this._workCell);let K=this._workCell.getWidth();if(K===0)continue;let j=!1,M=I>=H,q=I,W=this._workCell;if(S.length>0&&I===S[0][0]&&M){let He=S.shift(),hi=this._isCellInSelection(He[0],t);for(Z=He[0]+1;Z<He[1];Z++)M&&(M=hi===this._isCellInSelection(Z,t));M&&(M=!n||u<He[0]||u>=He[1]),M?(j=!0,W=new Pw(this._workCell,e.translateToString(!0,He[0],He[1]),He[1]-He[0]),q=He[1]-1,K=W.getWidth()):H=He[1]}let fe=this._isCellInSelection(I,t),k=n&&I===u,D=V&&I>=h&&I<=g,Y=!1;this._decorationService.forEachDecorationAtCell(I,t,void 0,He=>{Y=!0});let w=W.getChars()||sr;if(w===" "&&(W.isUnderline()||W.isOverline())&&(w=" "),_e=K*d-p.get(w,W.isBold(),W.isItalic()),!C)C=this._document.createElement("span");else if(B&&(fe&&ue||!fe&&!ue&&W.bg===P)&&(fe&&ue&&y.selectionForeground||W.fg===ee)&&W.extended.ext===ne&&D===z&&_e===ie&&!k&&!j&&!Y&&M){W.isInvisible()?A+=sr:A+=w,B++;continue}else B&&(C.textContent=A),C=this._document.createElement("span"),B=0,A="";if(P=W.bg,ee=W.fg,ne=W.extended.ext,z=D,ie=_e,ue=fe,j&&u>=I&&u<=q&&(u=I),!this._coreService.isCursorHidden&&k&&this._coreService.isCursorInitialized){if(te.push("xterm-cursor"),this._coreBrowserService.isFocused)c&&te.push("xterm-cursor-blink"),te.push(s==="bar"?"xterm-cursor-bar":s==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(a)switch(a){case"outline":te.push("xterm-cursor-outline");break;case"block":te.push("xterm-cursor-block");break;case"bar":te.push("xterm-cursor-bar");break;case"underline":te.push("xterm-cursor-underline");break}}if(W.isBold()&&te.push("xterm-bold"),W.isItalic()&&te.push("xterm-italic"),W.isDim()&&te.push("xterm-dim"),W.isInvisible()?A=sr:A=W.getChars()||sr,W.isUnderline()&&(te.push(`xterm-underline-${W.extended.underlineStyle}`),A===" "&&(A=" "),!W.isUnderlineColorDefault()))if(W.isUnderlineColorRGB())C.style.textDecorationColor=`rgb(${ra.toColorRGB(W.getUnderlineColor()).join(",")})`;else{let He=W.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&W.isBold()&&He<8&&(He+=8),C.style.textDecorationColor=y.ansi[He].css}W.isOverline()&&(te.push("xterm-overline"),A===" "&&(A=" ")),W.isStrikethrough()&&te.push("xterm-strikethrough"),D&&(C.style.textDecoration="underline");let se=W.getFgColor(),de=W.getFgColorMode(),ce=W.getBgColor(),xe=W.getBgColorMode(),We=!!W.isInverse();if(We){let He=se;se=ce,ce=He;let hi=de;de=xe,xe=hi}let Ae,Ot,Wt=!1;this._decorationService.forEachDecorationAtCell(I,t,void 0,He=>{He.options.layer!=="top"&&Wt||(He.backgroundColorRGB&&(xe=50331648,ce=He.backgroundColorRGB.rgba>>8&16777215,Ae=He.backgroundColorRGB),He.foregroundColorRGB&&(de=50331648,se=He.foregroundColorRGB.rgba>>8&16777215,Ot=He.foregroundColorRGB),Wt=He.options.layer==="top")}),!Wt&&fe&&(Ae=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,ce=Ae.rgba>>8&16777215,xe=50331648,Wt=!0,y.selectionForeground&&(de=50331648,se=y.selectionForeground.rgba>>8&16777215,Ot=y.selectionForeground)),Wt&&te.push("xterm-decoration-top");let Jt;switch(xe){case 16777216:case 33554432:Jt=y.ansi[ce],te.push(`xterm-bg-${ce}`);break;case 50331648:Jt=St.toColor(ce>>16,ce>>8&255,ce&255),this._addStyle(C,`background-color:#${ov((ce>>>0).toString(16),"0",6)}`);break;case 0:default:We?(Jt=y.foreground,te.push("xterm-bg-257")):Jt=y.background}switch(Ae||W.isDim()&&(Ae=it.multiplyOpacity(Jt,.5)),de){case 16777216:case 33554432:W.isBold()&&se<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(se+=8),this._applyMinimumContrast(C,Jt,y.ansi[se],W,Ae,void 0)||te.push(`xterm-fg-${se}`);break;case 50331648:let He=St.toColor(se>>16&255,se>>8&255,se&255);this._applyMinimumContrast(C,Jt,He,W,Ae,Ot)||this._addStyle(C,`color:#${ov(se.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(C,Jt,y.foreground,W,Ae,Ot)||We&&te.push("xterm-fg-257")}te.length&&(C.className=te.join(" "),te.length=0),!k&&!j&&!Y&&M?B++:C.textContent=A,_e!==this.defaultSpacing&&(C.style.letterSpacing=`${_e}px`),m.push(C),I=q}return C&&B&&(C.textContent=A),m}_applyMinimumContrast(e,t,n,s,a,u){if(this._optionsService.rawOptions.minimumContrastRatio===1||qw(s.getCode()))return!1;let c=this._getContrastCache(s),d;if(!a&&!u&&(d=c.getColor(t.rgba,n.rgba)),d===void 0){let p=this._optionsService.rawOptions.minimumContrastRatio/(s.isDim()?2:1);d=it.ensureContrastRatio(a||t,u||n,p),c.setColor((a||t).rgba,(u||n).rgba,d??null)}return d?(this._addStyle(e,`color:${d.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let n=this._selectionStart,s=this._selectionEnd;return!n||!s?!1:this._columnSelectMode?n[0]<=s[0]?e>=n[0]&&t>=n[1]&&e<s[0]&&t<=s[1]:e<n[0]&&t>=n[1]&&e>=s[0]&&t<=s[1]:t>n[1]&&t<s[1]||n[1]===s[1]&&t===n[1]&&e>=n[0]&&e<s[0]||n[1]<s[1]&&t===s[1]&&e<s[0]||n[1]<s[1]&&t===n[1]&&e>=n[0]}};Of=ct([oe(1,Iy),oe(2,Qt),oe(3,kn),oe(4,Nr),oe(5,sa),oe(6,Ls)],Of);function ov(e,t,n){for(;e.length<n;)e=t+e;return e}var Ww=class{constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let n=e.createElement("span");n.classList.add("xterm-char-measure-element");let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontWeight="bold";let a=e.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontStyle="italic";let u=e.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold",u.style.fontStyle="italic",this._measureElements=[n,s,a,u],this._container.appendChild(n),this._container.appendChild(s),this._container.appendChild(a),this._container.appendChild(u),t.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,n,s){e===this._font&&t===this._fontSize&&n===this._weight&&s===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=s,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${s}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${s}`,this.clear())}get(e,t,n){let s=0;if(!t&&!n&&e.length===1&&(s=e.charCodeAt(0))<256){if(this._flat[s]!==-9999)return this._flat[s];let c=this._measure(e,0);return c>0&&(this._flat[s]=c),c}let a=e;t&&(a+="B"),n&&(a+="I");let u=this._holey.get(a);if(u===void 0){let c=0;t&&(c|=1),n&&(c|=2),u=this._measure(e,c),u>0&&this._holey.set(a,u)}return u}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}},Yw=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,n,s=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1]){this.clear();return}let a=e.buffers.active.ydisp,u=t[1]-a,c=n[1]-a,d=Math.max(u,0),p=Math.min(c,e.rows-1);if(d>=e.rows||p<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=s,this.viewportStartRow=u,this.viewportEndRow=c,this.viewportCappedStartRow=d,this.viewportCappedEndRow=p,this.startCol=t[0],this.endCol=n[0]}isCellSelected(e,t,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&n>=this.viewportCappedStartRow&&t<this.endCol&&n<=this.viewportCappedEndRow:t<this.startCol&&n>=this.viewportCappedStartRow&&t>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol):!1}};function Kw(){return new Yw}var Uh="xterm-dom-renderer-owner-",zi="xterm-rows",zo="xterm-fg-",uv="xterm-bg-",zl="xterm-focus",Lo="xterm-selection",Xw=1,zf=class extends De{constructor(e,t,n,s,a,u,c,d,p,h,g,m,S,y){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=s,this._viewportElement=a,this._helperContainer=u,this._linkifier2=c,this._charSizeService=p,this._optionsService=h,this._bufferService=g,this._coreService=m,this._coreBrowserService=S,this._themeService=y,this._terminalClass=Xw++,this._rowElements=[],this._selectionRenderModel=Kw(),this.onRequestRedraw=this._register(new le).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(zi),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(Lo),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=Vw(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(b=>this._injectCss(b))),this._injectCss(this._themeService.colors),this._rowFactory=d.createInstance(Of,document),this._element.classList.add(Uh+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(b=>this._handleLinkHover(b))),this._register(this._linkifier2.onHideLinkUnderline(b=>this._handleLinkLeave(b))),this._register(rt(()=>{this._element.classList.remove(Uh+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new Ww(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let n of this._rowElements)n.style.width=`${this.dimensions.css.canvas.width}px`,n.style.height=`${this.dimensions.css.cell.height}px`,n.style.lineHeight=`${this.dimensions.css.cell.height}px`,n.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${zi} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${zi} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${zi} .xterm-dim { color: ${it.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let n=`blink_underline_${this._terminalClass}`,s=`blink_bar_${this._terminalClass}`,a=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${s} { 50% { box-shadow: none; }}`,t+=`@keyframes ${a} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${zi}.${zl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${zi}.${zl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${zi}.${zl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${a} 1s step-end infinite;}${this._terminalSelector} .${zi} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${zi} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${zi} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${zi} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${zi} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Lo} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Lo} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Lo} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[u,c]of e.ansi.entries())t+=`${this._terminalSelector} .${zo}${u} { color: ${c.css}; }${this._terminalSelector} .${zo}${u}.xterm-dim { color: ${it.multiplyOpacity(c,.5).css}; }${this._terminalSelector} .${uv}${u} { background-color: ${c.css}; }`;t+=`${this._terminalSelector} .${zo}257 { color: ${it.opaque(e.background).css}; }${this._terminalSelector} .${zo}257.xterm-dim { color: ${it.multiplyOpacity(it.opaque(e.background),.5).css}; }${this._terminalSelector} .${uv}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let n=this._rowElements.length;n<=t;n++){let s=this._document.createElement("div");this._rowContainer.appendChild(s),this._rowElements.push(s)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(zl),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(zl),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,n),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,n),!this._selectionRenderModel.hasSelection))return;let s=this._selectionRenderModel.viewportStartRow,a=this._selectionRenderModel.viewportEndRow,u=this._selectionRenderModel.viewportCappedStartRow,c=this._selectionRenderModel.viewportCappedEndRow,d=this._document.createDocumentFragment();if(n){let p=e[0]>t[0];d.appendChild(this._createSelectionElement(u,p?t[0]:e[0],p?e[0]:t[0],c-u+1))}else{let p=s===u?e[0]:0,h=u===a?t[0]:this._bufferService.cols;d.appendChild(this._createSelectionElement(u,p,h));let g=c-u-1;if(d.appendChild(this._createSelectionElement(u+1,0,this._bufferService.cols,g)),u!==c){let m=a===c?t[0]:this._bufferService.cols;d.appendChild(this._createSelectionElement(c,0,m))}}this._selectionContainer.appendChild(d)}_createSelectionElement(e,t,n,s=1){let a=this._document.createElement("div"),u=t*this.dimensions.css.cell.width,c=this.dimensions.css.cell.width*(n-t);return u+c>this.dimensions.css.canvas.width&&(c=this.dimensions.css.canvas.width-u),a.style.height=`${s*this.dimensions.css.cell.height}px`,a.style.top=`${e*this.dimensions.css.cell.height}px`,a.style.left=`${u}px`,a.style.width=`${c}px`,a}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let n=this._bufferService.buffer,s=n.ybase+n.y,a=Math.min(n.x,this._bufferService.cols-1),u=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,c=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,d=this._optionsService.rawOptions.cursorInactiveStyle;for(let p=e;p<=t;p++){let h=p+n.ydisp,g=this._rowElements[p],m=n.lines.get(h);if(!g||!m)break;g.replaceChildren(...this._rowFactory.createRow(m,h,h===s,c,d,a,u,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Uh}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,n,s,a,u){n<0&&(e=0),s<0&&(t=0);let c=this._bufferService.rows-1;n=Math.max(Math.min(n,c),0),s=Math.max(Math.min(s,c),0),a=Math.min(a,this._bufferService.cols);let d=this._bufferService.buffer,p=d.ybase+d.y,h=Math.min(d.x,a-1),g=this._optionsService.rawOptions.cursorBlink,m=this._optionsService.rawOptions.cursorStyle,S=this._optionsService.rawOptions.cursorInactiveStyle;for(let y=n;y<=s;++y){let b=y+d.ydisp,C=this._rowElements[y],B=d.lines.get(b);if(!C||!B)break;C.replaceChildren(...this._rowFactory.createRow(B,b,b===p,m,S,h,g,this.dimensions.css.cell.width,this._widthCache,u?y===n?e:0:-1,u?(y===s?t:a)-1:-1))}}};zf=ct([oe(7,ld),oe(8,su),oe(9,Qt),oe(10,Zt),oe(11,Nr),oe(12,kn),oe(13,Ls)],zf);var Lf=class extends De{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new le),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new $w(this._optionsService))}catch{this._measureStrategy=this._register(new Gw(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};Lf=ct([oe(2,Qt)],Lf);var lS=class extends De{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},Gw=class extends lS{constructor(e,t,n){super(),this._document=e,this._parentElement=t,this._optionsService=n,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},$w=class extends lS{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},Zw=class extends De{constructor(e,t,n){super(),this._textarea=e,this._window=t,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new Qw(this._window)),this._onDprChange=this._register(new le),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new le),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(s=>this._screenDprMonitor.setWindow(s))),this._register(Pt.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(be(this._textarea,"focus",()=>this._isFocused=!0)),this._register(be(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},Qw=class extends De{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Os),this._onDprChange=this._register(new le),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(rt(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=be(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var e;this._outerListener&&((e=this._resolutionMediaMatchList)==null||e.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},Jw=class extends De{constructor(){super(),this.linkProviders=[],this._register(rt(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function pd(e,t,n){let s=n.getBoundingClientRect(),a=e.getComputedStyle(n),u=parseInt(a.getPropertyValue("padding-left")),c=parseInt(a.getPropertyValue("padding-top"));return[t.clientX-s.left-u,t.clientY-s.top-c]}function eC(e,t,n,s,a,u,c,d,p){if(!u)return;let h=pd(e,t,n);if(h)return h[0]=Math.ceil((h[0]+(p?c/2:0))/c),h[1]=Math.ceil(h[1]/d),h[0]=Math.min(Math.max(h[0],1),s+(p?1:0)),h[1]=Math.min(Math.max(h[1],1),a),h}var Nf=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,s,a){return eC(window,e,t,n,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,a)}getMouseReportCoords(e,t){let n=pd(window,e,t);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};Nf=ct([oe(0,En),oe(1,su)],Nf);var tC=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,n){this._rowCount=n,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},aS={};hx(aS,{getSafariVersion:()=>nC,isChromeOS:()=>hS,isFirefox:()=>oS,isIpad:()=>rC,isIphone:()=>sC,isLegacyEdge:()=>iC,isLinux:()=>_d,isMac:()=>Zo,isNode:()=>lu,isSafari:()=>uS,isWindows:()=>cS});var lu=typeof process<"u"&&"title"in process,la=lu?"node":navigator.userAgent,aa=lu?"node":navigator.platform,oS=la.includes("Firefox"),iC=la.includes("Edge"),uS=/^((?!chrome|android).)*safari/i.test(la);function nC(){if(!uS)return 0;let e=la.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var Zo=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(aa),rC=aa==="iPad",sC=aa==="iPhone",cS=["Windows","Win16","Win32","WinCE"].includes(aa),_d=aa.indexOf("Linux")>=0,hS=/\bCrOS\b/.test(la),fS=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let t=0,n=0,s=e.timeRemaining(),a=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),n=Math.max(t,n),a=e.timeRemaining(),n*1.5>a){s-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-t))}ms`),this._start();return}s=a}this.clear()}},lC=class extends fS{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},aC=class extends fS{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},Qo=!lu&&"requestIdleCallback"in window?aC:lC,oC=class{constructor(){this._queue=new Qo}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},Hf=class extends De{constructor(e,t,n,s,a,u,c,d,p){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=s,this._coreService=a,this._coreBrowserService=d,this._renderer=this._register(new Os),this._pausedResizeTask=new oC,this._observerDisposable=this._register(new Os),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new le),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new le),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new le),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new le),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new tC((h,g)=>this._renderRows(h,g),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new uC(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(rt(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(c.onResize(()=>this._fullRefresh())),this._register(c.buffers.onBufferActivate(()=>{var h;return(h=this._renderer.value)==null?void 0:h.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(u.onDecorationRegistered(()=>this._fullRefresh())),this._register(u.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(c.cols,c.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(c.buffer.y,c.buffer.y,!0))),this._register(p.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(h=>this._registerIntersectionObserver(h,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let n=new e.IntersectionObserver(s=>this._handleIntersectionChange(s[s.length-1]),{threshold:0});n.observe(t),this._observerDisposable.value=rt(()=>n.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let s=this._syncOutputHandler.flush();s&&(e=Math.min(e,s.start),t=Math.max(t,s.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,t;this._renderer.value&&((t=(e=this._renderer.value).clearTextureAtlas)==null||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var n;return(n=this._renderer.value)==null?void 0:n.handleResize(e,t)}):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,t,n){var s;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,(s=this._renderer.value)==null||s.handleSelectionChanged(e,t,n)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};Hf=ct([oe(2,Qt),oe(3,su),oe(4,Nr),oe(5,sa),oe(6,Zt),oe(7,kn),oe(8,Ls)],Hf);var uC=class{constructor(e,t,n){this._coreBrowserService=e,this._coreService=t,this._onTimeout=n,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function cC(e,t,n,s){let a=n.buffer.x,u=n.buffer.y;if(!n.buffer.hasScrollback)return dC(a,u,e,t,n,s)+au(u,t,n,s)+pC(a,u,e,t,n,s);let c;if(u===t)return c=a>e?"D":"C",Jl(Math.abs(a-e),Ql(c,s));c=u>t?"D":"C";let d=Math.abs(u-t),p=fC(u>t?e:a,n)+(d-1)*n.cols+1+hC(u>t?a:e);return Jl(p,Ql(c,s))}function hC(e,t){return e-1}function fC(e,t){return t.cols-e}function dC(e,t,n,s,a,u){return au(t,s,a,u).length===0?"":Jl(pS(e,t,e,t-zr(t,a),!1,a).length,Ql("D",u))}function au(e,t,n,s){let a=e-zr(e,n),u=t-zr(t,n),c=Math.abs(a-u)-_C(e,t,n);return Jl(c,Ql(dS(e,t),s))}function pC(e,t,n,s,a,u){let c;au(t,s,a,u).length>0?c=s-zr(s,a):c=t;let d=s,p=mC(e,t,n,s,a,u);return Jl(pS(e,c,n,d,p==="C",a).length,Ql(p,u))}function _C(e,t,n){var c;let s=0,a=e-zr(e,n),u=t-zr(t,n);for(let d=0;d<Math.abs(a-u);d++){let p=dS(e,t)==="A"?-1:1;(c=n.buffer.lines.get(a+p*d))!=null&&c.isWrapped&&s++}return s}function zr(e,t){let n=0,s=t.buffer.lines.get(e),a=s==null?void 0:s.isWrapped;for(;a&&e>=0&&e<t.rows;)n++,s=t.buffer.lines.get(--e),a=s==null?void 0:s.isWrapped;return n}function mC(e,t,n,s,a,u){let c;return au(n,s,a,u).length>0?c=s-zr(s,a):c=t,e<n&&c<=s||e>=n&&c<s?"C":"D"}function dS(e,t){return e>t?"A":"B"}function pS(e,t,n,s,a,u){let c=e,d=t,p="";for(;(c!==n||d!==s)&&d>=0&&d<u.buffer.lines.length;)c+=a?1:-1,a&&c>u.cols-1?(p+=u.buffer.translateBufferLineToString(d,!1,e,c),c=0,e=0,d++):!a&&c<0&&(p+=u.buffer.translateBufferLineToString(d,!1,0,e+1),c=u.cols-1,e=c,d--);return p+u.buffer.translateBufferLineToString(d,!1,e,c)}function Ql(e,t){let n=t?"O":"[";return J.ESC+n+e}function Jl(e,t){e=Math.floor(e);let n="";for(let s=0;s<e;s++)n+=t;return n}var gC=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:!this.selectionEnd||!this.selectionStart?this.selectionStart:this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function cv(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var Ph=50,vC=15,yC=50,SC=500,bC=" ",xC=new RegExp(bC,"g"),jf=class extends De{constructor(e,t,n,s,a,u,c,d,p){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=s,this._coreService=a,this._mouseService=u,this._optionsService=c,this._renderService=d,this._coreBrowserService=p,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new ji,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new le),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new le),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new le),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new le),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=h=>this._handleMouseMove(h),this._mouseUpListener=h=>this._handleMouseUp(h),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(h=>this._handleTrim(h)),this._register(this._bufferService.buffers.onBufferActivate(h=>this._handleBufferActivate(h))),this.enable(),this._model=new gC(this._bufferService),this._activeSelectionMode=0,this._register(rt(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(h=>{h.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let n=this._bufferService.buffer,s=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let a=e[0]<t[0]?e[0]:t[0],u=e[0]<t[0]?t[0]:e[0];for(let c=e[1];c<=t[1];c++){let d=n.translateBufferLineToString(c,!0,a,u);s.push(d)}}else{let a=e[1]===t[1]?t[0]:void 0;s.push(n.translateBufferLineToString(e[1],!0,e[0],a));for(let u=e[1]+1;u<=t[1]-1;u++){let c=n.lines.get(u),d=n.translateBufferLineToString(u,!0);c!=null&&c.isWrapped?s[s.length-1]+=d:s.push(d)}if(e[1]!==t[1]){let u=n.lines.get(t[1]),c=n.translateBufferLineToString(t[1],!0,0,t[0]);u&&u.isWrapped?s[s.length-1]+=c:s.push(c)}}return s.map(a=>a.replace(xC," ")).join(cS?`\r
|
|
71
|
-
`:`
|
|
72
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),_d&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!n||!s||!t?!1:this._areCoordsInSelection(t,n,s)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!n||!s?!1:this._areCoordsInSelection([e,t],n,s)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){var a,u;let n=(u=(a=this._linkifier.currentLink)==null?void 0:a.link)==null?void 0:u.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=cv(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let s=this._getMouseBufferCoords(e);return s?(this._selectWordAt(s,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=pd(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-Ph),Ph),t/=Ph,t/Math.abs(t)+Math.round(t*(vC-1)))}shouldForceSelection(e){return Zo?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),yC)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(Zo&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let s=n.lines.get(this._model.selectionEnd[1]);s&&s.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[1]!==this._model.selectionEnd[1])&&this.refresh(!0)}_dragScroll(){if(!(!this._model.selectionEnd||!this._model.selectionStart)&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<SC&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let n=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(n&&n[0]!==void 0&&n[1]!==void 0){let s=cC(n[0]-1,n[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(s,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,n=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!n){this._oldHasSelection&&this._fireOnSelectionChange(e,t,n);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,n)}_fireOnSelectionChange(e,t,n){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let n=t;for(let s=0;t>=s;s++){let a=e.loadCell(s,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:a>1&&t!==s&&(n+=a-1)}return n}setSelection(e,t,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,n=!0,s=!0){if(e[0]>=this._bufferService.cols)return;let a=this._bufferService.buffer,u=a.lines.get(e[1]);if(!u)return;let c=a.translateBufferLineToString(e[1],!1),d=this._convertViewportColToCharacterIndex(u,e[0]),p=d,h=e[0]-d,g=0,m=0,S=0,y=0;if(c.charAt(d)===" "){for(;d>0&&c.charAt(d-1)===" ";)d--;for(;p<c.length&&c.charAt(p+1)===" ";)p++}else{let B=e[0],A=e[0];u.getWidth(B)===0&&(g++,B--),u.getWidth(A)===2&&(m++,A++);let Z=u.getString(A).length;for(Z>1&&(y+=Z-1,p+=Z-1);B>0&&d>0&&!this._isCharWordSeparator(u.loadCell(B-1,this._workCell));){u.loadCell(B-1,this._workCell);let P=this._workCell.getChars().length;this._workCell.getWidth()===0?(g++,B--):P>1&&(S+=P-1,d-=P-1),d--,B--}for(;A<u.length&&p+1<c.length&&!this._isCharWordSeparator(u.loadCell(A+1,this._workCell));){u.loadCell(A+1,this._workCell);let P=this._workCell.getChars().length;this._workCell.getWidth()===2?(m++,A++):P>1&&(y+=P-1,p+=P-1),p++,A++}}p++;let b=d+h-g+S,C=Math.min(this._bufferService.cols,p-d+g+m-S-y);if(!(!t&&c.slice(d,p).trim()==="")){if(n&&b===0&&u.getCodePoint(0)!==32){let B=a.lines.get(e[1]-1);if(B&&u.isWrapped&&B.getCodePoint(this._bufferService.cols-1)!==32){let A=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(A){let Z=this._bufferService.cols-A.start;b-=Z,C+=Z}}}if(s&&b+C===this._bufferService.cols&&u.getCodePoint(this._bufferService.cols-1)!==32){let B=a.lines.get(e[1]+1);if(B!=null&&B.isWrapped&&B.getCodePoint(0)!==32){let A=this._getWordAt([0,e[1]+1],!1,!1,!0);A&&(C+=A.length)}}return{start:b,length:C}}}_selectWordAt(e,t){let n=this._getWordAt(e,t);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let n=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,n]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=cv(n,this._bufferService.cols)}};jf=ct([oe(3,Zt),oe(4,Nr),oe(5,ad),oe(6,Qt),oe(7,En),oe(8,kn)],jf);var hv=class{constructor(){this._data={}}set(e,t,n){this._data[e]||(this._data[e]={}),this._data[e][t]=n}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},fv=class{constructor(){this._color=new hv,this._css=new hv}setCss(e,t,n){this._css.set(e,t,n)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,n){this._color.set(e,t,n)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},wt=Object.freeze((()=>{let e=[lt.toColor("#2e3436"),lt.toColor("#cc0000"),lt.toColor("#4e9a06"),lt.toColor("#c4a000"),lt.toColor("#3465a4"),lt.toColor("#75507b"),lt.toColor("#06989a"),lt.toColor("#d3d7cf"),lt.toColor("#555753"),lt.toColor("#ef2929"),lt.toColor("#8ae234"),lt.toColor("#fce94f"),lt.toColor("#729fcf"),lt.toColor("#ad7fa8"),lt.toColor("#34e2e2"),lt.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let s=t[n/36%6|0],a=t[n/6%6|0],u=t[n%6];e.push({css:St.toCss(s,a,u),rgba:St.toRgba(s,a,u)})}for(let n=0;n<24;n++){let s=8+n*10;e.push({css:St.toCss(s,s,s),rgba:St.toRgba(s,s,s)})}return e})()),Ar=lt.toColor("#ffffff"),Vl=lt.toColor("#000000"),dv=lt.toColor("#ffffff"),pv=Vl,Ll={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},wC=Ar,Uf=class extends De{constructor(e){super(),this._optionsService=e,this._contrastCache=new fv,this._halfContrastCache=new fv,this._onChangeColors=this._register(new le),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Ar,background:Vl,cursor:dv,cursorAccent:pv,selectionForeground:void 0,selectionBackgroundTransparent:Ll,selectionBackgroundOpaque:it.blend(Vl,Ll),selectionInactiveBackgroundTransparent:Ll,selectionInactiveBackgroundOpaque:it.blend(Vl,Ll),scrollbarSliderBackground:it.opacity(Ar,.2),scrollbarSliderHoverBackground:it.opacity(Ar,.4),scrollbarSliderActiveBackground:it.opacity(Ar,.5),overviewRulerBorder:Ar,ansi:wt.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=Ge(e.foreground,Ar),t.background=Ge(e.background,Vl),t.cursor=it.blend(t.background,Ge(e.cursor,dv)),t.cursorAccent=it.blend(t.background,Ge(e.cursorAccent,pv)),t.selectionBackgroundTransparent=Ge(e.selectionBackground,Ll),t.selectionBackgroundOpaque=it.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=Ge(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=it.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?Ge(e.selectionForeground,av):void 0,t.selectionForeground===av&&(t.selectionForeground=void 0),it.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=it.opacity(t.selectionBackgroundTransparent,.3)),it.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=it.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=Ge(e.scrollbarSliderBackground,it.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=Ge(e.scrollbarSliderHoverBackground,it.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=Ge(e.scrollbarSliderActiveBackground,it.opacity(t.foreground,.5)),t.overviewRulerBorder=Ge(e.overviewRulerBorder,wC),t.ansi=wt.slice(),t.ansi[0]=Ge(e.black,wt[0]),t.ansi[1]=Ge(e.red,wt[1]),t.ansi[2]=Ge(e.green,wt[2]),t.ansi[3]=Ge(e.yellow,wt[3]),t.ansi[4]=Ge(e.blue,wt[4]),t.ansi[5]=Ge(e.magenta,wt[5]),t.ansi[6]=Ge(e.cyan,wt[6]),t.ansi[7]=Ge(e.white,wt[7]),t.ansi[8]=Ge(e.brightBlack,wt[8]),t.ansi[9]=Ge(e.brightRed,wt[9]),t.ansi[10]=Ge(e.brightGreen,wt[10]),t.ansi[11]=Ge(e.brightYellow,wt[11]),t.ansi[12]=Ge(e.brightBlue,wt[12]),t.ansi[13]=Ge(e.brightMagenta,wt[13]),t.ansi[14]=Ge(e.brightCyan,wt[14]),t.ansi[15]=Ge(e.brightWhite,wt[15]),e.extendedAnsi){let n=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let s=0;s<n;s++)t.ansi[s+16]=Ge(e.extendedAnsi[s],wt[s+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};Uf=ct([oe(0,Qt)],Uf);function Ge(e,t){if(e!==void 0)try{return lt.toColor(e)}catch{}return t}var CC=class{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){let n=this._entries.get(e);return this._entries.set(e,t),n}forEach(e){for(let[t,n]of this._entries.entries())e(t,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},kC=class{constructor(){this._services=new CC,this._services.set(ld,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=vx(e).sort((u,c)=>u.index-c.index),s=[];for(let u of n){let c=this._services.get(u.id);if(!c)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${u.id._id}.`);s.push(c)}let a=n.length>0?n[0].index:t.length;if(t.length!==a)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${a+1} conflicts with ${t.length} static arguments`);return new e(...t,...s)}},EC={trace:0,debug:1,info:2,warn:3,error:4,off:5},TC="xterm.js: ",Pf=class extends De{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=EC[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?"":TC)+t,...n)}trace(e,...t){var n;this._logLevel<=0&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.trace.bind(this._optionsService.options.logger))??console.log,e,t)}debug(e,...t){var n;this._logLevel<=1&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.debug.bind(this._optionsService.options.logger))??console.log,e,t)}info(e,...t){var n;this._logLevel<=2&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.info.bind(this._optionsService.options.logger))??console.info,e,t)}warn(e,...t){var n;this._logLevel<=3&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.warn.bind(this._optionsService.options.logger))??console.warn,e,t)}error(e,...t){var n;this._logLevel<=4&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.error.bind(this._optionsService.options.logger))??console.error,e,t)}};Pf=ct([oe(0,Qt)],Pf);var _v=class extends De{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new le),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new le),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new le),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let n=0;n<Math.min(e,this.length);n++)t[n]=this._array[this._getCyclicIndex(n)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...n){if(t){for(let s=e;s<this._length-t;s++)this._array[this._getCyclicIndex(s)]=this._array[this._getCyclicIndex(s+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let s=this._length-1;s>=e;s--)this._array[this._getCyclicIndex(s+n.length)]=this._array[this._getCyclicIndex(s)];for(let s=0;s<n.length;s++)this._array[this._getCyclicIndex(e+s)]=n[s];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let s=this._length+n.length-this._maxLength;this._startIndex+=s,this._length=this._maxLength,this.onTrimEmitter.fire(s)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,n){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+n<0)throw new Error("Cannot shift elements in list beyond index 0");if(n>0){for(let a=t-1;a>=0;a--)this.set(e+a+n,this.get(e+a));let s=e+t+n-this._length;if(s>0)for(this._length+=s;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let s=0;s<t;s++)this.set(e+s+n,this.get(e+s))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Te=3,yt=Object.freeze(new ra),No=0,Ih=2,Wl=class _S{constructor(t,n,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Te);let a=n||ji.fromCharData([0,zy,1,0]);for(let u=0;u<t;++u)this.setCell(u,a);this.length=t}get(t){let n=this._data[t*Te+0],s=n&2097151;return[this._data[t*Te+1],n&2097152?this._combined[t]:s?nr(s):"",n>>22,n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):s]}set(t,n){this._data[t*Te+1]=n[0],n[1].length>1?(this._combined[t]=n[1],this._data[t*Te+0]=t|2097152|n[2]<<22):this._data[t*Te+0]=n[1].charCodeAt(0)|n[2]<<22}getWidth(t){return this._data[t*Te+0]>>22}hasWidth(t){return this._data[t*Te+0]&12582912}getFg(t){return this._data[t*Te+1]}getBg(t){return this._data[t*Te+2]}hasContent(t){return this._data[t*Te+0]&4194303}getCodePoint(t){let n=this._data[t*Te+0];return n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n&2097151}isCombined(t){return this._data[t*Te+0]&2097152}getString(t){let n=this._data[t*Te+0];return n&2097152?this._combined[t]:n&2097151?nr(n&2097151):""}isProtected(t){return this._data[t*Te+2]&536870912}loadCell(t,n){return No=t*Te,n.content=this._data[No+0],n.fg=this._data[No+1],n.bg=this._data[No+2],n.content&2097152&&(n.combinedData=this._combined[t]),n.bg&268435456&&(n.extended=this._extendedAttrs[t]),n}setCell(t,n){n.content&2097152&&(this._combined[t]=n.combinedData),n.bg&268435456&&(this._extendedAttrs[t]=n.extended),this._data[t*Te+0]=n.content,this._data[t*Te+1]=n.fg,this._data[t*Te+2]=n.bg}setCellFromCodepoint(t,n,s,a){a.bg&268435456&&(this._extendedAttrs[t]=a.extended),this._data[t*Te+0]=n|s<<22,this._data[t*Te+1]=a.fg,this._data[t*Te+2]=a.bg}addCodepointToCell(t,n,s){let a=this._data[t*Te+0];a&2097152?this._combined[t]+=nr(n):a&2097151?(this._combined[t]=nr(a&2097151)+nr(n),a&=-2097152,a|=2097152):a=n|1<<22,s&&(a&=-12582913,a|=s<<22),this._data[t*Te+0]=a}insertCells(t,n,s){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),n<this.length-t){let a=new ji;for(let u=this.length-t-n-1;u>=0;--u)this.setCell(t+n+u,this.loadCell(t+u,a));for(let u=0;u<n;++u)this.setCell(t+u,s)}else for(let a=t;a<this.length;++a)this.setCell(a,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(t,n,s){if(t%=this.length,n<this.length-t){let a=new ji;for(let u=0;u<this.length-t-n;++u)this.setCell(t+u,this.loadCell(t+n+u,a));for(let u=this.length-n;u<this.length;++u)this.setCell(u,s)}else for(let a=t;a<this.length;++a)this.setCell(a,s);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,s)}replaceCells(t,n,s,a=!1){if(a){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,s),n<this.length&&this.getWidth(n-1)===2&&!this.isProtected(n)&&this.setCellFromCodepoint(n,0,1,s);t<n&&t<this.length;)this.isProtected(t)||this.setCell(t,s),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),n<this.length&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n,0,1,s);t<n&&t<this.length;)this.setCell(t++,s)}resize(t,n){if(t===this.length)return this._data.length*4*Ih<this._data.buffer.byteLength;let s=t*Te;if(t>this.length){if(this._data.buffer.byteLength>=s*4)this._data=new Uint32Array(this._data.buffer,0,s);else{let a=new Uint32Array(s);a.set(this._data),this._data=a}for(let a=this.length;a<t;++a)this.setCell(a,n)}else{this._data=this._data.subarray(0,s);let a=Object.keys(this._combined);for(let c=0;c<a.length;c++){let d=parseInt(a[c],10);d>=t&&delete this._combined[d]}let u=Object.keys(this._extendedAttrs);for(let c=0;c<u.length;c++){let d=parseInt(u[c],10);d>=t&&delete this._extendedAttrs[d]}}return this.length=t,s*4*Ih<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Ih<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,n=!1){if(n){for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,t);return}this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let n in t._combined)this._combined[n]=t._combined[n];this._extendedAttrs={};for(let n in t._extendedAttrs)this._extendedAttrs[n]=t._extendedAttrs[n];this.isWrapped=t.isWrapped}clone(){let t=new _S(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let n in this._combined)t._combined[n]=this._combined[n];for(let n in this._extendedAttrs)t._extendedAttrs[n]=this._extendedAttrs[n];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Te+0]&4194303)return t+(this._data[t*Te+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Te+0]&4194303||this._data[t*Te+2]&50331648)return t+(this._data[t*Te+0]>>22);return 0}copyCellsFrom(t,n,s,a,u){let c=t._data;if(u)for(let p=a-1;p>=0;p--){for(let h=0;h<Te;h++)this._data[(s+p)*Te+h]=c[(n+p)*Te+h];c[(n+p)*Te+2]&268435456&&(this._extendedAttrs[s+p]=t._extendedAttrs[n+p])}else for(let p=0;p<a;p++){for(let h=0;h<Te;h++)this._data[(s+p)*Te+h]=c[(n+p)*Te+h];c[(n+p)*Te+2]&268435456&&(this._extendedAttrs[s+p]=t._extendedAttrs[n+p])}let d=Object.keys(t._combined);for(let p=0;p<d.length;p++){let h=parseInt(d[p],10);h>=n&&(this._combined[h-n+s]=t._combined[h])}}translateToString(t,n,s,a){n=n??0,s=s??this.length,t&&(s=Math.min(s,this.getTrimmedLength())),a&&(a.length=0);let u="";for(;n<s;){let c=this._data[n*Te+0],d=c&2097151,p=c&2097152?this._combined[n]:d?nr(d):sr;if(u+=p,a)for(let h=0;h<p.length;++h)a.push(n);n+=c>>22||1}return a&&a.push(n),u}};function DC(e,t,n,s,a,u){let c=[];for(let d=0;d<e.length-1;d++){let p=d,h=e.get(++p);if(!h.isWrapped)continue;let g=[e.get(d)];for(;p<e.length&&h.isWrapped;)g.push(h),h=e.get(++p);if(!u&&s>=d&&s<p){d+=g.length-1;continue}let m=0,S=ea(g,m,t),y=1,b=0;for(;y<g.length;){let B=ea(g,y,t),A=B-b,Z=n-S,P=Math.min(A,Z);g[m].copyCellsFrom(g[y],b,S,P,!1),S+=P,S===n&&(m++,S=0),b+=P,b===B&&(y++,b=0),S===0&&m!==0&&g[m-1].getWidth(n-1)===2&&(g[m].copyCellsFrom(g[m-1],n-1,S++,1,!1),g[m-1].setCell(n-1,a))}g[m].replaceCells(S,n,a);let C=0;for(let B=g.length-1;B>0&&(B>m||g[B].getTrimmedLength()===0);B--)C++;C>0&&(c.push(d+g.length-C),c.push(C)),d+=g.length-1}return c}function AC(e,t){let n=[],s=0,a=t[s],u=0;for(let c=0;c<e.length;c++)if(a===c){let d=t[++s];e.onDeleteEmitter.fire({index:c-u,amount:d}),c+=d-1,u+=d,a=t[++s]}else n.push(c);return{layout:n,countRemoved:u}}function MC(e,t){let n=[];for(let s=0;s<t.length;s++)n.push(e.get(t[s]));for(let s=0;s<n.length;s++)e.set(s,n[s]);e.length=t.length}function RC(e,t,n){let s=[],a=e.map((p,h)=>ea(e,h,t)).reduce((p,h)=>p+h),u=0,c=0,d=0;for(;d<a;){if(a-d<n){s.push(a-d);break}u+=n;let p=ea(e,c,t);u>p&&(u-=p,c++);let h=e[c].getWidth(u-1)===2;h&&u--;let g=h?n-1:n;s.push(g),d+=g}return s}function ea(e,t,n){if(t===e.length-1)return e[t].getTrimmedLength();let s=!e[t].hasContent(n-1)&&e[t].getWidth(n-1)===1,a=e[t+1].getWidth(0)===2;return s&&a?n-1:n}var mS=class gS{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=gS._nextId++,this._onDispose=this.register(new le),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Or(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};mS._nextId=1;var BC=mS,kt={},Mr=kt.B;kt[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"};kt.A={"#":"£"};kt.B=void 0;kt[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};kt.C=kt[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};kt.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};kt.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};kt.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};kt.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};kt.E=kt[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};kt.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};kt.H=kt[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};kt["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var mv=4294967295,gv=class{constructor(e,t,n){this._hasScrollback=e,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=yt.clone(),this.savedCharset=Mr,this.markers=[],this._nullCell=ji.fromCharData([0,zy,1,0]),this._whitespaceCell=ji.fromCharData([0,sr,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new Qo,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new _v(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new Xo),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new Xo),this._whitespaceCell}getBlankLine(e,t){return new Wl(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>mv?mv:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=yt);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new _v(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(yt),s=0,a=this._getCorrectBufferLength(t);if(a>this.lines.maxLength&&(this.lines.maxLength=a),this.lines.length>0){if(this._cols<e)for(let c=0;c<this.lines.length;c++)s+=+this.lines.get(c).resize(e,n);let u=0;if(this._rows<t)for(let c=this._rows;c<t;c++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new Wl(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+u+1?(this.ybase--,u++,this.ydisp>0&&this.ydisp--):this.lines.push(new Wl(e,n)));else for(let c=this._rows;c>t;c--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(a<this.lines.maxLength){let c=this.lines.length-a;c>0&&(this.lines.trimStart(c),this.ybase=Math.max(this.ybase-c,0),this.ydisp=Math.max(this.ydisp-c,0),this.savedY=Math.max(this.savedY-c,0)),this.lines.maxLength=a}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),u&&(this.y+=u),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let u=0;u<this.lines.length;u++)s+=+this.lines.get(u).resize(e,n);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),s>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,s=DC(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(yt),n);if(s.length>0){let a=AC(this.lines,s);MC(this.lines,a.layout),this._reflowLargerAdjustViewport(e,t,a.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let s=this.getNullCell(yt),a=n;for(;a-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new Wl(e,s))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,s=this.getNullCell(yt),a=[],u=0;for(let c=this.lines.length-1;c>=0;c--){let d=this.lines.get(c);if(!d||!d.isWrapped&&d.getTrimmedLength()<=e)continue;let p=[d];for(;d.isWrapped&&c>0;)d=this.lines.get(--c),p.unshift(d);if(!n){let P=this.ybase+this.y;if(P>=c&&P<c+p.length)continue}let h=p[p.length-1].getTrimmedLength(),g=RC(p,this._cols,e),m=g.length-p.length,S;this.ybase===0&&this.y!==this.lines.length-1?S=Math.max(0,this.y-this.lines.maxLength+m):S=Math.max(0,this.lines.length-this.lines.maxLength+m);let y=[];for(let P=0;P<m;P++){let ee=this.getBlankLine(yt,!0);y.push(ee)}y.length>0&&(a.push({start:c+p.length+u,newLines:y}),u+=y.length),p.push(...y);let b=g.length-1,C=g[b];C===0&&(b--,C=g[b]);let B=p.length-m-1,A=h;for(;B>=0;){let P=Math.min(A,C);if(p[b]===void 0)break;if(p[b].copyCellsFrom(p[B],A-P,C-P,P,!0),C-=P,C===0&&(b--,C=g[b]),A-=P,A===0){B--;let ee=Math.max(B,0);A=ea(p,ee,this._cols)}}for(let P=0;P<p.length;P++)g[P]<e&&p[P].setCell(g[P],s);let Z=m-S;for(;Z-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+u)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+m,this.ybase+t-1)}if(a.length>0){let c=[],d=[];for(let C=0;C<this.lines.length;C++)d.push(this.lines.get(C));let p=this.lines.length,h=p-1,g=0,m=a[g];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+u);let S=0;for(let C=Math.min(this.lines.maxLength-1,p+u-1);C>=0;C--)if(m&&m.start>h+S){for(let B=m.newLines.length-1;B>=0;B--)this.lines.set(C--,m.newLines[B]);C++,c.push({index:h+1,amount:m.newLines.length}),S+=m.newLines.length,m=a[++g]}else this.lines.set(C,d[h--]);let y=0;for(let C=c.length-1;C>=0;C--)c[C].index+=y,this.lines.onInsertEmitter.fire(c[C]),y+=c[C].amount;let b=Math.max(0,p+u-this.lines.maxLength);b>0&&this.lines.onTrimEmitter.fire(b)}}translateBufferLineToString(e,t,n=0,s){let a=this.lines.get(e);return a?a.translateToString(t,n,s):""}getWrappedRangeForLine(e){let t=e,n=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:t,last:n}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new BC(e);return this.markers.push(t),t.register(this.lines.onTrim(n=>{t.line-=n,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(n=>{t.line>=n.index&&(t.line+=n.amount)})),t.register(this.lines.onDelete(n=>{t.line>=n.index&&t.line<n.index+n.amount&&t.dispose(),t.line>n.index&&(t.line-=n.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},OC=class extends De{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new le),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new gv(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new gv(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},vS=2,yS=1,If=class extends De{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new le),this.onResize=this._onResize.event,this._onScroll=this._register(new le),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,vS),this.rows=Math.max(e.rawOptions.rows||0,yS),this.buffers=this._register(new OC(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let n=this.cols!==e,s=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:n,rowsChanged:s})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let n=this.buffer,s;s=this._cachedBlankLine,(!s||s.length!==this.cols||s.getFg(0)!==e.fg||s.getBg(0)!==e.bg)&&(s=n.getBlankLine(e,t),this._cachedBlankLine=s),s.isWrapped=t;let a=n.ybase+n.scrollTop,u=n.ybase+n.scrollBottom;if(n.scrollTop===0){let c=n.lines.isFull;u===n.lines.length-1?c?n.lines.recycle().copyFrom(s):n.lines.push(s.clone()):n.lines.splice(u+1,0,s.clone()),c?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let c=u-a+1;n.lines.shiftElements(a+1,c-1,-1),n.lines.set(u,s.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,t){let n=this.buffer;if(e<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else e+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let s=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),s!==n.ydisp&&(t||this._onScroll.fire(n.ydisp))}};If=ct([oe(0,Qt)],If);var Ts={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:Zo,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},zC=["normal","bold","100","200","300","400","500","600","700","800","900"],LC=class extends De{constructor(e){super(),this._onOptionChange=this._register(new le),this.onOptionChange=this._onOptionChange.event;let t={...Ts};for(let n in e)if(n in t)try{let s=e[n];t[n]=this._sanitizeAndValidateOption(n,s)}catch(s){console.error(s)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(rt(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(n=>{n===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(n=>{e.indexOf(n)!==-1&&t()})}_setupOptions(){let e=n=>{if(!(n in Ts))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},t=(n,s)=>{if(!(n in Ts))throw new Error(`No option with key "${n}"`);s=this._sanitizeAndValidateOption(n,s),this.rawOptions[n]!==s&&(this.rawOptions[n]=s,this._onOptionChange.fire(n))};for(let n in this.rawOptions){let s={get:e.bind(this,n),set:t.bind(this,n)};Object.defineProperty(this.options,n,s)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=Ts[e]),!NC(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Ts[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=zC.includes(t)?t:Ts[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function NC(e){return e==="block"||e==="underline"||e==="bar"}function Yl(e,t=5){if(typeof e!="object")return e;let n=Array.isArray(e)?[]:{};for(let s in e)n[s]=t<=1?e[s]:e[s]&&Yl(e[s],t-1);return n}var vv=Object.freeze({insertMode:!1}),yv=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),Ff=class extends De{constructor(e,t,n){super(),this._bufferService=e,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new le),this.onData=this._onData.event,this._onUserInput=this._register(new le),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new le),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new le),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=Yl(vv),this.decPrivateModes=Yl(yv)}reset(){this.modes=Yl(vv),this.decPrivateModes=Yl(yv)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(s=>s.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};Ff=ct([oe(0,Zt),oe(1,Uy),oe(2,Qt)],Ff);var Sv={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function Fh(e,t){let n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(n|=64,n|=e.action):(n|=e.button&3,e.button&4&&(n|=64),e.button&8&&(n|=128),e.action===32?n|=32:e.action===0&&!t&&(n|=3)),n}var qh=String.fromCharCode,bv={DEFAULT:e=>{let t=[Fh(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${qh(t[0])}${qh(t[1])}${qh(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Fh(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Fh(e,!0)};${e.x};${e.y}${t}`}},qf=class extends De{constructor(e,t,n){super(),this._bufferService=e,this._coreService=t,this._optionsService=n,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new le),this.onProtocolChange=this._onProtocolChange.event;for(let s of Object.keys(Sv))this.addProtocol(s,Sv[s]);for(let s of Object.keys(bv))this.addEncoding(s,bv[s]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,n){if(e.deltaY===0||e.shiftKey||t===void 0||n===void 0)return 0;let s=t/n,a=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(a/=s+0,Math.abs(e.deltaY)<50&&(a*=.3),this._wheelPartialScroll+=a,a=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(a*=this._bufferService.rows),a}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,n){if(n){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};qf=ct([oe(0,Zt),oe(1,Nr),oe(2,Qt)],qf);var Vh=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],HC=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],Ct;function jC(e,t){let n=0,s=t.length-1,a;if(e<t[0][0]||e>t[s][1])return!1;for(;s>=n;)if(a=n+s>>1,e>t[a][1])n=a+1;else if(e<t[a][0])s=a-1;else return!0;return!1}var UC=class{constructor(){if(this.version="6",!Ct){Ct=new Uint8Array(65536),Ct.fill(1),Ct[0]=0,Ct.fill(0,1,32),Ct.fill(0,127,160),Ct.fill(2,4352,4448),Ct[9001]=2,Ct[9002]=2,Ct.fill(2,11904,42192),Ct[12351]=1,Ct.fill(2,44032,55204),Ct.fill(2,63744,64256),Ct.fill(2,65040,65050),Ct.fill(2,65072,65136),Ct.fill(2,65280,65377),Ct.fill(2,65504,65511);for(let e=0;e<Vh.length;++e)Ct.fill(0,Vh[e][0],Vh[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?Ct[e]:jC(e,HC)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),s=n===0&&t!==0;if(s){let a=Rr.extractWidth(t);a===0?s=!1:a>n&&(n=a)}return Rr.createPropertyValue(0,n,s)}},Rr=class Yo{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new le,this.onChange=this._onChange.event;let t=new UC;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,n,s=!1){return(t&16777215)<<3|(n&3)<<1|(s?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let n=0,s=0,a=t.length;for(let u=0;u<a;++u){let c=t.charCodeAt(u);if(55296<=c&&c<=56319){if(++u>=a)return n+this.wcwidth(c);let h=t.charCodeAt(u);56320<=h&&h<=57343?c=(c-55296)*1024+h-56320+65536:n+=this.wcwidth(h)}let d=this.charProperties(c,s),p=Yo.extractWidth(d);Yo.extractShouldJoin(d)&&(p-=Yo.extractWidth(s)),n+=p,s=d}return n}charProperties(t,n){return this._activeProvider.charProperties(t,n)}},PC=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function xv(e){var s;let t=(s=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:s.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&t&&(n.isWrapped=t[3]!==0&&t[3]!==32)}var Nl=2147483647,IC=256,SS=class Vf{constructor(t=32,n=32){if(this.maxLength=t,this.maxSubParamsLength=n,n>IC)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(n),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let n=new Vf;if(!t.length)return n;for(let s=Array.isArray(t[0])?1:0;s<t.length;++s){let a=t[s];if(Array.isArray(a))for(let u=0;u<a.length;++u)n.addSubParam(a[u]);else n.addParam(a)}return n}clone(){let t=new Vf(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let n=0;n<this.length;++n){t.push(this.params[n]);let s=this._subParamsIdx[n]>>8,a=this._subParamsIdx[n]&255;a-s>0&&t.push(Array.prototype.slice.call(this._subParams,s,a))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>Nl?Nl:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>Nl?Nl:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let n=this._subParamsIdx[t]>>8,s=this._subParamsIdx[t]&255;return s-n>0?this._subParams.subarray(n,s):null}getSubParamsAll(){let t={};for(let n=0;n<this.length;++n){let s=this._subParamsIdx[n]>>8,a=this._subParamsIdx[n]&255;a-s>0&&(t[n]=this._subParams.slice(s,a))}return t}addDigit(t){let n;if(this._rejectDigits||!(n=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let s=this._digitIsSub?this._subParams:this.params,a=s[n-1];s[n-1]=~a?Math.min(a*10+t,Nl):t}},Hl=[],FC=class{constructor(){this._state=0,this._active=Hl,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let s=n.indexOf(t);s!==-1&&n.splice(s,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Hl}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=Hl,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Hl,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,n){if(!this._active.length)this._handlerFb(this._id,"PUT",ru(e,t,n));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,n)}start(){this.reset(),this._state=1}put(e,t,n){if(this._state!==3){if(this._state===1)for(;t<n;){let s=e[t++];if(s===59){this._state=2,this._start();break}if(s<48||57<s){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+s-48}this._state===2&&n-t>0&&this._put(e,t,n)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let n=!1,s=this._active.length-1,a=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,n=t,a=this._stack.fallThrough,this._stack.paused=!1),!a&&n===!1){for(;s>=0&&(n=this._active[s].end(e),n!==!0);s--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,n;s--}for(;s>=0;s--)if(n=this._active[s].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,n}this._active=Hl,this._id=-1,this._state=0}}},bi=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=ru(e,t,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(n=>(this._data="",this._hitLimit=!1,n));return this._data="",this._hitLimit=!1,t}},jl=[],qC=class{constructor(){this._handlers=Object.create(null),this._active=jl,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=jl}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let s=n.indexOf(t);s!==-1&&n.splice(s,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=jl,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||jl,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(t)}put(e,t,n){if(!this._active.length)this._handlerFb(this._ident,"PUT",ru(e,t,n));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,n)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let n=!1,s=this._active.length-1,a=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,n=t,a=this._stack.fallThrough,this._stack.paused=!1),!a&&n===!1){for(;s>=0&&(n=this._active[s].unhook(e),n!==!0);s--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,n;s--}for(;s>=0;s--)if(n=this._active[s].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,n}this._active=jl,this._ident=0}},Kl=new SS;Kl.addParam(0);var wv=class{constructor(e){this._handler=e,this._data="",this._params=Kl,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():Kl,this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=ru(e,t,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(n=>(this._params=Kl,this._data="",this._hitLimit=!1,n));return this._params=Kl,this._data="",this._hitLimit=!1,t}},VC=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,n,s){this.table[t<<8|e]=n<<4|s}addMany(e,t,n,s){for(let a=0;a<e.length;a++)this.table[t<<8|e[a]]=n<<4|s}},Ni=160,WC=(function(){let e=new VC(4095),t=Array.apply(null,Array(256)).map((d,p)=>p),n=(d,p)=>t.slice(d,p),s=n(32,127),a=n(0,24);a.push(25),a.push.apply(a,n(28,32));let u=n(0,14),c;e.setDefault(1,0),e.addMany(s,0,2,0);for(c in u)e.addMany([24,26,153,154],c,3,0),e.addMany(n(128,144),c,3,0),e.addMany(n(144,152),c,3,0),e.add(156,c,0,0),e.add(27,c,11,1),e.add(157,c,4,8),e.addMany([152,158,159],c,0,7),e.add(155,c,11,3),e.add(144,c,11,9);return e.addMany(a,0,3,0),e.addMany(a,1,3,1),e.add(127,1,0,1),e.addMany(a,8,0,8),e.addMany(a,3,3,3),e.add(127,3,0,3),e.addMany(a,4,3,4),e.add(127,4,0,4),e.addMany(a,6,3,6),e.addMany(a,5,3,5),e.add(127,5,0,5),e.addMany(a,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(s,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(s,7,0,7),e.addMany(a,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(a,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(a,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(a,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(a,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(a,13,13,13),e.addMany(s,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Ni,0,2,0),e.add(Ni,8,5,8),e.add(Ni,6,0,6),e.add(Ni,11,0,11),e.add(Ni,13,13,13),e})(),YC=class extends De{constructor(e=WC){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new SS,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,n,s)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,n)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(rt(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new FC),this._dcsParser=this._register(new qC),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let a=0;a<e.intermediates.length;++a){let u=e.intermediates.charCodeAt(a);if(32>u||u>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=u}}if(e.final.length!==1)throw new Error("final must be a single byte");let s=e.final.charCodeAt(0);if(t[0]>s||s>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return n<<=8,n|=s,n}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let s=this._escHandlers[n];return s.push(t),{dispose:()=>{let a=s.indexOf(t);a!==-1&&s.splice(a,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let s=this._csiHandlers[n];return s.push(t),{dispose:()=>{let a=s.indexOf(t);a!==-1&&s.splice(a,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,n,s,a){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=s,this._parseStack.chunkPos=a}parse(e,t,n){let s=0,a=0,u=0,c;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,u=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let d=this._parseStack.handlers,p=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&p>-1){for(;p>=0&&(c=d[p](this._params),c!==!0);p--)if(c instanceof Promise)return this._parseStack.handlerPos=p,c}this._parseStack.handlers=[];break;case 4:if(n===!1&&p>-1){for(;p>=0&&(c=d[p](),c!==!0);p--)if(c instanceof Promise)return this._parseStack.handlerPos=p,c}this._parseStack.handlers=[];break;case 6:if(s=e[this._parseStack.chunkPos],c=this._dcsParser.unhook(s!==24&&s!==26,n),c)return c;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(s=e[this._parseStack.chunkPos],c=this._oscParser.end(s!==24&&s!==26,n),c)return c;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,u=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let d=u;d<t;++d){switch(s=e[d],a=this._transitions.table[this.currentState<<8|(s<160?s:Ni)],a>>4){case 2:for(let S=d+1;;++S){if(S>=t||(s=e[S])<32||s>126&&s<Ni){this._printHandler(e,d,S),d=S-1;break}if(++S>=t||(s=e[S])<32||s>126&&s<Ni){this._printHandler(e,d,S),d=S-1;break}if(++S>=t||(s=e[S])<32||s>126&&s<Ni){this._printHandler(e,d,S),d=S-1;break}if(++S>=t||(s=e[S])<32||s>126&&s<Ni){this._printHandler(e,d,S),d=S-1;break}}break;case 3:this._executeHandlers[s]?this._executeHandlers[s]():this._executeHandlerFb(s),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:d,code:s,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let p=this._csiHandlers[this._collect<<8|s],h=p?p.length-1:-1;for(;h>=0&&(c=p[h](this._params),c!==!0);h--)if(c instanceof Promise)return this._preserveStack(3,p,h,a,d),c;h<0&&this._csiHandlerFb(this._collect<<8|s,this._params),this.precedingJoinState=0;break;case 8:do switch(s){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(s-48)}while(++d<t&&(s=e[d])>47&&s<60);d--;break;case 9:this._collect<<=8,this._collect|=s;break;case 10:let g=this._escHandlers[this._collect<<8|s],m=g?g.length-1:-1;for(;m>=0&&(c=g[m](),c!==!0);m--)if(c instanceof Promise)return this._preserveStack(4,g,m,a,d),c;m<0&&this._escHandlerFb(this._collect<<8|s),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|s,this._params);break;case 13:for(let S=d+1;;++S)if(S>=t||(s=e[S])===24||s===26||s===27||s>127&&s<Ni){this._dcsParser.put(e,d,S),d=S-1;break}break;case 14:if(c=this._dcsParser.unhook(s!==24&&s!==26),c)return this._preserveStack(6,[],0,a,d),c;s===27&&(a|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let S=d+1;;S++)if(S>=t||(s=e[S])<32||s>127&&s<Ni){this._oscParser.put(e,d,S),d=S-1;break}break;case 6:if(c=this._oscParser.end(s!==24&&s!==26),c)return this._preserveStack(5,[],0,a,d),c;s===27&&(a|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=a&15}}},KC=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,XC=/^[\da-f]+$/;function Cv(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let n=KC.exec(t);if(n){let s=n[1]?15:n[4]?255:n[7]?4095:65535;return[Math.round(parseInt(n[1]||n[4]||n[7]||n[10],16)/s*255),Math.round(parseInt(n[2]||n[5]||n[8]||n[11],16)/s*255),Math.round(parseInt(n[3]||n[6]||n[9]||n[12],16)/s*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),XC.exec(t)&&[3,6,9,12].includes(t.length))){let n=t.length/3,s=[0,0,0];for(let a=0;a<3;++a){let u=parseInt(t.slice(n*a,n*a+n),16);s[a]=n===1?u<<4:n===2?u:n===3?u>>4:u>>8}return s}}function Wh(e,t){let n=e.toString(16),s=n.length<2?"0"+n:n;switch(t){case 4:return n[0];case 8:return s;case 12:return(s+s).slice(0,3);default:return s+s}}function GC(e,t=16){let[n,s,a]=e;return`rgb:${Wh(n,t)}/${Wh(s,t)}/${Wh(a,t)}`}var $C={"(":0,")":1,"*":2,"+":3,"-":1,".":2},tr=131072,kv=10;function Ev(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var Tv=5e3,Dv=0,ZC=class extends De{constructor(e,t,n,s,a,u,c,d,p=new YC){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=s,this._optionsService=a,this._oscLinkService=u,this._coreMouseService=c,this._unicodeService=d,this._parser=p,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new mx,this._utf8Decoder=new gx,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=yt.clone(),this._eraseAttrDataInternal=yt.clone(),this._onRequestBell=this._register(new le),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new le),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new le),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new le),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new le),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new le),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new le),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new le),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new le),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new le),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new le),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new le),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new le),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new Wf(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(h=>this._activeBuffer=h.activeBuffer)),this._parser.setCsiHandlerFallback((h,g)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(h),params:g.toArray()})}),this._parser.setEscHandlerFallback(h=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(h)})}),this._parser.setExecuteHandlerFallback(h=>{this._logService.debug("Unknown EXECUTE code: ",{code:h})}),this._parser.setOscHandlerFallback((h,g,m)=>{this._logService.debug("Unknown OSC code: ",{identifier:h,action:g,data:m})}),this._parser.setDcsHandlerFallback((h,g,m)=>{g==="HOOK"&&(m=m.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(h),action:g,payload:m})}),this._parser.setPrintHandler((h,g,m)=>this.print(h,g,m)),this._parser.registerCsiHandler({final:"@"},h=>this.insertChars(h)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},h=>this.scrollLeft(h)),this._parser.registerCsiHandler({final:"A"},h=>this.cursorUp(h)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},h=>this.scrollRight(h)),this._parser.registerCsiHandler({final:"B"},h=>this.cursorDown(h)),this._parser.registerCsiHandler({final:"C"},h=>this.cursorForward(h)),this._parser.registerCsiHandler({final:"D"},h=>this.cursorBackward(h)),this._parser.registerCsiHandler({final:"E"},h=>this.cursorNextLine(h)),this._parser.registerCsiHandler({final:"F"},h=>this.cursorPrecedingLine(h)),this._parser.registerCsiHandler({final:"G"},h=>this.cursorCharAbsolute(h)),this._parser.registerCsiHandler({final:"H"},h=>this.cursorPosition(h)),this._parser.registerCsiHandler({final:"I"},h=>this.cursorForwardTab(h)),this._parser.registerCsiHandler({final:"J"},h=>this.eraseInDisplay(h,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},h=>this.eraseInDisplay(h,!0)),this._parser.registerCsiHandler({final:"K"},h=>this.eraseInLine(h,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},h=>this.eraseInLine(h,!0)),this._parser.registerCsiHandler({final:"L"},h=>this.insertLines(h)),this._parser.registerCsiHandler({final:"M"},h=>this.deleteLines(h)),this._parser.registerCsiHandler({final:"P"},h=>this.deleteChars(h)),this._parser.registerCsiHandler({final:"S"},h=>this.scrollUp(h)),this._parser.registerCsiHandler({final:"T"},h=>this.scrollDown(h)),this._parser.registerCsiHandler({final:"X"},h=>this.eraseChars(h)),this._parser.registerCsiHandler({final:"Z"},h=>this.cursorBackwardTab(h)),this._parser.registerCsiHandler({final:"`"},h=>this.charPosAbsolute(h)),this._parser.registerCsiHandler({final:"a"},h=>this.hPositionRelative(h)),this._parser.registerCsiHandler({final:"b"},h=>this.repeatPrecedingCharacter(h)),this._parser.registerCsiHandler({final:"c"},h=>this.sendDeviceAttributesPrimary(h)),this._parser.registerCsiHandler({prefix:">",final:"c"},h=>this.sendDeviceAttributesSecondary(h)),this._parser.registerCsiHandler({final:"d"},h=>this.linePosAbsolute(h)),this._parser.registerCsiHandler({final:"e"},h=>this.vPositionRelative(h)),this._parser.registerCsiHandler({final:"f"},h=>this.hVPosition(h)),this._parser.registerCsiHandler({final:"g"},h=>this.tabClear(h)),this._parser.registerCsiHandler({final:"h"},h=>this.setMode(h)),this._parser.registerCsiHandler({prefix:"?",final:"h"},h=>this.setModePrivate(h)),this._parser.registerCsiHandler({final:"l"},h=>this.resetMode(h)),this._parser.registerCsiHandler({prefix:"?",final:"l"},h=>this.resetModePrivate(h)),this._parser.registerCsiHandler({final:"m"},h=>this.charAttributes(h)),this._parser.registerCsiHandler({final:"n"},h=>this.deviceStatus(h)),this._parser.registerCsiHandler({prefix:"?",final:"n"},h=>this.deviceStatusPrivate(h)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},h=>this.softReset(h)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},h=>this.setCursorStyle(h)),this._parser.registerCsiHandler({final:"r"},h=>this.setScrollRegion(h)),this._parser.registerCsiHandler({final:"s"},h=>this.saveCursor(h)),this._parser.registerCsiHandler({final:"t"},h=>this.windowOptions(h)),this._parser.registerCsiHandler({final:"u"},h=>this.restoreCursor(h)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},h=>this.insertColumns(h)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},h=>this.deleteColumns(h)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},h=>this.selectProtected(h)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},h=>this.requestMode(h,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},h=>this.requestMode(h,!1)),this._parser.setExecuteHandler(J.BEL,()=>this.bell()),this._parser.setExecuteHandler(J.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(J.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(J.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(J.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(J.BS,()=>this.backspace()),this._parser.setExecuteHandler(J.HT,()=>this.tab()),this._parser.setExecuteHandler(J.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(J.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Vo.IND,()=>this.index()),this._parser.setExecuteHandler(Vo.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Vo.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new bi(h=>(this.setTitle(h),this.setIconName(h),!0))),this._parser.registerOscHandler(1,new bi(h=>this.setIconName(h))),this._parser.registerOscHandler(2,new bi(h=>this.setTitle(h))),this._parser.registerOscHandler(4,new bi(h=>this.setOrReportIndexedColor(h))),this._parser.registerOscHandler(8,new bi(h=>this.setHyperlink(h))),this._parser.registerOscHandler(10,new bi(h=>this.setOrReportFgColor(h))),this._parser.registerOscHandler(11,new bi(h=>this.setOrReportBgColor(h))),this._parser.registerOscHandler(12,new bi(h=>this.setOrReportCursorColor(h))),this._parser.registerOscHandler(104,new bi(h=>this.restoreIndexedColor(h))),this._parser.registerOscHandler(110,new bi(h=>this.restoreFgColor(h))),this._parser.registerOscHandler(111,new bi(h=>this.restoreBgColor(h))),this._parser.registerOscHandler(112,new bi(h=>this.restoreCursorColor(h))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let h in kt)this._parser.registerEscHandler({intermediates:"(",final:h},()=>this.selectCharset("("+h)),this._parser.registerEscHandler({intermediates:")",final:h},()=>this.selectCharset(")"+h)),this._parser.registerEscHandler({intermediates:"*",final:h},()=>this.selectCharset("*"+h)),this._parser.registerEscHandler({intermediates:"+",final:h},()=>this.selectCharset("+"+h)),this._parser.registerEscHandler({intermediates:"-",final:h},()=>this.selectCharset("-"+h)),this._parser.registerEscHandler({intermediates:".",final:h},()=>this.selectCharset("."+h)),this._parser.registerEscHandler({intermediates:"/",final:h},()=>this.selectCharset("/"+h));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(h=>(this._logService.error("Parsing error: ",h),h)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new wv((h,g)=>this.requestStatusString(h,g)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,n,s){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=n,this._parseStack.position=s}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,n)=>setTimeout(()=>n("#SLOW_TIMEOUT"),Tv))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${Tv} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,s=this._activeBuffer.x,a=this._activeBuffer.y,u=0,c=this._parseStack.paused;if(c){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(n),n;s=this._parseStack.cursorStartX,a=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>tr&&(u=this._parseStack.position+tr)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,h=>String.fromCharCode(h)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(h=>h.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<tr&&(this._parseBuffer=new Uint32Array(Math.min(e.length,tr))),c||this._dirtyRowTracker.clearRange(),e.length>tr)for(let h=u;h<e.length;h+=tr){let g=h+tr<e.length?h+tr:e.length,m=typeof e=="string"?this._stringDecoder.decode(e.substring(h,g),this._parseBuffer):this._utf8Decoder.decode(e.subarray(h,g),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,m))return this._preserveStack(s,a,m,h),this._logSlowResolvingAsync(n),n}else if(!c){let h=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,h))return this._preserveStack(s,a,h,0),this._logSlowResolvingAsync(n),n}(this._activeBuffer.x!==s||this._activeBuffer.y!==a)&&this._onCursorMove.fire();let d=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),p=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);p<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(p,this._bufferService.rows-1),end:Math.min(d,this._bufferService.rows-1)})}print(e,t,n){let s,a,u=this._charsetService.charset,c=this._optionsService.rawOptions.screenReaderMode,d=this._bufferService.cols,p=this._coreService.decPrivateModes.wraparound,h=this._coreService.modes.insertMode,g=this._curAttrData,m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-t>0&&m.getWidth(this._activeBuffer.x-1)===2&&m.setCellFromCodepoint(this._activeBuffer.x-1,0,1,g);let S=this._parser.precedingJoinState;for(let y=t;y<n;++y){if(s=e[y],s<127&&u){let A=u[String.fromCharCode(s)];A&&(s=A.charCodeAt(0))}let b=this._unicodeService.charProperties(s,S);a=Rr.extractWidth(b);let C=Rr.extractShouldJoin(b),B=C?Rr.extractWidth(S):0;if(S=b,c&&this._onA11yChar.fire(nr(s)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+a-B>d){if(p){let A=m,Z=this._activeBuffer.x-B;for(this._activeBuffer.x=B,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),B>0&&m instanceof Wl&&m.copyCellsFrom(A,Z,0,B,!1);Z<d;)A.setCellFromCodepoint(Z++,0,1,g)}else if(this._activeBuffer.x=d-1,a===2)continue}if(C&&this._activeBuffer.x){let A=m.getWidth(this._activeBuffer.x-1)?1:2;m.addCodepointToCell(this._activeBuffer.x-A,s,a);for(let Z=a-B;--Z>=0;)m.setCellFromCodepoint(this._activeBuffer.x++,0,0,g);continue}if(h&&(m.insertCells(this._activeBuffer.x,a-B,this._activeBuffer.getNullCell(g)),m.getWidth(d-1)===2&&m.setCellFromCodepoint(d-1,0,1,g)),m.setCellFromCodepoint(this._activeBuffer.x++,s,a,g),a>0)for(;--a;)m.setCellFromCodepoint(this._activeBuffer.x++,0,0,g)}this._parser.precedingJoinState=S,this._activeBuffer.x<d&&n-t>0&&m.getWidth(this._activeBuffer.x)===0&&!m.hasContent(this._activeBuffer.x)&&m.setCellFromCodepoint(this._activeBuffer.x,0,1,g),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,n=>Ev(n.params[0],this._optionsService.rawOptions.windowOptions)?t(n):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new wv(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new bi(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var e;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&e.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);t.hasWidth(this._activeBuffer.x)&&!t.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,n,s=!1,a=!1){let u=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);u.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),a),s&&(u.isWrapped=!1)}_resetBufferLine(e,t=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),n.isWrapped=!1)}eraseInDisplay(e,t=!1){var s;this._restrictCursor(this._bufferService.cols);let n;switch(e.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);n<this._bufferService.rows;n++)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(n);break;case 1:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(n=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,n-1);n--&&!((s=this._activeBuffer.lines.get(this._activeBuffer.ybase+n))!=null&&s.getTrimmedLength()););for(;n>=0;n--)this._bufferService.scroll(this._eraseAttrData())}else{for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let a=this._activeBuffer.lines.length-this._bufferService.rows;a>0&&(this._activeBuffer.lines.trimStart(a),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-a,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-a,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,a=this._bufferService.rows-1+this._activeBuffer.ybase-s+1;for(;t--;)this._activeBuffer.lines.splice(a-1,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,s;for(s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-s;t--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(s,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(yt));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);s.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);s.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);s.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);s.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let n=e.params[0]||1,s=Rr.extractWidth(t),a=this._activeBuffer.x-s,u=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(a),c=new Uint32Array(u.length*n),d=0;for(let h=0;h<u.length;){let g=u.codePointAt(h)||0;c[d++]=g,h+=g>65535?2:1}let p=d;for(let h=1;h<n;++h)c.copyWithin(p,0,d),p+=d;return this.print(c,0,p),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(J.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(J.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(J.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(J.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(J.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,Mr),this._charsetService.setgCharset(1,Mr),this._charsetService.setgCharset(2,Mr),this._charsetService.setgCharset(3,Mr);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,t){(C=>(C[C.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",C[C.SET=1]="SET",C[C.RESET=2]="RESET",C[C.PERMANENTLY_SET=3]="PERMANENTLY_SET",C[C.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(n={}));let s=this._coreService.decPrivateModes,{activeProtocol:a,activeEncoding:u}=this._coreMouseService,c=this._coreService,{buffers:d,cols:p}=this._bufferService,{active:h,alt:g}=d,m=this._optionsService.rawOptions,S=(C,B)=>(c.triggerDataEvent(`${J.ESC}[${t?"":"?"}${C};${B}$y`),!0),y=C=>C?1:2,b=e.params[0];return t?b===2?S(b,4):b===4?S(b,y(c.modes.insertMode)):b===12?S(b,3):b===20?S(b,y(m.convertEol)):S(b,0):b===1?S(b,y(s.applicationCursorKeys)):b===3?S(b,m.windowOptions.setWinLines?p===80?2:p===132?1:0:0):b===6?S(b,y(s.origin)):b===7?S(b,y(s.wraparound)):b===8?S(b,3):b===9?S(b,y(a==="X10")):b===12?S(b,y(m.cursorBlink)):b===25?S(b,y(!c.isCursorHidden)):b===45?S(b,y(s.reverseWraparound)):b===66?S(b,y(s.applicationKeypad)):b===67?S(b,4):b===1e3?S(b,y(a==="VT200")):b===1002?S(b,y(a==="DRAG")):b===1003?S(b,y(a==="ANY")):b===1004?S(b,y(s.sendFocus)):b===1005?S(b,4):b===1006?S(b,y(u==="SGR")):b===1015?S(b,4):b===1016?S(b,y(u==="SGR_PIXELS")):b===1048?S(b,1):b===47||b===1047||b===1049?S(b,y(h===g)):b===2004?S(b,y(s.bracketedPasteMode)):b===2026?S(b,y(s.synchronizedOutput)):S(b,0)}_updateAttrColor(e,t,n,s,a){return t===2?(e|=50331648,e&=-16777216,e|=ra.fromColorRGB([n,s,a])):t===5&&(e&=-50331904,e|=33554432|n&255),e}_extractColor(e,t,n){let s=[0,0,-1,0,0,0],a=0,u=0;do{if(s[u+a]=e.params[t+u],e.hasSubParams(t+u)){let c=e.getSubParams(t+u),d=0;do s[1]===5&&(a=1),s[u+d+1+a]=c[d];while(++d<c.length&&d+u+1+a<s.length);break}if(s[1]===5&&u+a>=2||s[1]===2&&u+a>=5)break;s[1]&&(a=1)}while(++u+t<e.length&&u+a<s.length);for(let c=2;c<s.length;++c)s[c]===-1&&(s[c]=0);switch(s[0]){case 38:n.fg=this._updateAttrColor(n.fg,s[1],s[3],s[4],s[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,s[1],s[3],s[4],s[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,s[1],s[3],s[4],s[5])}return u}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=yt.fg,e.bg=yt.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,n,s=this._curAttrData;for(let a=0;a<t;a++)n=e.params[a],n>=30&&n<=37?(s.fg&=-50331904,s.fg|=16777216|n-30):n>=40&&n<=47?(s.bg&=-50331904,s.bg|=16777216|n-40):n>=90&&n<=97?(s.fg&=-50331904,s.fg|=16777216|n-90|8):n>=100&&n<=107?(s.bg&=-50331904,s.bg|=16777216|n-100|8):n===0?this._processSGR0(s):n===1?s.fg|=134217728:n===3?s.bg|=67108864:n===4?(s.fg|=268435456,this._processUnderline(e.hasSubParams(a)?e.getSubParams(a)[0]:1,s)):n===5?s.fg|=536870912:n===7?s.fg|=67108864:n===8?s.fg|=1073741824:n===9?s.fg|=2147483648:n===2?s.bg|=134217728:n===21?this._processUnderline(2,s):n===22?(s.fg&=-134217729,s.bg&=-134217729):n===23?s.bg&=-67108865:n===24?(s.fg&=-268435457,this._processUnderline(0,s)):n===25?s.fg&=-536870913:n===27?s.fg&=-67108865:n===28?s.fg&=-1073741825:n===29?s.fg&=2147483647:n===39?(s.fg&=-67108864,s.fg|=yt.fg&16777215):n===49?(s.bg&=-67108864,s.bg|=yt.bg&16777215):n===38||n===48||n===58?a+=this._extractColor(e,a,s):n===53?s.bg|=1073741824:n===55?s.bg&=-1073741825:n===59?(s.extended=s.extended.clone(),s.extended.underlineColor=-1,s.updateExtended()):n===100?(s.fg&=-67108864,s.fg|=yt.fg&16777215,s.bg&=-67108864,s.bg|=yt.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${J.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${J.ESC}[${t};${n}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${J.ESC}[?${t};${n}R`);break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=yt.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let n=t%2===1;this._coreService.decPrivateModes.cursorBlink=n}return!0}setScrollRegion(e){let t=e.params[0]||1,n;return(e.length<2||(n=e.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(e){if(!Ev(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${J.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>kv&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>kv&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],n=e.split(";");for(;n.length>1;){let s=n.shift(),a=n.shift();if(/^\d+$/.exec(s)){let u=parseInt(s);if(Av(u))if(a==="?")t.push({type:0,index:u});else{let c=Cv(a);c&&t.push({type:1,index:u,color:c})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let n=e.slice(0,t).trim(),s=e.slice(t+1);return s?this._createHyperlink(n,s):n.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(":"),s,a=n.findIndex(u=>u.startsWith("id="));return a!==-1&&(s=n[a].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:s,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let n=e.split(";");for(let s=0;s<n.length&&!(t>=this._specialColors.length);++s,++t)if(n[s]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let a=Cv(n[s]);a&&this._onColor.fire([{type:1,index:this._specialColors[t],color:a}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],n=e.split(";");for(let s=0;s<n.length;++s)if(/^\d+$/.exec(n[s])){let a=parseInt(n[s]);Av(a)&&t.push({type:2,index:a})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,Mr),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset($C[e[0]],kt[e[1]]||Mr),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=yt.clone(),this._eraseAttrDataInternal=yt.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new ji;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let n=this._activeBuffer.ybase+this._activeBuffer.y+t,s=this._activeBuffer.lines.get(n);s&&(s.fill(e),s.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let n=c=>(this._coreService.triggerDataEvent(`${J.ESC}${c}${J.ESC}\\`),!0),s=this._bufferService.buffer,a=this._optionsService.rawOptions;return n(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${s.scrollTop+1};${s.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[a.cursorStyle]-(a.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},Wf=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(Dv=e,e=t,t=Dv),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Wf=ct([oe(0,Zt)],Wf);function Av(e){return 0<=e&&e<256}var QC=5e7,Mv=12,JC=50,ek=class extends De{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new le),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let n;for(;n=this._writeBuffer.shift();){this._action(n);let s=this._callbacks.shift();s&&s()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>QC)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let s=this._writeBuffer[this._bufferOffset],a=this._action(s,t);if(a){let c=d=>performance.now()-n>=Mv?setTimeout(()=>this._innerWrite(0,d)):this._innerWrite(n,d);a.catch(d=>(queueMicrotask(()=>{throw d}),Promise.resolve(!1))).then(c);return}let u=this._callbacks[this._bufferOffset];if(u&&u(),this._bufferOffset++,this._pendingData-=s.length,performance.now()-n>=Mv)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>JC&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},Yf=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let d=t.addMarker(t.ybase+t.y),p={data:e,id:this._nextId++,lines:[d]};return d.onDispose(()=>this._removeMarkerFromLink(p,d)),this._dataByLinkId.set(p.id,p),p.id}let n=e,s=this._getEntryIdKey(n),a=this._entriesWithId.get(s);if(a)return this.addLineToLink(a.id,t.ybase+t.y),a.id;let u=t.addMarker(t.ybase+t.y),c={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[u]};return u.onDispose(()=>this._removeMarkerFromLink(c,u)),this._entriesWithId.set(c.key,c),this._dataByLinkId.set(c.id,c),c.id}addLineToLink(e,t){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(s=>s.line!==t)){let s=this._bufferService.buffer.addMarker(t);n.lines.push(s),s.onDispose(()=>this._removeMarkerFromLink(n,s))}}getLinkData(e){var t;return(t=this._dataByLinkId.get(e))==null?void 0:t.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let n=e.lines.indexOf(t);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};Yf=ct([oe(0,Zt)],Yf);var Rv=!1,tk=class extends De{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Os),this._onBinary=this._register(new le),this.onBinary=this._onBinary.event,this._onData=this._register(new le),this.onData=this._onData.event,this._onLineFeed=this._register(new le),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new le),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new le),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new le),this._instantiationService=new kC,this.optionsService=this._register(new LC(e)),this._instantiationService.setService(Qt,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(If)),this._instantiationService.setService(Zt,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(Pf)),this._instantiationService.setService(Uy,this._logService),this.coreService=this._register(this._instantiationService.createInstance(Ff)),this._instantiationService.setService(Nr,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(qf)),this._instantiationService.setService(jy,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Rr)),this._instantiationService.setService(bx,this.unicodeService),this._charsetService=this._instantiationService.createInstance(PC),this._instantiationService.setService(Sx,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Yf),this._instantiationService.setService(Py,this._oscLinkService),this._inputHandler=this._register(new ZC(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Pt.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Pt.forward(this._bufferService.onResize,this._onResize)),this._register(Pt.forward(this.coreService.onData,this._onData)),this._register(Pt.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new ek((t,n)=>this._inputHandler.parse(t,n))),this._register(Pt.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new le),this._onScroll.event(e=>{var t;(t=this._onScrollApi)==null||t.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!Rv&&(this._logService.warn("writeSync is unreliable and will be removed soon."),Rv=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,vS),t=Math.max(t,yS),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(xv.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(xv(this._bufferService),!1))),this._windowsWrappingHeuristics.value=rt(()=>{for(let t of e)t.dispose()})}}},ik={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};function nk(e,t,n,s){var c;let a={type:0,cancel:!1,key:void 0},u=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?a.key=J.ESC+"OA":a.key=J.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?a.key=J.ESC+"OD":a.key=J.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?a.key=J.ESC+"OC":a.key=J.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?a.key=J.ESC+"OB":a.key=J.ESC+"[B");break;case 8:a.key=e.ctrlKey?"\b":J.DEL,e.altKey&&(a.key=J.ESC+a.key);break;case 9:if(e.shiftKey){a.key=J.ESC+"[Z";break}a.key=J.HT,a.cancel=!0;break;case 13:a.key=e.altKey?J.ESC+J.CR:J.CR,a.cancel=!0;break;case 27:a.key=J.ESC,e.altKey&&(a.key=J.ESC+J.ESC),a.cancel=!0;break;case 37:if(e.metaKey)break;u?a.key=J.ESC+"[1;"+(u+1)+"D":t?a.key=J.ESC+"OD":a.key=J.ESC+"[D";break;case 39:if(e.metaKey)break;u?a.key=J.ESC+"[1;"+(u+1)+"C":t?a.key=J.ESC+"OC":a.key=J.ESC+"[C";break;case 38:if(e.metaKey)break;u?a.key=J.ESC+"[1;"+(u+1)+"A":t?a.key=J.ESC+"OA":a.key=J.ESC+"[A";break;case 40:if(e.metaKey)break;u?a.key=J.ESC+"[1;"+(u+1)+"B":t?a.key=J.ESC+"OB":a.key=J.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(a.key=J.ESC+"[2~");break;case 46:u?a.key=J.ESC+"[3;"+(u+1)+"~":a.key=J.ESC+"[3~";break;case 36:u?a.key=J.ESC+"[1;"+(u+1)+"H":t?a.key=J.ESC+"OH":a.key=J.ESC+"[H";break;case 35:u?a.key=J.ESC+"[1;"+(u+1)+"F":t?a.key=J.ESC+"OF":a.key=J.ESC+"[F";break;case 33:e.shiftKey?a.type=2:e.ctrlKey?a.key=J.ESC+"[5;"+(u+1)+"~":a.key=J.ESC+"[5~";break;case 34:e.shiftKey?a.type=3:e.ctrlKey?a.key=J.ESC+"[6;"+(u+1)+"~":a.key=J.ESC+"[6~";break;case 112:u?a.key=J.ESC+"[1;"+(u+1)+"P":a.key=J.ESC+"OP";break;case 113:u?a.key=J.ESC+"[1;"+(u+1)+"Q":a.key=J.ESC+"OQ";break;case 114:u?a.key=J.ESC+"[1;"+(u+1)+"R":a.key=J.ESC+"OR";break;case 115:u?a.key=J.ESC+"[1;"+(u+1)+"S":a.key=J.ESC+"OS";break;case 116:u?a.key=J.ESC+"[15;"+(u+1)+"~":a.key=J.ESC+"[15~";break;case 117:u?a.key=J.ESC+"[17;"+(u+1)+"~":a.key=J.ESC+"[17~";break;case 118:u?a.key=J.ESC+"[18;"+(u+1)+"~":a.key=J.ESC+"[18~";break;case 119:u?a.key=J.ESC+"[19;"+(u+1)+"~":a.key=J.ESC+"[19~";break;case 120:u?a.key=J.ESC+"[20;"+(u+1)+"~":a.key=J.ESC+"[20~";break;case 121:u?a.key=J.ESC+"[21;"+(u+1)+"~":a.key=J.ESC+"[21~";break;case 122:u?a.key=J.ESC+"[23;"+(u+1)+"~":a.key=J.ESC+"[23~";break;case 123:u?a.key=J.ESC+"[24;"+(u+1)+"~":a.key=J.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?a.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?a.key=J.NUL:e.keyCode>=51&&e.keyCode<=55?a.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?a.key=J.DEL:e.keyCode===219?a.key=J.ESC:e.keyCode===220?a.key=J.FS:e.keyCode===221&&(a.key=J.GS);else if((!n||s)&&e.altKey&&!e.metaKey){let d=(c=ik[e.keyCode])==null?void 0:c[e.shiftKey?1:0];if(d)a.key=J.ESC+d;else if(e.keyCode>=65&&e.keyCode<=90){let p=e.ctrlKey?e.keyCode-64:e.keyCode+32,h=String.fromCharCode(p);e.shiftKey&&(h=h.toUpperCase()),a.key=J.ESC+h}else if(e.keyCode===32)a.key=J.ESC+(e.ctrlKey?J.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let p=e.code.slice(3,4);e.shiftKey||(p=p.toLowerCase()),a.key=J.ESC+p,a.cancel=!0}}else n&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(a.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?a.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(a.key=J.US),e.key==="@"&&(a.key=J.NUL));break}return a}var dt=0,rk=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new Qo,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new Qo,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((a,u)=>this._getKey(a)-this._getKey(u)),t=0,n=0,s=new Array(this._array.length+this._insertedValues.length);for(let a=0;a<s.length;a++)n>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[n])?(s[a]=e[t],t++):s[a]=this._array[n++];this._array=s,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(dt=this._search(t),dt===-1)||this._getKey(this._array[dt])!==t)return!1;do if(this._array[dt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(dt),!0;while(++dt<this._array.length&&this._getKey(this._array[dt])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((a,u)=>a-u),t=0,n=new Array(this._array.length-e.length),s=0;for(let a=0;a<this._array.length;a++)e[t]===a?t++:n[s++]=this._array[a];this._array=n,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(dt=this._search(e),!(dt<0||dt>=this._array.length)&&this._getKey(this._array[dt])===e))do yield this._array[dt];while(++dt<this._array.length&&this._getKey(this._array[dt])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(dt=this._search(e),!(dt<0||dt>=this._array.length)&&this._getKey(this._array[dt])===e))do t(this._array[dt]);while(++dt<this._array.length&&this._getKey(this._array[dt])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,n=this._array.length-1;for(;n>=t;){let s=t+n>>1,a=this._getKey(this._array[s]);if(a>e)n=s-1;else if(a<e)t=s+1;else{for(;s>0&&this._getKey(this._array[s-1])===e;)s--;return s}}return t}},Yh=0,Bv=0,sk=class extends De{constructor(){super(),this._decorations=new rk(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new le),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new le),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(rt(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new lk(e);if(t){let n=t.marker.onDispose(()=>t.dispose()),s=t.onDispose(()=>{s.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),n.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,n){let s=0,a=0;for(let u of this._decorations.getKeyIterator(t))s=u.options.x??0,a=s+(u.options.width??1),e>=s&&e<a&&(!n||(u.options.layer??"bottom")===n)&&(yield u)}forEachDecorationAtCell(e,t,n,s){this._decorations.forEachByKey(t,a=>{Yh=a.options.x??0,Bv=Yh+(a.options.width??1),e>=Yh&&e<Bv&&(!n||(a.options.layer??"bottom")===n)&&s(a)})}},lk=class extends lr{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new le),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new le),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=lt.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=lt.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},ak=1e3,ok=class{constructor(e,t=ak){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,n){this._rowCount=n,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t;let s=performance.now();if(s-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=s,this._innerRefresh();else if(!this._additionalRefreshRequested){let a=s-this._lastRefreshMs,u=this._debounceThresholdMS-a;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},u)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},Ov=20,Jo=class extends De{constructor(e,t,n,s){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=s,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let a=this._coreBrowserService.mainDocument;this._accessibilityContainer=a.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=a.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let u=0;u<this._terminal.rows;u++)this._rowElements[u]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[u]);if(this._topBoundaryFocusListener=u=>this._handleBoundaryFocus(u,0),this._bottomBoundaryFocusListener=u=>this._handleBoundaryFocus(u,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=a.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new ok(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(u=>this._handleResize(u.rows))),this._register(this._terminal.onRender(u=>this._refreshRows(u.start,u.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(u=>this._handleChar(u))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
73
|
-
`))),this._register(this._terminal.onA11yTab(u=>this._handleTab(u))),this._register(this._terminal.onKey(u=>this._handleKey(u.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(be(a,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(rt(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<Ov+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
74
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===Ov+1&&(this._liveRegion.textContent+=ff.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,s=n.lines.length.toString();for(let a=e;a<=t;a++){let u=n.lines.get(n.ydisp+a),c=[],d=(u==null?void 0:u.translateToString(!0,void 0,void 0,c))||"",p=(n.ydisp+a+1).toString(),h=this._rowElements[a];h&&(d.length===0?(h.textContent=" ",this._rowColumns.set(h,[0,1])):(h.textContent=d,this._rowColumns.set(h,c)),h.setAttribute("aria-posinset",p),h.setAttribute("aria-setsize",s),this._alignRowWidth(h))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let n=e.target,s=this._rowElements[t===0?1:this._rowElements.length-2],a=n.getAttribute("aria-posinset"),u=t===0?"1":`${this._terminal.buffer.lines.length}`;if(a===u||e.relatedTarget!==s)return;let c,d;if(t===0?(c=n,d=this._rowElements.pop(),this._rowContainer.removeChild(d)):(c=this._rowElements.shift(),d=n,this._rowContainer.removeChild(c)),c.removeEventListener("focus",this._topBoundaryFocusListener),d.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let p=this._createAccessibilityTreeNode();this._rowElements.unshift(p),this._rowContainer.insertAdjacentElement("afterbegin",p)}else{let p=this._createAccessibilityTreeNode();this._rowElements.push(p),this._rowContainer.appendChild(p)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var d;if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let s=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(s)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:s,offset:((d=s.textContent)==null?void 0:d.length)??0}),!this._rowContainer.contains(n.node))return;let a=({node:p,offset:h})=>{let g=p instanceof Text?p.parentNode:p,m=parseInt(g==null?void 0:g.getAttribute("aria-posinset"),10)-1;if(isNaN(m))return console.warn("row is invalid. Race condition?"),null;let S=this._rowColumns.get(g);if(!S)return console.warn("columns is null. Race condition?"),null;let y=h<S.length?S[h]:S.slice(-1)[0]+1;return y>=this._terminal.cols&&(++m,y=0),{row:m,column:y}},u=a(t),c=a(n);if(!(!u||!c)){if(u.row>c.row||u.row===c.row&&u.column>=c.column)throw new Error("invalid range");this._terminal.select(u.column,u.row,(c.row-u.row)*this._terminal.cols-u.column+c.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){var a,u;e.style.transform="";let t=e.getBoundingClientRect().width,n=(u=(a=this._rowColumns.get(e))==null?void 0:a.slice(-1))==null?void 0:u[0];if(!n)return;let s=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${s/t})`}};Jo=ct([oe(1,ld),oe(2,kn),oe(3,En)],Jo);var Kf=class extends De{constructor(e,t,n,s,a){super(),this._element=e,this._mouseService=t,this._renderService=n,this._bufferService=s,this._linkProviderService=a,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new le),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new le),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(rt(()=>{var u;Or(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(u=this._activeProviderReplies)==null||u.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(be(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(be(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(be(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(be(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let n=e.composedPath();for(let s=0;s<n.length;s++){let a=n[s];if(a.classList.contains("xterm"))break;if(a.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){var s,a;(!this._activeProviderReplies||!t)&&((s=this._activeProviderReplies)==null||s.forEach(u=>{u==null||u.forEach(c=>{c.link.dispose&&c.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[u,c]of this._linkProviderService.linkProviders.entries())t?(a=this._activeProviderReplies)!=null&&a.get(u)&&(n=this._checkLinkProviderResult(u,e,n)):c.provideLinks(e.y,d=>{var h,g;if(this._isMouseOut)return;let p=d==null?void 0:d.map(m=>({link:m}));(h=this._activeProviderReplies)==null||h.set(u,p),n=this._checkLinkProviderResult(u,e,n),((g=this._activeProviderReplies)==null?void 0:g.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let n=new Set;for(let s=0;s<t.size;s++){let a=t.get(s);if(a)for(let u=0;u<a.length;u++){let c=a[u],d=c.link.range.start.y<e?0:c.link.range.start.x,p=c.link.range.end.y>e?this._bufferService.cols:c.link.range.end.x;for(let h=d;h<=p;h++){if(n.has(h)){a.splice(u--,1);break}n.add(h)}}}}_checkLinkProviderResult(e,t,n){var u;if(!this._activeProviderReplies)return n;let s=this._activeProviderReplies.get(e),a=!1;for(let c=0;c<e;c++)(!this._activeProviderReplies.has(c)||this._activeProviderReplies.get(c))&&(a=!0);if(!a&&s){let c=s.find(d=>this._linkAtPosition(d.link,t));c&&(n=!0,this._handleNewLink(c))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let c=0;c<this._activeProviderReplies.size;c++){let d=(u=this._activeProviderReplies.get(c))==null?void 0:u.find(p=>this._linkAtPosition(p.link,t));if(d){n=!0,this._handleNewLink(d);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&uk(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Or(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var n,s;return(s=(n=this._currentLink)==null?void 0:n.state)==null?void 0:s.decorations.pointerCursor},set:n=>{var s;(s=this._currentLink)!=null&&s.state&&this._currentLink.state.decorations.pointerCursor!==n&&(this._currentLink.state.decorations.pointerCursor=n,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",n))}},underline:{get:()=>{var n,s;return(s=(n=this._currentLink)==null?void 0:n.state)==null?void 0:s.decorations.underline},set:n=>{var s,a,u;(s=this._currentLink)!=null&&s.state&&((u=(a=this._currentLink)==null?void 0:a.state)==null?void 0:u.decorations.underline)!==n&&(this._currentLink.state.decorations.underline=n,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,n))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(n=>{if(!this._currentLink)return;let s=n.start===0?0:n.start+1+this._bufferService.buffer.ydisp,a=this._bufferService.buffer.ydisp+1+n.end;if(this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=a&&(this._clearCurrentLink(s,a),this._lastMouseEvent)){let u=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);u&&this._askForLink(u,!1)}})))}_linkHover(e,t,n){var s;(s=this._currentLink)!=null&&s.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(n,t.text)}_fireUnderlineEvent(e,t){let n=e.range,s=this._bufferService.buffer.ydisp,a=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-s-1,n.end.x,n.end.y-s-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(a)}_linkLeave(e,t,n){var s;(s=this._currentLink)!=null&&s.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(n,t.text)}_linkAtPosition(e,t){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,s=e.range.end.y*this._bufferService.cols+e.range.end.x,a=t.y*this._bufferService.cols+t.x;return n<=a&&a<=s}_positionFromMouseEvent(e,t,n){let s=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(s)return{x:s[0],y:s[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,s,a){return{x1:e,y1:t,x2:n,y2:s,cols:this._bufferService.cols,fg:a}}};Kf=ct([oe(1,ad),oe(2,En),oe(3,Zt),oe(4,Fy)],Kf);function uk(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var ck=class extends tk{constructor(e={}){super(e),this._linkifier=this._register(new Os),this.browser=aS,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Os),this._onCursorMove=this._register(new le),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new le),this.onKey=this._onKey.event,this._onRender=this._register(new le),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new le),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new le),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new le),this.onBell=this._onBell.event,this._onFocus=this._register(new le),this._onBlur=this._register(new le),this._onA11yCharEmitter=this._register(new le),this._onA11yTabEmitter=this._register(new le),this._onWillOpen=this._register(new le),this._setup(),this._decorationService=this._instantiationService.createInstance(sk),this._instantiationService.setService(sa,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Jw),this._instantiationService.setService(Fy,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(pf)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh((t==null?void 0:t.start)??0,(t==null?void 0:t.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(Pt.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Pt.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Pt.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Pt.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(rt(()=>{var t,n;this._customKeyEventHandler=void 0,(n=(t=this.element)==null?void 0:t.parentNode)==null||n.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let n,s="";switch(t.index){case 256:n="foreground",s="10";break;case 257:n="background",s="11";break;case 258:n="cursor",s="12";break;default:n="ansi",s="4;"+t.index}switch(t.type){case 0:let a=it.toColorRGB(n==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${J.ESC}]${s};${GC(a)}${sS.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(u=>u.ansi[t.index]=St.toColor(...t.color));else{let u=n;this._themeService.modifyColors(c=>c[u]=St.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Jo,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(J.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var e;return(e=this.textarea)==null?void 0:e.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(J.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let n=Math.min(this.buffer.x,this.cols-1),s=this._renderService.dimensions.css.cell.height,a=t.getWidth(n),u=this._renderService.dimensions.css.cell.width*a,c=this.buffer.y*this._renderService.dimensions.css.cell.height,d=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=d+"px",this.textarea.style.top=c+"px",this.textarea.style.width=u+"px",this.textarea.style.height=s+"px",this.textarea.style.lineHeight=s+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(be(this.element,"copy",t=>{this.hasSelection()&&px(t,this._selectionService)}));let e=t=>_x(t,this.textarea,this.coreService,this.optionsService);this._register(be(this.textarea,"paste",e)),this._register(be(this.element,"paste",e)),oS?this._register(be(this.element,"mousedown",t=>{t.button===2&&qg(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(be(this.element,"contextmenu",t=>{qg(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),_d&&this._register(be(this.element,"auxclick",t=>{t.button===1&&Oy(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(be(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(be(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(be(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(be(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(be(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(be(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(be(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var a;if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((a=this.element)==null?void 0:a.ownerDocument.defaultView)&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(be(this.screenElement,"mousemove",u=>this.updateCursorStyle(u))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let n=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",hf.get()),hS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(Zw,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(kn,this._coreBrowserService),this._register(be(this.textarea,"focus",u=>this._handleTextAreaFocus(u))),this._register(be(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Lf,this._document,this._helperContainer),this._instantiationService.setService(su,this._charSizeService),this._themeService=this._instantiationService.createInstance(Uf),this._instantiationService.setService(Ls,this._themeService),this._characterJoinerService=this._instantiationService.createInstance($o),this._instantiationService.setService(Iy,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(Hf,this.rows,this.screenElement)),this._instantiationService.setService(En,this._renderService),this._register(this._renderService.onRenderedViewportChange(u=>this._onRender.fire(u))),this.onResize(u=>this._renderService.resize(u.cols,u.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(Bf,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Nf),this._instantiationService.setService(ad,this._mouseService);let s=this._linkifier.value=this._register(this._instantiationService.createInstance(Kf,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(Mf,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(u=>{super.scrollLines(u,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(jf,this.element,this.screenElement,s)),this._instantiationService.setService(wx,this._selectionService),this._register(this._selectionService.onRequestScrollLines(u=>this.scrollLines(u.amount,u.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(u=>this._renderService.handleSelectionChanged(u.start,u.end,u.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(u=>{this.textarea.value=u,this.textarea.focus(),this.textarea.select()})),this._register(Pt.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var u;this._selectionService.refresh(),(u=this._viewport)==null||u.queueSync()})),this._register(this._instantiationService.createInstance(Rf,this.screenElement)),this._register(be(this.element,"mousedown",u=>this._selectionService.handleMouseDown(u))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(Jo,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",u=>this._handleScreenReaderModeOptionChange(u))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Go,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",u=>{!this._overviewRulerRenderer&&u&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Go,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(zf,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function n(u){var h,g,m,S,y;let c=e._mouseService.getMouseReportCoords(u,e.screenElement);if(!c)return!1;let d,p;switch(u.overrideType||u.type){case"mousemove":p=32,u.buttons===void 0?(d=3,u.button!==void 0&&(d=u.button<3?u.button:3)):d=u.buttons&1?0:u.buttons&4?1:u.buttons&2?2:3;break;case"mouseup":p=0,d=u.button<3?u.button:3;break;case"mousedown":p=1,d=u.button<3?u.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(u)===!1)return!1;let b=u.deltaY;if(b===0||e.coreMouseService.consumeWheelEvent(u,(S=(m=(g=(h=e._renderService)==null?void 0:h.dimensions)==null?void 0:g.device)==null?void 0:m.cell)==null?void 0:S.height,(y=e._coreBrowserService)==null?void 0:y.dpr)===0)return!1;p=b<0?0:1,d=4;break;default:return!1}return p===void 0||d===void 0||d>4?!1:e.coreMouseService.triggerMouseEvent({col:c.col,row:c.row,x:c.x,y:c.y,button:d,action:p,ctrl:u.ctrlKey,alt:u.altKey,shift:u.shiftKey})}let s={mouseup:null,wheel:null,mousedrag:null,mousemove:null},a={mouseup:u=>(n(u),u.buttons||(this._document.removeEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.removeEventListener("mousemove",s.mousedrag)),this.cancel(u)),wheel:u=>(n(u),this.cancel(u,!0)),mousedrag:u=>{u.buttons&&n(u)},mousemove:u=>{u.buttons||n(u)}};this._register(this.coreMouseService.onProtocolChange(u=>{u?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(u)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),u&8?s.mousemove||(t.addEventListener("mousemove",a.mousemove),s.mousemove=a.mousemove):(t.removeEventListener("mousemove",s.mousemove),s.mousemove=null),u&16?s.wheel||(t.addEventListener("wheel",a.wheel,{passive:!1}),s.wheel=a.wheel):(t.removeEventListener("wheel",s.wheel),s.wheel=null),u&2?s.mouseup||(s.mouseup=a.mouseup):(this._document.removeEventListener("mouseup",s.mouseup),s.mouseup=null),u&4?s.mousedrag||(s.mousedrag=a.mousedrag):(this._document.removeEventListener("mousemove",s.mousedrag),s.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(be(t,"mousedown",u=>{if(u.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(u)))return n(u),s.mouseup&&this._document.addEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.addEventListener("mousemove",s.mousedrag),this.cancel(u)})),this._register(be(t,"wheel",u=>{var c,d,p,h,g;if(!s.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(u)===!1)return!1;if(!this.buffer.hasScrollback){if(u.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(u,(h=(p=(d=(c=e._renderService)==null?void 0:c.dimensions)==null?void 0:d.device)==null?void 0:p.cell)==null?void 0:h.height,(g=e._coreBrowserService)==null?void 0:g.dpr)===0)return this.cancel(u,!0);let m=J.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(u.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(m,!0),this.cancel(u,!0)}}},{passive:!1}))}refresh(e,t){var n;(n=this._renderService)==null||n.refreshRows(e,t)}updateCursorStyle(e){var t;(t=this._selectionService)!=null&&t.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){By(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,n){this._selectionService.setSelection(e,t,n)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var e;(e=this._selectionService)==null||e.clearSelection()}selectAll(){var e;(e=this._selectionService)==null||e.selectAll()}selectLines(e,t){var n;(n=this._selectionService)==null||n.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let n=nk(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let s=this.rows-1;return this.scrollLines(n.type===2?-s:s),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===J.ETX||n.key===J.CR)&&(this.textarea.value=""),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let n=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?n:n&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(hk(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){var n;(n=this._charSizeService)==null||n.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(yt));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){var t;this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),(t=this._selectionService)==null||t.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){var e;(e=this._renderService)==null||e.clearTextureAtlas()}_reportFocus(){var e;(e=this.element)!=null&&e.classList.contains("focus")?this.coreService.triggerDataEvent(J.ESC+"[I"):this.coreService.triggerDataEvent(J.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),n=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${J.ESC}[4;${n};${t}t`);break;case 1:let s=this._renderService.dimensions.css.cell.width.toFixed(0),a=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${J.ESC}[6;${a};${s}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function hk(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var fk=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let n={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(n),t.dispose=()=>this._wrappedAddonDispose(n),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){t=n;break}if(t===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},dk=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new ji)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}},zv=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new dk(t)}getNullCell(){return new ji}},pk=class extends De{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new le),this.onBufferChange=this._onBufferChange.event,this._normal=new zv(this._core.buffers.normal,"normal"),this._alternate=new zv(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},_k=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,n=>t(n.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(n,s)=>t(n,s.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},mk=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},gk=["cols","rows"],$i=0,vk=class extends De{constructor(e){super(),this._core=this._register(new ck(e)),this._addonManager=this._register(new fk),this._publicOptions={...this._core.options};let t=s=>this._core.options[s],n=(s,a)=>{this._checkReadonlyOptions(s),this._core.options[s]=a};for(let s in this._core.options){let a={get:t.bind(this,s),set:n.bind(this,s)};Object.defineProperty(this._publicOptions,s,a)}}_checkReadonlyOptions(e){if(gk.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new _k(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new mk(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this._register(new pk(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,n){this._verifyIntegers(e,t,n),this._core.select(e,t,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
75
|
-
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return hf.get()},set promptLabel(e){hf.set(e)},get tooMuchOutput(){return ff.get()},set tooMuchOutput(e){ff.set(e)}}}_verifyIntegers(...e){for($i of e)if($i===1/0||isNaN($i)||$i%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for($i of e)if($i&&($i===1/0||isNaN($i)||$i%1!==0||$i<0))throw new Error("This API only accepts positive integers")}};/**
|
|
76
|
-
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
77
|
-
* @license MIT
|
|
78
|
-
*
|
|
79
|
-
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
80
|
-
* @license MIT
|
|
81
|
-
*
|
|
82
|
-
* Originally forked from (with the author's permission):
|
|
83
|
-
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
84
|
-
* http://bellard.org/jslinux/
|
|
85
|
-
* Copyright (c) 2011 Fabrice Bellard
|
|
86
|
-
*/var yk=2,Sk=1,bk=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var m;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:((m=this._terminal.options.overviewRuler)==null?void 0:m.width)||14,n=window.getComputedStyle(this._terminal.element.parentElement),s=parseInt(n.getPropertyValue("height")),a=Math.max(0,parseInt(n.getPropertyValue("width"))),u=window.getComputedStyle(this._terminal.element),c={top:parseInt(u.getPropertyValue("padding-top")),bottom:parseInt(u.getPropertyValue("padding-bottom")),right:parseInt(u.getPropertyValue("padding-right")),left:parseInt(u.getPropertyValue("padding-left"))},d=c.top+c.bottom,p=c.right+c.left,h=s-d,g=a-p-t;return{cols:Math.max(yk,Math.floor(g/e.css.cell.width)),rows:Math.max(Sk,Math.floor(h/e.css.cell.height))}}};function xk({token:e}){const t=ge.useRef(null),n=ge.useRef(null),s=ge.useRef(null),a=ge.useRef(null),u=ge.useCallback(()=>{if(!t.current)return;const c=new vk({scrollback:5e3,fontSize:13,fontFamily:'"Geist Mono", ui-monospace, monospace',lineHeight:1.4,letterSpacing:.5,cursorBlink:!0,cursorStyle:"block",theme:{background:"#F0EBE1",foreground:"#2C1810",cursor:"#8B4513",cursorAccent:"#F0EBE1",selectionBackground:"#D4C5B0",selectionForeground:"#2C1810",black:"#2C1810",red:"#CC3333",green:"#5B7A2E",yellow:"#8B6914",blue:"#4A6FA5",magenta:"#7B4B8A",cyan:"#4A8B8B",white:"#2C1810",brightBlack:"#8B7355",brightRed:"#E04040",brightGreen:"#6B8F38",brightYellow:"#A07D1C",brightBlue:"#5A82BA",brightMagenta:"#8E5D9F",brightCyan:"#5A9F9F",brightWhite:"#4A3728"},allowTransparency:!1,drawBoldTextInBrightColors:!0}),d=new bk;c.loadAddon(d),c.open(t.current),a.current=d,n.current=c,requestAnimationFrame(()=>{try{d.fit()}catch{}});const p=window.location.protocol==="https:"?"wss:":"ws:",h=new WebSocket(`${p}//${window.location.host}/ws/terminal?token=${e}`);s.current=h,h.onopen=()=>{h.send(JSON.stringify({type:"resize",cols:c.cols,rows:c.rows}))},h.onmessage=m=>{c.write(m.data)},h.onclose=()=>{c.write(`\r
|
|
87
|
-
\x1B[33m[Terminal disconnected]\x1B[0m\r
|
|
88
|
-
`)},c.onData(m=>{h.readyState===WebSocket.OPEN&&h.send(m)});const g=new ResizeObserver(()=>{try{d.fit(),h.readyState===WebSocket.OPEN&&h.send(JSON.stringify({type:"resize",cols:c.cols,rows:c.rows}))}catch{}});return g.observe(t.current),()=>{g.disconnect(),h.close(),c.dispose()}},[e]);return ge.useEffect(()=>u(),[u]),E.jsxs("div",{className:"h-full flex flex-col",children:[E.jsxs("div",{className:"px-3 py-1.5 border-b border-border text-xs text-muted font-mono flex items-center gap-2",children:[E.jsx("span",{className:"w-2 h-2 rounded-full bg-green-600"}),"Claude CLI"]}),E.jsx("div",{ref:t,className:"flex-1 min-h-0"})]})}function wk(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Ck=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kk=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ek={};function Lv(e,t){return(Ek.jsx?kk:Ck).test(e)}const Tk=/[ \t\n\f\r]/g;function Dk(e){return typeof e=="object"?e.type==="text"?Nv(e.value):!1:Nv(e)}function Nv(e){return e.replace(Tk,"")===""}class oa{constructor(t,n,s){this.normal=n,this.property=t,s&&(this.space=s)}}oa.prototype.normal={};oa.prototype.property={};oa.prototype.space=void 0;function bS(e,t){const n={},s={};for(const a of e)Object.assign(n,a.property),Object.assign(s,a.normal);return new oa(n,s,t)}function Xf(e){return e.toLowerCase()}class ci{constructor(t,n){this.attribute=n,this.property=t}}ci.prototype.attribute="";ci.prototype.booleanish=!1;ci.prototype.boolean=!1;ci.prototype.commaOrSpaceSeparated=!1;ci.prototype.commaSeparated=!1;ci.prototype.defined=!1;ci.prototype.mustUseProperty=!1;ci.prototype.number=!1;ci.prototype.overloadedBoolean=!1;ci.prototype.property="";ci.prototype.spaceSeparated=!1;ci.prototype.space=void 0;let Ak=0;const Ee=Hr(),vt=Hr(),Gf=Hr(),re=Hr(),Je=Hr(),Bs=Hr(),xi=Hr();function Hr(){return 2**++Ak}const $f=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ee,booleanish:vt,commaOrSpaceSeparated:xi,commaSeparated:Bs,number:re,overloadedBoolean:Gf,spaceSeparated:Je},Symbol.toStringTag,{value:"Module"})),Kh=Object.keys($f);class md extends ci{constructor(t,n,s,a){let u=-1;if(super(t,n),Hv(this,"space",a),typeof s=="number")for(;++u<Kh.length;){const c=Kh[u];Hv(this,Kh[u],(s&$f[c])===$f[c])}}}md.prototype.defined=!0;function Hv(e,t,n){n&&(e[t]=n)}function Hs(e){const t={},n={};for(const[s,a]of Object.entries(e.properties)){const u=new md(s,e.transform(e.attributes||{},s),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(u.mustUseProperty=!0),t[s]=u,n[Xf(s)]=s,n[Xf(u.attribute)]=s}return new oa(t,n,e.space)}const xS=Hs({properties:{ariaActiveDescendant:null,ariaAtomic:vt,ariaAutoComplete:null,ariaBusy:vt,ariaChecked:vt,ariaColCount:re,ariaColIndex:re,ariaColSpan:re,ariaControls:Je,ariaCurrent:null,ariaDescribedBy:Je,ariaDetails:null,ariaDisabled:vt,ariaDropEffect:Je,ariaErrorMessage:null,ariaExpanded:vt,ariaFlowTo:Je,ariaGrabbed:vt,ariaHasPopup:null,ariaHidden:vt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Je,ariaLevel:re,ariaLive:null,ariaModal:vt,ariaMultiLine:vt,ariaMultiSelectable:vt,ariaOrientation:null,ariaOwns:Je,ariaPlaceholder:null,ariaPosInSet:re,ariaPressed:vt,ariaReadOnly:vt,ariaRelevant:null,ariaRequired:vt,ariaRoleDescription:Je,ariaRowCount:re,ariaRowIndex:re,ariaRowSpan:re,ariaSelected:vt,ariaSetSize:re,ariaSort:null,ariaValueMax:re,ariaValueMin:re,ariaValueNow:re,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function wS(e,t){return t in e?e[t]:t}function CS(e,t){return wS(e,t.toLowerCase())}const Mk=Hs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Bs,acceptCharset:Je,accessKey:Je,action:null,allow:null,allowFullScreen:Ee,allowPaymentRequest:Ee,allowUserMedia:Ee,alt:null,as:null,async:Ee,autoCapitalize:null,autoComplete:Je,autoFocus:Ee,autoPlay:Ee,blocking:Je,capture:null,charSet:null,checked:Ee,cite:null,className:Je,cols:re,colSpan:null,content:null,contentEditable:vt,controls:Ee,controlsList:Je,coords:re|Bs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ee,defer:Ee,dir:null,dirName:null,disabled:Ee,download:Gf,draggable:vt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ee,formTarget:null,headers:Je,height:re,hidden:Gf,high:re,href:null,hrefLang:null,htmlFor:Je,httpEquiv:Je,id:null,imageSizes:null,imageSrcSet:null,inert:Ee,inputMode:null,integrity:null,is:null,isMap:Ee,itemId:null,itemProp:Je,itemRef:Je,itemScope:Ee,itemType:Je,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ee,low:re,manifest:null,max:null,maxLength:re,media:null,method:null,min:null,minLength:re,multiple:Ee,muted:Ee,name:null,nonce:null,noModule:Ee,noValidate:Ee,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:Ee,optimum:re,pattern:null,ping:Je,placeholder:null,playsInline:Ee,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ee,referrerPolicy:null,rel:Je,required:Ee,reversed:Ee,rows:re,rowSpan:re,sandbox:Je,scope:null,scoped:Ee,seamless:Ee,selected:Ee,shadowRootClonable:Ee,shadowRootDelegatesFocus:Ee,shadowRootMode:null,shape:null,size:re,sizes:null,slot:null,span:re,spellCheck:vt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:re,step:null,style:null,tabIndex:re,target:null,title:null,translate:null,type:null,typeMustMatch:Ee,useMap:null,value:vt,width:re,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Je,axis:null,background:null,bgColor:null,border:re,borderColor:null,bottomMargin:re,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ee,declare:Ee,event:null,face:null,frame:null,frameBorder:null,hSpace:re,leftMargin:re,link:null,longDesc:null,lowSrc:null,marginHeight:re,marginWidth:re,noResize:Ee,noHref:Ee,noShade:Ee,noWrap:Ee,object:null,profile:null,prompt:null,rev:null,rightMargin:re,rules:null,scheme:null,scrolling:vt,standby:null,summary:null,text:null,topMargin:re,valueType:null,version:null,vAlign:null,vLink:null,vSpace:re,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ee,disableRemotePlayback:Ee,prefix:null,property:null,results:re,security:null,unselectable:null},space:"html",transform:CS}),Rk=Hs({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:xi,accentHeight:re,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:re,amplitude:re,arabicForm:null,ascent:re,attributeName:null,attributeType:null,azimuth:re,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:re,by:null,calcMode:null,capHeight:re,className:Je,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:re,diffuseConstant:re,direction:null,display:null,dur:null,divisor:re,dominantBaseline:null,download:Ee,dx:null,dy:null,edgeMode:null,editable:null,elevation:re,enableBackground:null,end:null,event:null,exponent:re,externalResourcesRequired:null,fill:null,fillOpacity:re,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:Bs,g2:Bs,glyphName:Bs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:re,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:re,horizOriginX:re,horizOriginY:re,id:null,ideographic:re,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:re,k:re,k1:re,k2:re,k3:re,k4:re,kernelMatrix:xi,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:re,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:re,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:re,overlineThickness:re,paintOrder:null,panose1:null,path:null,pathLength:re,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Je,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:re,pointsAtY:re,pointsAtZ:re,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:xi,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:xi,rev:xi,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:xi,requiredFeatures:xi,requiredFonts:xi,requiredFormats:xi,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:re,specularExponent:re,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:re,strikethroughThickness:re,string:null,stroke:null,strokeDashArray:xi,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:re,strokeOpacity:re,strokeWidth:null,style:null,surfaceScale:re,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:xi,tabIndex:re,tableValues:null,target:null,targetX:re,targetY:re,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:xi,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:re,underlineThickness:re,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:re,values:null,vAlphabetic:re,vMathematical:re,vectorEffect:null,vHanging:re,vIdeographic:re,version:null,vertAdvY:re,vertOriginX:re,vertOriginY:re,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:re,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:wS}),kS=Hs({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()}}),ES=Hs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:CS}),TS=Hs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Bk={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"},Ok=/[A-Z]/g,jv=/-[a-z]/g,zk=/^data[-\w.:]+$/i;function Lk(e,t){const n=Xf(t);let s=t,a=ci;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&zk.test(t)){if(t.charAt(4)==="-"){const u=t.slice(5).replace(jv,Hk);s="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=t.slice(4);if(!jv.test(u)){let c=u.replace(Ok,Nk);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}a=md}return new a(s,t)}function Nk(e){return"-"+e.toLowerCase()}function Hk(e){return e.charAt(1).toUpperCase()}const jk=bS([xS,Mk,kS,ES,TS],"html"),gd=bS([xS,Rk,kS,ES,TS],"svg");function Uk(e){return e.join(" ").trim()}var Ds={},Xh,Uv;function Pk(){if(Uv)return Xh;Uv=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,d=/^\s+|\s+$/g,p=`
|
|
89
|
-
`,h="/",g="*",m="",S="comment",y="declaration";function b(B,A){if(typeof B!="string")throw new TypeError("First argument must be a string");if(!B)return[];A=A||{};var Z=1,P=1;function ee(K){var j=K.match(t);j&&(Z+=j.length);var M=K.lastIndexOf(p);P=~M?K.length-M:P+K.length}function ne(){var K={line:Z,column:P};return function(j){return j.position=new z(K),_e(),j}}function z(K){this.start=K,this.end={line:Z,column:P},this.source=A.source}z.prototype.content=B;function ie(K){var j=new Error(A.source+":"+Z+":"+P+": "+K);if(j.reason=K,j.filename=A.source,j.line=Z,j.column=P,j.source=B,!A.silent)throw j}function ue(K){var j=K.exec(B);if(j){var M=j[0];return ee(M),B=B.slice(M.length),j}}function _e(){ue(n)}function H(K){var j;for(K=K||[];j=te();)j!==!1&&K.push(j);return K}function te(){var K=ne();if(!(h!=B.charAt(0)||g!=B.charAt(1))){for(var j=2;m!=B.charAt(j)&&(g!=B.charAt(j)||h!=B.charAt(j+1));)++j;if(j+=2,m===B.charAt(j-1))return ie("End of comment missing");var M=B.slice(2,j-2);return P+=2,ee(M),B=B.slice(j),P+=2,K({type:S,comment:M})}}function V(){var K=ne(),j=ue(s);if(j){if(te(),!ue(a))return ie("property missing ':'");var M=ue(u),q=K({type:y,property:C(j[0].replace(e,m)),value:M?C(M[0].replace(e,m)):m});return ue(c),q}}function I(){var K=[];H(K);for(var j;j=V();)j!==!1&&(K.push(j),H(K));return K}return _e(),I()}function C(B){return B?B.replace(d,m):m}return Xh=b,Xh}var Pv;function Ik(){if(Pv)return Ds;Pv=1;var e=Ds&&Ds.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.default=n;const t=e(Pk());function n(s,a){let u=null;if(!s||typeof s!="string")return u;const c=(0,t.default)(s),d=typeof a=="function";return c.forEach(p=>{if(p.type!=="declaration")return;const{property:h,value:g}=p;d?a(h,g,p):g&&(u=u||{},u[h]=g)}),u}return Ds}var Ul={},Iv;function Fk(){if(Iv)return Ul;Iv=1,Object.defineProperty(Ul,"__esModule",{value:!0}),Ul.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,u=function(h){return!h||n.test(h)||e.test(h)},c=function(h,g){return g.toUpperCase()},d=function(h,g){return"".concat(g,"-")},p=function(h,g){return g===void 0&&(g={}),u(h)?h:(h=h.toLowerCase(),g.reactCompat?h=h.replace(a,d):h=h.replace(s,d),h.replace(t,c))};return Ul.camelCase=p,Ul}var Pl,Fv;function qk(){if(Fv)return Pl;Fv=1;var e=Pl&&Pl.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(Ik()),n=Fk();function s(a,u){var c={};return!a||typeof a!="string"||(0,t.default)(a,function(d,p){d&&p&&(c[(0,n.camelCase)(d,u)]=p)}),c}return s.default=s,Pl=s,Pl}var Vk=qk();const Wk=nu(Vk),DS=AS("end"),vd=AS("start");function AS(e){return t;function t(n){const s=n&&n.position&&n.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function MS(e){const t=vd(e),n=DS(e);if(t&&n)return{start:t,end:n}}function Gl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?qv(e.position):"start"in e||"end"in e?qv(e):"line"in e||"column"in e?Zf(e):""}function Zf(e){return Vv(e&&e.line)+":"+Vv(e&&e.column)}function qv(e){return Zf(e&&e.start)+"-"+Zf(e&&e.end)}function Vv(e){return e&&typeof e=="number"?e:1}class Vt extends Error{constructor(t,n,s){super(),typeof n=="string"&&(s=n,n=void 0);let a="",u={},c=!1;if(n&&("line"in n&&"column"in n?u={place:n}:"start"in n&&"end"in n?u={place:n}:"type"in n?u={ancestors:[n],place:n.position}:u={...n}),typeof t=="string"?a=t:!u.cause&&t&&(c=!0,a=t.message,u.cause=t),!u.ruleId&&!u.source&&typeof s=="string"){const p=s.indexOf(":");p===-1?u.ruleId=s:(u.source=s.slice(0,p),u.ruleId=s.slice(p+1))}if(!u.place&&u.ancestors&&u.ancestors){const p=u.ancestors[u.ancestors.length-1];p&&(u.place=p.position)}const d=u.place&&"start"in u.place?u.place.start:u.place;this.ancestors=u.ancestors||void 0,this.cause=u.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=d?d.line:void 0,this.name=Gl(u.place)||"1:1",this.place=u.place||void 0,this.reason=this.message,this.ruleId=u.ruleId||void 0,this.source=u.source||void 0,this.stack=c&&u.cause&&typeof u.cause.stack=="string"?u.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Vt.prototype.file="";Vt.prototype.name="";Vt.prototype.reason="";Vt.prototype.message="";Vt.prototype.stack="";Vt.prototype.column=void 0;Vt.prototype.line=void 0;Vt.prototype.ancestors=void 0;Vt.prototype.cause=void 0;Vt.prototype.fatal=void 0;Vt.prototype.place=void 0;Vt.prototype.ruleId=void 0;Vt.prototype.source=void 0;const yd={}.hasOwnProperty,Yk=new Map,Kk=/[A-Z]/g,Xk=new Set(["table","tbody","thead","tfoot","tr"]),Gk=new Set(["td","th"]),RS="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $k(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let s;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=r2(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");s=n2(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,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"?gd:jk,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},u=BS(a,e,void 0);return u&&typeof u!="string"?u:a.create(e,a.Fragment,{children:u||void 0},void 0)}function BS(e,t,n){if(t.type==="element")return Zk(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Qk(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return e2(e,t,n);if(t.type==="mdxjsEsm")return Jk(e,t);if(t.type==="root")return t2(e,t,n);if(t.type==="text")return i2(e,t)}function Zk(e,t,n){const s=e.schema;let a=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(a=gd,e.schema=a),e.ancestors.push(t);const u=zS(e,t.tagName,!1),c=s2(e,t);let d=bd(e,t);return Xk.has(t.tagName)&&(d=d.filter(function(p){return typeof p=="string"?!Dk(p):!0})),OS(e,c,u,t),Sd(c,d),e.ancestors.pop(),e.schema=s,e.create(t,u,c,n)}function Qk(e,t){if(t.data&&t.data.estree&&e.evaluater){const s=t.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}ta(e,t.position)}function Jk(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ta(e,t.position)}function e2(e,t,n){const s=e.schema;let a=s;t.name==="svg"&&s.space==="html"&&(a=gd,e.schema=a),e.ancestors.push(t);const u=t.name===null?e.Fragment:zS(e,t.name,!0),c=l2(e,t),d=bd(e,t);return OS(e,c,u,t),Sd(c,d),e.ancestors.pop(),e.schema=s,e.create(t,u,c,n)}function t2(e,t,n){const s={};return Sd(s,bd(e,t)),e.create(t,e.Fragment,s,n)}function i2(e,t){return t.value}function OS(e,t,n,s){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=s)}function Sd(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function n2(e,t,n){return s;function s(a,u,c,d){const h=Array.isArray(c.children)?n:t;return d?h(u,c,d):h(u,c)}}function r2(e,t){return n;function n(s,a,u,c){const d=Array.isArray(u.children),p=vd(s);return t(a,u,c,d,{columnNumber:p?p.column-1:void 0,fileName:e,lineNumber:p?p.line:void 0},void 0)}}function s2(e,t){const n={};let s,a;for(a in t.properties)if(a!=="children"&&yd.call(t.properties,a)){const u=a2(e,a,t.properties[a]);if(u){const[c,d]=u;e.tableCellAlignToStyle&&c==="align"&&typeof d=="string"&&Gk.has(t.tagName)?s=d:n[c]=d}}if(s){const u=n.style||(n.style={});u[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return n}function l2(e,t){const n={};for(const s of t.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const u=s.data.estree.body[0];u.type;const c=u.expression;c.type;const d=c.properties[0];d.type,Object.assign(n,e.evaluater.evaluateExpression(d.argument))}else ta(e,t.position);else{const a=s.name;let u;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const d=s.value.data.estree.body[0];d.type,u=e.evaluater.evaluateExpression(d.expression)}else ta(e,t.position);else u=s.value===null?!0:s.value;n[a]=u}return n}function bd(e,t){const n=[];let s=-1;const a=e.passKeys?new Map:Yk;for(;++s<t.children.length;){const u=t.children[s];let c;if(e.passKeys){const p=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(p){const h=a.get(p)||0;c=p+"-"+h,a.set(p,h+1)}}const d=BS(e,u,c);d!==void 0&&n.push(d)}return n}function a2(e,t,n){const s=Lk(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=s.commaSeparated?wk(n):Uk(n)),s.property==="style"){let a=typeof n=="object"?n:o2(e,String(n));return e.stylePropertyNameCase==="css"&&(a=u2(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&s.space?Bk[s.property]||s.property:s.attribute,n]}}function o2(e,t){try{return Wk(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const s=n,a=new Vt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=RS+"#cannot-parse-style-attribute",a}}function zS(e,t,n){let s;if(!n)s={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let u=-1,c;for(;++u<a.length;){const d=Lv(a[u])?{type:"Identifier",name:a[u]}:{type:"Literal",value:a[u]};c=c?{type:"MemberExpression",object:c,property:d,computed:!!(u&&d.type==="Literal"),optional:!1}:d}s=c}else s=Lv(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){const a=s.value;return yd.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(s);ta(e)}function ta(e,t){const n=new Vt("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=RS+"#cannot-handle-mdx-estrees-without-createevaluater",n}function u2(e){const t={};let n;for(n in e)yd.call(e,n)&&(t[c2(n)]=e[n]);return t}function c2(e){let t=e.replace(Kk,h2);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function h2(e){return"-"+e.toLowerCase()}const Gh={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"]},f2={};function xd(e,t){const n=f2,s=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return LS(e,s,a)}function LS(e,t,n){if(d2(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 Wv(e.children,t,n)}return Array.isArray(e)?Wv(e,t,n):""}function Wv(e,t,n){const s=[];let a=-1;for(;++a<e.length;)s[a]=LS(e[a],t,n);return s.join("")}function d2(e){return!!(e&&typeof e=="object")}const Yv=document.createElement("i");function wd(e){const t="&"+e+";";Yv.innerHTML=t;const n=Yv.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function wi(e,t,n,s){const a=e.length;let u=0,c;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,s.length<1e4)c=Array.from(s),c.unshift(t,n),e.splice(...c);else for(n&&e.splice(t,n);u<s.length;)c=s.slice(u,u+1e4),c.unshift(t,0),e.splice(...c),u+=1e4,t+=1e4}function Hi(e,t){return e.length>0?(wi(e,e.length,0,t),e):t}const Kv={}.hasOwnProperty;function NS(e){const t={};let n=-1;for(;++n<e.length;)p2(t,e[n]);return t}function p2(e,t){let n;for(n in t){const a=(Kv.call(e,n)?e[n]:void 0)||(e[n]={}),u=t[n];let c;if(u)for(c in u){Kv.call(a,c)||(a[c]=[]);const d=u[c];_2(a[c],Array.isArray(d)?d:d?[d]:[])}}}function _2(e,t){let n=-1;const s=[];for(;++n<t.length;)(t[n].add==="after"?e:s).push(t[n]);wi(e,0,0,s)}function HS(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 Vi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const $t=ar(/[A-Za-z]/),qt=ar(/[\dA-Za-z]/),m2=ar(/[#-'*+\--9=?A-Z^-~]/);function eu(e){return e!==null&&(e<32||e===127)}const Qf=ar(/\d/),g2=ar(/[\dA-Fa-f]/),v2=ar(/[!-/:-@[-`{-~]/);function ve(e){return e!==null&&e<-2}function Qe(e){return e!==null&&(e<0||e===32)}function Oe(e){return e===-2||e===-1||e===32}const ou=ar(new RegExp("\\p{P}|\\p{S}","u")),Lr=ar(/\s/);function ar(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function js(e){const t=[];let n=-1,s=0,a=0;for(;++n<e.length;){const u=e.charCodeAt(n);let c="";if(u===37&&qt(e.charCodeAt(n+1))&&qt(e.charCodeAt(n+2)))a=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(c=String.fromCharCode(u));else if(u>55295&&u<57344){const d=e.charCodeAt(n+1);u<56320&&d>56319&&d<57344?(c=String.fromCharCode(u,d),a=1):c="�"}else c=String.fromCharCode(u);c&&(t.push(e.slice(s,n),encodeURIComponent(c)),s=n+a+1,c=""),a&&(n+=a,a=0)}return t.join("")+e.slice(s)}function je(e,t,n,s){const a=s?s-1:Number.POSITIVE_INFINITY;let u=0;return c;function c(p){return Oe(p)?(e.enter(n),d(p)):t(p)}function d(p){return Oe(p)&&u++<a?(e.consume(p),d):(e.exit(n),t(p))}}const y2={tokenize:S2};function S2(e){const t=e.attempt(this.parser.constructs.contentInitial,s,a);let n;return t;function s(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),je(e,t,"linePrefix")}function a(d){return e.enter("paragraph"),u(d)}function u(d){const p=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=p),n=p,c(d)}function c(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return ve(d)?(e.consume(d),e.exit("chunkText"),u):(e.consume(d),c)}}const b2={tokenize:x2},Xv={tokenize:w2};function x2(e){const t=this,n=[];let s=0,a,u,c;return d;function d(P){if(s<n.length){const ee=n[s];return t.containerState=ee[1],e.attempt(ee[0].continuation,p,h)(P)}return h(P)}function p(P){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&Z();const ee=t.events.length;let ne=ee,z;for(;ne--;)if(t.events[ne][0]==="exit"&&t.events[ne][1].type==="chunkFlow"){z=t.events[ne][1].end;break}A(s);let ie=ee;for(;ie<t.events.length;)t.events[ie][1].end={...z},ie++;return wi(t.events,ne+1,0,t.events.slice(ee)),t.events.length=ie,h(P)}return d(P)}function h(P){if(s===n.length){if(!a)return S(P);if(a.currentConstruct&&a.currentConstruct.concrete)return b(P);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Xv,g,m)(P)}function g(P){return a&&Z(),A(s),S(P)}function m(P){return t.parser.lazy[t.now().line]=s!==n.length,c=t.now().offset,b(P)}function S(P){return t.containerState={},e.attempt(Xv,y,b)(P)}function y(P){return s++,n.push([t.currentConstruct,t.containerState]),S(P)}function b(P){if(P===null){a&&Z(),A(0),e.consume(P);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:u}),C(P)}function C(P){if(P===null){B(e.exit("chunkFlow"),!0),A(0),e.consume(P);return}return ve(P)?(e.consume(P),B(e.exit("chunkFlow")),s=0,t.interrupt=void 0,d):(e.consume(P),C)}function B(P,ee){const ne=t.sliceStream(P);if(ee&&ne.push(null),P.previous=u,u&&(u.next=P),u=P,a.defineSkip(P.start),a.write(ne),t.parser.lazy[P.start.line]){let z=a.events.length;for(;z--;)if(a.events[z][1].start.offset<c&&(!a.events[z][1].end||a.events[z][1].end.offset>c))return;const ie=t.events.length;let ue=ie,_e,H;for(;ue--;)if(t.events[ue][0]==="exit"&&t.events[ue][1].type==="chunkFlow"){if(_e){H=t.events[ue][1].end;break}_e=!0}for(A(s),z=ie;z<t.events.length;)t.events[z][1].end={...H},z++;wi(t.events,ue+1,0,t.events.slice(ie)),t.events.length=z}}function A(P){let ee=n.length;for(;ee-- >P;){const ne=n[ee];t.containerState=ne[1],ne[0].exit.call(t,e)}n.length=P}function Z(){a.write([null]),u=void 0,a=void 0,t.containerState._closeFlow=void 0}}function w2(e,t,n){return je(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function zs(e){if(e===null||Qe(e)||Lr(e))return 1;if(ou(e))return 2}function uu(e,t,n){const s=[];let a=-1;for(;++a<e.length;){const u=e[a].resolveAll;u&&!s.includes(u)&&(t=u(t,n),s.push(u))}return t}const Jf={name:"attention",resolveAll:C2,tokenize:k2};function C2(e,t){let n=-1,s,a,u,c,d,p,h,g;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(s=n;s--;)if(e[s][0]==="exit"&&e[s][1].type==="attentionSequence"&&e[s][1]._open&&t.sliceSerialize(e[s][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[s][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[s][1].end.offset-e[s][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;p=e[s][1].end.offset-e[s][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[s][1].end},S={...e[n][1].start};Gv(m,-p),Gv(S,p),c={type:p>1?"strongSequence":"emphasisSequence",start:m,end:{...e[s][1].end}},d={type:p>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:S},u={type:p>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[n][1].start}},a={type:p>1?"strong":"emphasis",start:{...c.start},end:{...d.end}},e[s][1].end={...c.start},e[n][1].start={...d.end},h=[],e[s][1].end.offset-e[s][1].start.offset&&(h=Hi(h,[["enter",e[s][1],t],["exit",e[s][1],t]])),h=Hi(h,[["enter",a,t],["enter",c,t],["exit",c,t],["enter",u,t]]),h=Hi(h,uu(t.parser.constructs.insideSpan.null,e.slice(s+1,n),t)),h=Hi(h,[["exit",u,t],["enter",d,t],["exit",d,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,h=Hi(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,wi(e,s-1,n-s+3,h),n=s+h.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function k2(e,t){const n=this.parser.constructs.attentionMarkers.null,s=this.previous,a=zs(s);let u;return c;function c(p){return u=p,e.enter("attentionSequence"),d(p)}function d(p){if(p===u)return e.consume(p),d;const h=e.exit("attentionSequence"),g=zs(p),m=!g||g===2&&a||n.includes(p),S=!a||a===2&&g||n.includes(s);return h._open=!!(u===42?m:m&&(a||!S)),h._close=!!(u===42?S:S&&(g||!m)),t(p)}}function Gv(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const E2={name:"autolink",tokenize:T2};function T2(e,t,n){let s=0;return a;function a(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),u}function u(y){return $t(y)?(e.consume(y),c):y===64?n(y):h(y)}function c(y){return y===43||y===45||y===46||qt(y)?(s=1,d(y)):h(y)}function d(y){return y===58?(e.consume(y),s=0,p):(y===43||y===45||y===46||qt(y))&&s++<32?(e.consume(y),d):(s=0,h(y))}function p(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||eu(y)?n(y):(e.consume(y),p)}function h(y){return y===64?(e.consume(y),g):m2(y)?(e.consume(y),h):n(y)}function g(y){return qt(y)?m(y):n(y)}function m(y){return y===46?(e.consume(y),s=0,g):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):S(y)}function S(y){if((y===45||qt(y))&&s++<63){const b=y===45?S:m;return e.consume(y),b}return n(y)}}const ua={partial:!0,tokenize:D2};function D2(e,t,n){return s;function s(u){return Oe(u)?je(e,a,"linePrefix")(u):a(u)}function a(u){return u===null||ve(u)?t(u):n(u)}}const jS={continuation:{tokenize:M2},exit:R2,name:"blockQuote",tokenize:A2};function A2(e,t,n){const s=this;return a;function a(c){if(c===62){const d=s.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),u}return n(c)}function u(c){return Oe(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function M2(e,t,n){const s=this;return a;function a(c){return Oe(c)?je(e,u,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):u(c)}function u(c){return e.attempt(jS,t,n)(c)}}function R2(e){e.exit("blockQuote")}const US={name:"characterEscape",tokenize:B2};function B2(e,t,n){return s;function s(u){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(u),e.exit("escapeMarker"),a}function a(u){return v2(u)?(e.enter("characterEscapeValue"),e.consume(u),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(u)}}const PS={name:"characterReference",tokenize:O2};function O2(e,t,n){const s=this;let a=0,u,c;return d;function d(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),p}function p(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),u=31,c=qt,g(m))}function h(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),u=6,c=g2,g):(e.enter("characterReferenceValue"),u=7,c=Qf,g(m))}function g(m){if(m===59&&a){const S=e.exit("characterReferenceValue");return c===qt&&!wd(s.sliceSerialize(S))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(m)&&a++<u?(e.consume(m),g):n(m)}}const $v={partial:!0,tokenize:L2},Zv={concrete:!0,name:"codeFenced",tokenize:z2};function z2(e,t,n){const s=this,a={partial:!0,tokenize:ne};let u=0,c=0,d;return p;function p(z){return h(z)}function h(z){const ie=s.events[s.events.length-1];return u=ie&&ie[1].type==="linePrefix"?ie[2].sliceSerialize(ie[1],!0).length:0,d=z,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(z)}function g(z){return z===d?(c++,e.consume(z),g):c<3?n(z):(e.exit("codeFencedFenceSequence"),Oe(z)?je(e,m,"whitespace")(z):m(z))}function m(z){return z===null||ve(z)?(e.exit("codeFencedFence"),s.interrupt?t(z):e.check($v,C,ee)(z)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),S(z))}function S(z){return z===null||ve(z)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(z)):Oe(z)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),je(e,y,"whitespace")(z)):z===96&&z===d?n(z):(e.consume(z),S)}function y(z){return z===null||ve(z)?m(z):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(z))}function b(z){return z===null||ve(z)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(z)):z===96&&z===d?n(z):(e.consume(z),b)}function C(z){return e.attempt(a,ee,B)(z)}function B(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),A}function A(z){return u>0&&Oe(z)?je(e,Z,"linePrefix",u+1)(z):Z(z)}function Z(z){return z===null||ve(z)?e.check($v,C,ee)(z):(e.enter("codeFlowValue"),P(z))}function P(z){return z===null||ve(z)?(e.exit("codeFlowValue"),Z(z)):(e.consume(z),P)}function ee(z){return e.exit("codeFenced"),t(z)}function ne(z,ie,ue){let _e=0;return H;function H(j){return z.enter("lineEnding"),z.consume(j),z.exit("lineEnding"),te}function te(j){return z.enter("codeFencedFence"),Oe(j)?je(z,V,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):V(j)}function V(j){return j===d?(z.enter("codeFencedFenceSequence"),I(j)):ue(j)}function I(j){return j===d?(_e++,z.consume(j),I):_e>=c?(z.exit("codeFencedFenceSequence"),Oe(j)?je(z,K,"whitespace")(j):K(j)):ue(j)}function K(j){return j===null||ve(j)?(z.exit("codeFencedFence"),ie(j)):ue(j)}}}function L2(e,t,n){const s=this;return a;function a(c){return c===null?n(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u)}function u(c){return s.parser.lazy[s.now().line]?n(c):t(c)}}const $h={name:"codeIndented",tokenize:H2},N2={partial:!0,tokenize:j2};function H2(e,t,n){const s=this;return a;function a(h){return e.enter("codeIndented"),je(e,u,"linePrefix",5)(h)}function u(h){const g=s.events[s.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?c(h):n(h)}function c(h){return h===null?p(h):ve(h)?e.attempt(N2,c,p)(h):(e.enter("codeFlowValue"),d(h))}function d(h){return h===null||ve(h)?(e.exit("codeFlowValue"),c(h)):(e.consume(h),d)}function p(h){return e.exit("codeIndented"),t(h)}}function j2(e,t,n){const s=this;return a;function a(c){return s.parser.lazy[s.now().line]?n(c):ve(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),a):je(e,u,"linePrefix",5)(c)}function u(c){const d=s.events[s.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):ve(c)?a(c):n(c)}}const U2={name:"codeText",previous:I2,resolve:P2,tokenize:F2};function P2(e){let t=e.length-4,n=3,s,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(s=n;++s<t;)if(e[s][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(s=n-1,t++;++s<=t;)a===void 0?s!==t&&e[s][1].type!=="lineEnding"&&(a=s):(s===t||e[s][1].type==="lineEnding")&&(e[a][1].type="codeTextData",s!==a+2&&(e[a][1].end=e[s-1][1].end,e.splice(a+2,s-a-2),t-=s-a-2,s=a+2),a=void 0);return e}function I2(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function F2(e,t,n){let s=0,a,u;return c;function c(m){return e.enter("codeText"),e.enter("codeTextSequence"),d(m)}function d(m){return m===96?(e.consume(m),s++,d):(e.exit("codeTextSequence"),p(m))}function p(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),p):m===96?(u=e.enter("codeTextSequence"),a=0,g(m)):ve(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),p):(e.enter("codeTextData"),h(m))}function h(m){return m===null||m===32||m===96||ve(m)?(e.exit("codeTextData"),p(m)):(e.consume(m),h)}function g(m){return m===96?(e.consume(m),a++,g):a===s?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(u.type="codeTextData",h(m))}}class q2{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 s=n??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(t,s):t>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(t,n,s){const a=n||0;this.setCursor(Math.trunc(t));const u=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return s&&Il(this.left,s),u.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),Il(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Il(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);Il(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Il(this.left,n.reverse())}}}function Il(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 IS(e){const t={};let n=-1,s,a,u,c,d,p,h;const g=new q2(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(s=g.get(n),n&&s[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(p=s[1]._tokenizer.events,u=0,u<p.length&&p[u][1].type==="lineEndingBlank"&&(u+=2),u<p.length&&p[u][1].type==="content"))for(;++u<p.length&&p[u][1].type!=="content";)p[u][1].type==="chunkText"&&(p[u][1]._isInFirstContentOfListItem=!0,u++);if(s[0]==="enter")s[1].contentType&&(Object.assign(t,V2(g,n)),n=t[n],h=!0);else if(s[1]._container){for(u=n,a=void 0;u--;)if(c=g.get(u),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(a&&(g.get(a)[1].type="lineEndingBlank"),c[1].type="lineEnding",a=u);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;a&&(s[1].end={...g.get(a)[1].start},d=g.slice(a,n),d.unshift(s),g.splice(a,n-a+1,d))}}return wi(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!h}function V2(e,t){const n=e.get(t)[1],s=e.get(t)[2];let a=t-1;const u=[];let c=n._tokenizer;c||(c=s.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const d=c.events,p=[],h={};let g,m,S=-1,y=n,b=0,C=0;const B=[C];for(;y;){for(;e.get(++a)[1]!==y;);u.push(a),y._tokenizer||(g=s.sliceStream(y),y.next||g.push(null),m&&c.defineSkip(y.start),y._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(g),y._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),m=y,y=y.next}for(y=n;++S<d.length;)d[S][0]==="exit"&&d[S-1][0]==="enter"&&d[S][1].type===d[S-1][1].type&&d[S][1].start.line!==d[S][1].end.line&&(C=S+1,B.push(C),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(c.events=[],y?(y._tokenizer=void 0,y.previous=void 0):B.pop(),S=B.length;S--;){const A=d.slice(B[S],B[S+1]),Z=u.pop();p.push([Z,Z+A.length-1]),e.splice(Z,2,A)}for(p.reverse(),S=-1;++S<p.length;)h[b+p[S][0]]=b+p[S][1],b+=p[S][1]-p[S][0]-1;return h}const W2={resolve:K2,tokenize:X2},Y2={partial:!0,tokenize:G2};function K2(e){return IS(e),e}function X2(e,t){let n;return s;function s(d){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(d)}function a(d){return d===null?u(d):ve(d)?e.check(Y2,c,u)(d):(e.consume(d),a)}function u(d){return e.exit("chunkContent"),e.exit("content"),t(d)}function c(d){return e.consume(d),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function G2(e,t,n){const s=this;return a;function a(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),je(e,u,"linePrefix")}function u(c){if(c===null||ve(c))return n(c);const d=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):e.interrupt(s.parser.constructs.flow,n,t)(c)}}function FS(e,t,n,s,a,u,c,d,p){const h=p||Number.POSITIVE_INFINITY;let g=0;return m;function m(A){return A===60?(e.enter(s),e.enter(a),e.enter(u),e.consume(A),e.exit(u),S):A===null||A===32||A===41||eu(A)?n(A):(e.enter(s),e.enter(c),e.enter(d),e.enter("chunkString",{contentType:"string"}),C(A))}function S(A){return A===62?(e.enter(u),e.consume(A),e.exit(u),e.exit(a),e.exit(s),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),y(A))}function y(A){return A===62?(e.exit("chunkString"),e.exit(d),S(A)):A===null||A===60||ve(A)?n(A):(e.consume(A),A===92?b:y)}function b(A){return A===60||A===62||A===92?(e.consume(A),y):y(A)}function C(A){return!g&&(A===null||A===41||Qe(A))?(e.exit("chunkString"),e.exit(d),e.exit(c),e.exit(s),t(A)):g<h&&A===40?(e.consume(A),g++,C):A===41?(e.consume(A),g--,C):A===null||A===32||A===40||eu(A)?n(A):(e.consume(A),A===92?B:C)}function B(A){return A===40||A===41||A===92?(e.consume(A),C):C(A)}}function qS(e,t,n,s,a,u){const c=this;let d=0,p;return h;function h(y){return e.enter(s),e.enter(a),e.consume(y),e.exit(a),e.enter(u),g}function g(y){return d>999||y===null||y===91||y===93&&!p||y===94&&!d&&"_hiddenFootnoteSupport"in c.parser.constructs?n(y):y===93?(e.exit(u),e.enter(a),e.consume(y),e.exit(a),e.exit(s),t):ve(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===null||y===91||y===93||ve(y)||d++>999?(e.exit("chunkString"),g(y)):(e.consume(y),p||(p=!Oe(y)),y===92?S:m)}function S(y){return y===91||y===92||y===93?(e.consume(y),d++,m):m(y)}}function VS(e,t,n,s,a,u){let c;return d;function d(S){return S===34||S===39||S===40?(e.enter(s),e.enter(a),e.consume(S),e.exit(a),c=S===40?41:S,p):n(S)}function p(S){return S===c?(e.enter(a),e.consume(S),e.exit(a),e.exit(s),t):(e.enter(u),h(S))}function h(S){return S===c?(e.exit(u),p(c)):S===null?n(S):ve(S)?(e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),je(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(S))}function g(S){return S===c||S===null||ve(S)?(e.exit("chunkString"),h(S)):(e.consume(S),S===92?m:g)}function m(S){return S===c||S===92?(e.consume(S),g):g(S)}}function $l(e,t){let n;return s;function s(a){return ve(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,s):Oe(a)?je(e,s,n?"linePrefix":"lineSuffix")(a):t(a)}}const $2={name:"definition",tokenize:Q2},Z2={partial:!0,tokenize:J2};function Q2(e,t,n){const s=this;let a;return u;function u(y){return e.enter("definition"),c(y)}function c(y){return qS.call(s,e,d,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function d(y){return a=Vi(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),p):n(y)}function p(y){return Qe(y)?$l(e,h)(y):h(y)}function h(y){return FS(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function g(y){return e.attempt(Z2,m,m)(y)}function m(y){return Oe(y)?je(e,S,"whitespace")(y):S(y)}function S(y){return y===null||ve(y)?(e.exit("definition"),s.parser.defined.push(a),t(y)):n(y)}}function J2(e,t,n){return s;function s(d){return Qe(d)?$l(e,a)(d):n(d)}function a(d){return VS(e,u,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function u(d){return Oe(d)?je(e,c,"whitespace")(d):c(d)}function c(d){return d===null||ve(d)?t(d):n(d)}}const eE={name:"hardBreakEscape",tokenize:tE};function tE(e,t,n){return s;function s(u){return e.enter("hardBreakEscape"),e.consume(u),a}function a(u){return ve(u)?(e.exit("hardBreakEscape"),t(u)):n(u)}}const iE={name:"headingAtx",resolve:nE,tokenize:rE};function nE(e,t){let n=e.length-2,s=3,a,u;return e[s][1].type==="whitespace"&&(s+=2),n-2>s&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(s===n-1||n-4>s&&e[n-2][1].type==="whitespace")&&(n-=s+1===n?2:4),n>s&&(a={type:"atxHeadingText",start:e[s][1].start,end:e[n][1].end},u={type:"chunkText",start:e[s][1].start,end:e[n][1].end,contentType:"text"},wi(e,s,n-s+1,[["enter",a,t],["enter",u,t],["exit",u,t],["exit",a,t]])),e}function rE(e,t,n){let s=0;return a;function a(g){return e.enter("atxHeading"),u(g)}function u(g){return e.enter("atxHeadingSequence"),c(g)}function c(g){return g===35&&s++<6?(e.consume(g),c):g===null||Qe(g)?(e.exit("atxHeadingSequence"),d(g)):n(g)}function d(g){return g===35?(e.enter("atxHeadingSequence"),p(g)):g===null||ve(g)?(e.exit("atxHeading"),t(g)):Oe(g)?je(e,d,"whitespace")(g):(e.enter("atxHeadingText"),h(g))}function p(g){return g===35?(e.consume(g),p):(e.exit("atxHeadingSequence"),d(g))}function h(g){return g===null||g===35||Qe(g)?(e.exit("atxHeadingText"),d(g)):(e.consume(g),h)}}const sE=["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"],Qv=["pre","script","style","textarea"],lE={concrete:!0,name:"htmlFlow",resolveTo:uE,tokenize:cE},aE={partial:!0,tokenize:fE},oE={partial:!0,tokenize:hE};function uE(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 cE(e,t,n){const s=this;let a,u,c,d,p;return h;function h(w){return g(w)}function g(w){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(w),m}function m(w){return w===33?(e.consume(w),S):w===47?(e.consume(w),u=!0,C):w===63?(e.consume(w),a=3,s.interrupt?t:k):$t(w)?(e.consume(w),c=String.fromCharCode(w),B):n(w)}function S(w){return w===45?(e.consume(w),a=2,y):w===91?(e.consume(w),a=5,d=0,b):$t(w)?(e.consume(w),a=4,s.interrupt?t:k):n(w)}function y(w){return w===45?(e.consume(w),s.interrupt?t:k):n(w)}function b(w){const se="CDATA[";return w===se.charCodeAt(d++)?(e.consume(w),d===se.length?s.interrupt?t:V:b):n(w)}function C(w){return $t(w)?(e.consume(w),c=String.fromCharCode(w),B):n(w)}function B(w){if(w===null||w===47||w===62||Qe(w)){const se=w===47,de=c.toLowerCase();return!se&&!u&&Qv.includes(de)?(a=1,s.interrupt?t(w):V(w)):sE.includes(c.toLowerCase())?(a=6,se?(e.consume(w),A):s.interrupt?t(w):V(w)):(a=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(w):u?Z(w):P(w))}return w===45||qt(w)?(e.consume(w),c+=String.fromCharCode(w),B):n(w)}function A(w){return w===62?(e.consume(w),s.interrupt?t:V):n(w)}function Z(w){return Oe(w)?(e.consume(w),Z):H(w)}function P(w){return w===47?(e.consume(w),H):w===58||w===95||$t(w)?(e.consume(w),ee):Oe(w)?(e.consume(w),P):H(w)}function ee(w){return w===45||w===46||w===58||w===95||qt(w)?(e.consume(w),ee):ne(w)}function ne(w){return w===61?(e.consume(w),z):Oe(w)?(e.consume(w),ne):P(w)}function z(w){return w===null||w===60||w===61||w===62||w===96?n(w):w===34||w===39?(e.consume(w),p=w,ie):Oe(w)?(e.consume(w),z):ue(w)}function ie(w){return w===p?(e.consume(w),p=null,_e):w===null||ve(w)?n(w):(e.consume(w),ie)}function ue(w){return w===null||w===34||w===39||w===47||w===60||w===61||w===62||w===96||Qe(w)?ne(w):(e.consume(w),ue)}function _e(w){return w===47||w===62||Oe(w)?P(w):n(w)}function H(w){return w===62?(e.consume(w),te):n(w)}function te(w){return w===null||ve(w)?V(w):Oe(w)?(e.consume(w),te):n(w)}function V(w){return w===45&&a===2?(e.consume(w),M):w===60&&a===1?(e.consume(w),q):w===62&&a===4?(e.consume(w),D):w===63&&a===3?(e.consume(w),k):w===93&&a===5?(e.consume(w),fe):ve(w)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(aE,Y,I)(w)):w===null||ve(w)?(e.exit("htmlFlowData"),I(w)):(e.consume(w),V)}function I(w){return e.check(oE,K,Y)(w)}function K(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),j}function j(w){return w===null||ve(w)?I(w):(e.enter("htmlFlowData"),V(w))}function M(w){return w===45?(e.consume(w),k):V(w)}function q(w){return w===47?(e.consume(w),c="",W):V(w)}function W(w){if(w===62){const se=c.toLowerCase();return Qv.includes(se)?(e.consume(w),D):V(w)}return $t(w)&&c.length<8?(e.consume(w),c+=String.fromCharCode(w),W):V(w)}function fe(w){return w===93?(e.consume(w),k):V(w)}function k(w){return w===62?(e.consume(w),D):w===45&&a===2?(e.consume(w),k):V(w)}function D(w){return w===null||ve(w)?(e.exit("htmlFlowData"),Y(w)):(e.consume(w),D)}function Y(w){return e.exit("htmlFlow"),t(w)}}function hE(e,t,n){const s=this;return a;function a(c){return ve(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u):n(c)}function u(c){return s.parser.lazy[s.now().line]?n(c):t(c)}}function fE(e,t,n){return s;function s(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(ua,t,n)}}const dE={name:"htmlText",tokenize:pE};function pE(e,t,n){const s=this;let a,u,c;return d;function d(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),p}function p(k){return k===33?(e.consume(k),h):k===47?(e.consume(k),ne):k===63?(e.consume(k),P):$t(k)?(e.consume(k),ue):n(k)}function h(k){return k===45?(e.consume(k),g):k===91?(e.consume(k),u=0,b):$t(k)?(e.consume(k),Z):n(k)}function g(k){return k===45?(e.consume(k),y):n(k)}function m(k){return k===null?n(k):k===45?(e.consume(k),S):ve(k)?(c=m,q(k)):(e.consume(k),m)}function S(k){return k===45?(e.consume(k),y):m(k)}function y(k){return k===62?M(k):k===45?S(k):m(k)}function b(k){const D="CDATA[";return k===D.charCodeAt(u++)?(e.consume(k),u===D.length?C:b):n(k)}function C(k){return k===null?n(k):k===93?(e.consume(k),B):ve(k)?(c=C,q(k)):(e.consume(k),C)}function B(k){return k===93?(e.consume(k),A):C(k)}function A(k){return k===62?M(k):k===93?(e.consume(k),A):C(k)}function Z(k){return k===null||k===62?M(k):ve(k)?(c=Z,q(k)):(e.consume(k),Z)}function P(k){return k===null?n(k):k===63?(e.consume(k),ee):ve(k)?(c=P,q(k)):(e.consume(k),P)}function ee(k){return k===62?M(k):P(k)}function ne(k){return $t(k)?(e.consume(k),z):n(k)}function z(k){return k===45||qt(k)?(e.consume(k),z):ie(k)}function ie(k){return ve(k)?(c=ie,q(k)):Oe(k)?(e.consume(k),ie):M(k)}function ue(k){return k===45||qt(k)?(e.consume(k),ue):k===47||k===62||Qe(k)?_e(k):n(k)}function _e(k){return k===47?(e.consume(k),M):k===58||k===95||$t(k)?(e.consume(k),H):ve(k)?(c=_e,q(k)):Oe(k)?(e.consume(k),_e):M(k)}function H(k){return k===45||k===46||k===58||k===95||qt(k)?(e.consume(k),H):te(k)}function te(k){return k===61?(e.consume(k),V):ve(k)?(c=te,q(k)):Oe(k)?(e.consume(k),te):_e(k)}function V(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),a=k,I):ve(k)?(c=V,q(k)):Oe(k)?(e.consume(k),V):(e.consume(k),K)}function I(k){return k===a?(e.consume(k),a=void 0,j):k===null?n(k):ve(k)?(c=I,q(k)):(e.consume(k),I)}function K(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||Qe(k)?_e(k):(e.consume(k),K)}function j(k){return k===47||k===62||Qe(k)?_e(k):n(k)}function M(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function q(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),W}function W(k){return Oe(k)?je(e,fe,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):fe(k)}function fe(k){return e.enter("htmlTextData"),c(k)}}const Cd={name:"labelEnd",resolveAll:vE,resolveTo:yE,tokenize:SE},_E={tokenize:bE},mE={tokenize:xE},gE={tokenize:wE};function vE(e){let t=-1;const n=[];for(;++t<e.length;){const s=e[t][1];if(n.push(e[t]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const a=s.type==="labelImage"?4:2;s.type="data",t+=a}}return e.length!==n.length&&wi(e,0,e.length,n),e}function yE(e,t){let n=e.length,s=0,a,u,c,d;for(;n--;)if(a=e[n][1],u){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(c){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(u=n,a.type!=="labelLink")){s=2;break}}else a.type==="labelEnd"&&(c=n);const p={type:e[u][1].type==="labelLink"?"link":"image",start:{...e[u][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[u][1].start},end:{...e[c][1].end}},g={type:"labelText",start:{...e[u+s+2][1].end},end:{...e[c-2][1].start}};return d=[["enter",p,t],["enter",h,t]],d=Hi(d,e.slice(u+1,u+s+3)),d=Hi(d,[["enter",g,t]]),d=Hi(d,uu(t.parser.constructs.insideSpan.null,e.slice(u+s+4,c-3),t)),d=Hi(d,[["exit",g,t],e[c-2],e[c-1],["exit",h,t]]),d=Hi(d,e.slice(c+1)),d=Hi(d,[["exit",p,t]]),wi(e,u,e.length,d),e}function SE(e,t,n){const s=this;let a=s.events.length,u,c;for(;a--;)if((s.events[a][1].type==="labelImage"||s.events[a][1].type==="labelLink")&&!s.events[a][1]._balanced){u=s.events[a][1];break}return d;function d(S){return u?u._inactive?m(S):(c=s.parser.defined.includes(Vi(s.sliceSerialize({start:u.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(S),e.exit("labelMarker"),e.exit("labelEnd"),p):n(S)}function p(S){return S===40?e.attempt(_E,g,c?g:m)(S):S===91?e.attempt(mE,g,c?h:m)(S):c?g(S):m(S)}function h(S){return e.attempt(gE,g,m)(S)}function g(S){return t(S)}function m(S){return u._balanced=!0,n(S)}}function bE(e,t,n){return s;function s(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),a}function a(m){return Qe(m)?$l(e,u)(m):u(m)}function u(m){return m===41?g(m):FS(e,c,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function c(m){return Qe(m)?$l(e,p)(m):g(m)}function d(m){return n(m)}function p(m){return m===34||m===39||m===40?VS(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):g(m)}function h(m){return Qe(m)?$l(e,g)(m):g(m)}function g(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function xE(e,t,n){const s=this;return a;function a(d){return qS.call(s,e,u,c,"reference","referenceMarker","referenceString")(d)}function u(d){return s.parser.defined.includes(Vi(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?t(d):n(d)}function c(d){return n(d)}}function wE(e,t,n){return s;function s(u){return e.enter("reference"),e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),a}function a(u){return u===93?(e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),e.exit("reference"),t):n(u)}}const CE={name:"labelStartImage",resolveAll:Cd.resolveAll,tokenize:kE};function kE(e,t,n){const s=this;return a;function a(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),u}function u(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),c):n(d)}function c(d){return d===94&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):t(d)}}const EE={name:"labelStartLink",resolveAll:Cd.resolveAll,tokenize:TE};function TE(e,t,n){const s=this;return a;function a(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),u}function u(c){return c===94&&"_hiddenFootnoteSupport"in s.parser.constructs?n(c):t(c)}}const Zh={name:"lineEnding",tokenize:DE};function DE(e,t){return n;function n(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),je(e,t,"linePrefix")}}const Ko={name:"thematicBreak",tokenize:AE};function AE(e,t,n){let s=0,a;return u;function u(h){return e.enter("thematicBreak"),c(h)}function c(h){return a=h,d(h)}function d(h){return h===a?(e.enter("thematicBreakSequence"),p(h)):s>=3&&(h===null||ve(h))?(e.exit("thematicBreak"),t(h)):n(h)}function p(h){return h===a?(e.consume(h),s++,p):(e.exit("thematicBreakSequence"),Oe(h)?je(e,d,"whitespace")(h):d(h))}}const ui={continuation:{tokenize:OE},exit:LE,name:"list",tokenize:BE},ME={partial:!0,tokenize:NE},RE={partial:!0,tokenize:zE};function BE(e,t,n){const s=this,a=s.events[s.events.length-1];let u=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,c=0;return d;function d(y){const b=s.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!s.containerState.marker||y===s.containerState.marker:Qf(y)){if(s.containerState.type||(s.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(Ko,n,h)(y):h(y);if(!s.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),p(y)}return n(y)}function p(y){return Qf(y)&&++c<10?(e.consume(y),p):(!s.interrupt||c<2)&&(s.containerState.marker?y===s.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),h(y)):n(y)}function h(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||y,e.check(ua,s.interrupt?n:g,e.attempt(ME,S,m))}function g(y){return s.containerState.initialBlankLine=!0,u++,S(y)}function m(y){return Oe(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),S):n(y)}function S(y){return s.containerState.size=u+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function OE(e,t,n){const s=this;return s.containerState._closeFlow=void 0,e.check(ua,a,u);function a(d){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,je(e,t,"listItemIndent",s.containerState.size+1)(d)}function u(d){return s.containerState.furtherBlankLines||!Oe(d)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,c(d)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(RE,t,c)(d))}function c(d){return s.containerState._closeFlow=!0,s.interrupt=void 0,je(e,e.attempt(ui,t,n),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function zE(e,t,n){const s=this;return je(e,a,"listItemIndent",s.containerState.size+1);function a(u){const c=s.events[s.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===s.containerState.size?t(u):n(u)}}function LE(e){e.exit(this.containerState.type)}function NE(e,t,n){const s=this;return je(e,a,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(u){const c=s.events[s.events.length-1];return!Oe(u)&&c&&c[1].type==="listItemPrefixWhitespace"?t(u):n(u)}}const Jv={name:"setextUnderline",resolveTo:HE,tokenize:jE};function HE(e,t){let n=e.length,s,a,u;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){s=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!u&&e[n][1].type==="definition"&&(u=n);const c={type:"setextHeading",start:{...e[s][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",u?(e.splice(a,0,["enter",c,t]),e.splice(u+1,0,["exit",e[s][1],t]),e[s][1].end={...e[u][1].end}):e[s][1]=c,e.push(["exit",c,t]),e}function jE(e,t,n){const s=this;let a;return u;function u(h){let g=s.events.length,m;for(;g--;)if(s.events[g][1].type!=="lineEnding"&&s.events[g][1].type!=="linePrefix"&&s.events[g][1].type!=="content"){m=s.events[g][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||m)?(e.enter("setextHeadingLine"),a=h,c(h)):n(h)}function c(h){return e.enter("setextHeadingLineSequence"),d(h)}function d(h){return h===a?(e.consume(h),d):(e.exit("setextHeadingLineSequence"),Oe(h)?je(e,p,"lineSuffix")(h):p(h))}function p(h){return h===null||ve(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const UE={tokenize:PE};function PE(e){const t=this,n=e.attempt(ua,s,e.attempt(this.parser.constructs.flowInitial,a,je(e,e.attempt(this.parser.constructs.flow,a,e.attempt(W2,a)),"linePrefix")));return n;function s(u){if(u===null){e.consume(u);return}return e.enter("lineEndingBlank"),e.consume(u),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const IE={resolveAll:YS()},FE=WS("string"),qE=WS("text");function WS(e){return{resolveAll:YS(e==="text"?VE:void 0),tokenize:t};function t(n){const s=this,a=this.parser.constructs[e],u=n.attempt(a,c,d);return c;function c(g){return h(g)?u(g):d(g)}function d(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),p}function p(g){return h(g)?(n.exit("data"),u(g)):(n.consume(g),p)}function h(g){if(g===null)return!0;const m=a[g];let S=-1;if(m)for(;++S<m.length;){const y=m[S];if(!y.previous||y.previous.call(s,s.previous))return!0}return!1}}}function YS(e){return t;function t(n,s){let a=-1,u;for(;++a<=n.length;)u===void 0?n[a]&&n[a][1].type==="data"&&(u=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==u+2&&(n[u][1].end=n[a-1][1].end,n.splice(u+2,a-u-2),a=u+2),u=void 0);return e?e(n,s):n}}function VE(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 s=e[n-1][1],a=t.sliceStream(s);let u=a.length,c=-1,d=0,p;for(;u--;){const h=a[u];if(typeof h=="string"){for(c=h.length;h.charCodeAt(c-1)===32;)d++,c--;if(c)break;c=-1}else if(h===-2)p=!0,d++;else if(h!==-1){u++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(d=0),d){const h={type:n===e.length||p||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:u?c:s.start._bufferIndex+c,_index:s.start._index+u,line:s.end.line,column:s.end.column-d,offset:s.end.offset-d},end:{...s.end}};s.end={...h.start},s.start.offset===s.end.offset?Object.assign(s,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const WE={42:ui,43:ui,45:ui,48:ui,49:ui,50:ui,51:ui,52:ui,53:ui,54:ui,55:ui,56:ui,57:ui,62:jS},YE={91:$2},KE={[-2]:$h,[-1]:$h,32:$h},XE={35:iE,42:Ko,45:[Jv,Ko],60:lE,61:Jv,95:Ko,96:Zv,126:Zv},GE={38:PS,92:US},$E={[-5]:Zh,[-4]:Zh,[-3]:Zh,33:CE,38:PS,42:Jf,60:[E2,dE],91:EE,92:[eE,US],93:Cd,95:Jf,96:U2},ZE={null:[Jf,IE]},QE={null:[42,95]},JE={null:[]},eT=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:QE,contentInitial:YE,disable:JE,document:WE,flow:XE,flowInitial:KE,insideSpan:ZE,string:GE,text:$E},Symbol.toStringTag,{value:"Module"}));function tT(e,t,n){let s={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},u=[];let c=[],d=[];const p={attempt:ie(ne),check:ie(z),consume:Z,enter:P,exit:ee,interrupt:ie(z,{interrupt:!0})},h={code:null,containerState:{},defineSkip:C,events:[],now:b,parser:e,previous:null,sliceSerialize:S,sliceStream:y,write:m};let g=t.tokenize.call(h,p);return t.resolveAll&&u.push(t),h;function m(te){return c=Hi(c,te),B(),c[c.length-1]!==null?[]:(ue(t,0),h.events=uu(u,h.events,h),h.events)}function S(te,V){return nT(y(te),V)}function y(te){return iT(c,te)}function b(){const{_bufferIndex:te,_index:V,line:I,column:K,offset:j}=s;return{_bufferIndex:te,_index:V,line:I,column:K,offset:j}}function C(te){a[te.line]=te.column,H()}function B(){let te;for(;s._index<c.length;){const V=c[s._index];if(typeof V=="string")for(te=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===te&&s._bufferIndex<V.length;)A(V.charCodeAt(s._bufferIndex));else A(V)}}function A(te){g=g(te)}function Z(te){ve(te)?(s.line++,s.column=1,s.offset+=te===-3?2:1,H()):te!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===c[s._index].length&&(s._bufferIndex=-1,s._index++)),h.previous=te}function P(te,V){const I=V||{};return I.type=te,I.start=b(),h.events.push(["enter",I,h]),d.push(I),I}function ee(te){const V=d.pop();return V.end=b(),h.events.push(["exit",V,h]),V}function ne(te,V){ue(te,V.from)}function z(te,V){V.restore()}function ie(te,V){return I;function I(K,j,M){let q,W,fe,k;return Array.isArray(K)?Y(K):"tokenize"in K?Y([K]):D(K);function D(ce){return xe;function xe(We){const Ae=We!==null&&ce[We],Ot=We!==null&&ce.null,Wt=[...Array.isArray(Ae)?Ae:Ae?[Ae]:[],...Array.isArray(Ot)?Ot:Ot?[Ot]:[]];return Y(Wt)(We)}}function Y(ce){return q=ce,W=0,ce.length===0?M:w(ce[W])}function w(ce){return xe;function xe(We){return k=_e(),fe=ce,ce.partial||(h.currentConstruct=ce),ce.name&&h.parser.constructs.disable.null.includes(ce.name)?de():ce.tokenize.call(V?Object.assign(Object.create(h),V):h,p,se,de)(We)}}function se(ce){return te(fe,k),j}function de(ce){return k.restore(),++W<q.length?w(q[W]):M}}}function ue(te,V){te.resolveAll&&!u.includes(te)&&u.push(te),te.resolve&&wi(h.events,V,h.events.length-V,te.resolve(h.events.slice(V),h)),te.resolveTo&&(h.events=te.resolveTo(h.events,h))}function _e(){const te=b(),V=h.previous,I=h.currentConstruct,K=h.events.length,j=Array.from(d);return{from:K,restore:M};function M(){s=te,h.previous=V,h.currentConstruct=I,h.events.length=K,d=j,H()}}function H(){s.line in a&&s.column<2&&(s.column=a[s.line],s.offset+=a[s.line]-1)}}function iT(e,t){const n=t.start._index,s=t.start._bufferIndex,a=t.end._index,u=t.end._bufferIndex;let c;if(n===a)c=[e[n].slice(s,u)];else{if(c=e.slice(n,a),s>-1){const d=c[0];typeof d=="string"?c[0]=d.slice(s):c.shift()}u>0&&c.push(e[a].slice(0,u))}return c}function nT(e,t){let n=-1;const s=[];let a;for(;++n<e.length;){const u=e[n];let c;if(typeof u=="string")c=u;else switch(u){case-5:{c="\r";break}case-4:{c=`
|
|
90
|
-
`;break}case-3:{c=`\r
|
|
91
|
-
`;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&a)continue;c=" ";break}default:c=String.fromCharCode(u)}a=u===-2,s.push(c)}return s.join("")}function rT(e){const s={constructs:NS([eT,...(e||{}).extensions||[]]),content:a(y2),defined:[],document:a(b2),flow:a(UE),lazy:{},string:a(FE),text:a(qE)};return s;function a(u){return c;function c(d){return tT(s,u,d)}}}function sT(e){for(;!IS(e););return e}const ey=/[\0\t\n\r]/g;function lT(){let e=1,t="",n=!0,s;return a;function a(u,c,d){const p=[];let h,g,m,S,y;for(u=t+(typeof u=="string"?u.toString():new TextDecoder(c||void 0).decode(u)),m=0,t="",n&&(u.charCodeAt(0)===65279&&m++,n=void 0);m<u.length;){if(ey.lastIndex=m,h=ey.exec(u),S=h&&h.index!==void 0?h.index:u.length,y=u.charCodeAt(S),!h){t=u.slice(m);break}if(y===10&&m===S&&s)p.push(-3),s=void 0;else switch(s&&(p.push(-5),s=void 0),m<S&&(p.push(u.slice(m,S)),e+=S-m),y){case 0:{p.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,p.push(-2);e++<g;)p.push(-1);break}case 10:{p.push(-4),e=1;break}default:s=!0,e=1}m=S+1}return d&&(s&&p.push(-5),t&&p.push(t),p.push(null)),p}}const aT=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function oT(e){return e.replace(aT,uT)}function uT(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),u=a===120||a===88;return HS(n.slice(u?2:1),u?16:10)}return wd(n)||e}const KS={}.hasOwnProperty;function cT(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),hT(n)(sT(rT(n).document().write(lT()(e,t,!0))))}function hT(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(Pr),autolinkProtocol:_e,autolinkEmail:_e,atxHeading:u(jr),blockQuote:u(Ot),characterEscape:_e,characterReference:_e,codeFenced:u(Wt),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:u(Wt,c),codeText:u(Jt,c),codeTextData:_e,data:_e,codeFlowValue:_e,definition:u(He),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:u(hi),hardBreakEscape:u(Ur),hardBreakTrailing:u(Ur),htmlFlow:u(fa,c),htmlFlowData:_e,htmlText:u(fa,c),htmlTextData:_e,image:u(da),label:c,link:u(Pr),listItem:u(Us),listItemValue:S,listOrdered:u(Ir,m),listUnordered:u(Ir),paragraph:u(du),reference:w,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:u(jr),strong:u(pu),thematicBreak:u(_u)},exit:{atxHeading:p(),atxHeadingSequence:ne,autolink:p(),autolinkEmail:Ae,autolinkProtocol:We,blockQuote:p(),characterEscapeValue:H,characterReferenceMarkerHexadecimal:de,characterReferenceMarkerNumeric:de,characterReferenceValue:ce,characterReference:xe,codeFenced:p(B),codeFencedFence:C,codeFencedFenceInfo:y,codeFencedFenceMeta:b,codeFlowValue:H,codeIndented:p(A),codeText:p(j),codeTextData:H,data:H,definition:p(),definitionDestinationString:ee,definitionLabelString:Z,definitionTitleString:P,emphasis:p(),hardBreakEscape:p(V),hardBreakTrailing:p(V),htmlFlow:p(I),htmlFlowData:H,htmlText:p(K),htmlTextData:H,image:p(q),label:fe,labelText:W,lineEnding:te,link:p(M),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:se,resourceDestinationString:k,resourceTitleString:D,resource:Y,setextHeading:p(ue),setextHeadingLineSequence:ie,setextHeadingText:z,strong:p(),thematicBreak:p()}};XS(t,(e||{}).mdastExtensions||[]);const n={};return s;function s(G){let ae={type:"root",children:[]};const Se={stack:[ae],tokenStack:[],config:t,enter:d,exit:h,buffer:c,resume:g,data:n},Me=[];let Fe=-1;for(;++Fe<G.length;)if(G[Fe][1].type==="listOrdered"||G[Fe][1].type==="listUnordered")if(G[Fe][0]==="enter")Me.push(Fe);else{const fi=Me.pop();Fe=a(G,fi,Fe)}for(Fe=-1;++Fe<G.length;){const fi=t[G[Fe][0]];KS.call(fi,G[Fe][1].type)&&fi[G[Fe][1].type].call(Object.assign({sliceSerialize:G[Fe][2].sliceSerialize},Se),G[Fe][1])}if(Se.tokenStack.length>0){const fi=Se.tokenStack[Se.tokenStack.length-1];(fi[1]||ty).call(Se,void 0,fi[0])}for(ae.position={start:ir(G.length>0?G[0][1].start:{line:1,column:1,offset:0}),end:ir(G.length>0?G[G.length-2][1].end:{line:1,column:1,offset:0})},Fe=-1;++Fe<t.transforms.length;)ae=t.transforms[Fe](ae)||ae;return ae}function a(G,ae,Se){let Me=ae-1,Fe=-1,fi=!1,rn,Kt,bt,ei;for(;++Me<=Se;){const $e=G[Me];switch($e[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{$e[0]==="enter"?Fe++:Fe--,ei=void 0;break}case"lineEndingBlank":{$e[0]==="enter"&&(rn&&!ei&&!Fe&&!bt&&(bt=Me),ei=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ei=void 0}if(!Fe&&$e[0]==="enter"&&$e[1].type==="listItemPrefix"||Fe===-1&&$e[0]==="exit"&&($e[1].type==="listUnordered"||$e[1].type==="listOrdered")){if(rn){let Dn=Me;for(Kt=void 0;Dn--;){const Ui=G[Dn];if(Ui[1].type==="lineEnding"||Ui[1].type==="lineEndingBlank"){if(Ui[0]==="exit")continue;Kt&&(G[Kt][1].type="lineEndingBlank",fi=!0),Ui[1].type="lineEnding",Kt=Dn}else if(!(Ui[1].type==="linePrefix"||Ui[1].type==="blockQuotePrefix"||Ui[1].type==="blockQuotePrefixWhitespace"||Ui[1].type==="blockQuoteMarker"||Ui[1].type==="listItemIndent"))break}bt&&(!Kt||bt<Kt)&&(rn._spread=!0),rn.end=Object.assign({},Kt?G[Kt][1].start:$e[1].end),G.splice(Kt||Me,0,["exit",rn,$e[2]]),Me++,Se++}if($e[1].type==="listItemPrefix"){const Dn={type:"listItem",_spread:!1,start:Object.assign({},$e[1].start),end:void 0};rn=Dn,G.splice(Me,0,["enter",Dn,$e[2]]),Me++,Se++,bt=void 0,ei=!0}}}return G[ae][1]._spread=fi,Se}function u(G,ae){return Se;function Se(Me){d.call(this,G(Me),Me),ae&&ae.call(this,Me)}}function c(){this.stack.push({type:"fragment",children:[]})}function d(G,ae,Se){this.stack[this.stack.length-1].children.push(G),this.stack.push(G),this.tokenStack.push([ae,Se||void 0]),G.position={start:ir(ae.start),end:void 0}}function p(G){return ae;function ae(Se){G&&G.call(this,Se),h.call(this,Se)}}function h(G,ae){const Se=this.stack.pop(),Me=this.tokenStack.pop();if(Me)Me[0].type!==G.type&&(ae?ae.call(this,G,Me[0]):(Me[1]||ty).call(this,G,Me[0]));else throw new Error("Cannot close `"+G.type+"` ("+Gl({start:G.start,end:G.end})+"): it’s not open");Se.position.end=ir(G.end)}function g(){return xd(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function S(G){if(this.data.expectingFirstListItemValue){const ae=this.stack[this.stack.length-2];ae.start=Number.parseInt(this.sliceSerialize(G),10),this.data.expectingFirstListItemValue=void 0}}function y(){const G=this.resume(),ae=this.stack[this.stack.length-1];ae.lang=G}function b(){const G=this.resume(),ae=this.stack[this.stack.length-1];ae.meta=G}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function B(){const G=this.resume(),ae=this.stack[this.stack.length-1];ae.value=G.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function A(){const G=this.resume(),ae=this.stack[this.stack.length-1];ae.value=G.replace(/(\r?\n|\r)$/g,"")}function Z(G){const ae=this.resume(),Se=this.stack[this.stack.length-1];Se.label=ae,Se.identifier=Vi(this.sliceSerialize(G)).toLowerCase()}function P(){const G=this.resume(),ae=this.stack[this.stack.length-1];ae.title=G}function ee(){const G=this.resume(),ae=this.stack[this.stack.length-1];ae.url=G}function ne(G){const ae=this.stack[this.stack.length-1];if(!ae.depth){const Se=this.sliceSerialize(G).length;ae.depth=Se}}function z(){this.data.setextHeadingSlurpLineEnding=!0}function ie(G){const ae=this.stack[this.stack.length-1];ae.depth=this.sliceSerialize(G).codePointAt(0)===61?1:2}function ue(){this.data.setextHeadingSlurpLineEnding=void 0}function _e(G){const Se=this.stack[this.stack.length-1].children;let Me=Se[Se.length-1];(!Me||Me.type!=="text")&&(Me=Yt(),Me.position={start:ir(G.start),end:void 0},Se.push(Me)),this.stack.push(Me)}function H(G){const ae=this.stack.pop();ae.value+=this.sliceSerialize(G),ae.position.end=ir(G.end)}function te(G){const ae=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Se=ae.children[ae.children.length-1];Se.position.end=ir(G.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ae.type)&&(_e.call(this,G),H.call(this,G))}function V(){this.data.atHardBreak=!0}function I(){const G=this.resume(),ae=this.stack[this.stack.length-1];ae.value=G}function K(){const G=this.resume(),ae=this.stack[this.stack.length-1];ae.value=G}function j(){const G=this.resume(),ae=this.stack[this.stack.length-1];ae.value=G}function M(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const ae=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=ae,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function q(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const ae=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=ae,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function W(G){const ae=this.sliceSerialize(G),Se=this.stack[this.stack.length-2];Se.label=oT(ae),Se.identifier=Vi(ae).toLowerCase()}function fe(){const G=this.stack[this.stack.length-1],ae=this.resume(),Se=this.stack[this.stack.length-1];if(this.data.inReference=!0,Se.type==="link"){const Me=G.children;Se.children=Me}else Se.alt=ae}function k(){const G=this.resume(),ae=this.stack[this.stack.length-1];ae.url=G}function D(){const G=this.resume(),ae=this.stack[this.stack.length-1];ae.title=G}function Y(){this.data.inReference=void 0}function w(){this.data.referenceType="collapsed"}function se(G){const ae=this.resume(),Se=this.stack[this.stack.length-1];Se.label=ae,Se.identifier=Vi(this.sliceSerialize(G)).toLowerCase(),this.data.referenceType="full"}function de(G){this.data.characterReferenceType=G.type}function ce(G){const ae=this.sliceSerialize(G),Se=this.data.characterReferenceType;let Me;Se?(Me=HS(ae,Se==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Me=wd(ae);const Fe=this.stack[this.stack.length-1];Fe.value+=Me}function xe(G){const ae=this.stack.pop();ae.position.end=ir(G.end)}function We(G){H.call(this,G);const ae=this.stack[this.stack.length-1];ae.url=this.sliceSerialize(G)}function Ae(G){H.call(this,G);const ae=this.stack[this.stack.length-1];ae.url="mailto:"+this.sliceSerialize(G)}function Ot(){return{type:"blockquote",children:[]}}function Wt(){return{type:"code",lang:null,meta:null,value:""}}function Jt(){return{type:"inlineCode",value:""}}function He(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function hi(){return{type:"emphasis",children:[]}}function jr(){return{type:"heading",depth:0,children:[]}}function Ur(){return{type:"break"}}function fa(){return{type:"html",value:""}}function da(){return{type:"image",title:null,url:"",alt:null}}function Pr(){return{type:"link",title:null,url:"",children:[]}}function Ir(G){return{type:"list",ordered:G.type==="listOrdered",start:null,spread:G._spread,children:[]}}function Us(G){return{type:"listItem",spread:G._spread,checked:null,children:[]}}function du(){return{type:"paragraph",children:[]}}function pu(){return{type:"strong",children:[]}}function Yt(){return{type:"text",value:""}}function _u(){return{type:"thematicBreak"}}}function ir(e){return{line:e.line,column:e.column,offset:e.offset}}function XS(e,t){let n=-1;for(;++n<t.length;){const s=t[n];Array.isArray(s)?XS(e,s):fT(e,s)}}function fT(e,t){let n;for(n in t)if(KS.call(t,n))switch(n){case"canContainEols":{const s=t[n];s&&e[n].push(...s);break}case"transforms":{const s=t[n];s&&e[n].push(...s);break}case"enter":case"exit":{const s=t[n];s&&Object.assign(e[n],s);break}}}function ty(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Gl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Gl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Gl({start:t.start,end:t.end})+") is still open")}function dT(e){const t=this;t.parser=n;function n(s){return cT(s,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function pT(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 _T(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
92
|
-
`}]}function mT(e,t){const n=t.value?t.value+`
|
|
93
|
-
`:"",s={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(s.className=["language-"+a[0]]);let u={type:"element",tagName:"code",properties:s,children:[{type:"text",value:n}]};return t.meta&&(u.data={meta:t.meta}),e.patch(t,u),u=e.applyData(t,u),u={type:"element",tagName:"pre",properties:{},children:[u]},e.patch(t,u),u}function gT(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vT(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yT(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(t.identifier).toUpperCase(),a=js(s.toLowerCase()),u=e.footnoteOrder.indexOf(s);let c,d=e.footnoteCounts.get(s);d===void 0?(d=0,e.footnoteOrder.push(s),c=e.footnoteOrder.length):c=u+1,d+=1,e.footnoteCounts.set(s,d);const p={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,p);const h={type:"element",tagName:"sup",properties:{},children:[p]};return e.patch(t,h),e.applyData(t,h)}function ST(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 bT(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function GS(e,t){const n=t.referenceType;let s="]";if(n==="collapsed"?s+="[]":n==="full"&&(s+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+s}];const a=e.all(t),u=a[0];u&&u.type==="text"?u.value="["+u.value:a.unshift({type:"text",value:"["});const c=a[a.length-1];return c&&c.type==="text"?c.value+=s:a.push({type:"text",value:s}),a}function xT(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return GS(e,t);const a={src:js(s.url||""),alt:t.alt};s.title!==null&&s.title!==void 0&&(a.title=s.title);const u={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,u),e.applyData(t,u)}function wT(e,t){const n={src:js(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 s={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,s),e.applyData(t,s)}function CT(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const s={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,s),e.applyData(t,s)}function kT(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return GS(e,t);const a={href:js(s.url||"")};s.title!==null&&s.title!==void 0&&(a.title=s.title);const u={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,u),e.applyData(t,u)}function ET(e,t){const n={href:js(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const s={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function TT(e,t,n){const s=e.all(t),a=n?DT(n):$S(t),u={},c=[];if(typeof t.checked=="boolean"){const g=s[0];let m;g&&g.type==="element"&&g.tagName==="p"?m=g:(m={type:"element",tagName:"p",properties:{},children:[]},s.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let d=-1;for(;++d<s.length;){const g=s[d];(a||d!==0||g.type!=="element"||g.tagName!=="p")&&c.push({type:"text",value:`
|
|
94
|
-
`}),g.type==="element"&&g.tagName==="p"&&!a?c.push(...g.children):c.push(g)}const p=s[s.length-1];p&&(a||p.type!=="element"||p.tagName!=="p")&&c.push({type:"text",value:`
|
|
95
|
-
`});const h={type:"element",tagName:"li",properties:u,children:c};return e.patch(t,h),e.applyData(t,h)}function DT(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let s=-1;for(;!t&&++s<n.length;)t=$S(n[s])}return t}function $S(e){const t=e.spread;return t??e.children.length>1}function AT(e,t){const n={},s=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<s.length;){const c=s[a];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const u={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(s,!0)};return e.patch(t,u),e.applyData(t,u)}function MT(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function RT(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function BT(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function OT(e,t){const n=e.all(t),s=n.shift(),a=[];if(s){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(t.children[0],c),a.push(c)}if(n.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},d=vd(t.children[1]),p=DS(t.children[t.children.length-1]);d&&p&&(c.position={start:d,end:p}),a.push(c)}const u={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,u),e.applyData(t,u)}function zT(e,t,n){const s=n?n.children:void 0,u=(s?s.indexOf(t):1)===0?"th":"td",c=n&&n.type==="table"?n.align:void 0,d=c?c.length:t.children.length;let p=-1;const h=[];for(;++p<d;){const m=t.children[p],S={},y=c?c[p]:void 0;y&&(S.align=y);let b={type:"element",tagName:u,properties:S,children:[]};m&&(b.children=e.all(m),e.patch(m,b),b=e.applyData(m,b)),h.push(b)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,g),e.applyData(t,g)}function LT(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const iy=9,ny=32;function NT(e){const t=String(e),n=/\r?\n|\r/g;let s=n.exec(t),a=0;const u=[];for(;s;)u.push(ry(t.slice(a,s.index),a>0,!0),s[0]),a=s.index+s[0].length,s=n.exec(t);return u.push(ry(t.slice(a),a>0,!1)),u.join("")}function ry(e,t,n){let s=0,a=e.length;if(t){let u=e.codePointAt(s);for(;u===iy||u===ny;)s++,u=e.codePointAt(s)}if(n){let u=e.codePointAt(a-1);for(;u===iy||u===ny;)a--,u=e.codePointAt(a-1)}return a>s?e.slice(s,a):""}function HT(e,t){const n={type:"text",value:NT(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function jT(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const UT={blockquote:pT,break:_T,code:mT,delete:gT,emphasis:vT,footnoteReference:yT,heading:ST,html:bT,imageReference:xT,image:wT,inlineCode:CT,linkReference:kT,link:ET,listItem:TT,list:AT,paragraph:MT,root:RT,strong:BT,table:OT,tableCell:LT,tableRow:zT,text:HT,thematicBreak:jT,toml:Ho,yaml:Ho,definition:Ho,footnoteDefinition:Ho};function Ho(){}const ZS=-1,cu=0,Zl=1,tu=2,kd=3,Ed=4,Td=5,Dd=6,QS=7,JS=8,sy=typeof self=="object"?self:globalThis,PT=(e,t)=>{const n=(a,u)=>(e.set(u,a),a),s=a=>{if(e.has(a))return e.get(a);const[u,c]=t[a];switch(u){case cu:case ZS:return n(c,a);case Zl:{const d=n([],a);for(const p of c)d.push(s(p));return d}case tu:{const d=n({},a);for(const[p,h]of c)d[s(p)]=s(h);return d}case kd:return n(new Date(c),a);case Ed:{const{source:d,flags:p}=c;return n(new RegExp(d,p),a)}case Td:{const d=n(new Map,a);for(const[p,h]of c)d.set(s(p),s(h));return d}case Dd:{const d=n(new Set,a);for(const p of c)d.add(s(p));return d}case QS:{const{name:d,message:p}=c;return n(new sy[d](p),a)}case JS:return n(BigInt(c),a);case"BigInt":return n(Object(BigInt(c)),a);case"ArrayBuffer":return n(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:d}=new Uint8Array(c);return n(new DataView(d),c)}}return n(new sy[u](c),a)};return s},ly=e=>PT(new Map,e)(0),As="",{toString:IT}={},{keys:FT}=Object,Fl=e=>{const t=typeof e;if(t!=="object"||!e)return[cu,t];const n=IT.call(e).slice(8,-1);switch(n){case"Array":return[Zl,As];case"Object":return[tu,As];case"Date":return[kd,As];case"RegExp":return[Ed,As];case"Map":return[Td,As];case"Set":return[Dd,As];case"DataView":return[Zl,n]}return n.includes("Array")?[Zl,n]:n.includes("Error")?[QS,n]:[tu,n]},jo=([e,t])=>e===cu&&(t==="function"||t==="symbol"),qT=(e,t,n,s)=>{const a=(c,d)=>{const p=s.push(c)-1;return n.set(d,p),p},u=c=>{if(n.has(c))return n.get(c);let[d,p]=Fl(c);switch(d){case cu:{let g=c;switch(p){case"bigint":d=JS,g=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+p);g=null;break;case"undefined":return a([ZS],c)}return a([d,g],c)}case Zl:{if(p){let S=c;return p==="DataView"?S=new Uint8Array(c.buffer):p==="ArrayBuffer"&&(S=new Uint8Array(c)),a([p,[...S]],c)}const g=[],m=a([d,g],c);for(const S of c)g.push(u(S));return m}case tu:{if(p)switch(p){case"BigInt":return a([p,c.toString()],c);case"Boolean":case"Number":case"String":return a([p,c.valueOf()],c)}if(t&&"toJSON"in c)return u(c.toJSON());const g=[],m=a([d,g],c);for(const S of FT(c))(e||!jo(Fl(c[S])))&&g.push([u(S),u(c[S])]);return m}case kd:return a([d,c.toISOString()],c);case Ed:{const{source:g,flags:m}=c;return a([d,{source:g,flags:m}],c)}case Td:{const g=[],m=a([d,g],c);for(const[S,y]of c)(e||!(jo(Fl(S))||jo(Fl(y))))&&g.push([u(S),u(y)]);return m}case Dd:{const g=[],m=a([d,g],c);for(const S of c)(e||!jo(Fl(S)))&&g.push(u(S));return m}}const{message:h}=c;return a([d,{name:p,message:h}],c)};return u},ay=(e,{json:t,lossy:n}={})=>{const s=[];return qT(!(t||n),!!t,new Map,s)(e),s},ia=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ly(ay(e,t)):structuredClone(e):(e,t)=>ly(ay(e,t));function VT(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 WT(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function YT(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||VT,s=e.options.footnoteBackLabel||WT,a=e.options.footnoteLabel||"Footnotes",u=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let p=-1;for(;++p<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[p]);if(!h)continue;const g=e.all(h),m=String(h.identifier).toUpperCase(),S=js(m.toLowerCase());let y=0;const b=[],C=e.footnoteCounts.get(m);for(;C!==void 0&&++y<=C;){b.length>0&&b.push({type:"text",value:" "});let Z=typeof n=="string"?n:n(p,y);typeof Z=="string"&&(Z={type:"text",value:Z}),b.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+S+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(p,y),className:["data-footnote-backref"]},children:Array.isArray(Z)?Z:[Z]})}const B=g[g.length-1];if(B&&B.type==="element"&&B.tagName==="p"){const Z=B.children[B.children.length-1];Z&&Z.type==="text"?Z.value+=" ":B.children.push({type:"text",value:" "}),B.children.push(...b)}else g.push(...b);const A={type:"element",tagName:"li",properties:{id:t+"fn-"+S},children:e.wrap(g,!0)};e.patch(h,A),d.push(A)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...ia(c),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
|
|
96
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
|
|
97
|
-
`}]}}const hu=(function(e){if(e==null)return $T;if(typeof e=="function")return fu(e);if(typeof e=="object")return Array.isArray(e)?KT(e):XT(e);if(typeof e=="string")return GT(e);throw new Error("Expected function, string, or object as test")});function KT(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=hu(e[n]);return fu(s);function s(...a){let u=-1;for(;++u<t.length;)if(t[u].apply(this,a))return!0;return!1}}function XT(e){const t=e;return fu(n);function n(s){const a=s;let u;for(u in e)if(a[u]!==t[u])return!1;return!0}}function GT(e){return fu(t);function t(n){return n&&n.type===e}}function fu(e){return t;function t(n,s,a){return!!(ZT(n)&&e.call(this,n,typeof s=="number"?s:void 0,a||void 0))}}function $T(){return!0}function ZT(e){return e!==null&&typeof e=="object"&&"type"in e}const e0=[],QT=!0,ed=!1,JT="skip";function t0(e,t,n,s){let a;typeof t=="function"&&typeof n!="function"?(s=n,n=t):a=t;const u=hu(a),c=s?-1:1;d(e,void 0,[])();function d(p,h,g){const m=p&&typeof p=="object"?p:{};if(typeof m.type=="string"){const y=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(S,"name",{value:"node ("+(p.type+(y?"<"+y+">":""))+")"})}return S;function S(){let y=e0,b,C,B;if((!t||u(p,h,g[g.length-1]||void 0))&&(y=eD(n(p,g)),y[0]===ed))return y;if("children"in p&&p.children){const A=p;if(A.children&&y[0]!==JT)for(C=(s?A.children.length:-1)+c,B=g.concat(A);C>-1&&C<A.children.length;){const Z=A.children[C];if(b=d(Z,C,B)(),b[0]===ed)return b;C=typeof b[1]=="number"?b[1]:C+c}}return y}}}function eD(e){return Array.isArray(e)?e:typeof e=="number"?[QT,e]:e==null?e0:[e]}function Ad(e,t,n,s){let a,u,c;typeof t=="function"&&typeof n!="function"?(u=void 0,c=t,a=n):(u=t,c=n,a=s),t0(e,u,d,a);function d(p,h){const g=h[h.length-1],m=g?g.children.indexOf(p):void 0;return c(p,m,g)}}const td={}.hasOwnProperty,tD={};function iD(e,t){const n=t||tD,s=new Map,a=new Map,u=new Map,c={...UT,...n.handlers},d={all:h,applyData:rD,definitionById:s,footnoteById:a,footnoteCounts:u,footnoteOrder:[],handlers:c,one:p,options:n,patch:nD,wrap:lD};return Ad(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const m=g.type==="definition"?s:a,S=String(g.identifier).toUpperCase();m.has(S)||m.set(S,g)}}),d;function p(g,m){const S=g.type,y=d.handlers[S];if(td.call(d.handlers,S)&&y)return y(d,g,m);if(d.options.passThrough&&d.options.passThrough.includes(S)){if("children"in g){const{children:C,...B}=g,A=ia(B);return A.children=d.all(g),A}return ia(g)}return(d.options.unknownHandler||sD)(d,g,m)}function h(g){const m=[];if("children"in g){const S=g.children;let y=-1;for(;++y<S.length;){const b=d.one(S[y],g);if(b){if(y&&S[y-1].type==="break"&&(!Array.isArray(b)&&b.type==="text"&&(b.value=oy(b.value)),!Array.isArray(b)&&b.type==="element")){const C=b.children[0];C&&C.type==="text"&&(C.value=oy(C.value))}Array.isArray(b)?m.push(...b):m.push(b)}}}return m}}function nD(e,t){e.position&&(t.position=MS(e))}function rD(e,t){let n=t;if(e&&e.data){const s=e.data.hName,a=e.data.hChildren,u=e.data.hProperties;if(typeof s=="string")if(n.type==="element")n.tagName=s;else{const c="children"in n?n.children:[n];n={type:"element",tagName:s,properties:{},children:c}}n.type==="element"&&u&&Object.assign(n.properties,ia(u)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function sD(e,t){const n=t.data||{},s="value"in t&&!(td.call(n,"hProperties")||td.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function lD(e,t){const n=[];let s=-1;for(t&&n.push({type:"text",value:`
|
|
98
|
-
`});++s<e.length;)s&&n.push({type:"text",value:`
|
|
99
|
-
`}),n.push(e[s]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
100
|
-
`}),n}function oy(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function uy(e,t){const n=iD(e,t),s=n.one(e,void 0),a=YT(n),u=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return a&&u.children.push({type:"text",value:`
|
|
101
|
-
`},a),u}function aD(e,t){return e&&"run"in e?async function(n,s){const a=uy(n,{file:s,...t});await e.run(a,s)}:function(n,s){return uy(n,{file:s,...e||t})}}function cy(e){if(e)throw e}var Qh,hy;function oD(){if(hy)return Qh;hy=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},u=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var g=e.call(h,"constructor"),m=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!g&&!m)return!1;var S;for(S in h);return typeof S>"u"||e.call(h,S)},c=function(h,g){n&&g.name==="__proto__"?n(h,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):h[g.name]=g.newValue},d=function(h,g){if(g==="__proto__")if(e.call(h,g)){if(s)return s(h,g).value}else return;return h[g]};return Qh=function p(){var h,g,m,S,y,b,C=arguments[0],B=1,A=arguments.length,Z=!1;for(typeof C=="boolean"&&(Z=C,C=arguments[1]||{},B=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});B<A;++B)if(h=arguments[B],h!=null)for(g in h)m=d(C,g),S=d(h,g),C!==S&&(Z&&S&&(u(S)||(y=a(S)))?(y?(y=!1,b=m&&a(m)?m:[]):b=m&&u(m)?m:{},c(C,{name:g,newValue:p(Z,b,S)})):typeof S<"u"&&c(C,{name:g,newValue:S}));return C},Qh}var uD=oD();const Jh=nu(uD);function id(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 cD(){const e=[],t={run:n,use:s};return t;function n(...a){let u=-1;const c=a.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);d(null,...a);function d(p,...h){const g=e[++u];let m=-1;if(p){c(p);return}for(;++m<a.length;)(h[m]===null||h[m]===void 0)&&(h[m]=a[m]);a=h,g?hD(g,d)(...h):c(null,...h)}}function s(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function hD(e,t){let n;return s;function s(...c){const d=e.length>c.length;let p;d&&c.push(a);try{p=e.apply(this,c)}catch(h){const g=h;if(d&&n)throw g;return a(g)}d||(p&&p.then&&typeof p.then=="function"?p.then(u,a):p instanceof Error?a(p):u(p))}function a(c,...d){n||(n=!0,t(c,...d))}function u(c){a(null,c)}}const Qi={basename:fD,dirname:dD,extname:pD,join:_D,sep:"/"};function fD(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ca(e);let n=0,s=-1,a=e.length,u;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(u){n=a+1;break}}else s<0&&(u=!0,s=a+1);return s<0?"":e.slice(n,s)}if(t===e)return"";let c=-1,d=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(u){n=a+1;break}}else c<0&&(u=!0,c=a+1),d>-1&&(e.codePointAt(a)===t.codePointAt(d--)?d<0&&(s=a):(d=-1,s=c));return n===s?s=c:s<0&&(s=e.length),e.slice(n,s)}function dD(e){if(ca(e),e.length===0)return".";let t=-1,n=e.length,s;for(;--n;)if(e.codePointAt(n)===47){if(s){t=n;break}}else s||(s=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function pD(e){ca(e);let t=e.length,n=-1,s=0,a=-1,u=0,c;for(;t--;){const d=e.codePointAt(t);if(d===47){if(c){s=t+1;break}continue}n<0&&(c=!0,n=t+1),d===46?a<0?a=t:u!==1&&(u=1):a>-1&&(u=-1)}return a<0||n<0||u===0||u===1&&a===n-1&&a===s+1?"":e.slice(a,n)}function _D(...e){let t=-1,n;for(;++t<e.length;)ca(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":mD(n)}function mD(e){ca(e);const t=e.codePointAt(0)===47;let n=gD(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function gD(e,t){let n="",s=0,a=-1,u=0,c=-1,d,p;for(;++c<=e.length;){if(c<e.length)d=e.codePointAt(c);else{if(d===47)break;d=47}if(d===47){if(!(a===c-1||u===1))if(a!==c-1&&u===2){if(n.length<2||s!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(p=n.lastIndexOf("/"),p!==n.length-1){p<0?(n="",s=0):(n=n.slice(0,p),s=n.length-1-n.lastIndexOf("/")),a=c,u=0;continue}}else if(n.length>0){n="",s=0,a=c,u=0;continue}}t&&(n=n.length>0?n+"/..":"..",s=2)}else n.length>0?n+="/"+e.slice(a+1,c):n=e.slice(a+1,c),s=c-a-1;a=c,u=0}else d===46&&u>-1?u++:u=-1}return n}function ca(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const vD={cwd:yD};function yD(){return"/"}function nd(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function SD(e){if(typeof e=="string")e=new URL(e);else if(!nd(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 bD(e)}function bD(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const s=t.codePointAt(n+2);if(s===70||s===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const ef=["history","path","basename","stem","extname","dirname"];class i0{constructor(t){let n;t?nd(t)?n={path:t}:typeof t=="string"||xD(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":vD.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<ef.length;){const u=ef[s];u in n&&n[u]!==void 0&&n[u]!==null&&(this[u]=u==="history"?[...n[u]]:n[u])}let a;for(a in n)ef.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?Qi.basename(this.path):void 0}set basename(t){nf(t,"basename"),tf(t,"basename"),this.path=Qi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Qi.dirname(this.path):void 0}set dirname(t){fy(this.basename,"dirname"),this.path=Qi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Qi.extname(this.path):void 0}set extname(t){if(tf(t,"extname"),fy(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=Qi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){nd(t)&&(t=SD(t)),nf(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Qi.basename(this.path,this.extname):void 0}set stem(t){nf(t,"stem"),tf(t,"stem"),this.path=Qi.join(this.dirname||"",t+(this.extname||""))}fail(t,n,s){const a=this.message(t,n,s);throw a.fatal=!0,a}info(t,n,s){const a=this.message(t,n,s);return a.fatal=void 0,a}message(t,n,s){const a=new Vt(t,n,s);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function tf(e,t){if(e&&e.includes(Qi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Qi.sep+"`")}function nf(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function fy(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function xD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const wD=(function(e){const s=this.constructor.prototype,a=s[e],u=function(){return a.apply(u,arguments)};return Object.setPrototypeOf(u,s),u}),CD={}.hasOwnProperty;class Md extends wD{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=cD()}copy(){const t=new Md;let n=-1;for(;++n<this.attachers.length;){const s=this.attachers[n];t.use(...s)}return t.data(Jh(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(lf("data",this.frozen),this.namespace[t]=n,this):CD.call(this.namespace,t)&&this.namespace[t]||void 0:t?(lf("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,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const a=n.call(t,...s);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Uo(t),s=this.parser||this.Parser;return rf("parse",s),s(String(n),n)}process(t,n){const s=this;return this.freeze(),rf("process",this.parser||this.Parser),sf("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(u,c){const d=Uo(t),p=s.parse(d);s.run(p,d,function(g,m,S){if(g||!m||!S)return h(g);const y=m,b=s.stringify(y,S);TD(b)?S.value=b:S.result=b,h(g,S)});function h(g,m){g||!m?c(g):u?u(m):n(void 0,m)}}}processSync(t){let n=!1,s;return this.freeze(),rf("processSync",this.parser||this.Parser),sf("processSync",this.compiler||this.Compiler),this.process(t,a),py("processSync","process",n),s;function a(u,c){n=!0,cy(u),s=c}}run(t,n,s){dy(t),this.freeze();const a=this.transformers;return!s&&typeof n=="function"&&(s=n,n=void 0),s?u(void 0,s):new Promise(u);function u(c,d){const p=Uo(n);a.run(t,p,h);function h(g,m,S){const y=m||t;g?d(g):c?c(y):s(void 0,y,S)}}}runSync(t,n){let s=!1,a;return this.run(t,n,u),py("runSync","run",s),a;function u(c,d){cy(c),a=d,s=!0}}stringify(t,n){this.freeze();const s=Uo(n),a=this.compiler||this.Compiler;return sf("stringify",a),dy(t),a(t,s)}use(t,...n){const s=this.attachers,a=this.namespace;if(lf("use",this.frozen),t!=null)if(typeof t=="function")p(t,n);else if(typeof t=="object")Array.isArray(t)?d(t):c(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function u(h){if(typeof h=="function")p(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[g,...m]=h;p(g,m)}else c(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function c(h){if(!("plugins"in h)&&!("settings"in h))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");d(h.plugins),h.settings&&(a.settings=Jh(!0,a.settings,h.settings))}function d(h){let g=-1;if(h!=null)if(Array.isArray(h))for(;++g<h.length;){const m=h[g];u(m)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function p(h,g){let m=-1,S=-1;for(;++m<s.length;)if(s[m][0]===h){S=m;break}if(S===-1)s.push([h,...g]);else if(g.length>0){let[y,...b]=g;const C=s[S][1];id(C)&&id(y)&&(y=Jh(!0,C,y)),s[S]=[h,y,...b]}}}}const kD=new Md().freeze();function rf(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function sf(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function lf(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 dy(e){if(!id(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function py(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Uo(e){return ED(e)?e:new i0(e)}function ED(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function TD(e){return typeof e=="string"||DD(e)}function DD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const AD="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",_y=[],my={allowDangerousHtml:!0},MD=/^(https?|ircs?|mailto|xmpp)$/i,RD=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function BD(e){const t=OD(e),n=zD(e);return LD(t.runSync(t.parse(n),n),e)}function OD(e){const t=e.rehypePlugins||_y,n=e.remarkPlugins||_y,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...my}:my;return kD().use(dT).use(n).use(aD,s).use(t)}function zD(e){const t=e.children||"",n=new i0;return typeof t=="string"&&(n.value=t),n}function LD(e,t){const n=t.allowedElements,s=t.allowElement,a=t.components,u=t.disallowedElements,c=t.skipHtml,d=t.unwrapDisallowed,p=t.urlTransform||ND;for(const g of RD)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+AD+g.id,void 0);return Ad(e,h),$k(e,{Fragment:E.Fragment,components:a,ignoreInvalidStyle:!0,jsx:E.jsx,jsxs:E.jsxs,passKeys:!0,passNode:!0});function h(g,m,S){if(g.type==="raw"&&S&&typeof m=="number")return c?S.children.splice(m,1):S.children[m]={type:"text",value:g.value},m;if(g.type==="element"){let y;for(y in Gh)if(Object.hasOwn(Gh,y)&&Object.hasOwn(g.properties,y)){const b=g.properties[y],C=Gh[y];(C===null||C.includes(g.tagName))&&(g.properties[y]=p(String(b||""),y,g))}}if(g.type==="element"){let y=n?!n.includes(g.tagName):u?u.includes(g.tagName):!1;if(!y&&s&&typeof m=="number"&&(y=!s(g,m,S)),y&&S&&typeof m=="number")return d&&g.children?S.children.splice(m,1,...g.children):S.children.splice(m,1),m}}}function ND(e){const t=e.indexOf(":"),n=e.indexOf("?"),s=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||s!==-1&&t>s||MD.test(e.slice(0,t))?e:""}function HD(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function n0(e,t,n){const a=hu((n||{}).ignore||[]),u=jD(t);let c=-1;for(;++c<u.length;)t0(e,"text",d);function d(h,g){let m=-1,S;for(;++m<g.length;){const y=g[m],b=S?S.children:void 0;if(a(y,b?b.indexOf(y):void 0,S))return;S=y}if(S)return p(h,g)}function p(h,g){const m=g[g.length-1],S=u[c][0],y=u[c][1];let b=0;const B=m.children.indexOf(h);let A=!1,Z=[];S.lastIndex=0;let P=S.exec(h.value);for(;P;){const ee=P.index,ne={index:P.index,input:P.input,stack:[...g,h]};let z=y(...P,ne);if(typeof z=="string"&&(z=z.length>0?{type:"text",value:z}:void 0),z===!1?S.lastIndex=ee+1:(b!==ee&&Z.push({type:"text",value:h.value.slice(b,ee)}),Array.isArray(z)?Z.push(...z):z&&Z.push(z),b=ee+P[0].length,A=!0),!S.global)break;P=S.exec(h.value)}return A?(b<h.value.length&&Z.push({type:"text",value:h.value.slice(b)}),m.children.splice(B,1,...Z)):Z=[h],B+Z.length}}function jD(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 s=-1;for(;++s<n.length;){const a=n[s];t.push([UD(a[0]),PD(a[1])])}return t}function UD(e){return typeof e=="string"?new RegExp(HD(e),"g"):e}function PD(e){return typeof e=="function"?e:function(){return e}}function ID(e){n0(e,[/\r?\n|\r/g,FD])}function FD(){return{type:"break"}}function qD(){return function(e){ID(e)}}function gy(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let s=0,a=n.indexOf(t);for(;a!==-1;)s++,a=n.indexOf(t,a+t.length);return s}const af="phrasing",of=["autolink","link","image","label"];function VD(){return{transforms:[ZD],enter:{literalAutolink:YD,literalAutolinkEmail:uf,literalAutolinkHttp:uf,literalAutolinkWww:uf},exit:{literalAutolink:$D,literalAutolinkEmail:GD,literalAutolinkHttp:KD,literalAutolinkWww:XD}}}function WD(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:af,notInConstruct:of},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:af,notInConstruct:of},{character:":",before:"[ps]",after:"\\/",inConstruct:af,notInConstruct:of}]}}function YD(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function uf(e){this.config.enter.autolinkProtocol.call(this,e)}function KD(e){this.config.exit.autolinkProtocol.call(this,e)}function XD(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 GD(e){this.config.exit.autolinkEmail.call(this,e)}function $D(e){this.exit(e)}function ZD(e){n0(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,QD],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),JD]],{ignore:["link","linkReference"]})}function QD(e,t,n,s,a){let u="";if(!r0(a)||(/^w/i.test(t)&&(n=t+n,t="",u="http://"),!e3(n)))return!1;const c=t3(n+s);if(!c[0])return!1;const d={type:"link",title:null,url:u+t+c[0],children:[{type:"text",value:t+c[0]}]};return c[1]?[d,{type:"text",value:c[1]}]:d}function JD(e,t,n,s){return!r0(s,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function e3(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 t3(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],s=n.indexOf(")");const a=gy(e,"(");let u=gy(e,")");for(;s!==-1&&a>u;)e+=n.slice(0,s+1),n=n.slice(s+1),s=n.indexOf(")"),u++;return[e,n]}function r0(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Lr(n)||ou(n))&&(!t||n!==47)}s0.peek=c3;function i3(){this.buffer()}function n3(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function r3(){this.buffer()}function s3(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function l3(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Vi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function a3(e){this.exit(e)}function o3(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Vi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function u3(e){this.exit(e)}function c3(){return"["}function s0(e,t,n,s){const a=n.createTracker(s);let u=a.move("[^");const c=n.enter("footnoteReference"),d=n.enter("reference");return u+=a.move(n.safe(n.associationId(e),{after:"]",before:u})),d(),c(),u+=a.move("]"),u}function h3(){return{enter:{gfmFootnoteCallString:i3,gfmFootnoteCall:n3,gfmFootnoteDefinitionLabelString:r3,gfmFootnoteDefinition:s3},exit:{gfmFootnoteCallString:l3,gfmFootnoteCall:a3,gfmFootnoteDefinitionLabelString:o3,gfmFootnoteDefinition:u3}}}function f3(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:s0},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(s,a,u,c){const d=u.createTracker(c);let p=d.move("[^");const h=u.enter("footnoteDefinition"),g=u.enter("label");return p+=d.move(u.safe(u.associationId(s),{before:p,after:"]"})),g(),p+=d.move("]:"),s.children&&s.children.length>0&&(d.shift(4),p+=d.move((t?`
|
|
102
|
-
`:" ")+u.indentLines(u.containerFlow(s,d.current()),t?l0:d3))),h(),p}}function d3(e,t,n){return t===0?e:l0(e,t,n)}function l0(e,t,n){return(n?"":" ")+e}const p3=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];a0.peek=y3;function _3(){return{canContainEols:["delete"],enter:{strikethrough:g3},exit:{strikethrough:v3}}}function m3(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:p3}],handlers:{delete:a0}}}function g3(e){this.enter({type:"delete",children:[]},e)}function v3(e){this.exit(e)}function a0(e,t,n,s){const a=n.createTracker(s),u=n.enter("strikethrough");let c=a.move("~~");return c+=n.containerPhrasing(e,{...a.current(),before:c,after:"~"}),c+=a.move("~~"),u(),c}function y3(){return"~"}function S3(e){return e.length}function b3(e,t){const n=t||{},s=(n.align||[]).concat(),a=n.stringLength||S3,u=[],c=[],d=[],p=[];let h=0,g=-1;for(;++g<e.length;){const C=[],B=[];let A=-1;for(e[g].length>h&&(h=e[g].length);++A<e[g].length;){const Z=x3(e[g][A]);if(n.alignDelimiters!==!1){const P=a(Z);B[A]=P,(p[A]===void 0||P>p[A])&&(p[A]=P)}C.push(Z)}c[g]=C,d[g]=B}let m=-1;if(typeof s=="object"&&"length"in s)for(;++m<h;)u[m]=vy(s[m]);else{const C=vy(s);for(;++m<h;)u[m]=C}m=-1;const S=[],y=[];for(;++m<h;){const C=u[m];let B="",A="";C===99?(B=":",A=":"):C===108?B=":":C===114&&(A=":");let Z=n.alignDelimiters===!1?1:Math.max(1,p[m]-B.length-A.length);const P=B+"-".repeat(Z)+A;n.alignDelimiters!==!1&&(Z=B.length+Z+A.length,Z>p[m]&&(p[m]=Z),y[m]=Z),S[m]=P}c.splice(1,0,S),d.splice(1,0,y),g=-1;const b=[];for(;++g<c.length;){const C=c[g],B=d[g];m=-1;const A=[];for(;++m<h;){const Z=C[m]||"";let P="",ee="";if(n.alignDelimiters!==!1){const ne=p[m]-(B[m]||0),z=u[m];z===114?P=" ".repeat(ne):z===99?ne%2?(P=" ".repeat(ne/2+.5),ee=" ".repeat(ne/2-.5)):(P=" ".repeat(ne/2),ee=P):ee=" ".repeat(ne)}n.delimiterStart!==!1&&!m&&A.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&Z==="")&&(n.delimiterStart!==!1||m)&&A.push(" "),n.alignDelimiters!==!1&&A.push(P),A.push(Z),n.alignDelimiters!==!1&&A.push(ee),n.padding!==!1&&A.push(" "),(n.delimiterEnd!==!1||m!==h-1)&&A.push("|")}b.push(n.delimiterEnd===!1?A.join("").replace(/ +$/,""):A.join(""))}return b.join(`
|
|
103
|
-
`)}function x3(e){return e==null?"":String(e)}function vy(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function w3(e,t,n,s){const a=n.enter("blockquote"),u=n.createTracker(s);u.move("> "),u.shift(2);const c=n.indentLines(n.containerFlow(e,u.current()),C3);return a(),c}function C3(e,t,n){return">"+(n?"":" ")+e}function k3(e,t){return yy(e,t.inConstruct,!0)&&!yy(e,t.notInConstruct,!1)}function yy(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let s=-1;for(;++s<t.length;)if(e.includes(t[s]))return!0;return!1}function Sy(e,t,n,s){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
|
|
104
|
-
`&&k3(n.stack,n.unsafe[a]))return/[ \t]/.test(s.before)?"":" ";return`\\
|
|
105
|
-
`}function E3(e,t){const n=String(e);let s=n.indexOf(t),a=s,u=0,c=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;s!==-1;)s===a?++u>c&&(c=u):u=1,a=s+t.length,s=n.indexOf(t,a);return c}function T3(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 D3(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 A3(e,t,n,s){const a=D3(n),u=e.value||"",c=a==="`"?"GraveAccent":"Tilde";if(T3(e,n)){const m=n.enter("codeIndented"),S=n.indentLines(u,M3);return m(),S}const d=n.createTracker(s),p=a.repeat(Math.max(E3(u,a)+1,3)),h=n.enter("codeFenced");let g=d.move(p);if(e.lang){const m=n.enter(`codeFencedLang${c}`);g+=d.move(n.safe(e.lang,{before:g,after:" ",encode:["`"],...d.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${c}`);g+=d.move(" "),g+=d.move(n.safe(e.meta,{before:g,after:`
|
|
106
|
-
`,encode:["`"],...d.current()})),m()}return g+=d.move(`
|
|
107
|
-
`),u&&(g+=d.move(u+`
|
|
108
|
-
`)),g+=d.move(p),h(),g}function M3(e,t,n){return(n?"":" ")+e}function Rd(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 R3(e,t,n,s){const a=Rd(n),u=a==='"'?"Quote":"Apostrophe",c=n.enter("definition");let d=n.enter("label");const p=n.createTracker(s);let h=p.move("[");return h+=p.move(n.safe(n.associationId(e),{before:h,after:"]",...p.current()})),h+=p.move("]: "),d(),!e.url||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=p.move("<"),h+=p.move(n.safe(e.url,{before:h,after:">",...p.current()})),h+=p.move(">")):(d=n.enter("destinationRaw"),h+=p.move(n.safe(e.url,{before:h,after:e.title?" ":`
|
|
109
|
-
`,...p.current()}))),d(),e.title&&(d=n.enter(`title${u}`),h+=p.move(" "+a),h+=p.move(n.safe(e.title,{before:h,after:a,...p.current()})),h+=p.move(a),d()),c(),h}function B3(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 na(e){return"&#x"+e.toString(16).toUpperCase()+";"}function iu(e,t,n){const s=zs(e),a=zs(t);return s===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:s===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}o0.peek=O3;function o0(e,t,n,s){const a=B3(n),u=n.enter("emphasis"),c=n.createTracker(s),d=c.move(a);let p=c.move(n.containerPhrasing(e,{after:a,before:d,...c.current()}));const h=p.charCodeAt(0),g=iu(s.before.charCodeAt(s.before.length-1),h,a);g.inside&&(p=na(h)+p.slice(1));const m=p.charCodeAt(p.length-1),S=iu(s.after.charCodeAt(0),m,a);S.inside&&(p=p.slice(0,-1)+na(m));const y=c.move(a);return u(),n.attentionEncodeSurroundingInfo={after:S.outside,before:g.outside},d+p+y}function O3(e,t,n){return n.options.emphasis||"*"}function z3(e,t){let n=!1;return Ad(e,function(s){if("value"in s&&/\r?\n|\r/.test(s.value)||s.type==="break")return n=!0,ed}),!!((!e.depth||e.depth<3)&&xd(e)&&(t.options.setext||n))}function L3(e,t,n,s){const a=Math.max(Math.min(6,e.depth||1),1),u=n.createTracker(s);if(z3(e,n)){const g=n.enter("headingSetext"),m=n.enter("phrasing"),S=n.containerPhrasing(e,{...u.current(),before:`
|
|
110
|
-
`,after:`
|
|
111
|
-
`});return m(),g(),S+`
|
|
112
|
-
`+(a===1?"=":"-").repeat(S.length-(Math.max(S.lastIndexOf("\r"),S.lastIndexOf(`
|
|
113
|
-
`))+1))}const c="#".repeat(a),d=n.enter("headingAtx"),p=n.enter("phrasing");u.move(c+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
|
|
114
|
-
`,...u.current()});return/^[\t ]/.test(h)&&(h=na(h.charCodeAt(0))+h.slice(1)),h=h?c+" "+h:c,n.options.closeAtx&&(h+=" "+c),p(),d(),h}u0.peek=N3;function u0(e){return e.value||""}function N3(){return"<"}c0.peek=H3;function c0(e,t,n,s){const a=Rd(n),u=a==='"'?"Quote":"Apostrophe",c=n.enter("image");let d=n.enter("label");const p=n.createTracker(s);let h=p.move("![");return h+=p.move(n.safe(e.alt,{before:h,after:"]",...p.current()})),h+=p.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=p.move("<"),h+=p.move(n.safe(e.url,{before:h,after:">",...p.current()})),h+=p.move(">")):(d=n.enter("destinationRaw"),h+=p.move(n.safe(e.url,{before:h,after:e.title?" ":")",...p.current()}))),d(),e.title&&(d=n.enter(`title${u}`),h+=p.move(" "+a),h+=p.move(n.safe(e.title,{before:h,after:a,...p.current()})),h+=p.move(a),d()),h+=p.move(")"),c(),h}function H3(){return"!"}h0.peek=j3;function h0(e,t,n,s){const a=e.referenceType,u=n.enter("imageReference");let c=n.enter("label");const d=n.createTracker(s);let p=d.move("![");const h=n.safe(e.alt,{before:p,after:"]",...d.current()});p+=d.move(h+"]["),c();const g=n.stack;n.stack=[],c=n.enter("reference");const m=n.safe(n.associationId(e),{before:p,after:"]",...d.current()});return c(),n.stack=g,u(),a==="full"||!h||h!==m?p+=d.move(m+"]"):a==="shortcut"?p=p.slice(0,-1):p+=d.move("]"),p}function j3(){return"!"}f0.peek=U3;function f0(e,t,n){let s=e.value||"",a="`",u=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(s);)a+="`";for(/[^ \r\n]/.test(s)&&(/^[ \r\n]/.test(s)&&/[ \r\n]$/.test(s)||/^`|`$/.test(s))&&(s=" "+s+" ");++u<n.unsafe.length;){const c=n.unsafe[u],d=n.compilePattern(c);let p;if(c.atBreak)for(;p=d.exec(s);){let h=p.index;s.charCodeAt(h)===10&&s.charCodeAt(h-1)===13&&h--,s=s.slice(0,h)+" "+s.slice(p.index+1)}}return a+s+a}function U3(){return"`"}function d0(e,t){const n=xd(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))}p0.peek=P3;function p0(e,t,n,s){const a=Rd(n),u=a==='"'?"Quote":"Apostrophe",c=n.createTracker(s);let d,p;if(d0(e,n)){const g=n.stack;n.stack=[],d=n.enter("autolink");let m=c.move("<");return m+=c.move(n.containerPhrasing(e,{before:m,after:">",...c.current()})),m+=c.move(">"),d(),n.stack=g,m}d=n.enter("link"),p=n.enter("label");let h=c.move("[");return h+=c.move(n.containerPhrasing(e,{before:h,after:"](",...c.current()})),h+=c.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=n.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(n.safe(e.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(p=n.enter("destinationRaw"),h+=c.move(n.safe(e.url,{before:h,after:e.title?" ":")",...c.current()}))),p(),e.title&&(p=n.enter(`title${u}`),h+=c.move(" "+a),h+=c.move(n.safe(e.title,{before:h,after:a,...c.current()})),h+=c.move(a),p()),h+=c.move(")"),d(),h}function P3(e,t,n){return d0(e,n)?"<":"["}_0.peek=I3;function _0(e,t,n,s){const a=e.referenceType,u=n.enter("linkReference");let c=n.enter("label");const d=n.createTracker(s);let p=d.move("[");const h=n.containerPhrasing(e,{before:p,after:"]",...d.current()});p+=d.move(h+"]["),c();const g=n.stack;n.stack=[],c=n.enter("reference");const m=n.safe(n.associationId(e),{before:p,after:"]",...d.current()});return c(),n.stack=g,u(),a==="full"||!h||h!==m?p+=d.move(m+"]"):a==="shortcut"?p=p.slice(0,-1):p+=d.move("]"),p}function I3(){return"["}function Bd(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 F3(e){const t=Bd(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 q3(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 m0(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 V3(e,t,n,s){const a=n.enter("list"),u=n.bulletCurrent;let c=e.ordered?q3(n):Bd(n);const d=e.ordered?c==="."?")":".":F3(n);let p=t&&n.bulletLastUsed?c===n.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&g&&(!g.children||!g.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&&(p=!0),m0(n)===c&&g){let m=-1;for(;++m<e.children.length;){const S=e.children[m];if(S&&S.type==="listItem"&&S.children&&S.children[0]&&S.children[0].type==="thematicBreak"){p=!0;break}}}}p&&(c=d),n.bulletCurrent=c;const h=n.containerFlow(e,s);return n.bulletLastUsed=c,n.bulletCurrent=u,a(),h}function W3(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 Y3(e,t,n,s){const a=W3(n);let u=n.bulletCurrent||Bd(n);t&&t.type==="list"&&t.ordered&&(u=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+u);let c=u.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(c=Math.ceil(c/4)*4);const d=n.createTracker(s);d.move(u+" ".repeat(c-u.length)),d.shift(c);const p=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,d.current()),g);return p(),h;function g(m,S,y){return S?(y?"":" ".repeat(c))+m:(y?u:u+" ".repeat(c-u.length))+m}}function K3(e,t,n,s){const a=n.enter("paragraph"),u=n.enter("phrasing"),c=n.containerPhrasing(e,s);return u(),a(),c}const X3=hu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function G3(e,t,n,s){return(e.children.some(function(c){return X3(c)})?n.containerPhrasing:n.containerFlow).call(n,e,s)}function $3(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}g0.peek=Z3;function g0(e,t,n,s){const a=$3(n),u=n.enter("strong"),c=n.createTracker(s),d=c.move(a+a);let p=c.move(n.containerPhrasing(e,{after:a,before:d,...c.current()}));const h=p.charCodeAt(0),g=iu(s.before.charCodeAt(s.before.length-1),h,a);g.inside&&(p=na(h)+p.slice(1));const m=p.charCodeAt(p.length-1),S=iu(s.after.charCodeAt(0),m,a);S.inside&&(p=p.slice(0,-1)+na(m));const y=c.move(a+a);return u(),n.attentionEncodeSurroundingInfo={after:S.outside,before:g.outside},d+p+y}function Z3(e,t,n){return n.options.strong||"*"}function Q3(e,t,n,s){return n.safe(e.value,s)}function J3(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 eA(e,t,n){const s=(m0(n)+(n.options.ruleSpaces?" ":"")).repeat(J3(n));return n.options.ruleSpaces?s.slice(0,-1):s}const v0={blockquote:w3,break:Sy,code:A3,definition:R3,emphasis:o0,hardBreak:Sy,heading:L3,html:u0,image:c0,imageReference:h0,inlineCode:f0,link:p0,linkReference:_0,list:V3,listItem:Y3,paragraph:K3,root:G3,strong:g0,text:Q3,thematicBreak:eA};function tA(){return{enter:{table:iA,tableData:by,tableHeader:by,tableRow:rA},exit:{codeText:sA,table:nA,tableData:cf,tableHeader:cf,tableRow:cf}}}function iA(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 nA(e){this.exit(e),this.data.inTable=void 0}function rA(e){this.enter({type:"tableRow",children:[]},e)}function cf(e){this.exit(e)}function by(e){this.enter({type:"tableCell",children:[]},e)}function sA(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,lA));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function lA(e,t){return t==="|"?t:e}function aA(e){const t=e||{},n=t.tableCellPadding,s=t.tablePipeAlign,a=t.stringLength,u=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
115
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:S,table:c,tableCell:p,tableRow:d}};function c(y,b,C,B){return h(g(y,C,B),y.align)}function d(y,b,C,B){const A=m(y,C,B),Z=h([A]);return Z.slice(0,Z.indexOf(`
|
|
116
|
-
`))}function p(y,b,C,B){const A=C.enter("tableCell"),Z=C.enter("phrasing"),P=C.containerPhrasing(y,{...B,before:u,after:u});return Z(),A(),P}function h(y,b){return b3(y,{align:b,alignDelimiters:s,padding:n,stringLength:a})}function g(y,b,C){const B=y.children;let A=-1;const Z=[],P=b.enter("table");for(;++A<B.length;)Z[A]=m(B[A],b,C);return P(),Z}function m(y,b,C){const B=y.children;let A=-1;const Z=[],P=b.enter("tableRow");for(;++A<B.length;)Z[A]=p(B[A],y,b,C);return P(),Z}function S(y,b,C){let B=v0.inlineCode(y,b,C);return C.stack.includes("tableCell")&&(B=B.replace(/\|/g,"\\$&")),B}}function oA(){return{exit:{taskListCheckValueChecked:xy,taskListCheckValueUnchecked:xy,paragraph:cA}}}function uA(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:hA}}}function xy(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function cA(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 s=n.children[0];if(s&&s.type==="text"){const a=t.children;let u=-1,c;for(;++u<a.length;){const d=a[u];if(d.type==="paragraph"){c=d;break}}c===n&&(s.value=s.value.slice(1),s.value.length===0?n.children.shift():n.position&&s.position&&typeof s.position.start.offset=="number"&&(s.position.start.column++,s.position.start.offset++,n.position.start=Object.assign({},s.position.start)))}}this.exit(e)}function hA(e,t,n,s){const a=e.children[0],u=typeof e.checked=="boolean"&&a&&a.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",d=n.createTracker(s);u&&d.move(c);let p=v0.listItem(e,t,n,{...s,...d.current()});return u&&(p=p.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),p;function h(g){return g+c}}function fA(){return[VD(),h3(),_3(),tA(),oA()]}function dA(e){return{extensions:[WD(),f3(e),m3(),aA(e),uA()]}}const pA={tokenize:SA,partial:!0},y0={tokenize:bA,partial:!0},S0={tokenize:xA,partial:!0},b0={tokenize:wA,partial:!0},_A={tokenize:CA,partial:!0},x0={name:"wwwAutolink",tokenize:vA,previous:C0},w0={name:"protocolAutolink",tokenize:yA,previous:k0},Tn={name:"emailAutolink",tokenize:gA,previous:E0},nn={};function mA(){return{text:nn}}let Tr=48;for(;Tr<123;)nn[Tr]=Tn,Tr++,Tr===58?Tr=65:Tr===91&&(Tr=97);nn[43]=Tn;nn[45]=Tn;nn[46]=Tn;nn[95]=Tn;nn[72]=[Tn,w0];nn[104]=[Tn,w0];nn[87]=[Tn,x0];nn[119]=[Tn,x0];function gA(e,t,n){const s=this;let a,u;return c;function c(m){return!rd(m)||!E0.call(s,s.previous)||Od(s.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(m))}function d(m){return rd(m)?(e.consume(m),d):m===64?(e.consume(m),p):n(m)}function p(m){return m===46?e.check(_A,g,h)(m):m===45||m===95||qt(m)?(u=!0,e.consume(m),p):g(m)}function h(m){return e.consume(m),a=!0,p}function g(m){return u&&a&&$t(s.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):n(m)}}function vA(e,t,n){const s=this;return a;function a(c){return c!==87&&c!==119||!C0.call(s,s.previous)||Od(s.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(pA,e.attempt(y0,e.attempt(S0,u),n),n)(c))}function u(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(c)}}function yA(e,t,n){const s=this;let a="",u=!1;return c;function c(m){return(m===72||m===104)&&k0.call(s,s.previous)&&!Od(s.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(m),e.consume(m),d):n(m)}function d(m){if($t(m)&&a.length<5)return a+=String.fromCodePoint(m),e.consume(m),d;if(m===58){const S=a.toLowerCase();if(S==="http"||S==="https")return e.consume(m),p}return n(m)}function p(m){return m===47?(e.consume(m),u?h:(u=!0,p)):n(m)}function h(m){return m===null||eu(m)||Qe(m)||Lr(m)||ou(m)?n(m):e.attempt(y0,e.attempt(S0,g),n)(m)}function g(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function SA(e,t,n){let s=0;return a;function a(c){return(c===87||c===119)&&s<3?(s++,e.consume(c),a):c===46&&s===3?(e.consume(c),u):n(c)}function u(c){return c===null?n(c):t(c)}}function bA(e,t,n){let s,a,u;return c;function c(h){return h===46||h===95?e.check(b0,p,d)(h):h===null||Qe(h)||Lr(h)||h!==45&&ou(h)?p(h):(u=!0,e.consume(h),c)}function d(h){return h===95?s=!0:(a=s,s=void 0),e.consume(h),c}function p(h){return a||s||!u?n(h):t(h)}}function xA(e,t){let n=0,s=0;return a;function a(c){return c===40?(n++,e.consume(c),a):c===41&&s<n?u(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?e.check(b0,t,u)(c):c===null||Qe(c)||Lr(c)?t(c):(e.consume(c),a)}function u(c){return c===41&&s++,e.consume(c),a}}function wA(e,t,n){return s;function s(d){return d===33||d===34||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===63||d===95||d===126?(e.consume(d),s):d===38?(e.consume(d),u):d===93?(e.consume(d),a):d===60||d===null||Qe(d)||Lr(d)?t(d):n(d)}function a(d){return d===null||d===40||d===91||Qe(d)||Lr(d)?t(d):s(d)}function u(d){return $t(d)?c(d):n(d)}function c(d){return d===59?(e.consume(d),s):$t(d)?(e.consume(d),c):n(d)}}function CA(e,t,n){return s;function s(u){return e.consume(u),a}function a(u){return qt(u)?n(u):t(u)}}function C0(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Qe(e)}function k0(e){return!$t(e)}function E0(e){return!(e===47||rd(e))}function rd(e){return e===43||e===45||e===46||e===95||qt(e)}function Od(e){let t=e.length,n=!1;for(;t--;){const s=e[t][1];if((s.type==="labelLink"||s.type==="labelImage")&&!s._balanced){n=!0;break}if(s._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const kA={tokenize:OA,partial:!0};function EA(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:MA,continuation:{tokenize:RA},exit:BA}},text:{91:{name:"gfmFootnoteCall",tokenize:AA},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:TA,resolveTo:DA}}}}function TA(e,t,n){const s=this;let a=s.events.length;const u=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let c;for(;a--;){const p=s.events[a][1];if(p.type==="labelImage"){c=p;break}if(p.type==="gfmFootnoteCall"||p.type==="labelLink"||p.type==="label"||p.type==="image"||p.type==="link")break}return d;function d(p){if(!c||!c._balanced)return n(p);const h=Vi(s.sliceSerialize({start:c.end,end:s.now()}));return h.codePointAt(0)!==94||!u.includes(h.slice(1))?n(p):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),t(p))}}function DA(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 s={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const u={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},u.start),end:Object.assign({},u.end)},d=[e[n+1],e[n+2],["enter",s,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",u,t],["enter",c,t],["exit",c,t],["exit",u,t],e[e.length-2],e[e.length-1],["exit",s,t]];return e.splice(n,e.length-n+1,...d),e}function AA(e,t,n){const s=this,a=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let u=0,c;return d;function d(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),p}function p(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(m){if(u>999||m===93&&!c||m===null||m===91||Qe(m))return n(m);if(m===93){e.exit("chunkString");const S=e.exit("gfmFootnoteCallString");return a.includes(Vi(s.sliceSerialize(S)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return Qe(m)||(c=!0),u++,e.consume(m),m===92?g:h}function g(m){return m===91||m===92||m===93?(e.consume(m),u++,h):h(m)}}function MA(e,t,n){const s=this,a=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let u,c=0,d;return p;function p(b){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(b){return b===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):n(b)}function g(b){if(c>999||b===93&&!d||b===null||b===91||Qe(b))return n(b);if(b===93){e.exit("chunkString");const C=e.exit("gfmFootnoteDefinitionLabelString");return u=Vi(s.sliceSerialize(C)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),S}return Qe(b)||(d=!0),c++,e.consume(b),b===92?m:g}function m(b){return b===91||b===92||b===93?(e.consume(b),c++,g):g(b)}function S(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),a.includes(u)||a.push(u),je(e,y,"gfmFootnoteDefinitionWhitespace")):n(b)}function y(b){return t(b)}}function RA(e,t,n){return e.check(ua,t,e.attempt(kA,t,n))}function BA(e){e.exit("gfmFootnoteDefinition")}function OA(e,t,n){const s=this;return je(e,a,"gfmFootnoteDefinitionIndent",5);function a(u){const c=s.events[s.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?t(u):n(u)}}function zA(e){let n=(e||{}).singleTilde;const s={name:"strikethrough",tokenize:u,resolveAll:a};return n==null&&(n=!0),{text:{126:s},insideSpan:{null:[s]},attentionMarkers:{null:[126]}};function a(c,d){let p=-1;for(;++p<c.length;)if(c[p][0]==="enter"&&c[p][1].type==="strikethroughSequenceTemporary"&&c[p][1]._close){let h=p;for(;h--;)if(c[h][0]==="exit"&&c[h][1].type==="strikethroughSequenceTemporary"&&c[h][1]._open&&c[p][1].end.offset-c[p][1].start.offset===c[h][1].end.offset-c[h][1].start.offset){c[p][1].type="strikethroughSequence",c[h][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},c[h][1].start),end:Object.assign({},c[p][1].end)},m={type:"strikethroughText",start:Object.assign({},c[h][1].end),end:Object.assign({},c[p][1].start)},S=[["enter",g,d],["enter",c[h][1],d],["exit",c[h][1],d],["enter",m,d]],y=d.parser.constructs.insideSpan.null;y&&wi(S,S.length,0,uu(y,c.slice(h+1,p),d)),wi(S,S.length,0,[["exit",m,d],["enter",c[p][1],d],["exit",c[p][1],d],["exit",g,d]]),wi(c,h-1,p-h+3,S),p=h+S.length-2;break}}for(p=-1;++p<c.length;)c[p][1].type==="strikethroughSequenceTemporary"&&(c[p][1].type="data");return c}function u(c,d,p){const h=this.previous,g=this.events;let m=0;return S;function S(b){return h===126&&g[g.length-1][1].type!=="characterEscape"?p(b):(c.enter("strikethroughSequenceTemporary"),y(b))}function y(b){const C=zs(h);if(b===126)return m>1?p(b):(c.consume(b),m++,y);if(m<2&&!n)return p(b);const B=c.exit("strikethroughSequenceTemporary"),A=zs(b);return B._open=!A||A===2&&!!C,B._close=!C||C===2&&!!A,d(b)}}}class LA{constructor(){this.map=[]}add(t,n,s){NA(this,t,n,s)}consume(t){if(this.map.sort(function(u,c){return u[0]-c[0]}),this.map.length===0)return;let n=this.map.length;const s=[];for(;n>0;)n-=1,s.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];s.push(t.slice()),t.length=0;let a=s.pop();for(;a;){for(const u of a)t.push(u);a=s.pop()}this.map.length=0}}function NA(e,t,n,s){let a=0;if(!(n===0&&s.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...s);return}a+=1}e.map.push([t,n,s])}}function HA(e,t){let n=!1;const s=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&s.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const u=s.length-1;s[u]=s[u]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return s}function jA(){return{flow:{null:{name:"table",tokenize:UA,resolveAll:PA}}}}function UA(e,t,n){const s=this;let a=0,u=0,c;return d;function d(H){let te=s.events.length-1;for(;te>-1;){const K=s.events[te][1].type;if(K==="lineEnding"||K==="linePrefix")te--;else break}const V=te>-1?s.events[te][1].type:null,I=V==="tableHead"||V==="tableRow"?z:p;return I===z&&s.parser.lazy[s.now().line]?n(H):I(H)}function p(H){return e.enter("tableHead"),e.enter("tableRow"),h(H)}function h(H){return H===124||(c=!0,u+=1),g(H)}function g(H){return H===null?n(H):ve(H)?u>1?(u=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(H),e.exit("lineEnding"),y):n(H):Oe(H)?je(e,g,"whitespace")(H):(u+=1,c&&(c=!1,a+=1),H===124?(e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),c=!0,g):(e.enter("data"),m(H)))}function m(H){return H===null||H===124||Qe(H)?(e.exit("data"),g(H)):(e.consume(H),H===92?S:m)}function S(H){return H===92||H===124?(e.consume(H),m):m(H)}function y(H){return s.interrupt=!1,s.parser.lazy[s.now().line]?n(H):(e.enter("tableDelimiterRow"),c=!1,Oe(H)?je(e,b,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):b(H))}function b(H){return H===45||H===58?B(H):H===124?(c=!0,e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),C):ne(H)}function C(H){return Oe(H)?je(e,B,"whitespace")(H):B(H)}function B(H){return H===58?(u+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(H),e.exit("tableDelimiterMarker"),A):H===45?(u+=1,A(H)):H===null||ve(H)?ee(H):ne(H)}function A(H){return H===45?(e.enter("tableDelimiterFiller"),Z(H)):ne(H)}function Z(H){return H===45?(e.consume(H),Z):H===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(H),e.exit("tableDelimiterMarker"),P):(e.exit("tableDelimiterFiller"),P(H))}function P(H){return Oe(H)?je(e,ee,"whitespace")(H):ee(H)}function ee(H){return H===124?b(H):H===null||ve(H)?!c||a!==u?ne(H):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(H)):ne(H)}function ne(H){return n(H)}function z(H){return e.enter("tableRow"),ie(H)}function ie(H){return H===124?(e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),ie):H===null||ve(H)?(e.exit("tableRow"),t(H)):Oe(H)?je(e,ie,"whitespace")(H):(e.enter("data"),ue(H))}function ue(H){return H===null||H===124||Qe(H)?(e.exit("data"),ie(H)):(e.consume(H),H===92?_e:ue)}function _e(H){return H===92||H===124?(e.consume(H),ue):ue(H)}}function PA(e,t){let n=-1,s=!0,a=0,u=[0,0,0,0],c=[0,0,0,0],d=!1,p=0,h,g,m;const S=new LA;for(;++n<e.length;){const y=e[n],b=y[1];y[0]==="enter"?b.type==="tableHead"?(d=!1,p!==0&&(wy(S,t,p,h,g),g=void 0,p=0),h={type:"table",start:Object.assign({},b.start),end:Object.assign({},b.end)},S.add(n,0,[["enter",h,t]])):b.type==="tableRow"||b.type==="tableDelimiterRow"?(s=!0,m=void 0,u=[0,0,0,0],c=[0,n+1,0,0],d&&(d=!1,g={type:"tableBody",start:Object.assign({},b.start),end:Object.assign({},b.end)},S.add(n,0,[["enter",g,t]])),a=b.type==="tableDelimiterRow"?2:g?3:1):a&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")?(s=!1,c[2]===0&&(u[1]!==0&&(c[0]=c[1],m=Po(S,t,u,a,void 0,m),u=[0,0,0,0]),c[2]=n)):b.type==="tableCellDivider"&&(s?s=!1:(u[1]!==0&&(c[0]=c[1],m=Po(S,t,u,a,void 0,m)),u=c,c=[u[1],n,0,0])):b.type==="tableHead"?(d=!0,p=n):b.type==="tableRow"||b.type==="tableDelimiterRow"?(p=n,u[1]!==0?(c[0]=c[1],m=Po(S,t,u,a,n,m)):c[1]!==0&&(m=Po(S,t,c,a,n,m)),a=0):a&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(c[3]=n)}for(p!==0&&wy(S,t,p,h,g),S.consume(t.events),n=-1;++n<t.events.length;){const y=t.events[n];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=HA(t.events,n))}return e}function Po(e,t,n,s,a,u){const c=s===1?"tableHeader":s===2?"tableDelimiter":"tableData",d="tableContent";n[0]!==0&&(u.end=Object.assign({},Ms(t.events,n[0])),e.add(n[0],0,[["exit",u,t]]));const p=Ms(t.events,n[1]);if(u={type:c,start:Object.assign({},p),end:Object.assign({},p)},e.add(n[1],0,[["enter",u,t]]),n[2]!==0){const h=Ms(t.events,n[2]),g=Ms(t.events,n[3]),m={type:d,start:Object.assign({},h),end:Object.assign({},g)};if(e.add(n[2],0,[["enter",m,t]]),s!==2){const S=t.events[n[2]],y=t.events[n[3]];if(S[1].end=Object.assign({},y[1].end),S[1].type="chunkText",S[1].contentType="text",n[3]>n[2]+1){const b=n[2]+1,C=n[3]-n[2]-1;e.add(b,C,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return a!==void 0&&(u.end=Object.assign({},Ms(t.events,a)),e.add(a,0,[["exit",u,t]]),u=void 0),u}function wy(e,t,n,s,a){const u=[],c=Ms(t.events,n);a&&(a.end=Object.assign({},c),u.push(["exit",a,t])),s.end=Object.assign({},c),u.push(["exit",s,t]),e.add(n+1,0,u)}function Ms(e,t){const n=e[t],s=n[0]==="enter"?"start":"end";return n[1][s]}const IA={name:"tasklistCheck",tokenize:qA};function FA(){return{text:{91:IA}}}function qA(e,t,n){const s=this;return a;function a(p){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?n(p):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),u)}function u(p){return Qe(p)?(e.enter("taskListCheckValueUnchecked"),e.consume(p),e.exit("taskListCheckValueUnchecked"),c):p===88||p===120?(e.enter("taskListCheckValueChecked"),e.consume(p),e.exit("taskListCheckValueChecked"),c):n(p)}function c(p){return p===93?(e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):n(p)}function d(p){return ve(p)?t(p):Oe(p)?e.check({tokenize:VA},t,n)(p):n(p)}}function VA(e,t,n){return je(e,s,"whitespace");function s(a){return a===null?n(a):t(a)}}function WA(e){return NS([mA(),EA(),zA(e),jA(),FA()])}const YA={};function KA(e){const t=this,n=e||YA,s=t.data(),a=s.micromarkExtensions||(s.micromarkExtensions=[]),u=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),c=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);a.push(WA(n)),u.push(fA()),c.push(dA(n))}const Dr=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],Cy={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Dr,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Dr],h2:[["className","sr-only"]],img:[...Dr,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Dr,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Dr],table:[...Dr],ul:[...Dr,["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"]},rr={}.hasOwnProperty;function XA(e,t){let n={type:"root",children:[]};const s={schema:t?{...Cy,...t}:Cy,stack:[]},a=T0(s,e);return a&&(Array.isArray(a)?a.length===1?n=a[0]:n.children=a:n=a),n}function T0(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return GA(e,n);case"doctype":return $A(e,n);case"element":return ZA(e,n);case"root":return QA(e,n);case"text":return JA(e,n)}}}function GA(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",s=n.indexOf("-->"),u={type:"comment",value:s<0?n:n.slice(0,s)};return ha(u,t),u}}function $A(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return ha(n,t),n}}function ZA(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const s=D0(e,t.children),a=eM(e,t.properties);e.stack.pop();let u=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(u=!0,e.schema.ancestors&&rr.call(e.schema.ancestors,n))){const d=e.schema.ancestors[n];let p=-1;for(u=!1;++p<d.length;)e.stack.includes(d[p])&&(u=!0)}if(!u)return e.schema.strip&&!e.schema.strip.includes(n)?s:void 0;const c={type:"element",tagName:n,properties:a,children:s};return ha(c,t),c}function QA(e,t){const s={type:"root",children:D0(e,t.children)};return ha(s,t),s}function JA(e,t){const s={type:"text",value:typeof t.value=="string"?t.value:""};return ha(s,t),s}function D0(e,t){const n=[];if(Array.isArray(t)){const s=t;let a=-1;for(;++a<s.length;){const u=T0(e,s[a]);u&&(Array.isArray(u)?n.push(...u):n.push(u))}}return n}function eM(e,t){const n=e.stack[e.stack.length-1],s=e.schema.attributes,a=e.schema.required,u=s&&rr.call(s,n)?s[n]:void 0,c=s&&rr.call(s,"*")?s["*"]:void 0,d=t&&typeof t=="object"?t:{},p={};let h;for(h in d)if(rr.call(d,h)){const g=d[h];let m=ky(e,Ey(u,h),h,g);m==null&&(m=ky(e,Ey(c,h),h,g)),m!=null&&(p[h]=m)}if(a&&rr.call(a,n)){const g=a[n];for(h in g)rr.call(g,h)&&!rr.call(p,h)&&(p[h]=g[h])}return p}function ky(e,t,n,s){return t?Array.isArray(s)?tM(e,t,n,s):A0(e,t,n,s):void 0}function tM(e,t,n,s){let a=-1;const u=[];for(;++a<s.length;){const c=A0(e,t,n,s[a]);(typeof c=="number"||typeof c=="string")&&u.push(c)}return u}function A0(e,t,n,s){if(!(typeof s!="boolean"&&typeof s!="number"&&typeof s!="string")&&iM(e,n,s)){if(typeof t=="object"&&t.length>1){let a=!1,u=0;for(;++u<t.length;){const c=t[u];if(c&&typeof c=="object"&&"flags"in c){if(c.test(String(s))){a=!0;break}}else if(c===s){a=!0;break}}if(!a)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+s:s}}function iM(e,t,n){const s=e.schema.protocols&&rr.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!s||s.length===0)return!0;const a=String(n),u=a.indexOf(":"),c=a.indexOf("?"),d=a.indexOf("#"),p=a.indexOf("/");if(u<0||p>-1&&u>p||c>-1&&u>c||d>-1&&u>d)return!0;let h=-1;for(;++h<s.length;){const g=s[h];if(u===g.length&&a.slice(0,g.length)===g)return!0}return!1}function ha(e,t){const n=MS(t);t.data&&(e.data=ia(t.data)),n&&(e.position=n)}function Ey(e,t){let n,s=-1;if(e)for(;++s<e.length;){const a=e[s],u=typeof a=="string"?a:a[0];if(u===t)return a;u==="data*"&&(n=a)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function nM(e){return function(t){return XA(t,e)}}function rM({storyName:e,fileName:t,authFetch:n,onPublish:s,publishingFile:a}){var b;const[u,c]=ge.useState(null),[d,p]=ge.useState(!1),h=ge.useCallback(async()=>{if(!e||!t){c(null);return}try{const C=await n(`/api/stories/${e}/${t}`);C.ok&&c(await C.json())}catch{}},[e,t,n]);if(ge.useEffect(()=>{p(!0),h().finally(()=>p(!1))},[h]),ge.useEffect(()=>{if(!e||!t)return;const C=setInterval(h,3e3);return()=>clearInterval(C)},[e,t,h]),!e||!t)return E.jsx("div",{className:"h-full flex items-center justify-center text-muted",children:E.jsxs("div",{className:"text-center",children:[E.jsx("p",{className:"text-lg font-serif",children:"Select a file to preview"}),E.jsx("p",{className:"text-sm mt-1",children:"Click a story file in the sidebar"})]})});if(d&&!u)return E.jsx("div",{className:"h-full flex items-center justify-center text-muted",children:"Loading..."});const g=((b=u==null?void 0:u.content)==null?void 0:b.length)??0,S=t==="genesis.md"?1e3:1e4,y=g>S;return E.jsxs("div",{className:"h-full flex flex-col",children:[E.jsxs("div",{className:"px-3 py-1.5 border-b border-border flex items-center justify-between",children:[E.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-muted",children:[E.jsxs("span",{children:[e,"/",t]}),(u==null?void 0:u.status)==="published"&&E.jsx("span",{className:"text-green-700 font-medium",children:"Published"}),(u==null?void 0:u.status)==="pending"&&E.jsx("span",{className:"text-amber-700 font-medium",children:"Pending"})]}),E.jsx("div",{className:"flex items-center gap-2",children:E.jsxs("span",{className:`text-xs font-mono ${y?"text-error":"text-muted"}`,children:[g.toLocaleString(),"/",S.toLocaleString()]})})]}),E.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto px-6 py-4",style:{background:"var(--paper-bg)"},children:u!=null&&u.content?E.jsx("div",{className:"prose max-w-none",children:E.jsx(BD,{remarkPlugins:[qD,KA],rehypePlugins:[nM],children:u.content})}):E.jsx("p",{className:"text-muted italic",children:"No content"})}),E.jsx("div",{className:"px-3 py-2 border-t border-border flex items-center justify-between",children:t==="structure.md"?E.jsx("p",{className:"text-muted text-xs italic",children:"This is your story outline — not publishable. Ask AI to write the genesis next."}):(u==null?void 0:u.status)==="published"?E.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[E.jsx("span",{className:"text-green-700",children:"Published"}),u.storylineId&&E.jsx("a",{href:`https://plotlink.xyz/story/${u.storylineId}`,target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"View on PlotLink"}),u.txHash&&E.jsx("a",{href:`https://basescan.org/tx/${u.txHash}`,target:"_blank",rel:"noopener noreferrer",className:"text-muted underline",children:"BaseScan"})]}):E.jsx("button",{onClick:()=>e&&t&&(s==null?void 0:s(e,t)),disabled:!!a||(u==null?void 0:u.status)==="published",className:"px-4 py-1.5 bg-accent text-white text-sm rounded hover:bg-accent-dim disabled:opacity-50 disabled:cursor-not-allowed",children:a===t?"Publishing...":"Publish to PlotLink"})})]})}function sM({token:e,authFetch:t}){const[n,s]=ge.useState(null),[a,u]=ge.useState(null),[c,d]=ge.useState(null),[p,h]=ge.useState(""),g=ge.useCallback((S,y)=>{s(S),u(y)},[]),m=ge.useCallback(async(S,y)=>{var b;d(y),h("Reading file...");try{const C=await t(`/api/stories/${S}/${y}`);if(!C.ok)throw new Error("Failed to read file");const B=await C.json(),A=B.content.match(/^#\s+(.+)$/m),Z=A?A[1].slice(0,60):y.replace(".md","");let P="Fiction";try{const ue=await t(`/api/stories/${S}/structure.md`);if(ue.ok){const H=(await ue.json()).content.match(/genre[:\s]+(.+)/i);H&&(P=H[1].trim().slice(0,30))}}catch{}let ee;if(y.match(/^plot-\d+\.md$/)){try{const ue=await t(`/api/stories/${S}`);if(ue.ok){const H=(await ue.json()).files.find(te=>te.file==="genesis.md"&&te.storylineId);ee=H==null?void 0:H.storylineId}}catch{}if(!ee){h("Error: Publish genesis first to create the storyline"),setTimeout(()=>{d(null),h("")},3e3);return}}h("Publishing...");const ne=await t("/api/publish/file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({storyName:S,fileName:y,title:Z,content:B.content,genre:P,storylineId:ee})});if(!ne.ok){const ue=await ne.json();throw new Error(ue.error||"Publish failed")}const z=(b=ne.body)==null?void 0:b.getReader(),ie=new TextDecoder;if(z)for(;;){const{done:ue,value:_e}=await z.read();if(ue)break;const te=ie.decode(_e).split(`
|
|
117
|
-
`).filter(V=>V.startsWith("data: "));for(const V of te)try{const I=JSON.parse(V.slice(6));I.step&&h(I.step),I.step==="done"&&I.txHash&&await t(`/api/stories/${S}/${y}/publish-status`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({txHash:I.txHash,storylineId:I.storylineId,contentCid:I.contentCid,gasCost:I.gasCost})})}catch{}}h("Published!")}catch(C){const B=C instanceof Error?C.message:"Publish failed";h(`Error: ${B}`)}finally{setTimeout(()=>{d(null),h("")},3e3)}},[t]);return E.jsxs("div",{className:"h-[calc(100vh-3.5rem)] flex",children:[E.jsx("div",{className:"w-56 border-r border-border flex-shrink-0",children:E.jsx(ux,{authFetch:t,selectedStory:n,selectedFile:a,onSelectFile:g})}),E.jsx("div",{className:"flex-1 min-w-0 border-r border-border",children:E.jsx(xk,{token:e})}),E.jsxs("div",{className:"w-96 flex-shrink-0 flex flex-col",children:[E.jsx(rM,{storyName:n,fileName:a,authFetch:t,onPublish:m,publishingFile:c}),p&&E.jsx("div",{className:"px-3 py-1.5 bg-surface border-t border-border text-xs text-muted",children:p})]})]})}function lM({token:e,onComplete:t}){const[n,s]=ge.useState(!1),[a,u]=ge.useState(null),[c,d]=ge.useState(!1),p=async()=>{s(!0),u(null);try{const h=await fetch("/api/wallet/create",{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"}}),g=await h.json();if(!h.ok)throw new Error(g.error||"Wallet creation failed");d(!0)}catch(h){u(h instanceof Error?h.message:"Wallet creation failed")}s(!1)};return ge.useEffect(()=>{p()},[]),E.jsxs("div",{className:"mx-auto max-w-sm p-6 text-center",children:[E.jsx("h2",{className:"text-accent mb-1 text-lg font-bold",children:"Wallet Setup"}),E.jsx("p",{className:"text-muted mb-6 text-xs",children:"creating your OWS wallet for on-chain publishing"}),n&&E.jsx("p",{className:"text-accent text-sm",children:"creating wallet..."}),a&&E.jsxs("div",{className:"space-y-4",children:[E.jsx("div",{className:"rounded border border-red-700/30 p-3 text-xs text-red-700",children:a}),E.jsx("button",{onClick:p,className:"border-accent text-accent hover:bg-accent/10 w-full rounded border px-4 py-2 text-sm font-medium transition-colors",children:"retry"})]}),c&&E.jsxs("div",{className:"space-y-4",children:[E.jsx("div",{className:"text-accent text-2xl",children:"✓"}),E.jsx("p",{className:"text-foreground text-sm font-medium",children:"wallet created"}),E.jsx("button",{onClick:t,className:"border-accent text-accent hover:bg-accent/10 w-full rounded border px-4 py-2 text-sm font-medium transition-colors",children:"continue"})]})]})}function aM({token:e,onLogout:t}){const[n,s]=ge.useState("home"),[a,u]=ge.useState(0),c=ge.useCallback(async(d,p)=>fetch(d,{...p,headers:{...(p==null?void 0:p.headers)||{},Authorization:`Bearer ${e}`}}),[e]);return ge.useEffect(()=>{async function d(){try{if(!(await(await c("/api/wallet")).json()).exists){s("wallet-setup");return}const g=await c("/api/stories");if(g.ok){const m=await g.json();u(m.stories.filter(S=>S.name!=="_example").length)}}catch{}}d()},[e]),E.jsxs("div",{className:"flex h-screen flex-col",children:[E.jsxs("header",{className:"border-border flex h-14 items-center justify-between border-b px-4 flex-shrink-0",children:[E.jsxs("div",{className:"flex items-center gap-3",children:[E.jsx("button",{onClick:()=>{n!=="wallet-setup"&&s("home")},className:"flex items-center gap-2 hover:opacity-80",children:E.jsx("span",{className:"text-accent text-sm font-bold tracking-tight",children:"PlotLink OWS"})}),E.jsx("span",{className:"text-muted text-[10px] uppercase tracking-wider",children:"writer"})]}),n!=="wallet-setup"&&E.jsxs("nav",{className:"flex items-center gap-4",children:[E.jsx("button",{onClick:()=>s("stories"),className:`text-xs transition-colors ${n==="stories"?"text-accent":"text-muted hover:text-foreground"}`,children:"stories"}),E.jsx("button",{onClick:()=>s("dashboard"),className:`text-xs transition-colors ${n==="dashboard"?"text-accent":"text-muted hover:text-foreground"}`,children:"dashboard"}),E.jsx("button",{onClick:()=>s("settings"),className:`text-xs transition-colors ${n==="settings"?"text-accent":"text-muted hover:text-foreground"}`,children:"settings"}),E.jsx("button",{onClick:t,className:"text-muted hover:text-foreground text-xs transition-colors",children:"logout"})]})]}),E.jsxs("main",{className:"flex-1 min-h-0",children:[n==="home"&&E.jsxs("div",{className:"mx-auto max-w-lg space-y-6 p-8",children:[E.jsxs("div",{className:"text-center space-y-2",children:[E.jsx("h1",{className:"text-2xl font-serif text-foreground",children:"Write. Publish. Earn."}),E.jsx("p",{className:"text-muted text-sm",children:"Claude CLI writes stories. You publish them on-chain."})]}),E.jsxs("div",{className:"text-center space-y-3",children:[E.jsx("button",{onClick:()=>s("stories"),className:"bg-accent text-white hover:bg-accent-dim px-6 py-2.5 rounded text-sm font-medium transition-colors",children:"Start Writing"}),a>0&&E.jsxs("p",{className:"text-muted text-xs",children:[a," ",a===1?"story":"stories"," in progress"]})]}),E.jsxs("div",{className:"rounded border border-border p-4 space-y-2 text-xs text-muted",children:[E.jsx("p",{className:"font-medium text-foreground text-sm",children:"How it works"}),E.jsxs("ol",{className:"space-y-1.5 list-decimal list-inside",children:[E.jsxs("li",{children:["Open the ",E.jsx("strong",{children:"Stories"})," tab — Claude CLI launches in the terminal"]}),E.jsx("li",{children:"Tell Claude your story idea — it brainstorms, outlines, and writes"}),E.jsx("li",{children:"Review the live preview as Claude creates files"}),E.jsxs("li",{children:["Click ",E.jsx("strong",{children:"Publish"})," to put your story on-chain"]}),E.jsxs("li",{children:["Earn 5% royalties on every trade at ",E.jsx("a",{href:"https://plotlink.xyz",target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"plotlink.xyz"})]})]})]}),E.jsx(My,{token:e})]}),n==="stories"&&E.jsx(sM,{token:e,authFetch:c}),n==="dashboard"&&E.jsx(lx,{token:e}),n==="wallet-setup"&&E.jsx(lM,{token:e,onComplete:()=>s("home")}),n==="settings"&&E.jsx(rx,{token:e,onLogout:t})]})]})}function oM(){const[e,t]=ge.useState(()=>localStorage.getItem("ows-token")),[n,s]=ge.useState(null),[a,u]=ge.useState(!0);ge.useEffect(()=>{fetch("/api/auth/status").then(h=>h.json()).then(h=>s(h.configured)).catch(()=>s(null))},[]),ge.useEffect(()=>{if(!e){u(!1);return}fetch("/api/auth/verify",{headers:{Authorization:`Bearer ${e}`}}).then(h=>{h.ok||(localStorage.removeItem("ows-token"),t(null))}).catch(()=>{localStorage.removeItem("ows-token"),t(null)}).finally(()=>u(!1))},[e]);const c=async h=>{try{const g=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({passphrase:h})}),m=await g.json();return g.ok?(localStorage.setItem("ows-token",m.token),t(m.token),null):m.error||"Login failed"}catch{return"Cannot connect to server"}},d=async h=>{try{const g=await fetch("/api/auth/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({passphrase:h})}),m=await g.json();return g.ok?(localStorage.setItem("ows-token",m.token),t(m.token),s(!0),null):m.error||"Setup failed"}catch{return"Cannot connect to server"}},p=()=>{localStorage.removeItem("ows-token"),t(null)};return a||n===null?E.jsx("div",{className:"flex h-screen items-center justify-center",children:E.jsx("span",{className:"text-muted text-sm",children:"connecting..."})}):n?e?E.jsx(aM,{token:e,onLogout:p}):E.jsx(ix,{onLogin:c}):E.jsx(nx,{onSetup:d})}tx.createRoot(document.getElementById("root")).render(E.jsx(K1.StrictMode,{children:E.jsx(oM,{})}));
|